Skip to content

Commit

Permalink
imp: Remove user menu and alerts from Turbo cache
Browse files Browse the repository at this point in the history
This avoids "flashes" when coming back from e.g. the preferences page.
  • Loading branch information
marienfressinaud committed Oct 7, 2022
1 parent 87e5e9c commit 9f2534c
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 9 deletions.
7 changes: 6 additions & 1 deletion src/views/_layouts/connected.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@
</span>
</summary>

<nav class="popup__container popup__container--large popup__container--left" role="menu">
<nav
class="popup__container popup__container--large popup__container--left"
role="menu"
data-turbo-cache="false"
>
<div class="popup__title"><?= protect($current_user->username) ?></div>

<a
Expand Down Expand Up @@ -260,6 +264,7 @@
aria-modal="true"
aria-hidden="true"
tabindex="-1"
data-turbo-cache="false"
>
<section
class="modal__box"
Expand Down
6 changes: 5 additions & 1 deletion src/views/_layouts/connected_blocked.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@
</span>
</summary>

<nav class="popup__container popup__container--large popup__container--left" role="menu">
<nav
class="popup__container popup__container--large popup__container--left"
role="menu"
data-turbo-cache="false"
>
<div class="popup__title"><?= protect($current_user->username) ?></div>

<a
Expand Down
1 change: 1 addition & 0 deletions src/views/_layouts/not_connected.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
aria-modal="true"
aria-hidden="true"
tabindex="-1"
data-turbo-cache="false"
>
<section
class="modal__box"
Expand Down
2 changes: 1 addition & 1 deletion src/views/alerts/_error.phtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php if ($message): ?>
<div class="alert alert--error" role="alert">
<div class="alert alert--error" role="alert" data-turbo-cache="false">
<div class="alert__title"><?= _('Error') ?></div>

<p class="alert__message">
Expand Down
2 changes: 1 addition & 1 deletion src/views/alerts/_info.phtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php if ($message): ?>
<div class="alert alert--info" role="alert">
<div class="alert alert--info" role="alert" data-turbo-cache="false">
<div class="alert__title"><?= _('Info') ?></div>

<p class="alert__message">
Expand Down
2 changes: 1 addition & 1 deletion src/views/alerts/_success.phtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php if ($message): ?>
<div class="alert alert--success" role="alert">
<div class="alert alert--success" role="alert" data-turbo-cache="false">
<div class="alert__title"><?= _('Success') ?></div>

<p class="alert__message">
Expand Down
8 changes: 4 additions & 4 deletions src/views/news/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@
</details>
</div>
<?php else: ?>
<p class="section__intro">
<?= _('Fill the news with…') ?>
</p>

<?php if ($no_news): ?>
<?= $this->include('alerts/_info.phtml', ['message' => no_news_sentence()]) ?>
<?php else: ?>
<p class="section__intro">
<?= _('Fill the news with…') ?>
</p>
<?php endif; ?>

<form method="post" action="<?= url('fill news') ?>">
Expand Down

0 comments on commit 9f2534c

Please sign in to comment.