Skip to content

Commit

Permalink
More broken markup fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Daverball committed Jul 3, 2024
1 parent 78fc05b commit b7b0624
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ test =
pytest
pytest-asyncio
pytest-localserver
# FIXME: Update test fixtures to make them work again
pytest-redis
pytest-rerunfailures
pytest-timeout
Expand Down
25 changes: 10 additions & 15 deletions src/onegov/org/views/form_collection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
""" Lists the custom forms. """

import collections
from markupsafe import Markup
from onegov.core.security import Public
from onegov.form import FormCollection, FormDefinition
from onegov.org import _, OrgApp
Expand Down Expand Up @@ -101,24 +102,18 @@ def hint(model: FormDefinition) -> str:
hints = dict(get_hints(layout, model.current_registration_window))
if hints:
if 'stop' in hints:
hint = (
f'<div class="hint-stop">'
f'{request.translate(hints["stop"])}'
f'</div>'
)
hint = Markup(
'<div class="hint-stop">{}</div>'
).format(request.translate(hints["stop"]))
else:
if 'date' in hints:
hint = (
f'<div class="hint-date">'
f'{request.translate(hints["date"])}'
f'</div>'
)
hint = Markup(
'<div class="hint-date">{}</div>'
).format(request.translate(hints["date"]))
if 'count' in hints:
hint += (
f'<div class="hint-count">'
f'{request.translate(hints["count"])}'
f'</div>'
)
hint += Markup(
'<div class="hint-count">{}</div>'
).format(request.translate(hints["count"]))
return hint

return {
Expand Down
2 changes: 1 addition & 1 deletion src/onegov/town6/templates/directories.pt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</tal:b>
<tal:b metal:fill-slot="content">
<tal:b metal:use-macro="layout.macros.page_content"
tal:define="lead None; text None; people None; coordinates None; contact layout.org.meta.get('contact_html')">
tal:define="lead None; text None; people None; coordinates None; contact layout.org.contact_html|None">
<tal:b metal:fill-slot="after-text">
<p tal:condition="not:directories" i18n:translate="">No directories defined yet.</p>
<ul tal:condition="directories" class="more-list directory-list">
Expand Down
4 changes: 2 additions & 2 deletions src/onegov/town6/templates/forms.pt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</tal:b>
<tal:b metal:fill-slot="content">
<tal:b metal:use-macro="layout.macros.page_content"
tal:define="lead None; text None; people None; coordinates None; contact layout.org.meta.get('contact_html')">
tal:define="lead None; text None; people None; coordinates None; contact layout.org.contact_html|None">
<tal:b metal:fill-slot="after-text">
<p tal:condition="not:forms" i18n:translate="">No forms defined yet.</p>
<metal:b use-macro="layout.macros['group_by_column']" tal:condition="forms" tal:define="grouped forms; add_pagerefs request.is_logged_in" />
Expand All @@ -20,7 +20,7 @@
</a>
</li>
</ul>
</div>
</div>
</div>
</tal:b>
</tal:b>
Expand Down

0 comments on commit b7b0624

Please sign in to comment.