diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-03 08:57:35 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-03 08:57:35 +0200 |
commit | 2b840e0cfb63a453bea67a98541f3df9c273c5f5 (patch) | |
tree | 8c5aa51ba6481f29f9734373d6abd55917d1a671 /tpl/home.twig | |
parent | 8cbb2a88024969f7efd90f8053f3b0805fa2f8fa (diff) | |
download | wallabag-2b840e0cfb63a453bea67a98541f3df9c273c5f5.tar.gz wallabag-2b840e0cfb63a453bea67a98541f3df9c273c5f5.tar.zst wallabag-2b840e0cfb63a453bea67a98541f3df9c273c5f5.zip |
twig implementation
Diffstat (limited to 'tpl/home.twig')
-rw-r--r-- | tpl/home.twig | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/tpl/home.twig b/tpl/home.twig index 7b5b88a2..c79d4276 100644 --- a/tpl/home.twig +++ b/tpl/home.twig | |||
@@ -1,19 +1,18 @@ | |||
1 | {% extends "layout.twig" %} | 1 | {% extends "layout.twig" %} |
2 | 2 | {% block title %}{% trans "home" %}{% endblock %} | |
3 | {% block title %}Home{% endblock %} | ||
4 | {% block menu %} | 3 | {% block menu %} |
5 | <ul id="links"> | 4 | <ul id="links"> |
6 | <li><a href="index.php" {% if view == 'home' %}class="current"{% endif %}>home</a></li> | 5 | <li><a href="./" {% if view == 'home' %}class="current"{% endif %}>{% trans "home" %}</a></li> |
7 | <li><a href="?view=fav" {% if view == 'fav' %}class="current"{% endif %}>favorites</a></li> | 6 | <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li> |
8 | <li><a href="?view=archive" {% if view == 'archive' %}class="current"{% endif %}>archive</a></li> | 7 | <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li> |
9 | <li><a href="?view=config" {% if view == 'config' %}class="current"{% endif %}>config</a></li> | 8 | <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li> |
10 | <li><a href="?logout" title="Logout">logout</a></li> | 9 | <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li> |
11 | </ul> | 10 | </ul> |
12 | {% endblock %} | 11 | {% endblock %} |
13 | {% block precontent %} | 12 | {% block precontent %} |
14 | <ul id="sort"> | 13 | <ul id="sort"> |
15 | <li><img src="img/up.png" onclick="sort_links('{{ view }}', 'ia');" title="by date asc" /> by date <img src="img/down.png" onclick="sort_links('{{ view }}', 'id');" title="by date desc" /></li> | 14 | <li><img src="img/up.png" onclick="sort_links('{{ view }}', 'ia');" title="{% trans "by date asc" %}" /> {% trans "by date" %} <img src="img/down.png" onclick="sort_links('{{ view }}', 'id');" title="{% trans "by date desc" %}" /></li> |
16 | <li><img src="img/up.png" onclick="sort_links('{{ view }}', 'ta');" title="by title asc" /> by title <img src="img/down.png" onclick="sort_links('{{ view }}', 'td');" title="by title desc" /></li> | 15 | <li><img src="img/up.png" onclick="sort_links('{{ view }}', 'ta');" title="{% trans "by title asc" %}" /> {% trans "by title" %} <img src="img/down.png" onclick="sort_links('{{ view }}', 'td');" title="{% trans "by title desc" %}" /></li> |
17 | </ul> | 16 | </ul> |
18 | {% endblock %} | 17 | {% endblock %} |
19 | {% block content %} | 18 | {% block content %} |
@@ -27,9 +26,9 @@ | |||
27 | <div class="tools"> | 26 | <div class="tools"> |
28 | <ul> | 27 | <ul> |
29 | <li> | 28 | <li> |
30 | <a title="toggle mark as read" class="tool archive {% if entry.is_read == 0 %}archive-off{% endif %}" onclick="toggle_archive(this, {{ entry.id|e }})"><span></span></a></li> | 29 | <a title="{% trans "toggle mark as read" %}" class="tool archive {% if entry.is_read == 0 %}archive-off{% endif %}" onclick="toggle_archive(this, {{ entry.id|e }})"><span></span></a></li> |
31 | <li><a title="toggle favorite" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" onclick="toggle_favorite(this, {{ entry.id|e }})"><span></span></a></li> | 30 | <li><a title="{% trans "toggle favorite" %}" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" onclick="toggle_favorite(this, {{ entry.id|e }})"><span></span></a></li> |
32 | <li><form method="post" onsubmit="return confirm('Are you sure?')" style="display: inline;"><input type="hidden" name="token" id="token" value="{{ token }}" /><input type="hidden" id="action" name="action" value="delete" /><input type="hidden" id="view" name="view" value="{{ view }}" /><input type="hidden" id="id" name="id" value="{{ entry.id|e }}" /><input type="submit" class="delete" title="toggle delete" /></form> | 31 | <li><form method="post" onsubmit="return confirm('{% trans "are you sure?" %}')" style="display: inline;"><input type="hidden" name="token" id="token" value="{{ token }}" /><input type="hidden" id="action" name="action" value="delete" /><input type="hidden" id="view" name="view" value="{{ view }}" /><input type="hidden" id="id" name="id" value="{{ entry.id|e }}" /><input type="submit" class="delete" title="{% trans "toggle delete" %}" /></form> |
33 | </li> | 32 | </li> |
34 | </ul> | 33 | </ul> |
35 | </div> | 34 | </div> |
@@ -38,4 +37,26 @@ | |||
38 | </div> | 37 | </div> |
39 | {% endfor %} | 38 | {% endfor %} |
40 | </div> | 39 | </div> |
40 | {% endblock %} | ||
41 | |||
42 | {% block js %} | ||
43 | <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script> | ||
44 | <script type="text/javascript" src="js/poche.js"></script> | ||
45 | <script type="text/javascript" src="js/jquery.masonry.min.js"></script> | ||
46 | <script type="text/javascript"> | ||
47 | $( window ).load( function() | ||
48 | { | ||
49 | var columns = 3, | ||
50 | setColumns = function() { columns = $( window ).width() > 640 ? 3 : $( window ).width() > 320 ? 2 : 1; }; | ||
51 | |||
52 | setColumns(); | ||
53 | $( window ).resize( setColumns ); | ||
54 | |||
55 | $( '#content' ).masonry( | ||
56 | { | ||
57 | itemSelector: '.entrie', | ||
58 | columnWidth: function( containerWidth ) { return containerWidth / columns; } | ||
59 | }); | ||
60 | }); | ||
61 | </script> | ||
41 | {% endblock %} \ No newline at end of file | 62 | {% endblock %} \ No newline at end of file |