diff options
| author | 2012-10-21 18:47:57 +0200 | |
|---|---|---|
| committer | 2012-10-21 18:47:57 +0200 | |
| commit | fb57be5a5af3a2fb46b2dbf2b503ffe78eb5cf49 (patch) | |
| tree | 9440fc7846d8a56a7005b9ef029669c96ad959aa /app/views | |
First commit
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/configure/categorize.phtml | 3 | ||||
| -rw-r--r-- | app/views/configure/display.phtml | 28 | ||||
| -rw-r--r-- | app/views/configure/flux.phtml | 3 | ||||
| -rw-r--r-- | app/views/error/index.phtml | 13 | ||||
| -rwxr-xr-x | app/views/helpers/pagination.phtml | 34 | ||||
| -rw-r--r-- | app/views/index/index.phtml | 49 |
6 files changed, 130 insertions, 0 deletions
diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtml new file mode 100644 index 000000000..126f6b48a --- /dev/null +++ b/app/views/configure/categorize.phtml @@ -0,0 +1,3 @@ +<div class="post"> + Fonctionnalité non implémentée (pour le moment) +</div> diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml new file mode 100644 index 000000000..23c41712b --- /dev/null +++ b/app/views/configure/display.phtml @@ -0,0 +1,28 @@ +<div class="post"> + <form method="post" action=""> + <h1>Configuration de l'affichage</h1> + + <label for="posts_per_page">Nombre d'articles par page</label> + <input type="number" id="posts_per_page" name="posts_per_page" value="<?php echo $this->conf->postsPerPage (); ?>" /> + + <label>Vue par défaut</label> + <div class="radio_group"> + <input type="radio" name="default_view" id="radio_all" value="all"<?php echo $this->conf->defaultView () == 'all' ? ' checked="checked"' : ''; ?> /> + <label for="radio_all">Tout afficher</label> + <br /> + <input type="radio" name="default_view" id="radio_not_read" value="not_read"<?php echo $this->conf->defaultView () == 'not_read' ? ' checked="checked"' : ''; ?> /> + <label for="radio_not_read">Afficher les non lus</label> + </div> + + <label>Afficher les articles dépliés par défaut</label> + <div class="radio_group"> + <input type="radio" name="display_posts" id="radio_yes" value="yes"<?php echo $this->conf->displayPosts () ? ' checked="checked"' : ''; ?> /> + <label for="radio_yes">Oui</label> + <br /> + <input type="radio" name="display_posts" id="radio_no" value="no"<?php echo !$this->conf->displayPosts () ? ' checked="checked"' : ''; ?> /> + <label for="radio_no">Non</label> + </div> + + <input type="submit" value="Valider" /> + </form> +</div> diff --git a/app/views/configure/flux.phtml b/app/views/configure/flux.phtml new file mode 100644 index 000000000..126f6b48a --- /dev/null +++ b/app/views/configure/flux.phtml @@ -0,0 +1,3 @@ +<div class="post"> + Fonctionnalité non implémentée (pour le moment) +</div> diff --git a/app/views/error/index.phtml b/app/views/error/index.phtml new file mode 100644 index 000000000..ffa156068 --- /dev/null +++ b/app/views/error/index.phtml @@ -0,0 +1,13 @@ +<h1><?php echo Translate::t ('an error occured'); ?></h1> + +<h2><?php echo $this->code; ?></h2> + +<?php if (!empty ($this->logs)) { ?> +<ul> + <?php foreach ($this->logs as $log) { ?> + <li><?php echo $log; ?></li> + <?php } ?> +</ul> +<?php } ?> + +<p><a href="<?php echo Url::display (); ?>"><?php echo Translate::t ('go back home'); ?></a></p> diff --git a/app/views/helpers/pagination.phtml b/app/views/helpers/pagination.phtml new file mode 100755 index 000000000..fe9feb0e8 --- /dev/null +++ b/app/views/helpers/pagination.phtml @@ -0,0 +1,34 @@ +<?php + $c = Request::controllerName (); + $a = Request::actionName (); + $params = Request::params (); +?> + +<?php if ($this->nbPage > 1) { ?> +<ul class="pagination"> + <?php if ($this->currentPage > 1) { ?> + <?php $params[$getteur] = 1; ?> + <li class="pager-first"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">« Début</a></li> + <?php $params[$getteur] = $this->currentPage - 1; ?> + <li class="pager-previous"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">‹ Précédent</a></li> + <?php } ?> + + <?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="pager-item"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo $i; ?></a></li> + <?php } else { ?> + <li class="pager-current"><?php echo $i; ?></li> + <?php } ?> + <?php } ?> + <?php } ?> + + <?php if ($this->currentPage < $this->nbPage) { ?> + <?php $params[$getteur] = $this->currentPage + 1; ?> + <li class="pager-next"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">Suivant ›</a></li> + <?php $params[$getteur] = $this->nbPage; ?> + <li class="pager-last"><a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>">Fin »</a></li> + <?php } ?> +</ul> +<?php } ?> diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml new file mode 100644 index 000000000..2dfdb5064 --- /dev/null +++ b/app/views/index/index.phtml @@ -0,0 +1,49 @@ +<div id="top"> + <a class="read_all" href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'read', 'params' => array ('is_read' => 1))); ?>">Tout marquer comme lu</a><!-- + <?php if (Session::param ('mode', 'all') == 'not_read') { ?> + --><a class="print_all" href="<?php echo Url::display (array ('a' => 'changeMode', 'params' => array ('mode' => 'all'))); ?>">Tout afficher</a> + <?php } else { ?> + --><a class="print_non_read" href="<?php echo Url::display (array ('a' => 'changeMode', 'params' => array ('mode' => 'not_read'))); ?>">Afficher les non lus</a> + <?php } ?> +</div> + +<div id="stream"> +<?php $items = $this->entryPaginator->items (); ?> +<?php if (!empty ($items)) { ?> + <?php $this->entryPaginator->render ('pagination.phtml', 'page'); ?> + + <?php foreach ($items as $item) { ?> + <div class="post flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>"> + <div class="before"><?php echo $item->author (); ?> a écrit le <?php echo $item->date (); ?>,</div> + + <h1><a target="_blank" href="<?php echo $item->link (); ?>"> <?php echo $item->title (); ?></a></h1> + <div class="content"><?php echo $item->content (); ?></div> + + <div class="after"> + <?php if (!$item->isRead ()) { ?> + <a href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'read', 'params' => array ('id' => $item->id (), 'is_read' => 1))); ?>">J'ai fini de lire l'article</a><!-- + <?php } else { ?> + <a href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'read', 'params' => array ('id' => $item->id (), 'is_read' => 0))); ?>">Marquer comme non lu</a><!-- + <?php } ?> + + <?php if (!$item->isFavorite ()) { ?> + --><a href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'bookmark', 'params' => array ('id' => $item->id (), 'is_favorite' => 1))); ?>">Ajouter l'article à mes favoris</a> + <?php } else { ?> + --><a href="<?php echo Url::display (array ('c' => 'entry', 'a' => 'bookmark', 'params' => array ('id' => $item->id (), 'is_favorite' => 0))); ?>">Retirer l'article de mes favoris</a> + <?php } ?> + </div> + </div> + <?php } ?> + + <?php $this->entryPaginator->render ('pagination.phtml', 'page'); ?> +<?php } else { ?> + <div class="post flux"> + <p> + Il n'y a aucun flux à afficher. + <?php if (Session::param ('mode', 'all') == 'not_read') { ?> + <a class="print_all" href="<?php echo Url::display (array ('a' => 'changeMode', 'params' => array ('mode' => 'all'))); ?>">Afficher tous les articles ?</a> + <?php } ?> + </p> + </div> +<?php } ?> +</div> |
