forked from GNUsocial/gnu-social
[PLUGINS][AttachmentCollections] Fixed "Error: Expected Doctrine\ORM\Query\Lexer::T_IDENTIFIER, got 'Plugin\AttachmentCollections\Entity\AttachmentCollection'"
[TWIG] Cards are now divided into blocks and macros, additional macros done, attachments page no longer inside cards directory [CARDS][Navigation] Now using macros to create section, details, and nav elements
This commit is contained in:
@@ -89,7 +89,7 @@ class Attachment extends Controller
|
||||
try {
|
||||
return $this->attachment($attachment_id, $note_id, function ($res) use ($note_id, $attachment_id) {
|
||||
return [
|
||||
'_template' => '/cards/attachments/show.html.twig',
|
||||
'_template' => 'attachment/view.html.twig',
|
||||
'download' => $res['attachment']->getDownloadUrl(note: $note_id),
|
||||
'title' => $res['title'],
|
||||
'attachment' => $res['attachment'],
|
||||
|
@@ -54,7 +54,7 @@
|
||||
<h2>{% trans %}Results{% endtrans %}</h2>
|
||||
{% if actors is defined and actors is not empty %}
|
||||
{% for actor in actors %}
|
||||
{% block profile_view %}{% include 'cards/profile/view.html.twig' %}{% endblock profile_view %}
|
||||
{% block profile_view %}{% include 'cards/blocks/profile.html.twig' %}{% endblock profile_view %}
|
||||
<hr>
|
||||
{% endfor %}
|
||||
<span class="frame-section-button-like">{% trans %}Page: %page%{% endtrans %}</span>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{% extends 'stdgrid.html.twig' %}
|
||||
{% import '/cards/note/view.html.twig' as noteView %}
|
||||
{% import '/cards/macros/note.html.twig' as noteView %}
|
||||
|
||||
{% block title %}{% if page_title is defined %}{{ page_title | trans }}{% endif %}{% endblock %}
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
{% for conversation in notes %}
|
||||
{% block current_note %}
|
||||
{% if conversation is instanceof('array') %}
|
||||
{{ noteView.macro_note(conversation['note'], conversation['replies']) }}
|
||||
{{ noteView.note_vanilla(conversation['note'], conversation['replies']) }}
|
||||
{% else %}
|
||||
{{ noteView.macro_note(conversation) }}
|
||||
{{ noteView.note_vanilla(conversation) }}
|
||||
{% endif %}
|
||||
<hr tabindex="0" title="{{ 'End of note and replies.' | trans }}">
|
||||
{% endblock current_note %}
|
||||
|
@@ -217,7 +217,7 @@ class Conversation extends Component
|
||||
*/
|
||||
public function onPrependPostingForm(Request $request, array &$elements): bool
|
||||
{
|
||||
$elements[] = Formatting::twigRenderFile('cards/note/macro_note_minimal_wrapper.html.twig', ['note' => Note::getById((int) $request->query->get('reply_to_id'))]);
|
||||
$elements[] = Formatting::twigRenderFile('cards/blocks/note_compact_wrapper.html.twig', ['note' => Note::getById((int) $request->query->get('reply_to_id'))]);
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{% extends 'stdgrid.html.twig' %}
|
||||
{% import '/cards/note/view.html.twig' as noteView %}
|
||||
{% import '/cards/macros/note.html.twig' as noteView %}
|
||||
|
||||
{% set nickname = nickname|escape %}
|
||||
{% block title %}{{ nickname }}{% endblock %}
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
{% if actor is defined and actor is not null %}
|
||||
{% block profile_view %}
|
||||
{% include 'cards/profile/view.html.twig' with { 'actor': actor } only %}
|
||||
{% include 'cards/blocks/profile.html.twig' with { 'actor': actor } only %}
|
||||
{% endblock profile_view %}
|
||||
|
||||
{% if notes is defined %}
|
||||
@@ -46,9 +46,9 @@
|
||||
{% for conversation in notes %}
|
||||
{% block current_note %}
|
||||
{% if conversation is instanceof('array') %}
|
||||
{{ noteView.macro_note(conversation['note'], conversation['replies']) }}
|
||||
{{ noteView.note_vanilla(conversation['note'], conversation['replies']) }}
|
||||
{% else %}
|
||||
{{ noteView.macro_note(conversation) }}
|
||||
{{ noteView.note_vanilla(conversation) }}
|
||||
{% endif %}
|
||||
<hr tabindex="0" title="{{ 'End of note and replies.' | trans }}">
|
||||
{% endblock current_note %}
|
||||
|
@@ -7,18 +7,18 @@
|
||||
<section class="panel-content accessibility-target">
|
||||
{% if app.user %}
|
||||
<section class='frame-section frame-section-padding' title="{{ 'Your profile information.' | trans }}">
|
||||
{% block profile_view %}{% include 'cards/profile/view.html.twig' with { actor: current_actor } %}{% endblock profile_view %}
|
||||
{{ block("profile_current_actor", "cards/navigation/view.html.twig") }}
|
||||
{% block profile_view %}{% include 'cards/blocks/profile.html.twig' with { actor: current_actor } %}{% endblock profile_view %}
|
||||
{{ block("profile_current_actor", "cards/blocks/navigation.html.twig") }}
|
||||
</section>
|
||||
{% else %}
|
||||
<section>
|
||||
{{ block("profile_security", "cards/navigation/view.html.twig") }}
|
||||
{{ block("profile_security", "cards/blocks/navigation.html.twig") }}
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{{ block("feeds", "cards/navigation/view.html.twig") }}
|
||||
{{ block("feeds", "cards/blocks/navigation.html.twig") }}
|
||||
|
||||
{{ block("footer", "cards/navigation/view.html.twig") }}
|
||||
{{ block("footer", "cards/blocks/navigation.html.twig") }}
|
||||
</section>
|
||||
</aside>
|
||||
{% endblock leftpanel %}
|
||||
|
@@ -1,8 +1,7 @@
|
||||
{% block rightpanel %}
|
||||
{% set current_path = app.request.get('_route') %}
|
||||
<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 current_path == 'conversation_reply_to' %}checked{% endif %}>
|
||||
<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">
|
||||
<section class="panel-content accessibility-target">
|
||||
@@ -17,8 +16,7 @@
|
||||
<details class="section-details-title" open="open" title="{{ 'Expand if you want to access more options.' | trans }}">
|
||||
<summary class="details-summary-title">
|
||||
<span>
|
||||
{% set current_path = app.request.get('_route') %}
|
||||
{% if current_path == 'conversation_reply_to' %}
|
||||
{% if app.request.get('_route') == 'conversation_reply_to' %}
|
||||
{{ "Reply to note" | trans }}
|
||||
{% else %}
|
||||
{{ "Create a note" | trans }}
|
||||
@@ -26,7 +24,7 @@
|
||||
</span>
|
||||
</summary>
|
||||
|
||||
{% if current_path == 'conversation_reply_to' %}
|
||||
{% if app.request.get('_route') == 'conversation_reply_to' %}
|
||||
<section class="frame-section-padding">
|
||||
{% set prepend_posting_form = handle_event('PrependPostingForm', request) %}
|
||||
{% for widget in prepend_posting_form %}
|
||||
@@ -64,7 +62,7 @@
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% set extra_blocks = get_right_panel_blocks({'path': current_path, 'request': app.request, 'vars': (right_panel_vars | default)}) %}
|
||||
{% set extra_blocks = get_right_panel_blocks({'path': app.request.get('_route'), 'request': app.request, 'vars': right_panel_vars | default }) %}
|
||||
{% for block in extra_blocks %}
|
||||
{{ block | raw }}
|
||||
{% endfor %}
|
||||
|
@@ -110,7 +110,7 @@
|
||||
<h3>{% trans %}Actors found{% endtrans %}</h3>
|
||||
{% if actors is defined and actors is not empty %}
|
||||
{% for actor in actors %}
|
||||
{% include 'cards/profile/view.html.twig' with {'actor': actor} %}
|
||||
{% include 'cards/blocks/profile.html.twig' with {'actor': actor} %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<em>{% trans %}No Actors were found for the specified query...{% endtrans %}</em>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
{% block body %}
|
||||
{% block profile_view %}
|
||||
{% include 'cards/profile/view.html.twig' with { actor: object } %}
|
||||
{% include 'cards/blocks/profile.html.twig' with { actor: object } %}
|
||||
{% endblock profile_view %}
|
||||
{{ form(form) }}
|
||||
{% endblock body %}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
{% block body %}
|
||||
{% block profile_view %}
|
||||
{% include 'cards/profile/view.html.twig' with { actor: object } %}
|
||||
{% include 'cards/blocks/profile.html.twig' with { actor: object } %}
|
||||
{% endblock profile_view %}
|
||||
{{ form(form) }}
|
||||
{% endblock body %}
|
||||
|
@@ -20,7 +20,7 @@
|
||||
{% endfor %}
|
||||
|
||||
{% for actor in results %}
|
||||
{% block profile_view %}{% include 'cards/profile/view.html.twig' %}{% endblock profile_view %}
|
||||
{% block profile_view %}{% include 'cards/blocks/profile.html.twig' %}{% endblock profile_view %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="frame-section-button-like">
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import '/cards/note/view.html.twig' as noteView %}
|
||||
{% import '/cards/macros/note.html.twig' as noteView %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
{% for note in results %}
|
||||
{% block current_note %}
|
||||
{{ noteView.macro_note(note) }}
|
||||
{{ noteView.note_vanilla(note) }}
|
||||
{% endblock current_note %}
|
||||
{% endfor %}
|
||||
|
||||
|
Reference in New Issue
Block a user