[TWIG] Various fixes related to header elements hierarchy

Widgets shouldn't have a header element from here forward, since their location varies
This commit is contained in:
Eliseu Amaro 2022-01-23 19:46:47 +00:00
parent bf07fa1ade
commit ee04571f4d
Signed by: eliseuamaro
GPG Key ID: 96DA09D4B97BC2D5
17 changed files with 44 additions and 30 deletions

View File

@ -50,15 +50,16 @@
</form> </form>
</details> </details>
<section class="frame-section-padding"> <section class="frame-section frame-section-padding">
<h2>{% trans %}Results{% endtrans %}</h2>
{% if actors is defined and actors is not empty %} {% if actors is defined and actors is not empty %}
{% for actor in actors %} {% for actor in actors %}
{% block profile_view %}{% include 'cards/profile/view.html.twig' %}{% endblock profile_view %} {% block profile_view %}{% include 'cards/profile/view.html.twig' %}{% endblock profile_view %}
<hr> <hr>
{% endfor %} {% endfor %}
<p>{% trans %}Page: %page%{% endtrans %}</p> <span class="frame-section-button-like">{% trans %}Page: %page%{% endtrans %}</span>
{% else %} {% else %}
<h2>{{ empty_message }}</h2> <span>{{ empty_message }}</span>
{% endif %} {% endif %}
</section> </section>
</section> </section>

View File

@ -15,8 +15,13 @@
{% if notes is defined %} {% if notes is defined %}
<header class="feed-header"> <header class="feed-header">
{% set current_path = app.request.get('_route') %}
{% if page_title is defined %} {% if page_title is defined %}
<span class="section-title">{{ page_title | trans }}</span> {% if current_path starts with 'feed_' %}
<h1 class="section-title">{{ page_title | trans }}</h1>
{% else %}
<span class="section-title">{{ page_title | trans }}</span>
{% endif %}
{% else %} {% else %}
<span class="section-title">{{ 'Notes' | trans }}</span> <span class="section-title">{{ 'Notes' | trans }}</span>
{% endif %} {% endif %}

View File

@ -1,7 +1,7 @@
<section class="frame-section collections"> <section class="frame-section collections">
<details class="section-details-title" title="Expand if you want to access more options."> <details class="section-details-title" title="Expand if you want to access more options.">
<summary class="details-summary-title"> <summary class="details-summary-title">
<h2>{{ctitle}}</h2> <span>{{ctitle}}</span>
</summary> </summary>
{% if has_collections %} {% if has_collections %}
<section class="section-form"> <section class="section-form">

View File

@ -10,7 +10,7 @@
{% block body %} {% block body %}
<nav class='section-settings'> <nav class='section-settings'>
<h2>Settings</h2> <h1>Settings</h1>
<ul> <ul>
<li> <li>
{% set profile_tabs = [{'title': 'Personal Info', 'desc': 'Nickname, Homepage, Bio, Self Tags and more.', 'id': 'settings-personal-info', 'form': personal_info_form}] %} {% set profile_tabs = [{'title': 'Personal Info', 'desc': 'Nickname, Homepage, Bio, Self Tags and more.', 'id': 'settings-personal-info', 'form': personal_info_form}] %}

View File

@ -17,14 +17,14 @@
<details class="section-details-title" open="open" <details class="section-details-title" open="open"
title="{{ 'Expand if you want to access more options.' | trans }}"> title="{{ 'Expand if you want to access more options.' | trans }}">
<summary class="details-summary-title"> <summary class="details-summary-title">
<h2> <span>
{% set current_path = app.request.get('_route') %} {% set current_path = app.request.get('_route') %}
{% if current_path == 'conversation_reply_to' %} {% if current_path == 'conversation_reply_to' %}
{{ "Reply to note" | trans }} {{ "Reply to note" | trans }}
{% else %} {% else %}
{{ "Create a note" | trans }} {{ "Create a note" | trans }}
{% endif %} {% endif %}
</h2> </span>
</summary> </summary>
<section class="section-form"> <section class="section-form">

View File

