forked from GNUsocial/gnu-social
98 lines
3.8 KiB
Twig
98 lines
3.8 KiB
Twig
{% macro posting(form) %}
|
|
<section class="section-form">
|
|
{{ form_start(form) }}
|
|
{{ form_errors(form) }}
|
|
{% if form.in is defined %}
|
|
{{ form_row(form.in) }}
|
|
{% endif %}
|
|
{{ form_row(form.visibility) }}
|
|
{{ form_row(form.content_type) }}
|
|
{{ form_row(form.content) }}
|
|
{{ form_row(form.attachments) }}
|
|
|
|
<details class="section-details-subtitle">
|
|
<summary class="details-summary-subtitle">
|
|
<strong>
|
|
{{ "Additional options" | trans }}
|
|
</strong>
|
|
</summary>
|
|
<section class="section-form">
|
|
{{ form_row(form.language) }}
|
|
{{ form_row(form.tag_use_canonical) }}
|
|
</section>
|
|
</details>
|
|
{{ form_rest(form) }}
|
|
{{ form_end(form) }}
|
|
</section>
|
|
{% endmacro %}
|
|
|
|
{% macro posting_section_vanilla(widget) %}
|
|
<section class="frame-section" title="{{ 'Create a new note.' | trans }}">
|
|
<details class="section-details-title" open="open"
|
|
title="{{ 'Expand if you want to access more options.' | trans }}">
|
|
<summary class="details-summary-title">
|
|
<span>
|
|
{{ "Create a note" | trans }}
|
|
</span>
|
|
</summary>
|
|
|
|
{% import _self as forms %}
|
|
{{ forms.posting(widget) }}
|
|
</details>
|
|
</section>
|
|
{% endmacro %}
|
|
|
|
{% macro posting_section_reply(widget, extra) %}
|
|
<section class="frame-section" title="{{ 'Create a new note.' | trans }}">
|
|
<details class="section-details-title" open="open"
|
|
title="{{ 'Expand if you want to access more options.' | trans }}">
|
|
<summary class="details-summary-title">
|
|
<span>
|
|
{{ "Reply to note" | trans }}
|
|
</span>
|
|
</summary>
|
|
|
|
{% for block in extra %}
|
|
<section class="posting-extra frame-section-padding">
|
|
{{ block | raw }}
|
|
</section>
|
|
{% endfor %}
|
|
|
|
{% import _self as forms %}
|
|
{{ forms.posting(widget) }}
|
|
</details>
|
|
</section>
|
|
{% endmacro %}
|
|
|
|
{% block rightpanel %}
|
|
{% import _self as this %}
|
|
<label class="panel-right-icon" for="toggle-panel-right"
|
|
tabindex="-1">{{ icon('chevron-left', 'icon icon-right') | raw }}</label>
|
|
<a id="anchor-right-panel" class="anchor-hidden" tabindex="0"
|
|
title="{{ 'Press tab followed by a space to access right panel' | trans }}"></a>
|
|
<input type="checkbox" id="toggle-panel-right" tabindex="0" title="{{ 'Open right panel' | trans }}"
|
|
{% if app.request.get('_route') == 'conversation_reply_to' %}checked{% endif %}>
|
|
|
|
<aside class="section-panel section-panel-right">
|
|
{% set var_list = {'path': app.request.get('_route'), 'request': app.request, 'vars': right_panel_vars | default } %}
|
|
{% set blocks = add_right_panel_block('prepend', var_list) %}
|
|
{% set blocks = blocks|merge(add_right_panel_block('main', var_list)) %}
|
|
{% set blocks = blocks|merge(add_right_panel_block('append', var_list)) %}
|
|
|
|
<section class="panel-content accessibility-target">
|
|
{% for widget in blocks %}
|
|
{% if widget is iterable and widget.vars.id == 'post_note' %}
|
|
{% if app.request.get('_route') == 'conversation_reply_to' %}
|
|
{% set extra = handle_event('PrependPostingForm', request) %}
|
|
{{ this.posting_section_reply(widget, extra) }}
|
|
{% else %}
|
|
{{ this.posting_section_vanilla(widget) }}
|
|
{% endif %}
|
|
{% else %}
|
|
{{ widget | raw }}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</section>
|
|
</aside>
|
|
{% endblock rightpanel %}
|