From d3078fb726639eed478a2a449b0a9043af04a756 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 15 Jun 2013 19:42:02 +0200 Subject: Mise en place de la structure pour les différentes vues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/helpers/reader_view.phtml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 app/views/helpers/reader_view.phtml (limited to 'app/views/helpers/reader_view.phtml') diff --git a/app/views/helpers/reader_view.phtml b/app/views/helpers/reader_view.phtml new file mode 100644 index 000000000..b666fe620 --- /dev/null +++ b/app/views/helpers/reader_view.phtml @@ -0,0 +1,5 @@ +partial ('nav_menu'); +?> + +Non implémenté \ No newline at end of file -- cgit v1.2.3 From e3b3fa39d8b51bb571d2d15dafcfc94d4ab28787 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 15 Jun 2013 20:14:13 +0200 Subject: Première version de la vue lecture (issue #67) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/layout/nav_menu.phtml | 2 +- app/views/helpers/reader_view.phtml | 43 +++++++++++++++++++++++++++++++++++-- app/views/javascript/main.phtml | 2 +- public/theme/freshrss.css | 12 +++++++++++ 4 files changed, 55 insertions(+), 4 deletions(-) (limited to 'app/views/helpers/reader_view.phtml') diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index dbe597985..d36814bee 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -61,7 +61,7 @@
  • diff --git a/app/views/helpers/reader_view.phtml b/app/views/helpers/reader_view.phtml index b666fe620..f702a4b91 100644 --- a/app/views/helpers/reader_view.phtml +++ b/app/views/helpers/reader_view.phtml @@ -1,5 +1,44 @@ partial ('nav_menu'); + +if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { + $items = $this->entryPaginator->items (); ?> -Non implémenté \ No newline at end of file +
    + + +
    +
    +
    + feed (true); ?> + + name (); ?> + +

    title (); ?>

    + +
    + author (); ?> + + date (); ?> +
    + + conf->lazyload() == 'yes') { + echo lazyimg($item->content ()); + } else { + echo $item->content(); + } + ?> +
    +
    +
    + + + entryPaginator->render ('pagination.phtml', 'next'); ?> +
    + + +
    + +
    + \ No newline at end of file diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index 28bb0dfd9..5b325ac8d 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -117,7 +117,7 @@ function init_posts () { if (hide_posts) { - $(".flux:not(.active) .flux_content").hide (); + $("#stream:not(.reader) .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 26bb21d8f..60498ad5b 100644 --- a/public/theme/freshrss.css +++ b/public/theme/freshrss.css @@ -286,6 +286,18 @@ text-decoration: none; } +#stream.reader .flux { + padding: 0 0 30px; + border: none; + background: #f0f0f0; + color: #333; +} + #stream.reader .flux .author { + margin: 0 0 10px; + font-size: 90%; + color: #666; + } + .content { max-width: 550px; margin: 0 auto; -- cgit v1.2.3 From 36316a6d7e81c3e73cad1362194e73a9006b0c72 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 16 Jun 2013 20:28:57 +0200 Subject: Implémentation des vues lecture et globale (issue #67) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/Category.php | 6 +++--- app/views/helpers/global_view.phtml | 32 +++++++++++++++++++++++++++++-- app/views/helpers/normal_view.phtml | 2 +- app/views/helpers/reader_view.phtml | 1 + app/views/javascript/main.phtml | 19 ++++++++++++++++++- public/theme/freshrss.css | 38 +++++++++++++++++++++++++++++++++++++ 6 files changed, 91 insertions(+), 7 deletions(-) (limited to 'app/views/helpers/reader_view.phtml') diff --git a/app/models/Category.php b/app/models/Category.php index 273559b1e..0c991588d 100755 --- a/app/models/Category.php +++ b/app/models/Category.php @@ -35,10 +35,10 @@ class Category extends Model { public function feeds () { if (is_null ($this->feeds)) { $feedDAO = new FeedDAO (); - return $feedDAO->listByCategory ($this->id ()); - } else { - return $this->feeds; + $this->feeds = $feedDAO->listByCategory ($this->id ()); } + + return $this->feeds; } public function _id ($value) { diff --git a/app/views/helpers/global_view.phtml b/app/views/helpers/global_view.phtml index b666fe620..8e5e363f8 100644 --- a/app/views/helpers/global_view.phtml +++ b/app/views/helpers/global_view.phtml @@ -1,5 +1,33 @@ +partial ('nav_menu'); ?> + +
    partial ('nav_menu'); + foreach ($this->cat_aside as $cat) { + $feeds = $cat->feeds (); + $catNotRead = $cat->nbNotRead (); + if (!empty ($feeds)) { ?> + + +
    \ No newline at end of file diff --git a/app/views/helpers/normal_view.phtml b/app/views/helpers/normal_view.phtml index 515084047..2ca365552 100644 --- a/app/views/helpers/normal_view.phtml +++ b/app/views/helpers/normal_view.phtml @@ -7,7 +7,7 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { $items = $this->entryPaginator->items (); ?> -
    +
    partial ('nav_menu'); if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { $items = $this->entryPaginator->items (); diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index 5b325ac8d..e290e02d3 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -9,6 +9,16 @@ var hide_posts = false; $mark = $this->conf->markWhen (); ?> +function is_reader_mode() { + var stream = $("#stream.reader"); + return stream.html() != null; +} + +function is_normal_mode() { + var stream = $("#stream.normal"); + return stream.html() != null; +} + function redirect (url, new_tab) { if (url) { if (new_tab) { @@ -117,7 +127,7 @@ function init_posts () { if (hide_posts) { - $("#stream:not(.reader) .flux:not(.active) .flux_content").hide (); + $(".flux:not(.active) .flux_content").hide (); } $(".flux_header .item.title, .flux_header .item.date").click (function () { @@ -153,6 +163,10 @@ function init_posts () { } function init_column_categories () { + if(!is_normal_mode()) { + return; + } + $(".category").addClass ("stick"); $(".categories .category .btn:first-child").width ("160px"); $(".category").append (""); @@ -268,6 +282,9 @@ function init_shortcuts () { } $(document).ready (function () { + if(is_reader_mode()) { + hide_posts = false; + } init_posts (); init_column_categories (); init_shortcuts (); diff --git a/public/theme/freshrss.css b/public/theme/freshrss.css index 60498ad5b..345bd5252 100644 --- a/public/theme/freshrss.css +++ b/public/theme/freshrss.css @@ -298,6 +298,44 @@ color: #666; } +#stream.global { + text-align: center; +} + #stream.global .category { + display: inline-block; + width: 280px; + margin: 20px 10px; + vertical-align: top; + background: #fff; + border: 1px solid #aaa; + border-radius: 5px; + text-align: left; + box-shadow: 0 0 5px #bbb; + } + #stream.global .cat_header { + height: 35px; + padding: 0 10px; + background: #eee; + border-bottom: 1px solid #aaa; + border-radius: 5px 5px 0 0; + line-height: 35px; + font-size: 120%; + } + #stream.global .cat_header a { + color: #333; + text-shadow: 0 -1px 0px #aaa; + } + #stream.global .category .feeds { + max-height: 250px; + margin: 0; + list-style: none; + overflow: auto; + } + #stream.global .category .feeds .item { + padding: 0 10px; + font-size: 90%; + } + .content { max-width: 550px; margin: 0 auto; -- cgit v1.2.3