aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/home.twig
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/home.twig')
-rw-r--r--tpl/home.twig41
1 files changed, 11 insertions, 30 deletions
diff --git a/tpl/home.twig b/tpl/home.twig
index 49ef9050..6d0f1a66 100644
--- a/tpl/home.twig
+++ b/tpl/home.twig
@@ -1,38 +1,35 @@
1{% extends "layout.twig" %} 1{% extends "layout.twig" %}
2{% block title %}{% trans "home" %}{% endblock %} 2{% block title %}{% trans "home" %}{% endblock %}
3{% block menu %} 3{% block menu %}
4 <ul id="links"> 4{% include '_menu.twig' %}
5 <li><a href="./" {% if view == 'home' %}class="current"{% endif %}>{% trans "home" %}</a></li>
6 <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li>
7 <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li>
8 <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li>
9 <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
10 </ul>
11{% endblock %} 5{% endblock %}
12{% block precontent %} 6{% block precontent %}
13 <ul id="sort"> 7 <ul id="sort">
14 <li><img src="./tpl/img/up.png" onclick="sort_links('{{ view }}', 'ia');" title="{% trans "by date asc" %}" /> {% trans "by date" %} <img src="./tpl/img/down.png" onclick="sort_links('{{ view }}', 'id');" title="{% trans "by date desc" %}" /></li> 8 <li><a href="./?sort=ia"><img src="./tpl/img/up.png" title="{% trans "by date asc" %}" /></a> {% trans "by date" %} <a href="./?sort=id"><img src="./tpl/img/down.png" title="{% trans "by date desc" %}" /></a></li>
15 <li><img src="./tpl/img/up.png" onclick="sort_links('{{ view }}', 'ta');" title="{% trans "by title asc" %}" /> {% trans "by title" %} <img src="./tpl/img/down.png" onclick="sort_links('{{ view }}', 'td');" title="{% trans "by title desc" %}" /></li> 9 <li><a href="./?sort=ta"><img src="./tpl/img/up.png" title="{% trans "by title asc" %}" /></a> {% trans "by title" %} <a href="./?sort=td"><img src="./tpl/img/down.png" title="{% trans "by title desc" %}" /></a></li>
16 </ul> 10 </ul>
17{% endblock %} 11{% endblock %}
12{% block messages %}
13{% include '_messages.twig' %}
14{% endblock %}
18{% block content %} 15{% block content %}
19 <div id="content"> 16 <div id="content">
20 {% for entry in entries %} 17 {% for entry in entries %}
21 <div id="entry-{{ entry.id|e }}" class="entrie mb2"> 18 <div id="entry-{{ entry.id|e }}" class="entrie mb2">
22 <span class="content"> 19 <span class="content">
23 <h2 class="h6-like"> 20 <h2 class="h6-like">
24 <a href="index.php?&view=view&id={{ entry.id|e }}">{{ entry.title|e }}</a> 21 <a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|e }}</a>
25 </h2> 22 </h2>
26 <div class="tools"> 23 <div class="tools">
27 <ul> 24 <ul>
28 <li> 25 <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> 26 <a title="{% trans "toggle mark as read" %}" class="tool archive {% if entry.is_read == 0 %}archive-off{% endif %}" href="./?action=toggle_archive&id={{ 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> 27 <li><a title="{% trans "toggle favorite" %}" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" href="./?action=toggle_fav&id={{ entry.id|e }}"><span></span></a></li>
31 <li><form method="post" 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> 28 <li><form method="post" 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>
32 </li> 29 </li>
33 </ul> 30 </ul>
34 </div> 31 </div>
35 <div class="url">{{ entry.url|e }}</div> 32 <div class="url">{{ entry.url | e | getDomain }}</div>
36 </span> 33 </span>
37 </div> 34 </div>
38 {% endfor %} 35 {% endfor %}
@@ -41,22 +38,6 @@
41 38
42{% block js %} 39{% block js %}
43 <script type="text/javascript" src="./tpl/js/jquery-1.9.1.min.js"></script> 40 <script type="text/javascript" src="./tpl/js/jquery-1.9.1.min.js"></script>
44 <script type="text/javascript" src="./tpl/js/poche.js"></script>
45 <script type="text/javascript" src="./tpl/js/jquery.masonry.min.js"></script> 41 <script type="text/javascript" src="./tpl/js/jquery.masonry.min.js"></script>
46 <script type="text/javascript"> 42 <script type="text/javascript">$(window).load(function(){var e=3,t=function(){e=$(window).width()>640?3:$(window).width()>320?2:1};t();$(window).resize(t);$("#content").masonry({itemSelector:".entrie",columnWidth:function(t){return t/e}})})</script>
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>
62{% endblock %} \ No newline at end of file 43{% endblock %} \ No newline at end of file