The more/less toggles should be inline with the text. The caller should pass in the first and second halves of the content to be displayed.
30 lines
1.2 KiB
HTML
30 lines
1.2 KiB
HTML
{% from "components/icon.html" import Icon %}
|
|
|
|
{% macro SemiCollapsibleText(first_half=None, second_half=None) -%}
|
|
|
|
<semi-collapsible-text inline-template>
|
|
<div>
|
|
{% if first_half is none %}
|
|
{% set first_half="Aenean lacinia bibendum nulla sed consectetur. Sed posuere consectetur est at lobortis. Fusce dapibus an, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo." %}
|
|
{% endif %}
|
|
{% if second_half is none %}
|
|
{% set second_half="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip." %}
|
|
{% endif %}
|
|
<p class="section-description" v-if="open">
|
|
{{ first_half }}
|
|
{{ second_half }}
|
|
<a v-on:click='toggle' v-show="open" class="more">
|
|
Less{{ Icon('caret_up') }}
|
|
</a>
|
|
</p>
|
|
<p class="section-description" v-else>
|
|
{{ first_half }}
|
|
<a v-on:click='toggle' class="more">
|
|
More{{ Icon('caret_down') }}
|
|
</a>
|
|
</p>
|
|
</div>
|
|
</semi-collapsible-text>
|
|
|
|
{%- endmacro %}
|