Skip to content

Commit

Permalink
Directory: use human field ids and preserve order in accordion mode
Browse files Browse the repository at this point in the history
TYPE: Bugfix
LINK: ogc-1928
  • Loading branch information
Tschuppi81 authored Dec 5, 2024
1 parent b8931d3 commit afe504d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/onegov/org/templates/directory.pt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
<span class="h5">${entry.title}</span>
</a>
<div tal:attributes="id python:'panel'+str(repeat['entry'].index)" class="content">
<ul tal:repeat="item entry.values.items()" style="list-style: none; margin-left: 0">
<li tal:define="key item[0].capitalize(); value str(item[1]).replace('\r\n', Markup('<br>'))" tal:content="Markup('<strong>{}</strong>: {}').format(key, value)"></li>
<ul tal:repeat="field directory.fields" style="list-style: none; margin-left: 0">
<li tal:condition="field.type == 'textarea'" tal:define="key field.human_id; value entry.values[field.id]" tal:content="Markup('<strong>{}</strong>: <br>{}').format(key, value)" style="white-space: pre-wrap;"></li>
<li tal:condition="field.type != 'textarea'" tal:define="key field.human_id; value entry.values[field.id]" tal:content="Markup('<strong>{}</strong>: {}').format(key, value)"></li>
</ul>
<ul style="list-style: none; margin-left: 0">
<li>
Expand Down
5 changes: 3 additions & 2 deletions src/onegov/town6/templates/directory.pt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
<span class="h5">${entry.title}</span>
</a>
<div class="accordion-content" data-tab-content>
<ul tal:repeat="item entry.values.items()" style="list-style: none; margin-left: 0">
<li tal:define="key item[0].capitalize(); value str(item[1]).replace ('\r\n', Markup('<br>'))" tal:content="Markup('<strong>{}</strong>: {}').format(key, value)"></li>
<ul tal:repeat="field directory.fields" style="list-style: none; margin-left: 0">
<li tal:condition="field.type == 'textarea'" tal:define="key field.human_id; value entry.values[field.id]" tal:content="Markup('<strong>{}</strong>: <br>{}').format(key, value)" style="white-space: pre-wrap;"></li>
<li tal:condition="field.type != 'textarea'" tal:define="key field.human_id; value entry.values[field.id]" tal:content="Markup('<strong>{}</strong>: {}').format(key, value)"></li>
</ul>
<ul style="list-style: none; margin-left: 0">
<li>
Expand Down

0 comments on commit afe504d

Please sign in to comment.