diff options
| author | 2013-04-24 22:14:49 +0200 | |
|---|---|---|
| committer | 2013-04-24 22:14:49 +0200 | |
| commit | a6982216253d1356621916bb2b7734320fedec0d (patch) | |
| tree | 0d27b1011413e47e99605cfd686b5022f3bf17a0 /app | |
| parent | 7b75289a294a0f4865e8d5b9564b6583f5d01aec (diff) | |
Fix issue #55 : affichage des tags associés aux articles
Diffstat (limited to 'app')
| -rwxr-xr-x | app/models/Entry.php | 3 | ||||
| -rw-r--r-- | app/views/index/index.phtml | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php index 230b457bf..3daec5aa9 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -216,7 +216,7 @@ class Entry extends Model { class EntryDAO extends Model_pdo { public function addEntry ($valuesTmp) { - $sql = 'INSERT INTO entry(id, guid, title, author, content, link, date, is_read, is_favorite, is_public, id_feed, lastUpdate) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; + $sql = 'INSERT INTO entry(id, guid, title, author, content, link, date, is_read, is_favorite, is_public, id_feed, lastUpdate, tags) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; $stm = $this->bd->prepare ($sql); $values = array ( @@ -232,6 +232,7 @@ class EntryDAO extends Model_pdo { $valuesTmp['is_public'], $valuesTmp['id_feed'], $valuesTmp['lastUpdate'], + $valuesTmp['tags'], ); if ($stm && $stm->execute ($values)) { diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 6889a8b51..ff7325996 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -89,6 +89,24 @@ if (isset ($this->entryPaginator)) { </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 ();?>">Tags</a> + + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close"><i class="icon i_close"></i></a></li> + + <li class="dropdown-header">Tags associés</li> + <?php foreach($tags as $tag) { ?> + <li class="item"><span><?php echo $tag; ?></span></li> + <?php } ?> + </ul> + </div> + </li> + <?php } ?> </ul> </div> </div> |
