aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/home.twig
blob: 5752b2cf2bc4ba8ef9e6ebaf8859a6aef798c9ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{% extends "layout.twig" %}
{% block title %}{% trans "home" %}{% endblock %}
{% block menu %}
            <ul id="links">
                <li><a href="./" {% if view == 'home' %}class="current"{% endif %}>{% trans "home" %}</a></li>
                <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li>
                <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li>
                <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li>
                <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
            </ul>
{% endblock %}
{% block precontent %}
            <ul id="sort">
                <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>
                <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>
            </ul>
{% endblock %}
{% block notices %}
            <div class="messages">
                <ul>
                {% for notice in notices %}
                    <li>{{ notice.value|e }}</li>
                {% endfor %}
                </ul>
            </div>
{% endblock %}
{% block content %}
            <div id="content">
                {% for entry in entries %}
                    <div id="entry-{{ entry.id|e }}" class="entrie mb2">
                        <span class="content">
                            <h2 class="h6-like">
                                <a href="index.php?&view=view&id={{ entry.id|e }}">{{ entry.title|e }}</a>
                            </h2>
                            <div class="tools">
                                <ul>
                                    <li>
                                        <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>
                                        <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>
                                        <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>
                                    </li>
                                </ul>
                            </div>
                            <div class="url">{{ entry.url|e }}</div>
                        </span>
                    </div>
                {% endfor %}
            </div>
{% endblock %}

{% block js %}
            <script type="text/javascript" src="./tpl/js/jquery-1.9.1.min.js"></script>
            <script type="text/javascript" src="./tpl/js/poche.js"></script>
            <script type="text/javascript" src="./tpl/js/jquery.masonry.min.js"></script>
            <script type="text/javascript">
                $( window ).load( function()
                {
                    var columns    = 3,
                        setColumns = function() { columns = $( window ).width() > 640 ? 3 : $( window ).width() > 320 ? 2 : 1; };

                    setColumns();
                    $( window ).resize( setColumns );

                    $( '#content' ).masonry(
                    {
                        itemSelector: '.entrie',
                        columnWidth:  function( containerWidth ) { return containerWidth / columns; }
                    });
                });
            </script>
{% endblock %}