@ -9,7 +9,7 @@
{% endif %} {% endif %}
<section class="frame-section frame-section-padding"> <section class="frame-section frame-section-padding">
<h2>{% trans %}Search{% endtrans %}</h2> <h1 class="section-title">{% trans %}Search{% endtrans %}</h1>
{{ form_start(search_form) }} {{ form_start(search_form) }}
<section class="frame-section section-form"> <section class="frame-section section-form">

View File

@ -8,10 +8,10 @@
{% block body %} {% block body %}
{% if tag_name is defined and tag_name is not null %} {% if tag_name is defined and tag_name is not null %}
{% if tag_name is instanceof('string') %} {% if tag_name is instanceof('string') %}
<h2>{% trans %}Actors with tag: %tag_name%{% endtrans %}</h2> <h1>{% trans %}Actors with tag: %tag_name%{% endtrans %}</h1>
{% else %} {% else %}
{% set tags = tag_name|join(',') %} {# TODO Not ideal, hard to translate #} {% set tags = tag_name|join(',') %} {# TODO Not ideal, hard to translate #}
<h2>{% trans %}Actors with tags: %tags%{% endtrans %}</h2> <h1>{% trans %}Actors with tags: %tags%{% endtrans %}</h1>
{% endif %} {% endif %}
{% endif %} {% endif %}
@ -23,7 +23,7 @@
{% block profile_view %}{% include 'cards/profile/view.html.twig' %}{% endblock profile_view %} {% block profile_view %}{% include 'cards/profile/view.html.twig' %}{% endblock profile_view %}
{% endfor %} {% endfor %}
<div class="frame-section frame-section-padding"> <div class="frame-section-button-like">
{{ "Page: " ~ page }} {{ "Page: " ~ page }}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -9,10 +9,10 @@
{% block body %} {% block body %}
{% if tag_name is defined and tag_name is not null %} {% if tag_name is defined and tag_name is not null %}
{% if tag_name is instanceof('string') %} {% if tag_name is instanceof('string') %}
<h2>{% trans %}Notes with tag: %tag_name%{% endtrans %}</h2> <h1>{% trans %}Notes with tag: %tag_name%{% endtrans %}</h1>
{% else %} {% else %}
{% set tags = tag_name|join(', ') %} {# TODO Not ideal, hard to translate #} {% set tags = tag_name|join(', ') %} {# TODO Not ideal, hard to translate #}
<h2>{% trans %}People with tags: %tags%{% endtrans %}</h2> <h1>{% trans %}People with tags: %tags%{% endtrans %}</h1>
{% endif %} {% endif %}
{% endif %} {% endif %}
@ -26,7 +26,7 @@
{% endblock current_note %} {% endblock current_note %}
{% endfor %} {% endfor %}
<div class="frame-section frame-section-padding frame-section-paging"> <div class="frame-section-button-like">
{{ "Page " ~ page }} {{ "Page " ~ page }}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -3,7 +3,7 @@
{# Backwards compatibility with hAtom 0.1 #} {# Backwards compatibility with hAtom 0.1 #}
{% if pinnednotes is not empty %} {% if pinnednotes is not empty %}
<main class="feed pinned" tabindex="0" role="feed"> <main class="feed pinned" tabindex="0" role="feed">
<h2>Pinned Notes</h2> <h1>Pinned Notes</h1>
<div class="h-feed hfeed notes"> <div class="h-feed hfeed notes">
{% for conversation in pinnednotes %} {% for conversation in pinnednotes %}
{% block current_note %} {% block current_note %}

View File

@ -1,9 +1,9 @@
{% if actor_tags is not empty %} {% if actor_tags is not empty %}
<div class="frame-section frame-section-padding"> <section class="frame-section frame-section-padding">
<h2>Related tags:</h2> <span class="section-title">Related tags</span>
{% for at in actor_tags %} {% for at in actor_tags %}
{% include 'cards/tag/actor_tag.html.twig' with { 'tag': at, 'actor': null } %} {% include 'cards/tag/actor_tag.html.twig' with { 'tag': at, 'actor': null } %}
{% endfor %} {% endfor %}
</div> </section>
{% endif %} {% endif %}

View File

@ -1,6 +1,6 @@
{% if note_tags is not empty %} {% if note_tags is not empty %}
<div class="frame-section frame-section-padding"> <div class="frame-section frame-section-padding">
<h2>Related tags:</h2> <h1>Related tags</h1>
{% for nt in note_tags %} {% for nt in note_tags %}
{% include 'cards/tag/note_tag.html.twig' with { 'tag': nt } %} {% include 'cards/tag/note_tag.html.twig' with { 'tag': nt } %}

View File

@ -1,7 +1,7 @@
<section class="frame-section"> <section class="frame-section">
<details class="section-details-title" title="Expand if you want to access more options."> <details class="section-details-title" title="Expand if you want to access more options.">
<summary class="details-summary-title"> <summary class="details-summary-title">
<h2>Web Monetization</h2> <span>Web Monetization</span>
</summary> </summary>
<section class="section-form"> <section class="section-form">
{{ form(the_form) }} {{ form(the_form) }}

View File

@ -132,7 +132,7 @@ html {
.section-panel .panel-content { .section-panel .panel-content {
background: var(--background-hard); background: var(--background-hard);
display: block; display: block;
height: 100vh; height: max-content;
} }
@media only screen and (max-width: 1280px) { @media only screen and (max-width: 1280px) {
@ -166,6 +166,8 @@ html {
overflow-y: auto; overflow-y: auto;
width: 100vw; width: 100vw;
z-index: 1; z-index: 1;
background: var(--background-hard);
box-shadow: var(--shadow);
} }
} }

View File

@ -134,7 +134,7 @@
.feed-header { .feed-header {
display: flex; display: flex;
margin-top: var(--s); margin-top: var(--s);
margin-bottom: var(--s); margin-bottom: var(--m);
align-items: center; align-items: center;
} }

View File

@ -306,6 +306,16 @@
width: 100%; width: 100%;
} }
.details-summary-title {
line-height: initial;
font-weight: 700;
font-size: 1.067em;
padding: 6px 12px;
}
.details-summary-subtitle {
font-weight: 700;
}
.details-summary-title:after { .details-summary-title:after {
content: "\2193"; content: "\2193";
float: right; float: right;
@ -335,10 +345,6 @@
transform: rotate(180deg); transform: rotate(180deg);
} }
.details-summary-title {
padding: 6px 12px;
}
.section-form { .section-form {
background-color: var(--background-hard); background-color: var(--background-hard);
border-radius: var(--s); border-radius: var(--s);

View File

@ -3,7 +3,7 @@
<details class="section-details-title" open="open" <details class="section-details-title" open="open"
title="{{ 'Expand if you want to access more options.' | trans }}"> title="{{ 'Expand if you want to access more options.' | trans }}">
<summary class="details-summary-title"> <summary class="details-summary-title">
<h2>{{ 'Feeds' | trans }}</h2> <span>{{ 'Feeds' | trans }}</span>
{% if app.user %} {% if app.user %}
{# User custom feeds #} {# User custom feeds #}
<a class="edit-feed-link" href="{{ path('edit_feeds') }}">{{ icon('edit', 'icon icon-edit-feed') | raw }}</a> <a class="edit-feed-link" href="{{ path('edit_feeds') }}">{{ icon('edit', 'icon icon-edit-feed') | raw }}</a>

View File

@ -20,12 +20,12 @@
{% endif %} {% endif %}
{% if app.user %} {% if app.user %}
<h2> <span>
{{ "You are logged in as" | trans }} {{ app.user.username }}. {{ "You are logged in as" | trans }} {{ app.user.username }}.
<button class="btn btn-lg btn-primary"> <button class="btn btn-lg btn-primary">
<a href="{{ path('app_logout') }}">{{ "Logout" | trans }}</a> <a href="{{ path('app_logout') }}">{{ "Logout" | trans }}</a>
</button> </button>
</h2> </span>
{% else %} {% else %}
<div class="form-row"> <div class="form-row">
<label class="section-form-label" for="inputNicknameOrEmail">{{ "Nickname or Email" | trans }}</label> <label class="section-form-label" for="inputNicknameOrEmail">{{ "Nickname or Email" | trans }}</label>