Skip to content

Commit

Permalink
Merge pull request #59 from arthur-schnitzler/main
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
csae8092 authored Jan 29, 2024
2 parents a70753d + 1a1bf8c commit e9c369c
Show file tree
Hide file tree
Showing 8 changed files with 277 additions and 87 deletions.
12 changes: 10 additions & 2 deletions apis_core/apis_entities/list_view_person.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ def __init__(self, *args, **kwargs):

class PersonTable(tables.Table):
id = tables.LinkColumn(verbose_name="ID")
start_date_written = tables.TemplateColumn(
"<abbr title='{{ record.start_date_written }}'>{{ record.start_date|date:'Y' }}</a>",
verbose_name="Geburtsjahr",
)
end_date_written = tables.TemplateColumn(
"<abbr title='{{ record.end_date_written }}'>{{ record.end_date|date:'Y' }}</a>",
verbose_name="Todesjahr",
)
personplace_set = tables.ManyToManyColumn(
verbose_name="Geburtsort",
transform=lambda x: x.related_place,
Expand Down Expand Up @@ -209,8 +217,8 @@ class PersonListView(GenericListView):
"name",
"first_name",
"uris",
"start_date",
"end_date",
"start_date_written",
"end_date_written",
"personplace_set",
]
exclude_columns = excluded_cols
Expand Down
6 changes: 5 additions & 1 deletion apis_core/apis_entities/list_view_work.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ def __init__(self, *args, **kwargs):
class WorkTable(tables.Table):
id = tables.LinkColumn(verbose_name="ID")
name = tables.columns.Column(verbose_name="Titel")
start_date_written = tables.TemplateColumn(
"<abbr title='{{ record.start_date_written }}'>{{ record.start_date|date:'Y' }}</a>",
verbose_name="Erscheinungsjahr",
)
label_set = tables.ManyToManyColumn(verbose_name="Labels")
personwork_set = tables.ManyToManyColumn(
verbose_name="AutorIn",
Expand Down Expand Up @@ -163,7 +167,7 @@ class WorkListView(GenericListView):
init_columns = [
"id",
"name",
"start_date",
"start_date_written",
"personwork_set",
"kind",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% block content %}
{% include "partials/entity_styles.html" %}

<div class="container-fluid pt-4">
<div class="container-fluid pt-4 ps-4 pe-4">

<div class="row">
<div class="col-md-2">
Expand Down Expand Up @@ -51,33 +51,21 @@ <h2>
</div>
</div>

<div class="row">
<div class="col-md-5">
<h4 class="text-left" style="padding-left: 20px;">
<a href="{{ object.get_api_url }}">
<i class="bi bi-database" title="zur API-Ansicht der Entität"></i>
</a>
{% if entity_type != 'event' %}| <a href="{{ object.get_tei_url }}" title="zur TEI-Ansicht der Entität"><i class="bi bi-filetype-xml"></i></a>{% endif %}
</h3>
{% if object.img_url %}
<table class="table">
<div class="row p-5">
<div class="col-md-4">
<table class="table table-borderless table-hover ps-3 ">
<tr>
<th class="left-width"/>
<th class="w-25">Abbildung</th>
<td>
<img src="{{ object.img_url }}" class="rounded" alt="Bild von {{ object }}" style="height: 200px">
{% if object.img_credit %}
<figcaption class="figure-caption"><a href="{{ object.img_credit }}" style="color: dimgrey;">{{ object.img_credit_label }}</a></figcaption>
{% endif %}
</td>
<img src="{{ object.img_url }}" class="rounded" alt="Bild von {{ object }}" style="height: 200px">
{% if object.img_credit %}
<figcaption class="figure-caption"><a href="{{ object.img_credit }}" style="color: dimgrey;">{{ object.img_credit_label }}</a></figcaption>
{% endif %}
</td>
</tr>
</table>


{% endif %}
{% block info-table %}
<table class="table">
<tr>
<th class="left-width">
<th class="w-25">
Titel
</th>
<td>
Expand All @@ -86,31 +74,26 @@ <h4 class="text-left" style="padding-left: 20px;">
</tr>
{% if no_merge_labels %}
<tr>
<th class="left-width">
<th class="w-25">
Labels
</th>
<td>
<ul >
{% for x in no_merge_labels %}
<li class="list-unstyled">
<small>{{ x.label_type }}: </small>{{ x.label }}
</li>
<small>{{ x.label_type }}: </small>{{ x.label }}<br >
{% endfor %}
</ul>

</td>
</tr>
{% endif %}
<tr>
<th class="left-width">
<th class="w-25">
ID
</th>
<td>
{{ object.id }}
</td>
</tr>
<tr>
<th class="left-width">
<th class="w-25">
Typ
</th>
<td>
Expand All @@ -119,7 +102,7 @@ <h4 class="text-left" style="padding-left: 20px;">
</tr>
{% if object.start_date or object.end_date %}
<tr>
<th class="left-width">
<th class="w-25">
Datum
</th>
<td>
Expand All @@ -132,40 +115,40 @@ <h4 class="text-left" style="padding-left: 20px;">
</td>
</tr>
{% endif %}
{% if object.lat %}
<tr>
<th class="left-width">
Länge/Breite
</th>
<td>
{{ object.lat }} / {{ object.lng }}
</td>
</tr>
{% endif %}
</table>
{% endblock info-table %}
{% block info-metadata %}
<table class="table">
<tr>
<th class="left-width">
URI
</th>
<td style="padding-left: 20px;">
{% for x in object.uri_set.all %}
<a href="{{ x }}">{{ x }}</a> {% if user.is_authenticated %} <a href="{{ x.get_edit_url }}" title="URI bearbeiten">
<i class="bi bi-pencil-square"></i>
</a> | <a href="{{ x.get_delete_url }}" title="URI löschen">
<i class="bi bi-trash3"></i>
</a>{% endif %}<br />
{% endfor %}
</td>
</tr>
<tr>
<th class="w-25">JSON-EXPORT</th>
<td><a href="{{ object.get_api_url }}">
<i class="bi bi-database" title="zur API-Ansicht der Entität"></i>
</a></td>
</tr>
{% if entity_type != 'event' %}
<tr>
<th class="w-25">TEI/XML-EXPORT</th>
<td><a href="{{ object.get_tei_url }}" title="zur TEI-Ansicht der Entität"><i class="bi bi-filetype-xml"></i></a></td>
</tr>
{% endif %}
<tr>
<th class="w-25">
URI
</th>
<td>
{% for x in object.uri_set.all %}
<a href="{{ x }}">{{ x }}</a> {% if user.is_authenticated %} <a href="{{ x.get_edit_url }}" title="URI bearbeiten">
<i class="bi bi-pencil-square"></i>
</a> | <a href="{{ x.get_delete_url }}" title="URI löschen">
<i class="bi bi-trash3"></i>
</a>{% endif %}<br />
{% endfor %}
</td>
</tr>
{% if object.collection.all %}
<tr>
<th class="left-width">
Sammlungen
</th>
<td style="padding-left: 20px;">
<td>
{% for x in object.collection.all %}
{{ x }}<br />
{% endfor %}
Expand All @@ -175,7 +158,7 @@ <h4 class="text-left" style="padding-left: 20px;">
{% endif %}
{% if object.notes %}
<tr>
<th>
<th class="w-25">
Anmerkungen
</th>
<td>
Expand All @@ -185,7 +168,7 @@ <h4 class="text-left" style="padding-left: 20px;">
{% endif %}
{% if object.references %}
<tr>
<th>
<th class="w-25">
Belege
</th>
<td>
Expand All @@ -198,14 +181,15 @@ <h4 class="text-left" style="padding-left: 20px;">
{% block left-pane-additional %}
{% endblock left-pane-additional %}
</div>
<div class="col-md-1"></div>
<div class="col-md-7">
<h3 class="text-center">Beziehungen</h3>
{% block relations %}
{% for obj in right_card %}
{% if obj.1.data|length > 0 %}
<h4 > {{ obj.0 }}</h4>

<div id="tab_{{ obj.2 }}" style="margin-bottom: 50px;">
<div id="tab_{{ obj.2 }}" class="mb-5">
{% render_table obj.1 %}
</div>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{% extends "apis_entities/detail_views/entity_detail_generic.html" %}

{% block info-table %}
<table class="table">
<tr>
<th class="left-width">
<th class="w-25">
Name
</th>
<td>
Expand All @@ -12,7 +11,7 @@
</tr>
{% if no_merge_labels %}
<tr>
<th class="left-width">
<th class="w-25">
anderer Name
</th>
<td>
Expand All @@ -26,15 +25,15 @@
</tr>
{% endif %}
<tr>
<th class="left-width">
<th class="w-25">
ID
</th>
<td>
{{ object.id }}
</td>
</tr>
<tr>
<th class="left-width">
<th class="w-25">
Gender
</th>
<td>
Expand All @@ -43,7 +42,7 @@
</tr>
{% if object.start_date or object.end_date %}
<tr>
<th class="left-width">
<th class="w-25">
Zeit
</th>
<td>
Expand All @@ -58,7 +57,7 @@
{% endif %}
{% if object.profession.all %}
<tr>
<th class="left-width">
<th class="w-25">
Berufe
</th>
<td>
Expand All @@ -68,5 +67,4 @@
</td>
</tr>
{% endif %}
</table>
{% endblock info-table %}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
marker.bindPopup("{{ object.name }}").openPopup();
</script>
{% endif %}
<table class="table">

{% if no_merge_labels %}
<tr>
<th>
<th class="w-25">
Alternative Namen
</th>
<td>
Expand All @@ -33,31 +33,30 @@
</tr>
{% endif %}
<tr>
<th>
<th class="w-25">
ID
</th>
<td>
{{ object.id }}
</td>
</tr>
<tr>
<th>
<th class="w-25">
Koordinaten
</th>
<td>
{{ object.lat }} {{ object.lng}}
</td>
</tr>
<tr>
<th>Ortstype</th>
<th class="w-25">Ortstype</th>
<td>{% if object.kind.description %} {{ object.kind }} <small>{{ object.kind.description }}</small> {% else %} {{ object.kind }} {% endif %}</td>
</tr>
{% if object.start_date_written or object.end_date_written %}
<tr>
<th>von – bis</th>
<th class="w-25">von – bis</th>
<td>{% if object.start_date_written %}{{ object.start_date_written }}{% endif %}{% if object.end_date_written %} – {{ object.end_date_written }}{% endif %}</td>
</tr>
{% endif %}
</table>

{% endblock info-table %}
Loading

0 comments on commit e9c369c

Please sign in to comment.