Skip to content

Commit

Permalink
imp: Change the "news" tab by a "reading" tab (beta)
Browse files Browse the repository at this point in the history
The reading tab merges the features of news, bookmarks and read links.
Also, the news only gives access to the publications from the followed
feeds.
  • Loading branch information
marienfressinaud committed Mar 23, 2024
1 parent 4953b10 commit 4d02e91
Show file tree
Hide file tree
Showing 11 changed files with 274 additions and 138 deletions.
Binary file modified locales/fr_FR/LC_MESSAGES/main.mo
Binary file not shown.
93 changes: 51 additions & 42 deletions locales/fr_FR/LC_MESSAGES/main.po
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: flusio\n"
"POT-Creation-Date: 2024-03-10 18:30+0100\n"
"PO-Revision-Date: 2024-03-10 18:38+0100\n"
"POT-Creation-Date: 2024-03-23 11:19+0100\n"
"PO-Revision-Date: 2024-03-23 11:20+0100\n"
"Last-Translator: Marien Fressinaud <dev@marienfressinaud.fr>\n"
"Language-Team: \n"
"Language: fr_FR\n"
Expand All @@ -16,8 +16,8 @@ msgstr ""
"X-Poedit-SearchPath-0: .\n"

#: assets/javascripts/controllers/back_button_controller.js:47
#: views/_layouts/connected.phtml:225
#: views/_layouts/connected_blocked.phtml:184
#: views/_layouts/connected.phtml:229
#: views/_layouts/connected_blocked.phtml:183
#: views/_layouts/not_connected.phtml:151
msgid "Back"
msgstr "Retour"
Expand Down Expand Up @@ -294,11 +294,12 @@ msgid "The name must be less than {max} characters."
msgstr "Le nom ne doit pas faire plus de {max} caractères."

#: models/Collection.php:120 models/Collection.php:182
#: views/bookmarks/index.phtml:10
#: views/_layouts/reading.phtml:33 views/bookmarks/index.phtml:10
msgid "Bookmarks"
msgstr "Signets"

#: models/Collection.php:131 models/Collection.php:184
#: views/_layouts/reading.phtml:43
msgid "Links read"
msgstr "Liens lus"

Expand All @@ -307,8 +308,8 @@ msgid "Links never to read"
msgstr "Liens à ne jamais lire"

#: models/Collection.php:153 models/Collection.php:186
#: views/_layouts/connected.phtml:86 views/news/index.phtml:3
#: views/news/index.phtml:16
#: views/_layouts/connected.phtml:90 views/_layouts/reading.phtml:23
#: views/news/index.phtml:3 views/news/index.phtml:12
msgid "News"
msgstr "Journal"

Expand Down Expand Up @@ -553,69 +554,73 @@ msgstr ""
msgid "You must validate your account&nbsp;→"
msgstr "Vous devez valider votre compte&nbsp;→"

#: views/_layouts/connected.phtml:97 views/links/index.phtml:3
#: views/_layouts/connected.phtml:88
msgid "Reading"
msgstr "Lecture"

#: views/_layouts/connected.phtml:102 views/links/index.phtml:3
#: views/links/index.phtml:19
msgid "My links"
msgstr "Mes liens"

#: views/_layouts/connected.phtml:108 views/feeds/index.phtml:3
#: views/_layouts/connected.phtml:113 views/feeds/index.phtml:3
#: views/feeds/index.phtml:15
msgid "Feeds"
msgstr "Flux"

#: views/_layouts/connected.phtml:121 views/collections/_selector.phtml:83
#: views/_layouts/connected.phtml:126 views/collections/_selector.phtml:83
#: views/collections/groups/edit.phtml:88 views/links/searches/show.phtml:9
#: views/links/searches/show.phtml:21
msgid "New"
msgstr "Nouveau"

#: views/_layouts/connected.phtml:130 views/_layouts/connected.phtml:133
#: views/_layouts/connected.phtml:135 views/_layouts/connected.phtml:138
#: views/_layouts/connected_blocked.phtml:89
#: views/_layouts/connected_blocked.phtml:92
#, php-format
msgid "Menu of %s"
msgstr "Menu de %s"

#: views/_layouts/connected.phtml:151
#: views/_layouts/connected_blocked.phtml:110 views/my/profile/edit.phtml:3
#: views/_layouts/connected.phtml:155
#: views/_layouts/connected_blocked.phtml:109 views/my/profile/edit.phtml:3
#: views/my/profile/edit.phtml:14
msgid "Profile"
msgstr "Profil"

