From 52ab1f4b95440e2efabddd1a224989258421434c Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 11 Apr 2013 21:48:15 +0200 Subject: Oubli des deux fichiers CSS --- public/theme/global.css | 456 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 456 insertions(+) create mode 100644 public/theme/global.css (limited to 'public/theme/global.css') diff --git a/public/theme/global.css b/public/theme/global.css new file mode 100644 index 000000000..ad6521c54 --- /dev/null +++ b/public/theme/global.css @@ -0,0 +1,456 @@ +/* FONTS */ +@font-face { + font-family: 'OpenSans'; + src: local('fonts/openSans.woff') format('woff'); +} + + +* { + margin: 0; + padding: 0; +} +html, body { + height: 100%; + font-size: 95%; + font-family: "Cantarell", "Helvetica", "Arial", "sans-serif"; +} + +/* LIENS */ +a { + color: #0062BE; + text-decoration: none; +} + a:hover { + text-decoration: underline; + } + +/* LISTES */ +ul, ol, dl { + margin: 10px 0 10px 30px; + line-height: 190%; +} + dd { + margin: 0 0 10px 30px; + } + +/* TITRES */ +h1, h2, h3 { + min-height: 40px; + margin: 15px 0 5px; + line-height: 40px; +} + +/* IMG */ +img { + max-width: 100%; + vertical-align: middle; +} + a img { + border: none; + } + +/* FORMULAIRES */ +legend { + display: block; + width: 100%; + margin: 20px 0 5px; + padding: 5px 0; + border-bottom: 1px solid #ddd; + font-size: 150%; + clear: both; +} +label { + display: block; + min-height: 25px; + padding: 5px 0; + font-size: 14px; + line-height: 25px; + cursor: pointer; +} +input, select, textarea { + display: inline-block; + min-height: 25px; + padding: 5px; + background: #fdfdfd; + border: 1px solid #bbb; + border-radius: 3px; + color: #666; + line-height: 25px; + vertical-align: middle; + box-shadow: 0 2px 2px #eee inset; +} + input[type="radio"], + input[type="checkbox"] { + width: 15px; + min-height: 15px; + } + input:focus, select:focus, textarea:focus { + color: #0062BE; + border-color: #33BBFF; + box-shadow: 0 2px 2px #DDDDFF inset; + } + +.form-group { + margin: 0; + clear: both; +} + .form-group.form-actions { + min-width: 250px; + padding: 5px 0; + background: #f4f4f4; + border-top: 1px solid #ddd; + } + .form-group.form-actions .btn { + margin: 0 10px; + } + .form-group .group-name { + display: block; + float: left; + width: 200px; + padding: 10px 0; + text-align: right; + } + .form-group .group-controls { + min-width: 250px; + min-height: 25px; + margin: 0 0 0 220px; + padding: 5px 0; + } + .form-group .group-controls .control { + display: block; + min-height: 30px; + padding: 5px 0; + line-height: 25px; + font-size: 14px; + } + +.stick { + display: inline-block; + white-space: nowrap; + font-size: 0px; + vertical-align: middle; +} + .stick input { + border-radius: 0; + font-size: 14px; + } + .stick .btn { + border-radius: 0; + font-size: 14px; + } + .stick .btn:first-child, + .stick input:first-child { + border-radius: 3px 0 0 3px; + } + .stick .btn:last-child, + .stick input:last-child { + border-radius: 0 3px 3px 0; + } + .stick .btn + .btn, + .stick .btn + input, + .stick input + .btn, + .stick input + input { + border-left: none; + } + .stick input + .btn { + border-top: 1px solid #bbb; + } + .stick .btn + .dropdown > .btn { + border-left: none; + border-radius: 0 3px 3px 0; + } + .stick .btn + .dropdown a { + font-size: 12px; + } + +.btn { + display: inline-block; + min-height: 37px; + min-width: 15px; + padding: 5px 10px; + background: #fff; + background: linear-gradient(#fff, #eee); + border-radius: 3px; + border: 1px solid #ddd; + border-bottom: 1px solid #aaa; + border-right: 1px solid #aaa; + color: #666; + text-shadow: 0px -1px 0 #ddd; + line-height: 20px; + vertical-align: middle; + cursor: pointer; +} + a.btn { + min-height: 25px; + line-height: 25px; + } + .btn:hover { + background: #f0f0f0; + background: linear-gradient(#f8f8f8, #f0f0f0); + text-decoration: none; + } + .btn.active, + .btn:active { + box-shadow: 0px 2px 4px #e0e0e0 inset, 0px 1px 2px #fafafa; + background: #eee; + } + + .btn.btn-important { + background: #0084CC; + background: linear-gradient(#0084CC, #0045CC); + color: #fff; + border: 1px solid #0062B7; + text-shadow: 0px -1px 0 #aaa; + } + .btn.btn-important:hover { + background: linear-gradient(#0066CC, #0045CC); + } + .btn.btn-important:active { + background: #0044CB; + box-shadow: none; + } + + .btn.btn-attention { + background: #E95B57; + background: linear-gradient(#E95B57, #BD362F); + color: #fff; + border: 1px solid #C44742; + text-shadow: 0px -1px 0px #666; + } + .btn.btn-attention:hover { + background: linear-gradient(#D14641, #BD362F); + } + .btn.btn-attention:active { + background: #BD362F; + box-shadow: none; + } + +/* NAVIGATION */ +.nav.nav-list .nav-header, +.nav.nav-list .item { + display: block; + height: 35px; + line-height: 35px; +} + .nav.nav-list .item:hover { + background: #fafafa; + } + .nav.nav-list .item:hover a { + color: #003388; + } + .nav.nav-list .item.active { + background: #0062BE; + color: #fff; + } + .nav.nav-list .item.active a { + color: #fff; + } + .nav.nav-list .disable { + color: #aaa; + background: #fafafa; + text-align: center; + } + .nav.nav-list .item > * { + display: block; + padding: 0 10px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + .nav.nav-list a:hover { + text-decoration: none; + } + + .nav.nav-list .nav-header { + padding: 0 10px; + color: #888; + background: #f4f4f4; + border-bottom: 1px solid #ddd; + font-weight: bold; + text-shadow: 0 0 1px #ddd; + } + .nav.nav-list .separator { + display: block; + height: 0; + margin: 5px 0; + border-bottom: 1px solid #ddd; + } + + .nav.nav-list .nav-form { + padding: 3px; + text-align: center; + } + +.nav-head { + display: block; + margin: 0; + background: #fff; + background: linear-gradient(#fff, #f0f0f0); + border-bottom: 1px solid #ddd; + text-align: right; +} + .nav-head .item { + display: inline-block; + padding: 5px 10px; + } + +/* DROPDOWN */ +.dropdown { + position: relative; + display: inline-block; +} + .dropdown .dropdown-target { + display: none; + } + + .dropdown .dropdown-menu { + display: none; + min-width: 200px; + margin: 5px 0 0; + padding: 5px 0; + position: absolute; + right: 0px; + background: #fff; + border: 1px solid #ddd; + border-radius: 5px; + text-align: left; + box-shadow: 3px 3px 3px #ddd; + } + .dropdown .dropdown-menu .dropdown-header { + display: block; + padding: 0 5px; + color: #888; + font-weight: bold; + font-size: 14px; + line-height: 30px; + } + .dropdown .dropdown-menu .item { + display: block; + height: 30px; + font-size: 90%; + line-height: 30px; + } + .dropdown .dropdown-menu .item > * { + display: block; + padding: 0 25px; + line-height: 30px; + } + .dropdown .dropdown-menu .item:hover { + background: #0062BE; + color: #fff; + } + .dropdown .dropdown-menu .item:hover > * { + color: #fff; + text-decoration: none; + } + .dropdown .dropdown-menu .separator { + display: block; + height: 0; + margin: 5px 0; + border-bottom: 1px solid #ddd; + } + .dropdown .dropdown-target:target ~ .dropdown-menu { + display: block; + z-index: 10; + } + .dropdown .dropdown-close { + display: inline-block; + position: absolute; + top: -16px; right: -16px; + width: 16px; + height: 16px; + padding: 5px; + background: #fff; + border-radius: 50px; + border: 1px solid #ddd; + line-height: 16px; + text-align: center; + } + .dropdown .dropdown-close:hover { + background: #f4f4f4; + } + +/* ALERTS */ +.alert { + display: block; + width: 90%; + margin: 15px auto; + padding: 10px 15px; + background: #f4f4f4; + border: 1px solid #ccc; + border-right: 1px solid #aaa; + border-bottom: 1px solid #aaa; + border-radius: 5px; + color: #aaa; + text-shadow: 0 0 1px #eee; + box-shadow: 1px 1px 3px #aaa inset; +} + .alert .alert-head { + margin: 0; + font-weight: bold; + font-size: 110%; + } + +/* ICONES */ +.icon { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + line-height: 16px; + background: center center no-repeat; +} + .icon.i_refresh { + background-image: url("icons/refresh.svg"); + } + .icon.i_bookmark { + background-image: url("icons/starred.svg"); + } + .icon.i_not_bookmark { + background-image: url("icons/unstarred.svg"); + } + .icon.i_read { + background-image: url("icons/read.svg"); + } + .icon.i_unread { + background-image: url("icons/unread.svg"); + } + .icon.i_all { + background-image: url("icons/all.svg"); + } + .icon.i_close { + background-image: url("icons/close.svg"); + } + .icon.i_search { + background-image: url("icons/search.svg"); + } + .icon.i_configure { + background-image: url("icons/configure.svg"); + } + .icon.i_login { + background-image: url("icons/login.svg"); + } + .icon.i_logout { + background-image: url("icons/logout.svg"); + } + .icon.i_add { + background-image: url("icons/add.svg"); + } + .icon.i_link { + background-image: url("icons/link.svg"); + } + .icon.i_down { + background-image: url("icons/down.svg"); + } + .icon.i_up { + background-image: url("icons/up.svg"); + } + .icon.i_help { + background-image: url("icons/help.svg"); + } + .icon.i_note { + background-image: url("icons/note.svg"); + } + .icon.i_note_empty { + background-image: url("icons/note_empty.svg"); + } -- cgit v1.2.3 From 2f7ecb2e490ade40350a68b902b4ff28e3168cbb Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 13 Apr 2013 11:11:48 +0200 Subject: Fix issue #46 : ajout de la select list pour les catégories en vue mobile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/layout/aside_flux.phtml | 2 ++ app/layout/nav_menu.phtml | 2 +- public/theme/freshrss.css | 38 +++++++++++++++++++++++++++++++++++++- public/theme/global.css | 3 +++ public/theme/icons/category.svg | 31 +++++++++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 public/theme/icons/category.svg (limited to 'public/theme/global.css') diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index c7b520b35..198103428 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -1,4 +1,6 @@
+ +
    conf) || is_logged ()) { ?>
  • Gestion des abonnements
  • diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 4deb20836..90fe4aea1 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -1,5 +1,5 @@ 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 'public/theme/global.css') 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)) {
  • - - 'index', - 'a' => 'index', - 'params' => array ( - 'output' => 'rss' - ) - ); - if ($get != '') { - $url['params']['get'] = $get; - } - if ($search != '') { - $url['params']['search'] = $search; - } - ?> - diff --git a/public/theme/freshrss.css b/public/theme/freshrss.css index e60310354..6db467a76 100644 --- a/public/theme/freshrss.css +++ b/public/theme/freshrss.css @@ -150,7 +150,7 @@ } .day { - height: 50px; + min-height: 50px; padding: 0 10px; font-size: 130%; font-weight: bold; diff --git a/public/theme/global.css b/public/theme/global.css index e44cda059..e4c503dfc 100644 --- a/public/theme/global.css +++ b/public/theme/global.css @@ -143,6 +143,9 @@ input, select, textarea { .stick input:first-child { border-radius: 3px 0 0 3px; } + .stick .btn.btn-important:first-child { + border-right: 1px solid #06f; + } .stick .btn:last-child, .stick input:last-child { border-radius: 0 3px 3px 0; diff --git a/public/theme/icons/rss.svg b/public/theme/icons/rss.svg index fe588c2cf..ceaddceee 100644 --- a/public/theme/icons/rss.svg +++ b/public/theme/icons/rss.svg @@ -22,8 +22,8 @@ - - + + -- cgit v1.2.3 From 8c2c5d287d5ac08aa9d0a3fb3d353ea7a18c92c3 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 14 Apr 2013 18:57:47 +0200 Subject: Fix issue #43 : création d'un installateur MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/configuration/application.ini | 13 - public/data/Configuration.array.php | 23 -- public/index.php | 26 +- public/install.php | 486 ++++++++++++++++++++++++++++++++++++ public/theme/global.css | 16 +- 5 files changed, 516 insertions(+), 48 deletions(-) delete mode 100644 app/configuration/application.ini delete mode 100644 public/data/Configuration.array.php create mode 100755 public/install.php (limited to 'public/theme/global.css') diff --git a/app/configuration/application.ini b/app/configuration/application.ini deleted file mode 100644 index 2beb60324..000000000 --- a/app/configuration/application.ini +++ /dev/null @@ -1,13 +0,0 @@ -[general] -environment = "development" -use_url_rewriting = false -sel_application = "flux rss lalala ~~~" - -base_url = "/~marien/rss/public" ; pas de slash à la fin /!\ -title = "FreshRSS" - -[db] -host = "localhost" -user = "bd" -password = "bede" -base = "marienfr_rss" diff --git a/public/data/Configuration.array.php b/public/data/Configuration.array.php deleted file mode 100644 index ce5a1a8ee..000000000 --- a/public/data/Configuration.array.php +++ /dev/null @@ -1,23 +0,0 @@ - 20, - 'default_view' => 'not_read', - 'display_posts' => 'no', - 'sort_order' => 'low_to_high', - 'old_entries' => 3, - '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', - ), -); diff --git a/public/index.php b/public/index.php index 330843719..4e39d028e 100755 --- a/public/index.php +++ b/public/index.php @@ -25,16 +25,20 @@ define ('APP_PATH', realpath (PUBLIC_PATH . '/../app')); define ('LOG_PATH', realpath (PUBLIC_PATH . '/../log')); define ('CACHE_PATH', realpath (PUBLIC_PATH . '/../cache')); -set_include_path (get_include_path () - . PATH_SEPARATOR - . LIB_PATH - . PATH_SEPARATOR - . LIB_PATH . '/minz' - . PATH_SEPARATOR - . APP_PATH); +if (file_exists (PUBLIC_PATH . '/install.php')) { + include ('install.php'); +} else { + set_include_path (get_include_path () + . PATH_SEPARATOR + . LIB_PATH + . PATH_SEPARATOR + . LIB_PATH . '/minz' + . PATH_SEPARATOR + . APP_PATH); -require (APP_PATH . '/App_FrontController.php'); + require (APP_PATH . '/App_FrontController.php'); -$front_controller = new App_FrontController (); -$front_controller->init (); -$front_controller->run (); + $front_controller = new App_FrontController (); + $front_controller->init (); + $front_controller->run (); +} diff --git a/public/install.php b/public/install.php new file mode 100755 index 000000000..512e4b5d5 --- /dev/null +++ b/public/install.php @@ -0,0 +1,486 @@ + $val) { + if (is_array ($val)) { + writeLine ($f, '\'' . $key . '\' => array ('); + writeArray ($f, $val); + writeLine ($f, '),'); + } else { + writeLine ($f, '\'' . $key . '\' => \'' . $val . '\','); + } + } +} + +/*** SAUVEGARDES ***/ +function saveStep2 () { + if (!empty ($_POST)) { + if (empty ($_POST['sel']) || + empty ($_POST['title']) || + empty ($_POST['old_entries'])) { + return false; + } + + $_SESSION['sel'] = $_POST['sel']; + $_SESSION['base_url'] = $_POST['base_url']; + $_SESSION['title'] = $_POST['title']; + $_SESSION['old_entries'] = $_POST['old_entries']; + if (!is_int (intval ($_SESSION['old_entries'])) || + $_SESSION['old_entries'] < 1) { + $_SESSION['old_entries'] = 3; + } + $_SESSION['mail_login'] = $_POST['mail_login']; + + $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, ' 1 && checkStep1 ()['all'] != 'ok') { + header ('Location: index.php?step=1'); + } elseif (STEP > 2 && checkStep2 ()['all'] != 'ok') { + header ('Location: index.php?step=2'); + } elseif (STEP > 3 && checkStep3 ()['all'] != 'ok') { + header ('Location: index.php?step=3'); + } +} +function checkStep1 () { + $php = version_compare (PHP_VERSION, '5.1.0') >= 0; + $minz = file_exists (LIB_PATH . '/minz'); + $curl = extension_loaded ('curl'); + $pdo = extension_loaded ('pdo_mysql'); + $cache = CACHE_PATH && is_writable (CACHE_PATH); + $conf = APP_PATH && is_writable (APP_PATH . '/configuration'); + $data = is_writable (PUBLIC_PATH . '/data'); + + return array ( + 'php' => $php ? 'ok' : 'ko', + 'minz' => $minz ? 'ok' : 'ko', + 'curl' => $curl ? 'ok' : 'ko', + 'pdo-mysql' => $pdo ? 'ok' : 'ko', + 'cache' => $cache ? 'ok' : 'ko', + 'configuration' => $conf ? 'ok' : 'ko', + 'data' => $data ? 'ok' : 'ko', + 'all' => $php && $minz && $curl && $pdo && $cache && $conf && $data ? 'ok' : 'ko' + ); +} +function checkStep2 () { + $conf = isset ($_SESSION['sel']) && + isset ($_SESSION['base_url']) && + isset ($_SESSION['title']) && + isset ($_SESSION['old_entries']) && + isset ($_SESSION['mail_login']); + $data = file_exists (PUBLIC_PATH . '/data/Configuration.array.php'); + + return array ( + 'conf' => $conf ? 'ok' : 'ko', + 'data' => $data ? 'ok' : 'ko', + 'all' => $conf && $data ? 'ok' : 'ko' + ); +} +function checkStep3 () { + $conf = file_exists (APP_PATH . '/configuration/application.ini'); + $bd = isset ($_SESSION['bd_host']) && + isset ($_SESSION['bd_user']) && + isset ($_SESSION['bd_pass']) && + isset ($_SESSION['bd_name']); + + return array ( + 'bd' => $bd ? 'ok' : 'ko', + 'conf' => $conf ? 'ok' : 'ko', + 'all' => $bd && $conf ? 'ok' : 'ko' + ); +} +function checkBD () { + $error = false; + + try { + $c = new PDO ('mysql:host=' . $_SESSION['bd_host'] . ';dbname=' . $_SESSION['bd_name'], + $_SESSION['bd_user'], + $_SESSION['bd_pass']); + + $res = $c->query (SQL_REQ); + + if (!$res) { + $error = true; + } + } catch (PDOException $e) { + $error = true; + } + + if ($error && file_exists (APP_PATH . '/configuration/application.ini')) { + unlink (APP_PATH . '/configuration/application.ini'); + } + + return !$error; +} + +/*** AFFICHAGE ***/ +function printStep1 () { + $res = checkStep1 (); +?> + + + +

    Ok ! Votre version de PHP est la et est compatible avec FreshRSS

    + +

    Arf ! Votre version de PHP est la . Vous devriez avoir au moins la version 5.1.0

    + + + +

    Ok ! Vous disposez du framework Minz

    + +

    Arf ! Vous ne disposez pas de la librairie Minz. Vous devriez exécuter le script build.sh ou bien la télécharger sur Github et installer dans le répertoire le contenu de son répertoire /lib.

    + + + + +

    Ok ! Vous disposez de cURL dans sa version

    + +

    Arf ! Vous ne disposez pas de cURL

    + + + +

    Ok ! Vous disposez de PDO et de son driver pour MySQL

    + +

    Arf ! Vous ne disposez pas de PDO ou de son driver pour MySQL

    + + + +

    Ok ! Les droits sur le répertoire de cache sont bons

    + +

    Arf ! Veuillez vérifier les droits sur le répertoire . Le serveur HTTP doit être capable d'écrire dedans

    + + + +

    Ok ! Les droits sur le répertoire de configuration sont bons

    + +

    Arf ! Veuillez vérifier les droits sur le répertoire . Le serveur HTTP doit être capable d'écrire dedans

    + + + +

    Ok ! Les droits sur le répertoire de data sont bons

    + +

    Arf ! Veuillez vérifier les droits sur le répertoire . Le serveur HTTP doit être capable d'écrire dedans

    + + + + Passer à l'étape suivante + + Veuillez corriger les erreurs avant de passer à l'étape suivante. + + + +

    Ok ! La configuration générale a été enregistrée.

    + + +
    + Configuration générale +
    + +
    + Vous devriez changer cette valeur par n'importe quelle autre +
    +
    + + +
    + +
    + Laissez tel quel dans le doute +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + mois +
    +
    + +
    + +
    + + +
    +
    + +
    +
    + + + + Passer à l'étape suivante + +
    +
    +
    + + +

    Ok ! La configuration de la base de données a été enregistrée.

    + + +
    + Configuration de la base de données +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    +
    + + + + Passer à l'étape suivante + +
    +
    +
    + +

    Félicitations ! L'installation s'est bien passée. Il faut maintenant supprimer le fichier install.php pour pouvoir accéder à FreshRSS... ou simplement cliquer sur le bouton ci-dessous ;)

    + Terminer l'installation + +

    Oups ! Quelque chose s'est mal passé, vous devriez supprimer le fichier à la main.

    + + + + + + + Installation - FreshRSS + + + + + +
    +
    +

    FreshRSS

    +

    Installation - étape

    +
    +
    + + + + + diff --git a/public/theme/global.css b/public/theme/global.css index e4c503dfc..c08463b8b 100644 --- a/public/theme/global.css +++ b/public/theme/global.css @@ -400,13 +400,27 @@ input, select, textarea { border-radius: 5px; color: #aaa; text-shadow: 0 0 1px #eee; - box-shadow: 1px 1px 3px #aaa inset; } .alert .alert-head { margin: 0; font-weight: bold; font-size: 110%; } + .alert.alert-warn { + background: #ffe; + border: 1px solid #eeb; + color: #c95; + } + .alert.alert-success { + background: #dfd; + border: 1px solid #cec; + color: #484; + } + .alert.alert-error { + background: #fdd; + border: 1px solid #ecc; + color: #844; + } /* ICONES */ .icon { -- cgit v1.2.3