Skip to content
Snippets Groups Projects
Commit 3b53e767 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch '121-remove-cards-and-popovers-for-now' into 'master'

Resolve "Remove cards and popovers for now"

Closes #121

See merge request BiscuIT/BiscuIT-ng!80
parents 14718bbe 2447d26b
1 merge request!80Resolve "Remove cards and popovers for now"
Pipeline #431 failed
$(document).ready( function () {
$('table.datatable').each(function (index) {
$(this).DataTable({
"paging": false
});
});
$('*:not(a, span)[data-poload]').each(function() {
$(this).find('a, span').attr('data-poload', $(this).attr('data-poload'));
$(this).removeAttr('data-poload');
});
$('*[data-poload]').popover({
html: true,
animation: true,
placement: 'auto',
contianer: 'body',
trigger: 'hover'
}).on("inserted.bs.popover", function() {
var trigger_el = $(this);
var popover_id = trigger_el.attr("aria-describedby");
var popover_el = $('#' + popover_id);
$.get(trigger_el.data('poload'), function(d) {
popover_el.html(d);
});
});
});
......@@ -17,7 +17,6 @@
{% block bootstrap4_extra_script %}
{% include_js "DataTables" %}
{% include_js "DataTables-Bootstrap4" %}
<script type="text/javascript" src="{% static 'js/main.js' %}" /></script>
{% endblock %}
{% block bootstrap4_content %}
......
{# -*- engine:django -*- #}
{% load static cropping %}
<div class="card shadow">
<div class="card-header">{{ person.first_name }} {{ person.last_name }}</div>
<div class="card-body">
<div class="row no-gutters">
<div class="col-sm">
{% if person.photo %}
<img class="person-img" src="{% cropped_thumbnail person 'photo_cropping' max_size='300x400' %}" alt="{{ person.first_name }} {{ person.last_name }}" />
{% else %}
<img class="person-img" src="{% static 'img/fallback.png' %}" alt="{{ person.first_name }} {{ person.last_name }}" />
{% endif %}
</div>
<div class="col-sm">
<p class="card-text">{{ person.date_of_birth|date }}</p>
</div>
</div>
</div>
</div>
......@@ -22,12 +22,11 @@ urlpatterns = [
path("persons", views.persons, name="persons"),
path("persons/accounts", views.persons_accounts, name="persons_accounts"),
path("person", views.person, name="person"),
path("person/<int:id_>", views.person, {"template": "full"}, name="person_by_id"),
path("person/<int:id_>/card", views.person, {"template": "card"}, name="person_by_id_card"),
path("person/<int:id_>", views.person, name="person_by_id"),
path("person/<int:id_>/edit", views.edit_person, name="edit_person_by_id"),
path("groups", views.groups, name="groups"),
path("group/create", views.edit_group, name="create_group"),
path("group/<int:id_>", views.group, {"template": "full"}, name="group_by_id"),
path("group/<int:id_>", views.group, name="group_by_id"),
path("group/<int:id_>/edit", views.edit_group, name="edit_group_by_id"),
path("", views.index, name="index"),
path("maintenance-mode/", include("maintenance_mode.urls")),
......
......@@ -41,7 +41,7 @@ def persons(request: HttpRequest) -> HttpResponse:
@login_required
def person(request: HttpRequest, id_: int, template: str) -> HttpResponse:
def person(request: HttpRequest, id_: int) -> HttpResponse:
context = {}
# Get person and check access
......@@ -61,11 +61,11 @@ def person(request: HttpRequest, id_: int, template: str) -> HttpResponse:
RequestConfig(request).configure(groups_table)
context["groups_table"] = groups_table
return render(request, "core/person_%s.html" % template, context)
return render(request, "core/person_full.html", context)
@login_required
def group(request: HttpRequest, id_: int, template: str) -> HttpResponse:
def group(request: HttpRequest, id_: int) -> HttpResponse:
context = {}
# Get group and check if it exist
......@@ -96,7 +96,7 @@ def group(request: HttpRequest, id_: int, template: str) -> HttpResponse:
RequestConfig(request).configure(owners_table)
context["owners_table"] = owners_table
return render(request, "core/group_%s.html" % template, context)
return render(request, "core/group_full.html", context)
@login_required
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment