-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: table serializer use record/collection variables instead of row…
…/table
- Loading branch information
1 parent
0be661c
commit 8189eb0
Showing
10 changed files
with
62 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
ckanext/collection/templates/collection/snippets/html_main.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<ul> | ||
{%- for record in collection %} | ||
{%- snippet record_template, record=record, collection=collection -%} | ||
{% endfor -%} | ||
</ul> |
1 change: 1 addition & 0 deletions
1
ckanext/collection/templates/collection/snippets/html_record.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
<li>{{ record | tojson }}</li> |
16 changes: 0 additions & 16 deletions
16
ckanext/collection/templates/collection/snippets/table.html
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
ckanext/collection/templates/collection/snippets/table_main.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<table id="collection--{{ collection.name }}--table" class="collection-table"> | ||
<tr class="collection-table--row collection-table--header"> | ||
{% for col in collection.columns.names if col in collection.columns.visible %} | ||
|
||
<td class="collection-table--cell{% if sortable %} collection-table--cell-sortable{% endif %}"> | ||
<span>{{ collection.columns.labels[col] or col }}</span> | ||
</td> | ||
|
||
{% endfor %} | ||
</tr> | ||
|
||
{%- for record in collection %} | ||
{%- snippet record_template, record=record, collection=collection -%} | ||
{% endfor -%} | ||
|
||
</table> |
7 changes: 3 additions & 4 deletions
7
...on/templates/collection/snippets/row.html → ...tes/collection/snippets/table_record.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,10 +1,9 @@ | ||
<tr class="collection-table--row"> | ||
{% for column in table.columns.names if column in table.columns.visible %} | ||
{% for column in collection.columns.names if column in collection.columns.visible -%} | ||
<td class="collection-table--cell{% if sortable %} collection-table--cell-sortable{% endif %}"> | ||
<div> | ||
{{ row[column] }} | ||
{{ record[column] }} | ||
</div> | ||
</td> | ||
{% endfor %} | ||
|
||
{%- endfor %} | ||
</tr> |
Empty file.
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