diff --git a/core/templates/core/macros.jinja b/core/templates/core/macros.jinja index 84c5b05a0..b9888d07e 100644 --- a/core/templates/core/macros.jinja +++ b/core/templates/core/macros.jinja @@ -328,3 +328,22 @@ {% endmacro %} + +{% macro read_more(text, max_size, tag, tag_attrs) %} + {% set tag = tag|default('p') %} + {% set tag_attrs = tag_attrs|default('tag_attrs') %} +
{{ election.description }}
@@ -68,7 +65,7 @@{{ role.description }}
+ {{ read_more(role.description, 300, "p", "class='role_description'") }} {%- if role.max_choice > 1 and not election.has_voted(user) and election.can_vote(user) %} {% trans %}You may choose up to{% endtrans %} {{ role.max_choice }} {% trans %}people.{% endtrans %} {%- endif %} @@ -139,7 +136,7 @@{{ candidature.program | markdown or '' }}+ {{ read_more(candidature.program|markdown or '', 200, "q", "class='candidate_program'") }} {%- endif %}