#: views/_layouts/connected.phtml:161
#: views/_layouts/connected_blocked.phtml:120 views/my/preferences/edit.phtml:3
#: views/_layouts/connected.phtml:165
#: views/_layouts/connected_blocked.phtml:119 views/my/preferences/edit.phtml:3
#: views/my/preferences/edit.phtml:12
msgid "Preferences"
msgstr "Préférences"

#: views/_layouts/connected.phtml:171
#: views/_layouts/connected_blocked.phtml:130 views/my/account/show.phtml:3
#: views/_layouts/connected.phtml:175
#: views/_layouts/connected_blocked.phtml:129 views/my/account/show.phtml:3
#: views/my/account/show.phtml:11
msgid "Account & data"
msgstr "Compte & données"

#: views/_layouts/connected.phtml:183
#: views/_layouts/connected_blocked.phtml:142 views/pages/addons.phtml:3
#: views/_layouts/connected.phtml:187
#: views/_layouts/connected_blocked.phtml:141 views/pages/addons.phtml:3
#: views/pages/addons.phtml:11
msgid "Add-ons"
msgstr "Extensions"

#: views/_layouts/connected.phtml:193
#: views/_layouts/connected_blocked.phtml:152 views/support/show.phtml:3
#: views/_layouts/connected.phtml:197
#: views/_layouts/connected_blocked.phtml:151 views/support/show.phtml:3
#: views/support/show.phtml:12
msgid "Help & support"
msgstr "Aide & support"

#: views/_layouts/connected.phtml:202
#: views/_layouts/connected_blocked.phtml:161
#: views/_layouts/connected.phtml:206
#: views/_layouts/connected_blocked.phtml:160
msgid "Log out"
msgstr "Se déconnecter"

#: views/_layouts/connected.phtml:236 views/_layouts/connected.phtml:237
#: views/_layouts/connected.phtml:240 views/_layouts/connected.phtml:241
msgid "Search links by words or URL"
msgstr "Rechercher des liens par mots ou URL"

#: views/_layouts/connected.phtml:245 views/links/searches/show.phtml:47
#: views/_layouts/connected.phtml:249 views/links/searches/show.phtml:47
#: views/links/searches/show.phtml:63
msgid "Search"
msgstr "Rechercher"
Expand Down Expand Up @@ -655,11 +660,11 @@ msgstr "passer"
msgid "finished"
msgstr "terminé"

#: views/_modal.phtml:26
#: views/_modal.phtml:25
msgid "Close"
msgstr "Fermer"

#: views/_modal.phtml:27
#: views/_modal.phtml:26
msgid "Close this window"
msgstr "Fermer cette fenêtre"

Expand Down Expand Up @@ -776,7 +781,7 @@ msgid ""
msgstr ""
"<strong>%s</strong> a ajouté ce lien à <strong>%s</strong> (partagée par %s)."

#: views/collections/_selector.phtml:41 views/links/index.phtml:107
#: views/collections/_selector.phtml:41 views/links/index.phtml:109
msgid "Shared with me"
msgstr "Partagées avec moi"

Expand Down Expand Up @@ -1138,7 +1143,7 @@ msgstr "Régler pour le journal"
msgid "Copy the link"
msgstr "Copier le lien"

#: views/collections/show_public.phtml:165 views/news/index.phtml:56
#: views/collections/show_public.phtml:165 views/news/index.phtml:52
msgid "Mark all as read"
msgstr "Tout marquer comme lu"

Expand Down Expand Up @@ -1575,15 +1580,15 @@ msgstr "minutes pour le consulter."
msgid "Organize your links in your bookmarks and your collections."
msgstr "Organisez vos liens dans vos signets et vos collections."

#: views/links/index.phtml:35
#: views/links/index.phtml:36
msgid "Your links to read later"
msgstr "Vos liens à lire plus tard"

#: views/links/index.phtml:47
#: views/links/index.phtml:48
msgid "Your links marked as read"
msgstr "Vos liens marqués comme lu"

#: views/links/index.phtml:66
#: views/links/index.phtml:68
msgid "Create a collection"
msgstr "Créer une collection"

Expand Down Expand Up @@ -2105,47 +2110,51 @@ msgstr "Toujours rien&nbsp;? Avez-vous vérifié votre spam&nbsp;?"
msgid "Didn’t receive the email? Resend it"
msgstr "Courriel non reçu ? Renvoyer"

#: views/news/index.phtml:45
#: views/news/index.phtml:41
msgid "Empty the news"
msgstr "Vider le journal"

#: views/news/index.phtml:66
#: views/news/index.phtml:62
msgid "Read the links later"
msgstr "Lire les liens plus tard"

