diff options
| author | 2013-04-24 22:14:49 +0200 | |
|---|---|---|
| committer | 2013-04-24 22:14:49 +0200 | |
| commit | a6982216253d1356621916bb2b7734320fedec0d (patch) | |
| tree | 0d27b1011413e47e99605cfd686b5022f3bf17a0 | |
| parent | 7b75289a294a0f4865e8d5b9564b6583f5d01aec (diff) | |
Fix issue #55 : affichage des tags associés aux articles
| -rwxr-xr-x | app/models/Entry.php | 3 | ||||
| -rw-r--r-- | app/views/index/index.phtml | 18 | ||||
| -rw-r--r-- | public/theme/global.css | 4 | ||||
| -rw-r--r-- | public/theme/icons/tag.png | bin | 0 -> 196 bytes | |||
| -rw-r--r-- | public/theme/icons/tag.svg | 134 |
5 files changed, 158 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> diff --git a/public/theme/global.css b/public/theme/global.css index 84fbca3cb..d619c4e99 100644 --- a/public/theme/global.css +++ b/public/theme/global.css @@ -511,3 +511,7 @@ input, select, textarea { background-image: url("icons/share.png"); background-image: url("icons/share.svg"); } + .icon.i_tag { + background-image: url("icons/tag.png"); + background-image: url("icons/tag.svg"); + } diff --git a/public/theme/icons/tag.png b/public/theme/icons/tag.png Binary files differnew file mode 100644 index 000000000..cb1a13833 --- /dev/null +++ b/public/theme/icons/tag.png diff --git a/public/theme/icons/tag.svg b/public/theme/icons/tag.svg new file mode 100644 index 000000000..688aca7a4 --- /dev/null +++ b/public/theme/icons/tag.svg @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + sodipodi:docname="tag.svg" + height="16" + id="svg7384" + inkscape:version="0.48.4 r9939" + version="1.1" + width="16"> + <metadata + id="metadata90"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title>Gnome Symbolic Icon Theme</dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <sodipodi:namedview + inkscape:bbox-paths="false" + bordercolor="#666666" + borderopacity="1" + inkscape:current-layer="layer12" + inkscape:cx="63.620645" + inkscape:cy="27.761176" + gridtolerance="10" + inkscape:guide-bbox="true" + guidetolerance="10" + id="namedview88" + inkscape:object-nodes="false" + inkscape:object-paths="false" + objecttolerance="10" + pagecolor="#555753" + inkscape:pageopacity="1" + inkscape:pageshadow="2" + showborder="false" + showgrid="false" + showguides="true" + inkscape:snap-bbox="true" + inkscape:snap-bbox-midpoints="false" + inkscape:snap-global="true" + inkscape:snap-grids="true" + inkscape:snap-nodes="false" + inkscape:snap-others="false" + inkscape:snap-to-guides="true" + inkscape:window-height="709" + inkscape:window-maximized="1" + inkscape:window-width="1366" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:zoom="4"> + <inkscape:grid + empspacing="2" + enabled="true" + id="grid4866" + snapvisiblegridlinesonly="true" + spacingx="1px" + spacingy="1px" + type="xygrid" + visible="true" /> + </sodipodi:namedview> + <title + id="title9167">Gnome Symbolic Icon Theme</title> + <defs + id="defs7386" /> + <g + inkscape:groupmode="layer" + id="layer9" + inkscape:label="status" + style="display:inline" + transform="translate(-141.0002,-807)" /> + <g + inkscape:groupmode="layer" + id="layer10" + inkscape:label="devices" + transform="translate(-141.0002,-807)" /> + <g + inkscape:groupmode="layer" + id="layer11" + inkscape:label="apps" + transform="translate(-141.0002,-807)" /> + <g + inkscape:groupmode="layer" + id="layer13" + inkscape:label="places" + transform="translate(-141.0002,-807)" /> + <g + inkscape:groupmode="layer" + id="layer14" + inkscape:label="mimetypes" + transform="translate(-141.0002,-807)" /> + <g + inkscape:groupmode="layer" + id="layer15" + inkscape:label="emblems" + style="display:inline" + transform="translate(-141.0002,-807)" /> + <g + inkscape:groupmode="layer" + id="g71291" + inkscape:label="emotes" + style="display:inline" + transform="translate(-141.0002,-807)" /> + <g + inkscape:groupmode="layer" + id="g4953" + inkscape:label="categories" + style="display:inline" + transform="translate(-141.0002,-807)" /> + <g + inkscape:groupmode="layer" + id="layer12" + inkscape:label="actions" + style="display:inline" + transform="translate(-141.0002,-807)"> + <path + inkscape:connector-curvature="0" + d="m 149.0002,809 0,13 4,-4 4,4 c 0.0525,-6.84943 -0.0285,-10.58353 0,-13 z" + id="path12292" + sodipodi:nodetypes="cccccc" + style="fill:#bebebe;fill-opacity:1;stroke:none" /> + </g> +</svg> |
