Commit 8e1a3e8b authored by Emma's avatar Emma 🏳🌈

night mode in menu, username in menu on mobile

parent 8f7fd3f7
Pipeline #57848534 passed with stages
in 7 minutes and 45 seconds
.menu-link {
.menu-item {
color: var(--text);
display: block;
padding: 0.5rem 1rem;
......@@ -16,10 +16,16 @@
}
}
&:hover {
background-color: var(--accent);
color: var(--accent-fg);
text-decoration: none;
&:any-link,
input&[type="submit"],
input&[type="reset"],
input&[type="button"],
button& {
&:not(:disabled):hover {
background-color: var(--accent);
color: var(--accent-fg);
text-decoration: none;
}
}
&:focus {
......
......@@ -25,7 +25,7 @@
@import '_widgets/button'; // must come before other widget types
@import '_widgets/clear-notification-button';
@import '_widgets/dropdown';
@import '_widgets/menu-link';
@import '_widgets/menu-item';
@import '_widgets/subscribe-button';
@import '_widgets/tab';
......
......@@ -215,6 +215,18 @@
"css": "ok",
"code": 59413,
"src": "fontawesome"
},
{
"uid": "c2152732d525871cf35345955854f711",
"css": "moon-inv",
"code": 59414,
"src": "iconic"
},
{
"uid": "48050e07077b01021f7fbdbbec8f7de7",
"css": "sun-inv",
"code": 59416,
"src": "iconic"
}
]
}
}
\ No newline at end of file
......@@ -23,6 +23,7 @@
<symbol id="logout" viewBox="0 0 928.6 1000"><path d="M357 804q0 2 1 11t0 14-2 14-5 11-12 3H161q-67 0-114-47T0 696V304q0-67 47-114t114-47h178q8 0 13 5t5 13q0 2 1 11t0 15-2 13-5 11-12 3H161q-37 0-63 26t-27 64v392q0 37 27 63t63 27h180l7 2 4 3 4 5 1 8zm518-304q0 14-11 25L561 829q-11 10-25 10t-25-10-11-25V643H250q-14 0-25-11t-11-25V393q0-15 11-25t25-11h250V196q0-14 11-25t25-10 25 10l303 304q11 10 11 25z"/></symbol>
<symbol id="mail" viewBox="0 0 1000 1000"><path d="M929 839V411q-18 20-39 36-149 115-238 189-28 24-46 37t-48 28-57 13h-2q-26 0-57-13t-48-28-46-37q-88-74-238-189-21-16-39-36v428q0 7 6 13t12 5h822q7 0 12-5t6-13zm0-586v-14l-1-7-1-7-3-5-5-4-8-2H89q-7 0-12 6t-6 12q0 94 83 159 107 84 223 176 4 3 20 17t25 21 25 17 28 16 24 5h2q11 0 24-5t28-16 25-17 25-21 20-17q116-92 224-176 30-24 56-65t26-73zm71-21v607q0 37-26 63t-63 27H89q-36 0-63-27T0 839V232q0-37 26-63t63-26h822q37 0 63 26t26 63z"/></symbol>
<symbol id="menu" viewBox="0 0 857.1 1000"><path d="M857 750v71q0 15-10 25t-26 11H36q-15 0-25-11T0 821v-71q0-15 11-25t25-11h785q15 0 26 11t10 25zm0-286v72q0 14-10 25t-26 10H36q-15 0-25-10T0 536v-72q0-14 11-25t25-10h785q15 0 26 10t10 25zm0-285v71q0 14-10 25t-26 11H36q-15 0-25-11T0 250v-71q0-15 11-26t25-10h785q15 0 26 10t10 26z"/></symbol>
<symbol id="moon-inv" viewBox="0 0 928 1000"><path d="M706 672q105 0 205-56-42 145-162 238t-275 93q-188 0-322-134T18 490q0-154 93-274T348 53q-56 100-56 205 0 172 122 293t292 121z"/></symbol>
<symbol id="ok" viewBox="0 0 1000 1000"><path d="M933 316q0 22-16 38L513 758l-76 76q-16 15-38 15t-38-15l-76-76L83 556q-15-16-15-38t15-38l76-76q16-16 38-16t38 16l164 165 366-367q16-16 38-16t38 16l76 76q16 15 16 38z"/></symbol>
<symbol id="pencil" viewBox="0 0 857.1 1000"><path d="M203 857l50-51-131-131-51 51v60h72v71h60zm291-518q0-12-12-12-5 0-9 4L170 633q-4 4-4 10 0 12 13 12 5 0 9-4l303-302q3-4 3-10zm-30-107l232 232-464 465H0V696zm381 54q0 29-20 50l-93 93-232-233 93-92q20-21 50-21 29 0 51 21l131 131q20 22 20 51z"/></symbol>
<symbol id="pin-outline" viewBox="0 0 886 1000"><path d="M856 296q30 30 30 73t-30 75q-16 16-36 24-106 51-144 125-51 102-51 246 0 45-29 74t-75 30q-47 0-75-30L279 744 0 943l199-279L30 496q-20-18-27-49t5-64q27-65 96-65 146 0 246-50l11-7q69-37 118-141 7-20 21-34 30-30 74-29t74 31zM583 546q53-107 196-175L574 160q-69 146-176 200l-13 6q-120 57-281 57l416 416q0-168 63-293z"/></symbol>
......@@ -33,6 +34,7 @@
<symbol id="sitemap" viewBox="0 0 1000 1000"><path d="M1000 696v179q0 22-16 38t-38 16H768q-22 0-38-16t-16-38V696q0-22 16-38t38-15h53V536H536v107h53q23 0 38 15t16 38v179q0 22-16 38t-38 16H411q-23 0-38-16t-16-38V696q0-22 16-38t38-15h53V536H179v107h53q23 0 38 15t16 38v179q0 22-16 38t-38 16H54q-23 0-38-16T0 875V696q0-22 16-38t38-15h53V536q0-29 21-51t51-21h285V357h-53q-23 0-38-16t-16-37V125q0-22 16-38t38-16h178q23 0 38 16t16 38v179q0 22-16 37t-38 16h-53v107h285q29 0 51 21t21 51v107h53q23 0 38 15t16 38z"/></symbol>
<symbol id="sort" viewBox="0 0 571.4 1000"><path d="M571 607q0 15-10 25L311 882q-11 11-25 11t-25-11L11 632Q0 622 0 607t11-25 25-11h500q14 0 25 11t10 25zm0-214q0 14-10 25t-25 11H36q-15 0-25-11T0 393t11-25l250-250q10-11 25-11t25 11l250 250q10 10 10 25z"/></symbol>
<symbol id="spinner" viewBox="0 0 1000 1000"><path d="M294 778q0 29-21 50t-51 21q-29 0-50-21t-21-50q0-30 21-51t50-21 51 21 21 51zm277 115q0 29-20 50t-51 21-50-21-21-50 21-51 50-21 51 21 20 51zM179 500q0 30-21 50t-51 21-50-21-21-50 21-51 50-20 51 20 21 51zm670 278q0 29-21 50t-50 21q-30 0-51-21t-20-50 20-51 51-21 50 21 21 51zM311 222q0 37-26 63t-63 26-63-26-26-63 26-63 63-26 63 26 26 63zm653 278q0 30-21 50t-50 21-51-21-21-50 21-51 51-20 50 20 21 51zM607 107q0 45-31 76t-76 31-76-31-31-76 31-76 76-31 76 31 31 76zm296 115q0 52-37 88t-88 37q-52 0-88-37t-37-88q0-51 37-88t88-37q51 0 88 37t37 88z"/></symbol>
<symbol id="sun-inv" viewBox="0 0 928 1000"><path d="M465 276q92 0 158 66t65 158-65 158-158 65-158-65-66-158 66-158 158-66zm56-168q0 24-17 41t-39 16-39-16-17-41 17-39 38-16q24 0 41 16t16 39zM130 220q0-55 56-55 55 0 55 55 0 56-55 56-56 0-56-56zM74 443q23 0 40 16t16 40-16 40-40 16-40-16-16-40q0-24 16-40t40-16zm56 335q0-55 56-55 55 0 55 55 0 56-55 56-56 0-56-56zm279 112q0-22 17-39t38-17q24 0 41 17t16 39-17 40-39 17-39-17-17-40zm296-72q-16-16-16-39t16-39 39-17 40 17 15 39-15 39-40 15-39-15zm151-263q-24 0-40-16t-17-40q0-24 17-40t40-16 39 16 16 40-16 40-39 16zm-72-295q-16 16-40 16t-39-16-16-40 16-40 39-17 40 17 15 40-15 40z"/></symbol>
<symbol id="text" viewBox="0 0 857.1 1000"><path d="M819 212q16 16 27 42t11 50v642q0 23-15 38t-38 16H54q-23 0-38-16T0 946V54q0-23 16-38T54 0h500q22 0 49 11t42 27zM571 76v210h210q-5-17-12-23L594 88q-6-7-23-12zm215 853V357H554q-23 0-38-16t-16-37V71H71v858h715zM214 446q0-7 5-12t13-5h393q8 0 13 5t5 12v36q0 8-5 13t-13 5H232q-8 0-13-5t-5-13v-36zm411 125q8 0 13 5t5 13v36q0 8-5 13t-13 5H232q-8 0-13-5t-5-13v-36q0-8 5-13t13-5h393zm0 143q8 0 13 5t5 13v36q0 8-5 13t-13 5H232q-8 0-13-5t-5-13v-36q0-8 5-13t13-5h393z"/></symbol>
<symbol id="trash" viewBox="0 0 785.7 1000"><path d="M286 768V375q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v393q0 8 5 13t13 5h36q8 0 13-5t5-13zm143 0V375q0-8-5-13t-13-5h-36q-8 0-13 5t-5 13v393q0 8 5 13t13 5h36q8 0 13-5t5-13zm142 0V375q0-8-5-13t-12-5h-36q-8 0-13 5t-5 13v393q0 8 5 13t13 5h36q7 0 12-5t5-13zM268 214h250l-27-65q-4-5-9-6H305q-6 1-10 6zm518 18v36q0 8-5 13t-13 5h-54v529q0 46-26 80t-63 34H161q-37 0-63-33t-27-79V286H18q-8 0-13-5t-5-13v-36q0-8 5-13t13-5h172l39-93q9-21 31-35t44-15h178q23 0 44 15t30 35l39 93h173q8 0 13 5t5 13z"/></symbol>
<symbol id="up" viewBox="0 0 928 1000"><path d="M18 498L464 53l447 445-159 159-176-177v467H353V480L176 657z"/></symbol>
......
......@@ -133,3 +133,15 @@ unhide_forum:
defaults: { hide: false }
path: /user/{username}/unhide_forum/{forum}
methods: [POST]
night_mode_on:
controller: App\Controller\UserController::toggleNightMode
defaults: { enabled: true }
methods: [POST]
path: /night_mode_on
night_mode_off:
controller: App\Controller\UserController::toggleNightMode
defaults: { enabled: false }
methods: [POST]
path: /night_mode_off
......@@ -466,8 +466,7 @@ final class UserController extends AbstractController {
* @IsGranted("edit_user", subject="user", statusCode=403)
*
* @param EntityManager $em
* @param Request $request
* @param User $user
* @param Request $request @param User $user
* @param Forum $forum
* @param bool $hide
*
......@@ -492,4 +491,26 @@ final class UserController extends AbstractController {
'username' => $this->getUser()->getUsername(),
]);
}
/**
* @IsGranted("ROLE_USER")
*
* @param EntityManager $em
* @param Request $request
* @param bool $enabled
*
* @return Response
*/
public function toggleNightMode(EntityManager $em, Request $request, bool $enabled): Response {
$this->validateCsrf('toggle_night_mode', $request->request->get('token'));
$this->getUser()->setNightMode($enabled);
$em->flush();
if ($request->headers->has('Referer')) {
return $this->redirect($request->headers->get('Referer'));
}
return $this->redirectToRoute('front');
}
}
......@@ -56,8 +56,6 @@ class UserData implements UserInterface {
*/
private $frontPage;
private $nightMode;
private $showCustomStylesheets;
/**
......@@ -100,7 +98,6 @@ class UserData implements UserInterface {
$self->email = $user->getEmail();
$self->locale = $user->getLocale();
$self->frontPage = $user->getFrontPage();
$self->nightMode = $user->isNightMode();
$self->showCustomStylesheets = $user->isShowCustomStylesheets();
$self->preferredTheme = $user->getPreferredTheme();
$self->openExternalLinksInNewTab = $user->openExternalLinksInNewTab();
......@@ -126,7 +123,6 @@ class UserData implements UserInterface {
$user->setEmail($this->email);
$user->setLocale($this->locale);
$user->setFrontPage($this->frontPage);
$user->setNightMode($this->nightMode);
$user->setShowCustomStylesheets($this->showCustomStylesheets);
$user->setPreferredTheme($this->preferredTheme);
$user->setOpenExternalLinksInNewTab($this->openExternalLinksInNewTab);
......@@ -150,7 +146,6 @@ class UserData implements UserInterface {
'showCustomStylesheets',
'frontPage',
'locale',
'nightMode',
'preferredTheme',
'openExternalLinksInNewTab',
'autoFetchSubmissionTitles',
......@@ -230,14 +225,6 @@ class UserData implements UserInterface {
$this->frontPage = $frontPage;
}
public function getNightMode() {
return $this->nightMode;
}
public function setNightMode($nightMode) {
$this->nightMode = $nightMode;
}
public function getShowCustomStylesheets() {
return $this->showCustomStylesheets;
}
......
......@@ -42,9 +42,6 @@ final class UserSettingsType extends AbstractType {
],
'label' => 'label.front_page',
])
->add('night_mode', CheckboxType::class, [
'required' => false,
])
->add('openExternalLinksInNewTab', CheckboxType::class, [
'required' => false,
'label' => 'label.open_external_links_in_new_tab',
......
......@@ -146,7 +146,7 @@
{{- block('comment_nav_delete') -}}
{{- block('comment_nav_edit') }}
{% elseif is_granted('moderator', comment.submission.forum) %}
{% set comment_nav_classes = 'menu-link no-wrap' %}
{% set comment_nav_classes = 'menu-item no-wrap' %}
<li class="dropdown">
<button class="dropdown__toggle fg-inherit no-underline text-sm unbuttonize">
<span class="no-underline__exempt">{{ 'nav.actions'|trans }}</span>
......@@ -232,7 +232,7 @@
<input type="hidden" name="token" value="{{ csrf_token('softdelete_comment') }}">
<button type="submit"
class="unbuttonize comment__soft-delete-button {{ comment_nav_classes }} js-confirm-comment-delete">
{{- 'menu-link' in comment_nav_classes ? icon('trash') }}
{{- 'menu-item' in comment_nav_classes ? icon('trash') }}
{{ 'comments.delete'|trans -}}
</button>
</form>
......@@ -250,7 +250,7 @@
<input type="hidden" name="token" value="{{ csrf_token('delete_comment') }}">
<button type="submit"
class="unbuttonize comment__thread-delete-button {{ comment_nav_classes }} js-confirm-comment-delete">
{{- 'menu-link' in comment_nav_classes ? icon('trash') }}
{{- 'menu-item' in comment_nav_classes ? icon('trash') }}
{{ delete_thread_label|trans -}}
</button>
</form>
......@@ -266,7 +266,7 @@
submission_id: comment.submission.id,
comment_id: comment.id,
}) }}" class="comment__edit-link {{ comment_nav_classes }}">
{{- 'menu-link' in comment_nav_classes ? icon('pencil') }}
{{- 'menu-item' in comment_nav_classes ? icon('pencil') }}
{{ 'comments.edit'|trans -}}
</a>
</li>
......@@ -278,7 +278,7 @@
{% if is_granted('moderator', comment.submission.forum) %}
<li>
<a href="{{ path('forum_ban', {forum_name: comment.submission.forum.name, username: comment.user.username}) }}"
class="comment__ban-link menu-link no-wrap">
class="comment__ban-link menu-item no-wrap">
{{- icon('user-times') }}
{{ 'action.ban'|trans -}}
</a>
......@@ -291,7 +291,7 @@
{% if is_granted('ROLE_ADMIN') %}
<li>
<a href="{{ path('ban_user', {'username': comment.user.username}) }}"
class="comment__ip-ban-link menu-link no-wrap">
class="comment__ip-ban-link menu-item no-wrap">
{{- icon('hammer') }}
{{ 'action.global_ban'|trans -}}
</a>
......
......@@ -72,19 +72,19 @@
{% block site_nav_main_menu_admin_items %}
{% from '_macros/icon.html.twig' import icon %}
<li>
<a href="{{ path('user_bans') }}" class="menu-link {{ active_menu_item == 'bans' ? 'menu-link--active' }}">
<a href="{{ path('user_bans') }}" class="menu-item {{ active_menu_item == 'bans' ? 'menu-item--active' }}">
{{ icon('hammer') }}
{{ 'label.bans'|trans }}
</a>
</li>
<li>
<a href="{{ path('manage_forum_categories') }}" class="menu-link {{ active_menu_item == 'forum_categories' ? 'menu-link--active' }}">
<a href="{{ path('manage_forum_categories') }}" class="menu-item {{ active_menu_item == 'forum_categories' ? 'menu-item--active' }}">
{{ icon('sitemap') }}
{{ 'nav.forum_categories'|trans }}
</a>
</li>
<li>
<a href="{{ path('users') }}" class="menu-link {{ active_menu_item == 'users' ? 'menu-link--active' }}">
<a href="{{ path('users') }}" class="menu-item {{ active_menu_item == 'users' ? 'menu-item--active' }}">
{{ icon('user') }}
{{ 'nav.users'|trans }}
</a>
......@@ -185,37 +185,60 @@
{% block site_nav_user_menu_dropdown_items %}
{% from '_macros/icon.html.twig' import icon %}
<li class="no-desktop">
<span class="menu-item ">
{{ 'nav.logged_in_as_user'|trans({
'%user%': '<strong>%s</strong>'|format(app.user.username|e)
})|raw }}
</span>
</li>
<li class="no-desktop"><hr></li>
<li>
<a href="{{ path('user', {username: app.user.username}) }}"
class="menu-link {{ active_menu_item == 'profile' ? 'menu-link--active' }}">
class="menu-item {{ active_menu_item == 'profile' ? 'menu-item--active' }}">
{{ icon('user') }}
{{ 'nav.profile'|trans }}
</a>
</li>
<li>
<a href="{{ path('edit_user', {username: app.user.username}) }}"
class="menu-link {{ active_menu_item == 'account' ? 'menu-link--active' }}">
class="menu-item {{ active_menu_item == 'account' ? 'menu-item--active' }}">
{{ icon('lock') }}
{{ 'nav.my_account'|trans }}
</a>
</li>
<li>
<a href="{{ path('user_settings', {username: app.user.username}) }}"
class="menu-link {{ active_menu_item == 'preferences' ? 'menu-link--active' }}">
class="menu-item {{ active_menu_item == 'preferences' ? 'menu-item--active' }}">
{{ icon('settings') }}
{{ 'nav.user_settings'|trans }}
</a>
</li>
<li>
<a href="{{ path('user_block_list', {username: app.user.username}) }}"
class="menu-link {{ active_menu_item == 'block_list' ? 'menu-link--active' }}">
class="menu-item {{ active_menu_item == 'block_list' ? 'menu-item--active' }}">
{{ icon('block') }}
{{ 'nav.block_list'|trans }}
</a>
</li>
<li><hr></li>
<li>
<form action="{{ app.user.nightMode ? path('night_mode_off') : path('night_mode_on') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token('toggle_night_mode') }}">
<button class="menu-item unbuttonize">
{% if not app.user.nightMode %}
{{ icon('moon-inv') }}
{{ 'nav.dark_mode'|trans }}
{%- else -%}
{{ icon('sun-inv') }}
{{ 'nav.light_mode'|trans }}
{%- endif -%}
</button>
</form>
</li>
<li>
<form action="{{ logout_path() }}" method="POST">
<button class="menu-link unbuttonize">
<button class="menu-item unbuttonize">
{{ icon('logout') }}
{{ 'nav.log_out'|trans }}
</button>
......
......@@ -180,7 +180,7 @@
{% endblock submission_nav_comments %}
{% block submission_nav_moderation %}
{% set nav_link_classes = 'menu-link no-wrap' %}
{% set nav_link_classes = 'menu-item no-wrap' %}
{% if submission.user is same as(self) %}
{% set nav_link_classes = 'fg-inherit text-sm' %}
......@@ -214,7 +214,7 @@
<li>
<a href="{{ path('edit_submission', {forum_name: submission.forum.name, submission_id: submission.id}) }}"
class="{{ nav_link_classes }}">
{{- 'menu-link' in nav_link_classes ? icon('pencil') }}
{{- 'menu-item' in nav_link_classes ? icon('pencil') }}
{{ 'submissions.edit'|trans -}}
</a>
</li>
......@@ -228,7 +228,7 @@
<form action="{{ path('submission_delete_immediately', {forum_name: submission.forum.name, submission_id: submission.id}) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token('delete_submission') }}">
<button class="{{ nav_link_classes }} unbuttonize js-confirm-submission-delete">
{{- 'menu-link' in nav_link_classes ? icon('trash') }}
{{- 'menu-item' in nav_link_classes ? icon('trash') }}
{{ 'action.delete'|trans -}}
</button>
</form>
......@@ -237,7 +237,7 @@
<li>
<a href="{{ path('submission_delete_with_reason', {forum_name: submission.forum.name, submission_id: submission.id}) }}"
class="{{ nav_link_classes }}">
{{- 'menu-link' in nav_link_classes ? icon('trash') }}
{{- 'menu-item' in nav_link_classes ? icon('trash') }}
{{ 'action.delete'|trans -}}
</a>
</li>
......@@ -252,7 +252,7 @@
submission_id: submission.id,
}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('pin') }}">
<button class="unbuttonize menu-link no-wrap">
<button class="unbuttonize menu-item no-wrap">
{{- submission.sticky ? icon('pin-outline') : icon('pin') }}
{{ submission.sticky ? 'action.unpin'|trans : 'action.pin'|trans -}}
</button>
......@@ -268,7 +268,7 @@
submission_id: submission.id,
}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('lock') }}">
<button class="unbuttonize menu-link no-wrap">
<button class="unbuttonize menu-item no-wrap">
{{- submission.locked ? icon('lock-open') : icon('lock') }}
{{ submission.locked ? 'action.unlock'|trans : 'action.lock'|trans -}}
</button>
......@@ -280,7 +280,7 @@
{% from '_macros/icon.html.twig' import icon %}
<li>
<a href="{{ path('forum_ban', {forum_name: submission.forum.name, username: submission.user.username}) }}"
class="menu-link no-wrap">
class="menu-item no-wrap">
{{- icon('user-times') }}
{{ 'action.ban'|trans -}}
</a>
......@@ -292,7 +292,7 @@
{% if is_granted('ROLE_ADMIN') %}
<li>
<a href="{{ path('ban_user', {'username': submission.user.username}) }}"
class="menu-link no-wrap">
class="menu-item no-wrap">
{{- icon('hammer') }}
{{ 'action.global_ban'|trans -}}
</a>
......
......@@ -50,7 +50,7 @@
{% for type in types %}
<li>
<a href="{{ path(attr.get('_route'), (attr.get('_route_params') ?? [])|merge({sortBy: type, t: time})) }}"
class="no-wrap menu-link {{ type == current ? 'menu-link--active' }}">
class="no-wrap menu-item {{ type == current ? 'menu-item--active' }}">
{{- ('submissions.sort_by_'~type)|trans -}}
</a>
</li>
......@@ -74,7 +74,7 @@
{% for route, mode in filter_modes if (mode.condition ?? true) %}
<li>
<a href="{{ path(route, {sortBy: sort_by}) }}"
class="no-wrap menu-link {{ choice == route ? 'menu-link--active' }}">
class="no-wrap menu-item {{ choice == route ? 'menu-item--active' }}">
{{- mode.label -}}
</a>
</li>
......@@ -100,7 +100,7 @@
{% for time in times %}
<li>
<a href="{{ path(attr.get('_route'), (attr.get('_route_params') ?? [])|merge({t: time})) }}"
class="no-wrap menu-link {{ time == current ? 'menu-link--active' }}">
class="no-wrap menu-item {{ time == current ? 'menu-item--active' }}">
{{- ('submissions.time_'~time)|trans -}}
</a>
</li>
......
......@@ -66,29 +66,29 @@
{# sorted nav items #}
{% with { items: {} } %}
{% set item %}
<li><a href="{{ path('forum_bans', {forum_name: forum.name}) }}" class="menu-link">{{ 'nav.bans'|trans }}</a></li>
<li><a href="{{ path('forum_bans', {forum_name: forum.name}) }}" class="menu-item">{{ 'nav.bans'|trans }}</a></li>
{% endset %}
{% set items = items|merge({('nav.bans'|trans): item}) %}
{% set item %}
<li><a href="{{ path('moderation_log', {forum_name: forum.name}) }}" class="menu-link">{{ 'nav.moderation_log'|trans }}</a></li>
<li><a href="{{ path('moderation_log', {forum_name: forum.name}) }}" class="menu-item">{{ 'nav.moderation_log'|trans }}</a></li>
{% endset %}
{% set items = items|merge({('nav.moderation_log'|trans): item}) %}
{% if is_granted('moderator', forum) %}
{% set item %}
<li><a href="{{ path('edit_forum', {forum_name: forum.name}) }}" class="menu-link">{{ 'forum.edit'|trans }}</a></li>
<li><a href="{{ path('edit_forum', {forum_name: forum.name}) }}" class="menu-item">{{ 'forum.edit'|trans }}</a></li>
{% endset %}
{% set items = items|merge({('forum.edit'|trans): item}) %}
{% set item %}
<li><a href="{{ path('forum_appearance', {forum_name: forum.name}) }}" class="menu-link">{{ 'nav.appearance'|trans }}</a></li>
<li><a href="{{ path('forum_appearance', {forum_name: forum.name}) }}" class="menu-item">{{ 'nav.appearance'|trans }}</a></li>
{% endset %}
{% set items = items|merge({('nav.appearance'|trans): item}) %}
{% if app_webhooks_enabled() %}
{% set item %}
<li><a href="{{ path('forum_webhooks', {forum_name: forum.name}) }}" class="menu-link">{{ 'nav.webhooks'|trans }}</a></li>
<li><a href="{{ path('forum_webhooks', {forum_name: forum.name}) }}" class="menu-item">{{ 'nav.webhooks'|trans }}</a></li>
{% endset %}
{% set items = items|merge({('nav.webhooks'|trans): item}) %}
{% endif %}
......@@ -96,13 +96,13 @@
{% if is_granted('ROLE_ADMIN') %}
{% set item %}
<li><a href="{{ path('add_moderator', {forum_name: forum.name}) }}" class="menu-link">{{ 'forum.add_moderator'|trans }}</a></li>
<li><a href="{{ path('add_moderator', {forum_name: forum.name}) }}" class="menu-item">{{ 'forum.add_moderator'|trans }}</a></li>
{% endset %}
{% set items = items|merge({('forum.add_moderator'|trans): item}) %}
{% set item %}
<li>
<a href="{{ path('delete_forum', {forum_name: forum.name}) }}" class="menu-link">
<a href="{{ path('delete_forum', {forum_name: forum.name}) }}" class="menu-item">
{{- 'nav.delete_forum'|trans -}}
</a>
</li>
......@@ -125,7 +125,7 @@
{% for moderator in forum.moderators %}
<li class="break-text">
<a href="{{ path('user', {username: moderator.user.username}) }}"
class="menu-link">
class="menu-item">
{{- moderator.user.username -}}
</a>
</li>
......
......@@ -41,7 +41,7 @@
{% for mode, label in forum_sort_modes %}
<li>
<a href="{{ path('forum_list', { sortBy: mode }) }}"
class="menu-link {{ app.request.attributes.get('sortBy') == mode ? 'menu-link--active' }}">
class="menu-item {{ app.request.attributes.get('sortBy') == mode ? 'menu-item--active' }}">
{{- label -}}
</a>
</li>
......
......@@ -31,7 +31,7 @@
<ul class="unlistify sidebar__no-padding">
{% for forum in forums %}
<li><a href="{{ path('forum', {forum_name: forum}) }}" class="menu-link">{{ forum }}</a></li>
<li><a href="{{ path('forum', {forum_name: forum}) }}" class="menu-item">{{ forum }}</a></li>
{% endfor %}
</ul>
</section>
......
......@@ -11,7 +11,7 @@
{% if forums|length > 0 %}
<ul class="unlistify sidebar__no-padding">
{% for name in forums %}
<li><a href="{{ path('forum', {forum_name: name}) }}" class="menu-link">{{ name }}</a></li>
<li><a href="{{ path('forum', {forum_name: name}) }}" class="menu-item">{{ name }}</a></li>
{% endfor %}
</ul>
{% else %}
......
......@@ -20,7 +20,7 @@
<h1 class="sidebar__title">{{ 'heading.forums_you_moderate'|trans }}</h1>
<ul class="unlistify sidebar__no-padding">
{% for forum in forums %}
<li><a href="{{ path('forum', {forum_name: forum}) }}" class="menu-link">{{ forum }}</a></li>
<li><a href="{{ path('forum', {forum_name: forum}) }}" class="menu-item">{{ forum }}</a></li>
{% endfor %}
</ul>
</section>
......
......@@ -23,7 +23,7 @@
{% if forums|length > 0 %}
<ul class="unlistify sidebar__no-padding">
{% for name in forums %}
<li><a href="{{ path('forum', {forum_name: name}) }}" class="menu-link">{{ name }}</a></li>
<li><a href="{{ path('forum', {forum_name: name}) }}" class="menu-item">{{ name }}</a></li>
{% endfor %}
</ul>
{% else %}
......
......@@ -27,14 +27,14 @@
{% if is_granted('ROLE_USER') and user is not same as(app.user) %}
{% if is_granted('message', user) %}
{% set item %}
<li><a href="{{ path('compose_message', {username: user.username}) }}" class="menu-link">{{ 'user.message'|trans }}</a></li>
<li><a href="{{ path('compose_message', {username: user.username}) }}" class="menu-item">{{ 'user.message'|trans }}</a></li>
{% endset %}
{% set toolbox_items = toolbox_items|merge([item]) %}
{% endif %}
{% if not app.user.isBlocking(user) %}
{% set item %}
<li><a href="{{ path('block_user', {username: user.username}) }}" class="menu-link">{{ 'nav.block_user'|trans }}</a></li>
<li><a href="{{ path('block_user', {username: user.username}) }}" class="menu-item">{{ 'nav.block_user'|trans }}</a></li>
{% endset %}
{% set toolbox_items = toolbox_items|merge([item]) %}
{% endif %}
......@@ -42,15 +42,15 @@
{% if is_granted('ROLE_ADMIN') %}
{% set item %}
{% if not user.banned %}
<li><a href="{{ path('ban_user', {username: user.username}) }}" class="menu-link">{{ 'action.ban'|trans }}</a></li>
<li><a href="{{ path('ban_user', {username: user.username}) }}" class="menu-item">{{ 'action.ban'|trans }}</a></li>
{% else %}
<li><a href="{{ path('unban_user', {username: user.username}) }}" class="menu-link">{{ 'action.unban'|trans }}</a></li>
<li><a href="{{ path('unban_user', {username: user.username}) }}" class="menu-item">{{ 'action.unban'|trans }}</a></li>
{% endif %}
{% endset %}
{% set toolbox_items = toolbox_items|merge([item]) %}
{% set item %}
<li><a href="{{ path('user_forum_bans', {username: user.username}) }}" class="menu-link">{{ 'nav.forum_bans'|trans }}</a></li>
<li><a href="{{ path('user_forum_bans', {username: user.username}) }}" class="menu-item">{{ 'nav.forum_bans'|trans }}</a></li>
{% endset %}
{% set toolbox_items = toolbox_items|merge([item]) %}
{% endif %}
......@@ -58,12 +58,12 @@
{% if user is same as(app.user) %}
{% set item %}
<li><a href="{{ path('edit_biography', {username: user.username}) }}" class="menu-link">{{ 'nav.edit_biography'|trans }}</a></li>
<li><a href="{{ path('edit_biography', {username: user.username}) }}" class="menu-item">{{ 'nav.edit_biography'|trans }}</a></li>
{% endset %}
{% set toolbox_items = toolbox_items|merge([item]) %}
{% set item %}
<li><a href="{{ path('hidden_forums', {username: user.username}) }}" class="menu-link">{{ 'nav.hidden_forums'|trans }}</a></li>
<li><a href="{{ path('hidden_forums', {username: user.username}) }}" class="menu-item">{{ 'nav.hidden_forums'|trans }}</a></li>
{% endset %}
{% set toolbox_items = toolbox_items|merge([item]) %}
{% endif %}
......@@ -96,7 +96,7 @@
<h1 class="sidebar__title break-text">{{ 'user.moderates'|trans({'%username%': user.username}) }}</h1>
<ul class="unlistify sidebar__no-padding">
{% for token in user.moderatorTokens %}
<li><a href="{{ path('forum', {forum_name: token.forum.name}) }}" class="menu-link">{{ token.forum.name }}</a></li>
<li><a href="{{ path('forum', {forum_name: token.forum.name}) }}" class="menu-item">{{ token.forum.name }}</a></li>
{% endfor %}
</ul>
</section>
......
......@@ -56,8 +56,6 @@
{{ form_row(form.showCustomStylesheets) }}
{{ form_row(form.night_mode) }}
{# waiting to be reused #}
{#{{ form_row(form.show_custom_stylesheets) }}#}
</fieldset>
......
......@@ -72,9 +72,9 @@
<ul class="unlistify sidebar__no-padding">
{% if is_granted('write', page) %}
<li><a href="{{ path('wiki_edit', {path: page.path}) }}" class="menu-link">{{ 'wiki.edit_page'|trans }}</a></li>
<li><a href="{{ path('wiki_edit', {path: page.path}) }}" class="menu-item">{{ 'wiki.edit_page'|trans }}</a></li>
{% endif %}
<li><a href="{{ path('wiki_history', {path: page.path}) }}" class="menu-link">{{ 'wiki.page_history'|trans }}</a></li>
<li><a href="{{ path('wiki_history', {path: page.path}) }}" class="menu-item">{{ 'wiki.page_history'|trans }}</a></li>
</ul>
</section>
......@@ -82,8 +82,8 @@
<h1 class="sidebar__title">{{ 'wiki.navigation'|trans }}</h1>
<ul class="unlistify sidebar__no-padding">
<li><a href="{{ path('wiki_all') }}" class="menu-link">{{ 'wiki.all_pages'|trans }}</a></li>
<li><a href="{{ path('wiki_recent_changes') }}" class="menu-link">{{ 'label.recent_changes'|trans }}</a></li>
<li><a href="{{ path('wiki_all') }}" class="menu-item">{{ 'wiki.all_pages'|trans }}</a></li>
<li><a href="{{ path('wiki_recent_changes') }}" class="menu-item">{{ 'label.recent_changes'|trans }}</a></li>
</ul>
</section>
{% endblock %}
......
......@@ -225,5 +225,4 @@ user_settings:
user_settings_form:
locale: Sprache
night_mode: Nachtmodus
save: Änderungen speichern
......@@ -403,7 +403,6 @@ user_settings:
user_settings_form:
locale: Γλώσσα
night_mode: Νυχτερινή λειτουργία
save: Αποθήκευσε τις αλλαγές
wiki:
......
......@@ -394,6 +394,9 @@ nav:
home: Home
user: User
search: Search
dark_mode: Dark mode
light_mode: Light mode
logged_in_as_user: Logged in as %user%
placeholder:
choose_one: Choose one…
......@@ -551,7 +554,6 @@ user_settings:
user_settings_form:
locale: Language
night_mode: Night mode
save: Save changes
wiki:
......
......@@ -543,7 +543,6 @@ user_settings:
user_settings_form:
locale: Lingvo
night_mode: Nokta reĝimo
save: Konservi ŝanĝojn
wiki:
......
......@@ -478,7 +478,6 @@ user_settings:
user_settings_form:
locale: Idioma
night_mode: Modo nocturno
save: Guardar cambios
wiki:
......
......@@ -266,7 +266,6 @@ user_settings:
user_settings_form:
locale: Kieli
night_mode: Yötila
save: Tallenna muutokset
wiki:
......
......@@ -487,7 +487,6 @@ user_settings: