Skip to content

Commit

Permalink
some info text if relations are capped
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 committed Nov 5, 2024
1 parent d77e116 commit 049396d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion apis_core/apis_entities/detail_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ def get(self, request, *args, **kwargs):
if callable(getattr(objects, "filter_for_user", None)):
objects = objects.filter_for_user()
disable_sort = False
if objects.count() > 50:
show_more = False
object_count = objects.count()
if object_count > 50:
objects = objects[:50]
disable_sort = True
show_more = True
table = get_generic_relations_table(
relation_class=rel,
entity_instance=instance,
Expand All @@ -84,6 +87,8 @@ def get(self, request, *args, **kwargs):
tb_object_open,
link_to_relations,
rel_type,
show_more,
object_count,
)
)
object_lod = Uri.objects.filter(entity=instance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ <h3 class="text-center mt-5">Beziehungen</h3>
{% block relations %}
{% for obj in right_card %}
{% if obj.1.data|length > 0 %}
<h4>{{ obj.0 }} {% if obj.5 %}<a class="apis-{{ obj.5 }}" title="Gehe zu {{ object }}–{{ obj.0 }} Relationen" href="{{ obj.4 }}"><i class="bi bi-box-arrow-up-right" aria-hidden="true"><span class="visually-hidden">Gehe zu {{ object }} - {{ obj.5 }} Relationen</span></i></a>{% endif %}</h4>
<h4>{{ obj.0 }} {% if obj.5 %}<a class="apis-{{ obj.5 }}" title="Gehe zu {{ object }}–{{ obj.0 }} Relationen" href="{{ obj.4 }}"><i class="bi bi-box-arrow-up-right" aria-hidden="true"><span class="visually-hidden">Gehe zu {{ object }} - {{ obj.5 }} Relationen</span></i></a> {% if obj.6 %} <span class="fs-6 fw-light">aus technischen Gründen werden hier nur 50 von {{ obj.7 }} Relationen angezeigt </span> {% endif %}{% endif %}</h4>

<div id="tab_{{ obj.2 }}" class="mb-5">
{% render_table obj.1 %}
Expand Down

0 comments on commit 049396d

Please sign in to comment.