A free, self-hostable news aggregator…
Fix issue #5 : menu tout le temps visible
Marien Fressinaud59d80a742825
diff --git a/app/controllers/indexController.php b/app/controllers/indexController.phpindex 315e301ad..c6373cb29 100755--- a/app/controllers/indexController.php+++ b/app/controllers/indexController.php@@ -32,6 +32,7 @@ class indexController extends ActionController {} else {View::prependTitle ('Vos flux RSS - ');}+ $this->view->get = $get;// Cas où on ne choisie ni catégorie ni les favoris// ou si la catégorie ne correspond à aucunediff --git a/app/layout/aside.phtml b/app/layout/aside.phtmlindex d26af69cf..73f797850 100644--- a/app/layout/aside.phtml+++ b/app/layout/aside.phtml@@ -11,25 +11,18 @@<a href="<?php echo Url::display (array ()); ?>">Flux RSS <span class="nb_not_read"><?php if ($this->nb_not_read > 0) { ?>(<?php echo $this->nb_not_read; ?> non lu<?php echo $this->nb_not_read > 1 ? 's' : ''; ?>)<?php } ?></span></a>-- <?php if (isset ($this->cat_aside)) { ?>- <ul id="flux_menu">- <li><a href="<?php echo Url::display (array ()); ?>">Tous <span><?php echo $this->nb_total; ?> article<?php echo $this->nb_total > 1 ? 's' : ''; ?></span></a></li>- <li><a href="<?php echo Url::display (array ('params' => array ('get' => 'favoris'))); ?>">Favoris <span><?php echo $this->nb_favorites; ?> article<?php echo $this->nb_favorites > 1 ? 's' : ''; ?></span></a></li>- <?php foreach ($this->cat_aside as $cat) { ?>- <li><a href="<?php echo Url::display (array ('params' => array ('get' => $cat->id ()))); ?>"><?php echo $cat->name (); ?> <span><?php echo $cat->nbFeed (); ?> flux</span></a></li>- <?php } ?>- </ul>- <?php } ?></li>+<?php if (!login_is_conf ($this->conf) || is_logged ()) { ?><li <?php echo Request::controllerName () == 'configure' ? 'class="active"' : ''; ?>><a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'feed')); ?>">Configurer</a></li><?php } ?>+<li><a href="<?php echo Url::display (array ('c' => 'feed', 'a' => 'actualize')); ?>">Mettre les flux à jour</a></li>+<?php if (login_is_conf ($this->conf)) { ?><li><?php if (!is_logged ()) { ?>@@ -39,29 +32,15 @@<?php } ?></li><?php } ?>++ <?php if (isset ($this->cat_aside)) { ?>+ <li class="all<?php echo !$this->get ? ' active' : ''; ?>"><a href="<?php echo Url::display (array ()); ?>">Tous <span><?php echo $this->nb_total; ?> article<?php echo $this->nb_total > 1 ? 's' : ''; ?></span></a></li>++ <li class="favorites<?php echo $this->get == 'favoris' ? ' active' : ''; ?>"><a href="<?php echo Url::display (array ('params' => array ('get' => 'favoris'))); ?>">Favoris <span><?php echo $this->nb_favorites; ?> article<?php echo $this->nb_favorites > 1 ? 's' : ''; ?></span></a></li>++ <?php foreach ($this->cat_aside as $cat) { ?>+ <li class="category<?php echo $this->get == $cat->id () ? ' active' : ''; ?>"><a href="<?php echo Url::display (array ('params' => array ('get' => $cat->id ()))); ?>"><?php echo $cat->name (); ?> <span><?php echo $cat->nbFeed (); ?> flux</span></a></li>+ <?php } ?>+ <?php } ?></ul></div>--<?php if (Request::controllerName () == 'configure' &&- (!login_is_conf ($this->conf) || is_logged ())) { ?>-<div class="aside">- <ul id="menu">- <li><h2>Configuration</h2></li>- <li <?php echo Request::actionName () == 'feed' ? 'class="active"' : ''; ?>>- <a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'feed')); ?>">Flux RSS</a>- </li>- <li <?php echo Request::actionName () == 'categorize' ? 'class="active"' : ''; ?>>- <a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'categorize')); ?>">Catégories</a>- </li>- <li <?php echo Request::actionName () == 'display' ? 'class="active"' : ''; ?>>- <a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'display')); ?>">Général et affichage</a>- </li>- <li <?php echo Request::actionName () == 'importExport' ? 'class="active"' : ''; ?>>- <a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'importExport')); ?>">Import / Export OPML</a>- </li>- <li <?php echo Request::actionName () == 'shortcut' ? 'class="active"' : ''; ?>>- <a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'shortcut')); ?>">Raccourcis</a>- </li>- </ul>-</div>-<?php } ?>diff --git a/app/layout/configure_aside.phtml b/app/layout/configure_aside.phtmlnew file mode 100644index 000000000..c1dbda4f3--- /dev/null+++ b/app/layout/configure_aside.phtml@@ -0,0 +1,20 @@+<div class="aside">+ <ul id="menu">+ <li><h2>Configuration</h2></li>+ <li <?php echo Request::actionName () == 'feed' ? 'class="active"' : ''; ?>>+ <a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'feed')); ?>">Flux RSS</a>+ </li>+ <li <?php echo Request::actionName () == 'categorize' ? 'class="active"' : ''; ?>>+ <a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'categorize')); ?>">Catégories</a>+ </li>+ <li <?php echo Request::actionName () == 'display' ? 'class="active"' : ''; ?>>+ <a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'display')); ?>">Général et affichage</a>+ </li>+ <li <?php echo Request::actionName () == 'importExport' ? 'class="active"' : ''; ?>>+ <a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'importExport')); ?>">Import / Export OPML</a>+ </li>+ <li <?php echo Request::actionName () == 'shortcut' ? 'class="active"' : ''; ?>>+ <a href="<?php echo Url::display (array ('c' => 'configure', 'a' => 'shortcut')); ?>">Raccourcis</a>+ </li>+ </ul>+</div>diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtmlindex 093ec1dcf..9f03c187f 100644--- a/app/views/configure/categorize.phtml+++ b/app/views/configure/categorize.phtml@@ -1,14 +1,18 @@-<form method="post" action="">- <h1>Gérer les catégories</h1>+<div class="table">+ <?php $this->partial ('configure_aside'); ?>++ <form method="post" action="">+ <h1>Gérer les catégories</h1>- <?php $i = 0; foreach ($this->categories as $cat) { $i++; ?>- <label for="cat_<?php echo $cat->id (); ?>">Catégorie n°<?php echo $i; ?></label>- <input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" />- <input type="hidden" name="ids[]" value="<?php echo $cat->id (); ?>" />- <?php } ?>+ <?php $i = 0; foreach ($this->categories as $cat) { $i++; ?>+ <label for="cat_<?php echo $cat->id (); ?>">Catégorie n°<?php echo $i; ?></label>+ <input type="text" id="cat_<?php echo $cat->id (); ?>" name="categories[]" value="<?php echo $cat->name (); ?>" />+ <input type="hidden" name="ids[]" value="<?php echo $cat->id (); ?>" />+ <?php } ?>- <label for="new_category">Ajouter une catégorie</label>- <input type="text" id="new_category" name="new_category" placeholder="Nouvelle catégorie" />+ <label for="new_category">Ajouter une catégorie</label>+ <input type="text" id="new_category" name="new_category" placeholder="Nouvelle catégorie" />- <input type="submit" value="Valider" />-</form>+ <input type="submit" value="Valider" />+ </form>+</div>diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtmlindex 089533aff..b468839c2 100644--- a/app/views/configure/display.phtml+++ b/app/views/configure/display.phtml@@ -1,43 +1,47 @@-<form method="post" action="">- <h1>Configuration générale</h1>-- <label for="old_entries">Supprimer les articles au bout de (mois)</label>- <input type="number" id="old_entries" name="old_entries" value="<?php echo $this->conf->oldEntries (); ?>" />-- <label for="mail_login">Adresse mail de connexion (utilise <a href="https://persona.org/">Persona</a>)</label>- <p><noscript>nécessite que javascript soit activé</noscript></p>- <?php $mail = $this->conf->mailLogin (); ?>- <input type="email" id="mail_login" name="mail_login" value="<?php echo $mail ? $mail : ''; ?>" placeholder="Laissez vide pour désactiver" />- <br />-- <h1>Configuration de l'affichage</h1>-- <label for="posts_per_page">Nombre d'articles par page</label>- <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->postsPerPage (); ?>" />-- <label>Vue par défaut</label>- <div class="radio_group">- <input type="radio" name="default_view" id="radio_all" value="all"<?php echo $this->conf->defaultView () == 'all' ? ' checked="checked"' : ''; ?> />- <label for="radio_all">Tout afficher</label>- <br />- <input type="radio" name="default_view" id="radio_not_read" value="not_read"<?php echo $this->conf->defaultView () == 'not_read' ? ' checked="checked"' : ''; ?> />- <label for="radio_not_read">Afficher les non lus</label>- </div>-- <label for="sort_order">Ordre de tri</label>- <select name="sort_order" id="sort_order">- <option value="low_to_high"<?php echo $this->conf->sortOrder () == 'low_to_high' ? ' selected="selected"' : ''; ?>>Du plus récent au plus ancien</option>- <option value="high_to_low"<?php echo $this->conf->sortOrder () == 'high_to_low' ? ' selected="selected"' : ''; ?>>Du plus ancien au plus récent</option>- </select>-- <label>Afficher les articles dépliés par défaut</label>- <div class="radio_group">- <input type="radio" name="display_posts" id="radio_yes" value="yes"<?php echo $this->conf->displayPosts () == 'yes' ? ' checked="checked"' : ''; ?> />- <label for="radio_yes">Oui</label>+<div class="table">+ <?php $this->partial ('configure_aside'); ?>++ <form method="post" action="">+ <h1>Configuration générale</h1>++ <label for="old_entries">Supprimer les articles au bout de (mois)</label>+ <input type="number" id="old_entries" name="old_entries" value="<?php echo $this->conf->oldEntries (); ?>" />++ <label for="mail_login">Adresse mail de connexion (utilise <a href="https://persona.org/">Persona</a>)</label>+ <p><noscript>nécessite que javascript soit activé</noscript></p>+ <?php $mail = $this->conf->mailLogin (); ?>+ <input type="email" id="mail_login" name="mail_login" value="<?php echo $mail ? $mail : ''; ?>" placeholder="Laissez vide pour désactiver" /><br />- <input type="radio" name="display_posts" id="radio_no" value="no"<?php echo $this->conf->displayPosts () == 'no' ? ' checked="checked"' : ''; ?> />- <label for="radio_no">Non<noscript> - <strong>nécessite que javascript soit activé</strong></noscript></label>- </div>- <input type="submit" value="Valider" />-</form>+ <h1>Configuration de l'affichage</h1>++ <label for="posts_per_page">Nombre d'articles par page</label>+ <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->postsPerPage (); ?>" />++ <label>Vue par défaut</label>+ <div class="radio_group">+ <input type="radio" name="default_view" id="radio_all" value="all"<?php echo $this->conf->defaultView () == 'all' ? ' checked="checked"' : ''; ?> />+ <label for="radio_all">Tout afficher</label>+ <br />+ <input type="radio" name="default_view" id="radio_not_read" value="not_read"<?php echo $this->conf->defaultView () == 'not_read' ? ' checked="checked"' : ''; ?> />+ <label for="radio_not_read">Afficher les non lus</label>+ </div>++ <label for="sort_order">Ordre de tri</label>+ <select name="sort_order" id="sort_order">+ <option value="low_to_high"<?php echo $this->conf->sortOrder () == 'low_to_high' ? ' selected="selected"' : ''; ?>>Du plus récent au plus ancien</option>+ <option value="high_to_low"<?php echo $this->conf->sortOrder () == 'high_to_low' ? ' selected="selected"' : ''; ?>>Du plus ancien au plus récent</option>+ </select>++ <label>Afficher les articles dépliés par défaut</label>+ <div class="radio_group">+ <input type="radio" name="display_posts" id="radio_yes" value="yes"<?php echo $this->conf->displayPosts () == 'yes' ? ' checked="checked"' : ''; ?> />+ <label for="radio_yes">Oui</label>+ <br />+ <input type="radio" name="display_posts" id="radio_no" value="no"<?php echo $this->conf->displayPosts () == 'no' ? ' checked="checked"' : ''; ?> />+ <label for="radio_no">Non<noscript> - <strong>nécessite que javascript soit activé</strong></noscript></label>+ </div>++ <input type="submit" value="Valider" />+ </form>+</div>diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtmlindex 582457b63..54867ba9a 100644--- a/app/views/configure/feed.phtml+++ b/app/views/configure/feed.phtml@@ -1,4 +1,6 @@<div class="table">+ <?php $this->partial ('configure_aside'); ?>+<div class="aside"><ul><li><h2>Vox flux RSS</h2></li>diff --git a/app/views/configure/importExport.phtml b/app/views/configure/importExport.phtmlindex c8ee6b7f1..03e4746ac 100644--- a/app/views/configure/importExport.phtml+++ b/app/views/configure/importExport.phtml@@ -11,14 +11,17 @@</body></opml><?php } else { ?>+<div class="table">+ <?php $this->partial ('configure_aside'); ?>-<form method="post" action="<?php echo Url::display (array ('c' => 'configure', 'a' => 'importExport', 'params' => array ('q' => 'import'))); ?>" enctype="multipart/form-data">- <h1>Exporter au format OPML</h1>- <button formaction="<?php echo Url::display (array ('c' => 'configure', 'a' => 'importExport', 'params' => array ('q' => 'export'))); ?>">Exporter</button>+ <form method="post" action="<?php echo Url::display (array ('c' => 'configure', 'a' => 'importExport', 'params' => array ('q' => 'import'))); ?>" enctype="multipart/form-data">+ <h1>Exporter au format OPML</h1>+ <button formaction="<?php echo Url::display (array ('c' => 'configure', 'a' => 'importExport', 'params' => array ('q' => 'export'))); ?>">Exporter</button>- <h1>Importer au format OPML</h1>- <label for="file">Fichier</label>- <input type="file" name="file" id="file" />- <input type="submit" value="Charger" />-</form>+ <h1>Importer au format OPML</h1>+ <label for="file">Fichier</label>+ <input type="file" name="file" id="file" />+ <input type="submit" value="Charger" />+ </form>+</div><?php } ?>diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtmlindex cf8af7ff9..eeaa89cda 100644--- a/app/views/configure/shortcut.phtml+++ b/app/views/configure/shortcut.phtml@@ -1,41 +1,45 @@-<datalist id="keys">- <?php foreach ($this->list_keys as $key) { ?>- <option value="<?php echo $key; ?>">- <?php } ?>-</datalist>+<div class="table">+ <?php $this->partial ('configure_aside'); ?>-<?php $s = $this->conf->shortcuts (); ?>+ <datalist id="keys">+ <?php foreach ($this->list_keys as $key) { ?>+ <option value="<?php echo $key; ?>">+ <?php } ?>+ </datalist>-<form method="post" action="">- <h1>Gérer les raccourcis</h1>+ <?php $s = $this->conf->shortcuts (); ?>++ <form method="post" action="">+ <h1>Gérer les raccourcis</h1>- <noscript>Le javascript doit être activé pour pouvoir utiliser les raccourcis</noscript>+ <noscript>Le javascript doit être activé pour pouvoir utiliser les raccourcis</noscript>- <label for="mark_read">Marquer l'article comme lu / non lu</label>- <input type="text" id="mark_read" name="shortcuts[mark_read]" list="keys" value="<?php echo $s['mark_read']; ?>" />- <p>+ <code>shift</code> pour marquer tous les articles comme non lus</p>+ <label for="mark_read">Marquer l'article comme lu / non lu</label>+ <input type="text" id="mark_read" name="shortcuts[mark_read]" list="keys" value="<?php echo $s['mark_read']; ?>" />+ <p>+ <code>shift</code> pour marquer tous les articles comme non lus</p>- <label for="mark_favorite">Mettre l'article en favori</label>- <input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?php echo $s['mark_favorite']; ?>" />+ <label for="mark_favorite">Mettre l'article en favori</label>+ <input type="text" id="mark_favorite" name="shortcuts[mark_favorite]" list="keys" value="<?php echo $s['mark_favorite']; ?>" />- <label for="go_website">Afficher l'article sur le site d'origine</label>- <input type="text" id="go_website" name="shortcuts[go_website]" list="keys" value="<?php echo $s['go_website']; ?>" />+ <label for="go_website">Afficher l'article sur le site d'origine</label>+ <input type="text" id="go_website" name="shortcuts[go_website]" list="keys" value="<?php echo $s['go_website']; ?>" />- <label for="next_entry">Passer à l'article suivant</label>- <input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?php echo $s['next_entry']; ?>" />- <p>+ <code>shift</code> pour passer au dernier article de la page</p>+ <label for="next_entry">Passer à l'article suivant</label>+ <input type="text" id="next_entry" name="shortcuts[next_entry]" list="keys" value="<?php echo $s['next_entry']; ?>" />+ <p>+ <code>shift</code> pour passer au dernier article de la page</p>- <label for="prev_entry">Passer à l'article précédent</label>- <input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?php echo $s['prev_entry']; ?>" />- <p>+ <code>shift</code> pour passer au premier article de la page</p>+ <label for="prev_entry">Passer à l'article précédent</label>+ <input type="text" id="prev_entry" name="shortcuts[prev_entry]" list="keys" value="<?php echo $s['prev_entry']; ?>" />+ <p>+ <code>shift</code> pour passer au premier article de la page</p>- <label for="next_page">Passer à la page suivant</label>- <input type="text" id="next_page" name="shortcuts[next_page]" list="keys" value="<?php echo $s['next_page']; ?>" />- <p>+ <code>shift</code> pour passer à la dernière page</p>+ <label for="next_page">Passer à la page suivant</label>+ <input type="text" id="next_page" name="shortcuts[next_page]" list="keys" value="<?php echo $s['next_page']; ?>" />+ <p>+ <code>shift</code> pour passer à la dernière page</p>- <label for="prev_page">Passer à la page précédente</label>- <input type="text" id="prev_page" name="shortcuts[prev_page]" list="keys" value="<?php echo $s['prev_page']; ?>" />- <p>+ <code>shift</code> pour passer à la première page</p>+ <label for="prev_page">Passer à la page précédente</label>+ <input type="text" id="prev_page" name="shortcuts[prev_page]" list="keys" value="<?php echo $s['prev_page']; ?>" />+ <p>+ <code>shift</code> pour passer à la première page</p>- <input type="submit" value="Valider" />-</form>+ <input type="submit" value="Valider" />+ </form>+</div>diff --git a/public/theme/base.css b/public/theme/base.cssindex 898ac65a7..12dff63cd 100644--- a/public/theme/base.css+++ b/public/theme/base.css@@ -131,8 +131,9 @@ form {background: #fff;}.aside li > a span {- font-size: 90%;float: right;+ padding: 0 5px;+ font-size: 80%;}.aside li.active > a {background: #0062BE;@@ -176,26 +177,21 @@ form {border: none;border-radius: 0;}- .aside #flux_menu {- display: none;- position: absolute;- top: 0; left: 250px;- border-bottom: 2px solid #0062BE;+ #main_aside {+ position: fixed;}- .aside li:hover #flux_menu {- display: block;- }- .aside #flux_menu a {- background: #fff;- color: #0062BE;+ #menu {+ height: 92%;+ overflow: auto;+ }+ #menu li.all {+ border-top: 1px solid #aaa;}- .aside #flux_menu a:hover {- background: #f0f0f0;- }#main {display: table-cell;height: 100%;max-width: 800px;+ padding: 0 0 0 250px;line-height: 180%;background: #fafafa;vertical-align: top;