Skip to content

Commit

Permalink
Allow the legend to be customized
Browse files Browse the repository at this point in the history
Cherry picked from @mauritsvanrees PR
#715
  • Loading branch information
ale-rt committed Apr 19, 2024
1 parent af3e98f commit 4da1b56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/euphorie/client/browser/templates/webhelpers.pt
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,9 @@
>
<metal:call use-macro="webhelpers/macros/survey_tree_inner" />
<ul class="legend">
<li class="unvisited"
i18n:translate=""
>Unvisited</li>
<li class="postponed"
i18n:translate=""
>Postponed</li>
<li class="answered"
i18n:translate=""
>Risk not present</li>
<li class="answered risk"
i18n:translate=""
>Risk present</li>
<li class="${legend/class}"
tal:repeat="legend webhelpers/navigation_tree_legend"
>${legend/title}</li>
</ul>
</div>
</metal:survey>
Expand Down
7 changes: 7 additions & 0 deletions src/euphorie/client/browser/webhelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ class WebHelpers(BrowserView):
survey_session_model = SurveySession
dashboard_tabs = ["surveys", "assessments", "organisation"]

navigation_tree_legend = [
{"class": "unvisited", "title": _("Unvisited")},
{"class": "postponed", "title": _("Postponed")},
{"class": "answered", "title": _("Risk not present")},
{"class": "answered risk", "title": _("Risk present")},
]

def to_decimal(self, value):
"""Transform value in to a decimal."""
return Decimal(value)
Expand Down

0 comments on commit 4da1b56

Please sign in to comment.