diff options
Diffstat (limited to 'app/views/helpers')
| -rw-r--r-- | app/views/helpers/global_view.phtml | 37 | ||||
| -rwxr-xr-x | app/views/helpers/logs_pagination.phtml | 47 | ||||
| -rw-r--r-- | app/views/helpers/normal_view.phtml | 131 | ||||
| -rwxr-xr-x | app/views/helpers/pagination.phtml | 2 | ||||
| -rw-r--r-- | app/views/helpers/reader_view.phtml | 45 | ||||
| -rwxr-xr-x | app/views/helpers/rss_view.phtml (renamed from app/views/helpers/rss.phtml) | 0 |
6 files changed, 261 insertions, 1 deletions
diff --git a/app/views/helpers/global_view.phtml b/app/views/helpers/global_view.phtml new file mode 100644 index 000000000..fff391cba --- /dev/null +++ b/app/views/helpers/global_view.phtml @@ -0,0 +1,37 @@ +<?php $this->partial ('nav_menu'); ?> + +<div id="stream" class="global"> +<?php + foreach ($this->cat_aside as $cat) { + $feeds = $cat->feeds (); + $catNotRead = $cat->nbNotRead (); + if (!empty ($feeds)) { +?> + <div class="category"> + <div class="cat_header"> + <a href="<?php echo _url ('index', 'index', 'get', 'c_' . $cat->id ()); ?>"> + <?php echo $cat->name(); ?><?php echo $catNotRead > 0 ? ' (' . $catNotRead . ')' : ''; ?> + </a> + </div> + + <ul class="feeds"> + <?php foreach ($feeds as $feed) { ?> + <?php $not_read = $feed->nbNotRead (); ?> + <li class="item"> + <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="" /> + + <a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"> + <?php echo $not_read > 0 ? '<b>' : ''; ?> + <?php echo $feed->name(); ?> + <?php echo $not_read > 0 ? ' (' . $not_read . ')' : ''; ?> + <?php echo $not_read > 0 ? '</b>' : ''; ?> + </a> + </li> + <?php } ?> + </ul> + </div> +<?php + } + } +?> +</div>
\ No newline at end of file diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml new file mode 100755 index 000000000..0088dabc6 --- /dev/null +++ b/app/views/helpers/logs_pagination.phtml @@ -0,0 +1,47 @@ +<?php + $c = Request::controllerName (); + $a = Request::actionName (); + $params = Request::params (); +?> + +<?php if ($this->nbPage > 1) { ?> +<ul class="pagination"> + <?php $params[$getteur] = 1; ?> + <li class="item pager-first"> + <?php if ($this->currentPage > 1) { ?> + <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« Début</a> + <?php } ?> + </li> + + <?php $params[$getteur] = $this->currentPage - 1; ?> + <li class="item pager-previous"> + <?php if ($this->currentPage > 1) { ?> + <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ Précédent</a> + <?php } ?> + </li> + + <?php for ($i = $this->currentPage - 2; $i <= $this->currentPage + 2; $i++) { ?> + <?php if($i > 0 && $i <= $this->nbPage) { ?> + <?php if ($i != $this->currentPage) { ?> + <?php $params[$getteur] = $i; ?> + <li class="item pager-item"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li> + <?php } else { ?> + <li class="item pager-current"><?php echo $i; ?></li> + <?php } ?> + <?php } ?> + <?php } ?> + + <?php $params[$getteur] = $this->currentPage + 1; ?> + <li class="item pager-next"> + <?php if ($this->currentPage < $this->nbPage) { ?> + <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">Suivant ›</a> + <?php } ?> + </li> + <?php $params[$getteur] = $this->nbPage; ?> + <li class="item pager-last"> + <?php if ($this->currentPage < $this->nbPage) { ?> + <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">Fin »</a> + <?php } ?> + </li> +</ul> +<?php } ?> diff --git a/app/views/helpers/normal_view.phtml b/app/views/helpers/normal_view.phtml new file mode 100644 index 000000000..126fa5a78 --- /dev/null +++ b/app/views/helpers/normal_view.phtml @@ -0,0 +1,131 @@ +<?php + +$this->partial ('aside_flux'); +$this->partial ('nav_menu'); + +if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { + $items = $this->entryPaginator->items (); +?> + +<div id="stream" class="normal"> + <?php + $display_today = true; + $display_yesterday = true; + $display_others = true; + ?> + <?php foreach ($items as $item) { ?> + + <?php if ($display_today && $item->isDay (Days::TODAY)) { ?> + <div class="day"><?php echo Translate::t ('today'); ?> - <?php echo timestamptodate (time (), false); ?></div> + <?php $display_today = false; } ?> + <?php if ($display_yesterday && $item->isDay (Days::YESTERDAY)) { ?> + <div class="day"><?php echo Translate::t ('yesterday'); ?> - <?php echo timestamptodate (time () - 86400, false); ?></div> + <?php $display_yesterday = false; } ?> + <?php if ($display_others && $item->isDay (Days::BEFORE_YESTERDAY)) { ?> + <div class="day"><?php echo Translate::t ('before_yesterday'); ?></div> + <?php $display_others = false; } ?> + + <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> + <ul class="horizontal-list flux_header"> + <?php if (!login_is_conf ($this->conf) || is_logged ()) { ?> + <li class="item manage"> + <?php if (!$item->isRead ()) { ?> + <a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', 1); ?>"> </a> + <?php } else { ?> + <a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', 0); ?>"> </a> + <?php } ?> + + <?php if (!$item->isFavorite ()) { ?> + <a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', 1); ?>"> </a> + <?php } else { ?> + <a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', 0); ?>"> </a> + <?php } ?> + </li> + <?php } ?> + <?php $feed = $item->feed (true); ?> + <li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="" /> <span><?php echo $feed->name (); ?></span></a></li> + <li class="item title"><?php echo $item->title (); ?></li> + <li class="item date"><?php echo $item->date (); ?></li> + <li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"> </a></li> + </ul> + + <div class="flux_content"> + <div class="content"> + <h1 class="title"><?php echo $item->title (); ?></h1> + <?php $author = $item->author (); ?> + <?php echo $author != '' ? '<div class="author">' . Translate::t ('by_author', $author) . '</div>' : ''; ?> + <?php + if($this->conf->lazyload() == 'yes') { + echo lazyimg($item->content ()); + } else { + echo $item->content(); + } + ?> + </div> + + <ul class="horizontal-list bottom"> + <?php if (!login_is_conf ($this->conf) || is_logged ()) { ?> + <li class="item manage"> + <?php if (!$item->isRead ()) { ?> + <a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', 1); ?>"> </a> + <?php } else { ?> + <a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', 0); ?>"> </a> + <?php } ?> + + <?php if (!$item->isFavorite ()) { ?> + <a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', 1); ?>"> </a> + <?php } else { ?> + <a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', 0); ?>"> </a> + <?php } ?> + </li> + <?php } ?> + <li class="item"> + <div class="dropdown"> + <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div> + <i class="icon i_share"></i> <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>"><?php echo Translate::t ('share'); ?></a> + + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close"><i class="icon i_close"></i></a></li> + + <li class="item"><a href="mailto:?subject=<?php echo $item->title (); ?>&body=J'ai trouvé cet article intéressant, tu peux le lire à cette adresse : <?php echo urlencode($item->link ()); ?>"><?php echo Translate::t ('by_email'); ?></a></li> + <?php + $shaarli = $this->conf->urlShaarli (); + if ($shaarli) { + ?> + <li class="item"><a target="_blank" href="<?php echo $shaarli . '?post=' . urlencode($item->link ()) . '&title=' . urlencode ($item->title ()) . '&source=bookmarklet'; ?>"><?php echo Translate::t ('on_shaarli'); ?></a></li> + <?php } ?> + </ul> + </div> + </li> + <?php $tags = $item->tags(); ?> + <?php if(!empty($tags)) { ?> + <li class="item"> + <div class="dropdown"> + <div id="dropdown-tags-<?php echo $item->id ();?>" class="dropdown-target"></div> + <i class="icon i_tag"></i> <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"><?php echo Translate::t ('related_tags'); ?></a> + + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close"><i class="icon i_close"></i></a></li> + + <?php foreach($tags as $tag) { ?> + <li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li> + <?php } ?> + </ul> + </div> + </li> + <?php } ?> + </ul> + </div> + </div> + <?php } ?> + + <?php $this->entryPaginator->render ('pagination.phtml', 'next'); ?> +</div> + +<?php $this->partial ('nav_entries'); ?> + +<?php } else { ?> +<div class="alert alert-warn"> + <span class="alert-head"><?php echo Translate::t ('no_feed_to_display'); ?></span> +</div> +<?php } ?>
\ No newline at end of file diff --git a/app/views/helpers/pagination.phtml b/app/views/helpers/pagination.phtml index f029f281a..80c0976ad 100755 --- a/app/views/helpers/pagination.phtml +++ b/app/views/helpers/pagination.phtml @@ -8,7 +8,7 @@ <li class="item pager-next"> <?php if ($this->next != '') { ?> <?php $params[$getteur] = $this->next; ?> - <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t ('load_more'); ?></a> + <a id="load_more" href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t ('load_more'); ?></a> <?php } else { ?> <?php echo Translate::t ('nothing_to_load'); ?> <?php } ?> diff --git a/app/views/helpers/reader_view.phtml b/app/views/helpers/reader_view.phtml new file mode 100644 index 000000000..cdca393b9 --- /dev/null +++ b/app/views/helpers/reader_view.phtml @@ -0,0 +1,45 @@ +<?php +$this->partial ('nav_menu'); + +if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { + $items = $this->entryPaginator->items (); +?> + +<div id="stream" class="reader"> + <?php foreach ($items as $item) { ?> + + <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> + <div class="flux_content"> + <div class="content"> + <?php $feed = $item->feed (true); ?> + <a href="<?php echo $item->link (); ?>"> + <img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="" /> <span><?php echo $feed->name (); ?></span> + </a> + <h1 class="title"><?php echo $item->title (); ?></h1> + + <div class="author"> + <?php $author = $item->author (); ?> + <?php echo $author != '' ? Translate::t ('by_author', $author) . ' - ' : ''; ?> + <?php echo $item->date (); ?> + </div> + + <?php + if($this->conf->lazyload() == 'yes') { + echo lazyimg($item->content ()); + } else { + echo $item->content(); + } + ?> + </div> + </div> + </div> + <?php } ?> + + <?php $this->entryPaginator->render ('pagination.phtml', 'next'); ?> +</div> + +<?php } else { ?> +<div class="alert alert-warn"> + <span class="alert-head"><?php echo Translate::t ('no_feed_to_display'); ?></span> +</div> +<?php } ?>
\ No newline at end of file diff --git a/app/views/helpers/rss.phtml b/app/views/helpers/rss_view.phtml index 83de6de2e..83de6de2e 100755 --- a/app/views/helpers/rss.phtml +++ b/app/views/helpers/rss_view.phtml |