#: views/news/index.phtml:75
#: views/news/index.phtml:71
msgid ""
"You’ll remove all the news links, this action cannot be canceled. Are you "
"sure?"
msgstr ""
"Vous allez retirer tous les liens du journal, cette action ne peut pas être "
"annulée. Confirmez-vous ?"

#: views/news/index.phtml:83
#: views/news/index.phtml:79
msgid "Never see the links again"
msgstr "Ne plus revoir les liens"

#: views/news/index.phtml:91
#: views/news/index.phtml:88
msgid "Fill the news with…"
msgstr "Remplissez votre journal avec…"

#: views/news/index.phtml:114
#: views/news/index.phtml:105
msgid "Refresh the news"
msgstr "Rafraichir le journal"

#: views/news/index.phtml:118
msgid "the latest publications"
msgstr "les dernières publications"

#: views/news/index.phtml:115
#: views/news/index.phtml:119
msgid "from your followed feeds"
msgstr "depuis vos flux suivis"

#: views/news/index.phtml:130
#: views/news/index.phtml:134
msgid "3 links of -10 minutes"
msgstr "3 liens de -10 minutes"

#: views/news/index.phtml:131 views/news/index.phtml:147
#: views/news/index.phtml:135 views/news/index.phtml:151
msgid "from your bookmarks"
msgstr "depuis vos signets"

#: views/news/index.phtml:146
#: views/news/index.phtml:150
msgid "1 link of +10 minutes"
msgstr "1 lien de +10 minutes"

Expand Down
1 change: 1 addition & 0 deletions src/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@import './custom/messages.css';
@import './custom/news.css';
@import './custom/profiles.css';
@import './custom/reading-nav.css';
@import './custom/share.css';
@import './custom/topics-selector.css';

Expand Down
55 changes: 55 additions & 0 deletions src/assets/stylesheets/custom/reading-nav.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.reading-nav {
text-align: center;
}

.reading-nav__container {
display: inline-flex;
margin: 0;
margin-bottom: var(--space-large);
padding-left: 0;

justify-content: center;

border: 1px solid var(--color-turquoise-3);
border-radius: var(--radius-button);

list-style: none;
}

.reading-nav__anchor {
display: inline-block;
padding: var(--space-small) var(--space-medium);

text-decoration: none;

background-color: var(--color-turquoise-1);

outline-offset: -0.3rem;

transition:
color 0.3s ease-in-out,
background-color 0.3s ease-in-out;
}

@media (min-width: 800px) {
.reading-nav__anchor {
padding-right: var(--space-larger);
padding-left: var(--space-larger);
}
}

.reading-nav__anchor:hover {
background-color: var(--color-turquoise-2);
}

.reading-nav__anchor[aria-current="page"] {
background-color: var(--color-turquoise-3);
}

.reading-nav__item:first-child .reading-nav__anchor {
border-radius: var(--radius-button) 0 0 var(--radius-button);
}

.reading-nav__item:last-child .reading-nav__anchor {
border-radius: 0 var(--radius-button) var(--radius-button) 0;
}
6 changes: 4 additions & 2 deletions src/utils/view_helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,13 @@ function human_implode(array $array, string $separator, string $last_separator):
/**
* Return a random sentence to display when there are no news.
*/
function no_news_sentence(): string
function no_news_sentence(bool $beta_enabled): string
{
$bookmarks_url = url('bookmarks');
$sentence = _('There are no relevant links to suggest at this time.') . '<br />';
$sentence .= _f('You can add links to <a href="%s">your bookmarks</a> to read them later.', $bookmarks_url);
if (!$beta_enabled) {
$sentence .= _f('You can add links to <a href="%s">your bookmarks</a> to read them later.', $bookmarks_url);
}

if (rand(0, 100) === 0) {
if (rand(0, 10) === 0) {
Expand Down
11 changes: 8 additions & 3 deletions src/views/_layouts/connected.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,18 @@
<div class="header__separator"></div>

<a
class="header__link <?= $current_tab === 'news' ? 'header__link--active' : '' ?>"
<?= $current_page === 'news' ? 'aria-current="page"' : '' ?>
class="header__link <?= $current_tab === 'reading' ? 'header__link--active' : '' ?>"
<?= $current_page === 'reading' ? 'aria-current="page"' : '' ?>
href="<?= url('news') ?>"
>
<?= icon('news') ?>

<span class="no-mobile">
<?= _('News') ?>
<?php if ($beta_enabled): ?>
<?= _('Reading') ?>
<?php else: ?>
<?= _('News') ?>
<?php endif; ?>
</span>
</a>

Expand Down

0 comments on commit 4d02e91

Please sign in to comment.