From 1a4e8849ae10ce15f14b143448e0296704fa0130 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 11 Apr 2013 21:53:17 +0200 Subject: Changement du lien 'website' pour filtrer l'affichage selon ce site plutôt que d'envoyer sur ce dernier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/index/index.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/index/index.phtml') diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 53d7a2412..8d11d8838 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -50,7 +50,7 @@ if (isset ($this->entryPaginator)) { feed (true); ?> -
  • favicon <?php echo $feed->name (); ?> name (); ?>
  • +
  • favicon <?php echo $feed->name (); ?> name (); ?>
  • title (); ?>

  • le date (); ?>
  • -- cgit v1.2.3 From c12af70b1005635006f61a13ce6dd43bd5444557 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 13 Apr 2013 10:21:31 +0200 Subject: Fix issue #54 : suppression contenu attribut alt pour les favicons --- app/layout/aside_feed.phtml | 2 +- app/layout/aside_flux.phtml | 4 ++-- app/layout/nav_menu.phtml | 2 ++ app/views/index/index.phtml | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) (limited to 'app/views/index/index.phtml') diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index aaeb225eb..bd92b3393 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -35,7 +35,7 @@ feeds as $feed) { ?>
  • - favicon <?php echo $feed->name (); ?> + name (); ?>
  • diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index 1d1700170..c7b520b35 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -1,4 +1,4 @@ -
    +
      conf) || is_logged ()) { ?>
    • Gestion des abonnements
    • @@ -60,7 +60,7 @@ nbNotRead (); ?> - favicon <?php echo $feed->name (); ?> + 0 ? '' : ''; ?> 0 ? '(' . $not_read . ') ' : ''; ?> diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 4962c3aa5..e30823321 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -1,4 +1,6 @@ diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index 05368683c..e6c882333 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -26,10 +26,10 @@ function toggleContent (new_active, old_active) { } if (hide_posts) { - old_active.children (".content").toggle (0); + old_active.children (".flux_content").toggle (0); if (old_active[0] != new_active[0]) { - new_active.children (".content").toggle (0, function () { + new_active.children (".flux_content").toggle (0, function () { $("html,body").scrollTop (new_active.position ().top); }); } @@ -127,7 +127,7 @@ function init_posts () { init_img (); if (hide_posts) { - $(".flux:not(.active) .content").hide (); + $(".flux:not(.active) .flux_content").hide (); } $(".flux_header .item.title, .flux_header .item.date").click (function () { diff --git a/public/theme/freshrss.css b/public/theme/freshrss.css index 46b8cb57b..e60310354 100644 --- a/public/theme/freshrss.css +++ b/public/theme/freshrss.css @@ -184,122 +184,103 @@ } .flux_header { - display: table; - table-layout: fixed; - margin: 0; - padding: 0; - width: 100%; height: 25px; font-size: 12px; line-height: 25px; border-top: 1px solid #ddd; } - .flux_header .item { - display: table-cell; - vertical-align: middle; + .flux_header .item.manage { + width: 60px; + white-space: nowrap; + font-size: 0px; + text-align: center; } - .flux_header .item.manage { - width: 90px; - white-space: nowrap; - font-size: 0px; + .flux_header .item.manage .read { + display: inline-block; + width: 30px; + height: 40px; + background: url("icons/read.svg") center center no-repeat; vertical-align: middle; - text-align: center; } - .flux_header .item.manage .read { - display: inline-block; - width: 30px; - height: 40px; - background: url("icons/read.svg") center center no-repeat; - vertical-align: middle; + .flux_header .item.manage .read:hover { + text-decoration: none; } - .flux_header .item.manage .read:hover { - text-decoration: none; - } - .flux.not_read .flux_header .item.manage .read { - background: url("icons/unread.svg") center center no-repeat; - } - .flux_header .item.manage .bookmark { - display: inline-block; - width: 30px; - height: 40px; - background: url("icons/non-starred.svg") center center no-repeat; - vertical-align: middle; + .flux.not_read .flux_header .item.manage .read { + background: url("icons/unread.svg") center center no-repeat; } - .flux_header .item.manage .bookmark:hover { - text-decoration: none; - } - .flux.favorite .flux_header .item.manage .bookmark { - background: url("icons/starred.svg") center center no-repeat; - } - .flux_header .item.manage .note { - display: inline-block; - width: 30px; - height: 40px; - vertical-align: middle; - line-height: 40px; - font-size: 12px; - } - .flux_header .item.website { - width: 200px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - line-height: 40px; + .flux_header .item.manage .bookmark { + display: inline-block; + width: 30px; + height: 40px; + background: url("icons/non-starred.svg") center center no-repeat; + vertical-align: middle; } - .flux_header .item.website a { - display: block; - padding: 0 5px; - height: 40px; + .flux_header .item.manage .bookmark:hover { + text-decoration: none; } - .flux_header .item.title { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - cursor: pointer; - } - .flux_header .item.title h1 { - font-size: 12px; - margin: 0; - font-weight: normal; + .flux.favorite .flux_header .item.manage .bookmark { + background: url("icons/starred.svg") center center no-repeat; } - .flux.not_read .flux_header .item.title h1 { - font-weight: bold; - } - .flux_header .item.date { - width: 200px; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - text-align: right; - font-size: 10px; - color: #666; - cursor: pointer; + .flux_header .item.website { + width: 200px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + line-height: 40px; + } + .flux_header .item.website a { + display: block; + padding: 0 5px; + height: 40px; } - .flux_header .item.link { + .flux_header .item.title { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + cursor: pointer; + } + .flux.not_read .flux_header .item.title { + font-weight: bold; + } + .flux_header .item.date { + width: 200px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + text-align: right; + font-size: 10px; + color: #666; + cursor: pointer; + } + .flux_header .item.link { + width: 35px; + text-align: center; + } + .flux_header .item.link a { + display: inline-block; width: 35px; - text-align: center; + height: 40px; + background: url("icons/link.svg") center center no-repeat; + vertical-align: middle; } - .flux_header .item.link a { - display: inline-block; - width: 35px; - height: 40px; - background: url("icons/link.svg") center center no-repeat; - vertical-align: middle; + .flux_header .item.link a:hover { + text-decoration: none; } - .flux_header .item.link a:hover { - text-decoration: none; - } .content { max-width: 550px; margin: 0 auto; - padding: 10px; + padding: 20px 10px; line-height: 170%; font-family: 'OpenSans'; } + .content .title { + margin: 0 0 5px; + } .content h1, .content h2, .content h3 { margin: 20px 0 5px; } + .content p { margin: 0 0 20px; } @@ -329,6 +310,11 @@ margin: 0; } +.flux_content .bottom { + font-size: 90%; + text-align: center; +} + /*** PAGINATION ***/ .pagination { display: table; @@ -400,7 +386,8 @@ .aside .btn-important, .aside .feeds .dropdown, .flux_header .item.website span, - .flux_header .item.date { + .flux_header .item.date, + .flux_content .bottom { display: none; } .flux_header .item.website { diff --git a/public/theme/global.css b/public/theme/global.css index 3262036be..f4466cec1 100644 --- a/public/theme/global.css +++ b/public/theme/global.css @@ -69,6 +69,7 @@ label { } input, select, textarea { display: inline-block; + max-width: 100%; min-height: 25px; padding: 5px; background: #fdfdfd; @@ -294,6 +295,19 @@ input, select, textarea { padding: 5px 10px; } +/* HORIZONTAL-LIST */ +.horizontal-list { + display: table; + table-layout: fixed; + margin: 0; + padding: 0; + width: 100%; +} + .horizontal-list .item { + display: table-cell; + vertical-align: middle; + } + /* DROPDOWN */ .dropdown { position: relative; -- cgit v1.2.3 From c2bf3ead8ae15288eb99c82643fb0cbd595e1454 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 13 Apr 2013 13:02:21 +0200 Subject: Export des flux au format RSS pleinement supporté (voir issue #34) - possibilité de les filtrer comme pour la vue principale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/indexController.php | 14 +++++++++++++ app/controllers/rssController.php | 35 ------------------------------- app/layout/nav_menu.phtml | 19 +++++++++++++++++ app/models/Entry.php | 42 ++++++++++++++++++++++++++++--------- app/views/helpers/rss.phtml | 30 ++++++++++++++++++++++++++ app/views/index/index.phtml | 9 +++++++- app/views/rss/public.phtml | 31 --------------------------- public/theme/global.css | 6 ++++++ public/theme/icons/rss.svg | 32 ++++++++++++++++++++++++++++ public/theme/icons/share.svg | 34 ++++++++++++++++++++++++++++++ 10 files changed, 175 insertions(+), 77 deletions(-) delete mode 100755 app/controllers/rssController.php create mode 100755 app/views/helpers/rss.phtml delete mode 100755 app/views/rss/public.phtml create mode 100644 public/theme/icons/rss.svg create mode 100644 public/theme/icons/share.svg (limited to 'app/views/index/index.phtml') diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php index 1eba7231f..a11c26044 100755 --- a/app/controllers/indexController.php +++ b/app/controllers/indexController.php @@ -38,6 +38,9 @@ class indexController extends ActionController { } elseif ($this->get['type'] == 'favoris') { $entries = $entryDAO->listFavorites ($this->mode, $search, $order); View::prependTitle ('Vos favoris - '); + } elseif ($this->get['type'] == 'public') { + $entries = $entryDAO->listPublic ($this->mode, $search, $order); + View::prependTitle ('Public - '); } elseif ($this->get != false) { if ($this->get['type'] == 'c') { $cat = $catDAO->searchById ($this->get['filter']); @@ -81,6 +84,10 @@ class indexController extends ActionController { $this->view->cat_aside = $catDAO->listCategories (); $this->view->nb_favorites = $entryDAO->countFavorites (); $this->view->nb_total = $entryDAO->count (); + + if (Request::param ('output', '') == 'rss') { + $this->view->_useLayout (false); + } } } @@ -157,6 +164,13 @@ class indexController extends ActionController { if ($get == 'favoris') { $this->view->get_c = $get; + $this->get = array ( + 'type' => $get, + 'filter' => $get + ); + } elseif ($get == 'public') { + $this->view->get_c = $get; + $this->get = array ( 'type' => $get, 'filter' => $get diff --git a/app/controllers/rssController.php b/app/controllers/rssController.php deleted file mode 100755 index 1f66f4517..000000000 --- a/app/controllers/rssController.php +++ /dev/null @@ -1,35 +0,0 @@ -view->_useLayout (false); - } - - public function publicAction () { - $entryDAO = new EntryDAO (); - $entryDAO->_nbItemsPerPage (-1); - - $items = $entryDAO->listPublic ('low_to_high'); - - try { - $page = Request::param('page', 1); - $nb = Request::param('nb', 15); - $this->view->itemPaginator = new Paginator($items); - $this->view->itemPaginator->_nbItemsPerPage($nb); - $this->view->itemPaginator->_currentPage($page); - } catch(CurrentPagePaginationException $e) { - Error::error( - 404, - array('error' => array('La page que vous cherchez n\'existe pas')) - ); - } - } - - public function getNbNotReadAction() { - } -} diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 90fe4aea1..71a5bd11e 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -62,4 +62,23 @@
    + + 'index', + 'a' => 'index', + 'params' => array ( + 'output' => 'rss' + ) + ); + if ($get != '') { + $url['params']['get'] = $get; + } + if ($search != '') { + $url['params']['search'] = $search; + } + ?> +
    diff --git a/app/models/Entry.php b/app/models/Entry.php index b9b6d30db..230b457bf 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -422,7 +422,7 @@ class EntryDAO extends Model_pdo { $values = array(); if ($search) { $values[] = '%'.$search.'%'; - $where = ' AND title LIKE ?'; + $where .= ' AND title LIKE ?'; } if ($order == 'low_to_high') { @@ -455,8 +455,17 @@ class EntryDAO extends Model_pdo { return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC)); } - public function listPublic ($order = 'high_to_low') { + public function listPublic ($mode, $search = false, $order = 'high_to_low') { $where = ' WHERE is_public=1'; + if ($mode == 'not_read') { + $where .= ' AND is_read=0'; + } + + $values = array(); + if ($search) { + $values[] = '%'.$search.'%'; + $where .= ' AND title LIKE ?'; + } if ($order == 'low_to_high') { $order = ' DESC'; @@ -464,10 +473,26 @@ class EntryDAO extends Model_pdo { $order = ''; } - $sql = 'SELECT * FROM entry' . $where . ' ORDER BY date' . $order; + $sql = 'SELECT COUNT(*) AS count FROM entry' . $where; + $stm = $this->bd->prepare ($sql); + $stm->execute ($values); + $res = $stm->fetchAll (PDO::FETCH_ASSOC); + $this->nbItems = $res[0]['count']; + if($this->nbItemsPerPage < 0) { + $sql = 'SELECT * FROM entry' . $where + . ' ORDER BY date' . $order; + } else { + $deb = ($this->currentPage () - 1) * $this->nbItemsPerPage; + $fin = $this->nbItemsPerPage; + + $sql = 'SELECT * FROM entry' . $where + . ' ORDER BY date' . $order + . ' LIMIT ' . $deb . ', ' . $fin; + } $stm = $this->bd->prepare ($sql); - $stm->execute (); + + $stm->execute ($values); return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC)); } @@ -481,7 +506,7 @@ class EntryDAO extends Model_pdo { $values = array ($cat); if ($search) { $values[] = '%'.$search.'%'; - $where = ' AND title LIKE ?'; + $where .= ' AND title LIKE ?'; } if ($order == 'low_to_high') { @@ -515,10 +540,10 @@ class EntryDAO extends Model_pdo { $where .= ' AND is_read=0'; } - $values = array(); + $values = array($feed); if ($search) { $values[] = '%'.$search.'%'; - $where = ' AND title LIKE ?'; + $where .= ' AND title LIKE ?'; } if ($order == 'low_to_high') { @@ -529,7 +554,6 @@ class EntryDAO extends Model_pdo { $sql = 'SELECT COUNT(*) AS count FROM entry' . $where; $stm = $this->bd->prepare ($sql); - $values = array ($feed); $stm->execute ($values); $res = $stm->fetchAll (PDO::FETCH_ASSOC); $this->nbItems = $res[0]['count']; @@ -542,8 +566,6 @@ class EntryDAO extends Model_pdo { $stm = $this->bd->prepare ($sql); - $values = array ($feed); - $stm->execute ($values); return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC)); diff --git a/app/views/helpers/rss.phtml b/app/views/helpers/rss.phtml new file mode 100755 index 000000000..b75e6d3bc --- /dev/null +++ b/app/views/helpers/rss.phtml @@ -0,0 +1,30 @@ +'; ?> + + + <?php echo View::title(); ?> + + Flux RSS de + + GMT + +entryPaginator->items (); +foreach ($items as $item) { +?> + + <?php echo htmlspecialchars(html_entity_decode($item->title ())); ?> + link (); ?> + author (); ?> + + + + content (); +?>]]> + date (true)); ?> + guid (); ?> + + + + + diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index f9e953858..cd0ff0504 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -1,3 +1,10 @@ +renderHelper ('rss'); + return; +} +?> + partial ('aside_flux'); ?> partial ('nav_menu'); ?> @@ -67,7 +74,7 @@ if (isset ($this->entryPaginator)) {
  • + Partage +
    + +
    + +
    +
    +
    diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index cd0ff0504..6889a8b51 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -80,6 +80,12 @@ if (isset ($this->entryPaginator)) {
  • Par mail
  • + conf->urlShaarli (); + if ($shaarli) { + ?> +
  • Shaarli
  • + diff --git a/public/install.php b/public/install.php index fca4ff38e..7065e3a77 100644 --- a/public/install.php +++ b/public/install.php @@ -91,32 +91,13 @@ function saveStep2 () { $file_data = PUBLIC_PATH . '/data/Configuration.array.php'; - $conf = array ( - 'posts_per_page' => 20, - 'default_view' => 'not_read', - 'display_posts' => 'no', - 'sort_order' => 'low_to_high', - 'old_entries' => $_SESSION['old_entries'], - 'mail_login' => $_SESSION['mail_login'], - 'shortcuts' => array ( - 'mark_read' => 'r', - 'mark_favorite' => 'f', - 'go_website' => 'space', - 'next_entry' => 'j', - 'prev_entry' => 'k', - 'next_page' => 'right', - 'prev_page' => 'left', - ), - 'mark_when' => array ( - 'article' => 'yes', - 'site' => 'yes', - 'page' => 'no', - ), - ); $f = fopen ($file_data, 'w'); writeLine ($f, ' $_SESSION['old_entries'], + 'mail_login' => $_SESSION['mail_login'] + )); writeLine ($f, ');'); fclose ($f); -- cgit v1.2.3