-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(apis_relations): drop custom table factory
This commit drops the `get_generic_triple_table` method that was used to generate the table classes for the triple tables in the edit and the detail view. For the edit and the detail view there are now the templatetags `triple_tables_related_detail` and `triple_tables_related_edit` which provide those tables. The `generic_order*` and `generic_render*` methods that were located in the `apis_metainfo.tables` module where dropped and replaced by custom table columns `StartDateColumn` and `EndDateColumn`.
- Loading branch information
Showing
9 changed files
with
250 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 15 additions & 14 deletions
29
..._core/apis_entities/templates/apis_entities/partials/entity_relations_multiple_cards.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
{% load django_tables2 %} | ||
{% load apis_templatetags %} | ||
{% object_relations detail=False as object_relations %} | ||
{% for obj in object_relations %} | ||
<div class="card card-default mb-2"> | ||
<div class="card-header" role="tab" id="heading{{ forloop.counter }}"> | ||
<div class="card-title"> | ||
<a data-toggle="collapse" href="#collapse{{ forloop.counter }}">{{ obj.0|title }} ({{ obj.1.data|length }})</a> | ||
{% load apis_relations %} | ||
{% load apiscore %} | ||
{% with object|opts as opts %} | ||
{% for objecttype, table in object|triple_tables_related_edit %} | ||
<div class="card card-default mb-2"> | ||
<div class="card-header" role="tab" id="heading{{ forloop.counter }}"> | ||
<div class="card-title"> | ||
<a data-toggle="collapse" href="#collapse{{ forloop.counter }}">{{ objecttype.name|title }} ({{ table.data|length }})</a> | ||
</div> | ||
</div> | ||
<div id="collapse{{ forloop.counter }}" class="card-collapse collapse"> | ||
<div id="tab_triple_form_{{ opts.verbose_name }}_to_{{ objecttype.name }}" | ||
class="card-body">{% render_table table %}</div> | ||
</div> | ||
</div> | ||
<div id="collapse{{ forloop.counter }}" class="card-collapse collapse | ||
{% if obj.3 %}in{% endif %} | ||
"> | ||
<div id="tab_{{ obj.2 }}" class="card-body">{% render_table obj.1 %}</div> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
{% endfor %} | ||
{% endwith %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.