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/i18n/en.php | 3 + app/i18n/fr.php | 3 + app/layout/nav_menu.phtml | 67 +++++++++++++------ app/views/helpers/global_view.phtml | 5 ++ app/views/helpers/normal_view.phtml | 114 ++++++++++++++++++++++++++++++++ app/views/helpers/reader_view.phtml | 5 ++ app/views/helpers/rss.phtml | 30 --------- app/views/helpers/rss_view.phtml | 30 +++++++++ app/views/index/index.phtml | 128 ++---------------------------------- lib/lib_text.php | 8 +++ public/theme/freshrss.css | 7 +- 11 files changed, 228 insertions(+), 172 deletions(-) create mode 100644 app/views/helpers/global_view.phtml create mode 100644 app/views/helpers/normal_view.phtml create mode 100644 app/views/helpers/reader_view.phtml delete mode 100755 app/views/helpers/rss.phtml create mode 100755 app/views/helpers/rss_view.phtml diff --git a/app/i18n/en.php b/app/i18n/en.php index e40be045a..4dbfde715 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -37,6 +37,9 @@ return array ( 'before_one_day' => 'Before one day', 'before_one_week' => 'Before one week', 'display' => 'Display', + 'normal_view' => 'Normal view', + 'reader_view' => 'Reading view', + 'global_view' => 'Global view', 'show_all_articles' => 'Show all articles', 'show_not_reads' => 'Show only unread', 'older_first' => 'Oldest first', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 69c7a8ffe..7a58b984c 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -37,6 +37,9 @@ return array ( 'before_one_day' => 'Antérieurs à 1 jour', 'before_one_week' => 'Antérieurs à 1 semaine', 'display' => 'Affichage', + 'normal_view' => 'Vue normale', + 'reader_view' => 'Vue lecture', + 'global_view' => 'Vue globale', 'show_all_articles' => 'Afficher tous les articles', 'show_not_reads' => 'Afficher les non lus', 'older_first' => 'Plus anciens en premier', diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 3411f344b..dbe597985 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -59,43 +59,72 @@ diff --git a/app/views/helpers/global_view.phtml b/app/views/helpers/global_view.phtml new file mode 100644 index 000000000..b666fe620 --- /dev/null +++ b/app/views/helpers/global_view.phtml @@ -0,0 +1,5 @@ +partial ('nav_menu'); +?> + +Non implémenté \ No newline at end of file diff --git a/app/views/helpers/normal_view.phtml b/app/views/helpers/normal_view.phtml new file mode 100644 index 000000000..515084047 --- /dev/null +++ b/app/views/helpers/normal_view.phtml @@ -0,0 +1,114 @@ +partial ('aside_flux'); +$this->partial ('nav_menu'); + +if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { + $items = $this->entryPaginator->items (); +?> + +
+ + + + isDay (Days::TODAY)) { ?> +
-
+ + isDay (Days::YESTERDAY)) { ?> +
-
+ + isDay (Days::BEFORE_YESTERDAY)) { ?> +
+ + +
+
    + conf) || is_logged ()) { ?> +
  • + isRead ()) { ?> +   + +   + + + isFavorite ()) { ?> +   + +   + +
  • + + feed (true); ?> +
  • name (); ?>
  • +
  • title (); ?>
  • +
  • date (); ?>
  • + +
+ +
+
+

title (); ?>

+ author (); ?> + ' . Translate::t ('by_author', $author) . '
' : ''; ?> + conf->lazyload() == 'yes') { + echo lazyimg($item->content ()); + } else { + echo $item->content(); + } + ?> +
+ +
    +
  • + +
  • + tags(); ?> + +
  • + +
  • + +
+
+
+ + + entryPaginator->render ('pagination.phtml', 'next'); ?> + + + +
+ +
+ \ No newline at end of file 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 diff --git a/app/views/helpers/rss.phtml b/app/views/helpers/rss.phtml deleted file mode 100755 index 83de6de2e..000000000 --- a/app/views/helpers/rss.phtml +++ /dev/null @@ -1,30 +0,0 @@ -'; ?> - - - <?php echo View::title(); ?> - - - - GMT - -entryPaginator->items (); -foreach ($items as $item) { -?> - - <?php echo htmlspecialchars(html_entity_decode($item->title ())); ?> - link (); ?> - author (); ?> - - - - content (); -?>]]> - date (true)); ?> - id (); ?> - - - - - diff --git a/app/views/helpers/rss_view.phtml b/app/views/helpers/rss_view.phtml new file mode 100755 index 000000000..83de6de2e --- /dev/null +++ b/app/views/helpers/rss_view.phtml @@ -0,0 +1,30 @@ +'; ?> + + + <?php echo View::title(); ?> + + + + GMT + +entryPaginator->items (); +foreach ($items as $item) { +?> + + <?php echo htmlspecialchars(html_entity_decode($item->title ())); ?> + link (); ?> + author (); ?> + + + + content (); +?>]]> + date (true)); ?> + id (); ?> + + + + + diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 30df591eb..46ff33b3a 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -1,127 +1,13 @@ /i', - '', - $content - ); -} $output = Request::param ('output', 'normal'); if ($output == 'rss') { - $this->renderHelper ('rss'); + $this->renderHelper ('rss_view'); +} elseif($output == 'reader') { + $this->renderHelper ('reader_view'); +} elseif($output == 'global') { + $this->renderHelper ('global_view'); } else { - $this->partial ('aside_flux'); - $this->partial ('nav_menu'); - - if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { - $items = $this->entryPaginator->items (); -?> - -
- - - - isDay (Days::TODAY)) { ?> -
-
- - isDay (Days::YESTERDAY)) { ?> -
-
- - isDay (Days::BEFORE_YESTERDAY)) { ?> -
- - -
-
    - conf) || is_logged ()) { ?> -
  • - isRead ()) { ?> -   - -   - - - isFavorite ()) { ?> -   - -   - -
  • - - feed (true); ?> -
  • name (); ?>
  • -
  • title (); ?>
  • -
  • date (); ?>
  • - -
- -
-
-

title (); ?>

- author (); ?> - ' . Translate::t ('by_author', $author) . '
' : ''; ?> - conf->lazyload() == 'yes') { - echo lazyimg($item->content ()); - } else { - echo $item->content(); - } - ?> -
- -
    -
  • - -
  • - tags(); ?> - -
  • - -
  • - -
-
-
- - - entryPaginator->render ('pagination.phtml', 'next'); ?> - - - -
- -
- - + $this->renderHelper ('normal_view'); +} \ No newline at end of file diff --git a/lib/lib_text.php b/lib/lib_text.php index 6e8f7b2bf..9792e191e 100644 --- a/lib/lib_text.php +++ b/lib/lib_text.php @@ -86,3 +86,11 @@ function parse_tags ($desc) { return $desc_parse; } + +function lazyimg($content) { + return preg_replace( + '//i', + '', + $content + ); +} \ No newline at end of file diff --git a/public/theme/freshrss.css b/public/theme/freshrss.css index 636f9e09d..26bb21d8f 100644 --- a/public/theme/freshrss.css +++ b/public/theme/freshrss.css @@ -245,11 +245,10 @@ line-height: 40px; } .flux_header .item.website .favicon { - padding: 12px; + padding: 5px; } .flux_header .item.website a { display: block; - padding: 0; height: 40px; } .flux_header .item.title { @@ -293,6 +292,7 @@ padding: 20px 10px; line-height: 170%; font-family: 'OpenSans'; + word-wrap: break-word; } .content .title { margin: 0 0 5px; @@ -480,6 +480,9 @@ width: 40px; text-align: center; } + .flux_header .item.website .favicon { + padding: 12px; + } .content { font-size: 120%; -- cgit v1.2.3