aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
blob: f93b635f9b7c53d72a2736f089134d19fcdc88ac (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
{% extends "WallabagCoreBundle::base.html.twig" %}

{% block css %}
    {{ parent() }}
    {% if not app.debug %}
        <link rel="stylesheet" href="{{ asset('bundles/wallabagcore/material.css') }}">
    {% endif %}
{% endblock %}

{% block scripts %}
    {{ parent() }}
    <script src="{{ asset('bundles/wallabagcore/material' ~ (app.debug ? '.dev' : '') ~ '.js') }}"></script>
{% endblock %}

{% block header %}
{% endblock %}

{% block messages %}
    {% for flashMessage in app.session.flashbag.get('notice') %}
        <script>
            Materialize.toast('{{ flashMessage|trans }}', 4000);
        </script>
    {% endfor %}
{% endblock %}

{% block menu %}
    <nav class="cyan darken-1">
        <ul id="slide-out" class="side-nav fixed">
            {% block logo %}
                <li class="logo border-bottom">
                    <a title="{{ 'menu.left.back_to_unread'|trans }}" href="{{ path('unread') }}">
                        <img src="{{ asset('bundles/wallabagcore/themes/_global/img/logo-square.png') }}" alt="wallabag logo" />
                    </a>
                </li>
            {% endblock %}

            {% set currentRoute = app.request.attributes.get('_route') %}
            {% set currentRouteFromQueryParams = app.request.query.get('currentRoute') %}

            {% set activeRoute = null %}
            {% if currentRoute == 'all' or currentRouteFromQueryParams == 'all' %}
               {% set activeRoute = 'all' %}
            {% elseif currentRoute == 'archive' or currentRouteFromQueryParams == 'archive' %}
               {% set activeRoute = 'archive' %}
            {% elseif currentRoute == 'starred' or currentRouteFromQueryParams == 'starred' %}
               {% set activeRoute = 'starred' %}
            {% elseif currentRoute == 'unread' or currentRoute == 'homepage' or currentRouteFromQueryParams == 'unread' %}
               {% set activeRoute = 'unread' %}
            {% endif %}

            <li class="bold {% if activeRoute == 'unread' %}active{% endif %}">
                <a class="waves-effect" href="{{ path('unread') }}">{{ 'menu.left.unread'|trans }} <span class="numberItems grey-text">{{ count_entries('unread') }}</span></a>
            </li>
            <li class="bold {% if activeRoute == 'starred' %}active{% endif %}">
                <a class="waves-effect" href="{{ path('starred') }}">{{ 'menu.left.starred'|trans }} <span class="numberItems grey-text">{{ count_entries('starred') }}</span></a>
            </li>
            <li class="bold {% if activeRoute == 'archive' %}active{% endif %}">
                <a class="waves-effect" href="{{ path('archive') }}">{{ 'menu.left.archive'|trans }} <span class="numberItems grey-text">{{ count_entries('archive') }}</span></a>
            </li>
            <li class="bold {% if activeRoute == 'all' %}active{% endif %}">
                <a class="waves-effect" href="{{ path('all') }}">{{ 'menu.left.all_articles'|trans }} <span class="numberItems grey-text">{{ count_entries('all') }}</span></a>
            </li>
            <li class="bold border-bottom {% if currentRoute == 'tags' %}active{% endif %}">
                <a class="waves-effect" href="{{ path('tag') }}">{{ 'menu.left.tags'|trans }} <span class="numberItems grey-text">{{ count_tags() }}</span></a>
            </li>
            <li class="bold {% if currentRoute == 'config' %}active{% endif %}">
                <a class="waves-effect" href="{{ path('config') }}">{{ 'menu.left.config'|trans }}</a>
            </li>
            {% if craue_setting('restricted_access') %}
            <li class="bold {% if currentRoute starts with 'site_credentials_' %}active{% endif %}">
                <a class="waves-effect" href="{{ path('site_credentials_index') }}">{{ 'menu.left.site_credentials'|trans }}</a>
            </li>
            {% endif %}
            {% if is_granted('ROLE_SUPER_ADMIN') %}
                <li class="bold {% if currentRoute starts with 'user_' %}active{% endif %}">
                    <a class="waves-effect" href="{{ path('user_index') }}">{{ 'menu.left.users_management'|trans }}</a>
                </li>

                <li class="bold border-bottom {% if currentRoute == 'craue_config_settings_modify' %}active{% endif %}">
                    <a class="waves-effect" href="{{ path('craue_config_settings_modify') }}">{{ 'menu.left.internal_settings'|trans }}</a>
                </li>
            {% endif %}
            <li class="bold {% if currentRoute == 'import' %}active{% endif %}">
                <a class="waves-effect" href="{{ path('import') }}">{{ 'menu.left.import'|trans }}</a>
            </li>
            <li class="bold {% if currentRoute == 'developer' %}active{% endif %}">
                <a class="waves-effect" href="{{ path('developer') }}">{{ 'menu.left.developer'|trans }}</a>
            </li>
            <li class="bold {% if currentRoute == 'howto' %}active{% endif %}">
                <a class="waves-effect" href="{{ path('howto') }}">{{ 'menu.left.howto'|trans }}</a>
            </li>
            <li class="bold">
                <a class="waves-effect icon icon-power" href="{{ path('fos_user_security_logout') }}">{{ 'menu.left.logout'|trans }}</a>
            </li>
        </ul>
        <div class="nav-wrapper nav-panels">
            <a href="#" data-activates="slide-out" class="nav-panel-menu button-collapse"><i class="material-icons">menu</i></a>
            <div class="left action">
                {% block title %}
                {% endblock %}
            </div>
            <ul class="input-field nav-panel-buttom">
                <li class="bold">
                    <a class="waves-effect tooltipped" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.add_new_entry'|trans }}" href="{{ path('new') }}" id="nav-btn-add">
                        <i class="material-icons">add</i>
                    </a>
                </li>
                <li>
                    <a class="waves-effect tooltipped" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.search'|trans }}" href="javascript: void(null);" id="nav-btn-search">
                        <i class="material-icons">search</i>
                    </a>
                </li>
                <li id="button_notifications">
                    {% set unreadNotifs = get_notifications() | unread_notif | length %}
                    <a class="nav-panel-menu button-collapse-right tooltipped js-notifications-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.notifications' | trans }}" href="#" data-activates="notifications">
                        <i class="material-icons">notifications{% if unreadNotifs == 0 %}_none{% endif %}</i>
                        {% if unreadNotifs > 0 %}<span id="notifications-count" class="red-text text-accent-2">{{ unreadNotifs }}</span>{% endif %}
                    </a>
                </li>
                <li id="button_profile">
                    <a class="nav-panel-menu button-collapse-right tooltipped" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.profile' | trans }}" href="{{ path('user-profile', {'user': app.user.account.username}) }}">
                        <i class="material-icons">person</i>
                    </a>
                </li>
                <li id="button_filters">
                    <a class="nav-panel-menu button-collapse-right tooltipped js-filters-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.filter_entries'|trans }}" href="#" data-activates="filters">
                        <i class="material-icons">filter_list</i>
                    </a>
                </li>
                <li id="button_export">
                    <a class="nav-panel-menu button-collapse-right tooltipped js-export-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.export'|trans }}" href="#" data-activates="export">
                        <i class="material-icons">file_download</i>
                    </a>
                </li>
            </ul>
            <div class="input-field nav-panel-search" style="display: none">
                {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }}
                <label for="search"><i class="material-icons search">search</i></label>
                <i class="material-icons close">clear</i>
            </div>
            <div class="input-field nav-panel-add" style="display: none">
                {{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }}
                <label for="add"><i class="material-icons add">add</i></label>
                <i class="material-icons close">clear</i>
            </div>
        </div>
    </nav>
{% endblock %}

{% block content %}

    <div id="notifications" class="side-nav">
        {% if app.user.notifications is not empty %}
        <div class="notifications-area">
            <ul class="collection">
                {% for notification in get_notifications() | slice(0, 10) %}
                <li class="notification collection-item avatar{% if not notification.read %} light-blue lighten-5{% else %} grey-text{% endif %}">
                    <i class="material-icons circle">{% spaceless %}
                        {% if notification.type == constant('TYPE_ADMIN', notification) %}
                            build
                        {% elseif notification.type == constant('TYPE_USER', notification) %}
                            person
                        {% elseif notification.type == constant('TYPE_RELEASE', notification) %}
                            new_releases
                        {% endif %}
                        {% endspaceless %}</i>
                    <span class="title">{{ notification.title | trans(notification.parameters) }}</span>
                    <p>{{ notification.description | trans(notification.parameters) }}</p>
                    <time datetime="{{ notification.timestamp | date }}">{{ notification.timestamp | time_diff }}</time>
                    <div>
                        {% for action in notification.actions %}
                            <a class="notification-action-button btn waves-effect waves-light {% spaceless %}
                                   {% if action.type == constant('TYPE_OK', action) %}
                                   {% elseif action.type == constant('TYPE_YES', action) %}
                                        cyan
                                   {% elseif action.type == constant('TYPE_NO', action) %}
                                        red
                                   {% elseif action.type == constant('TYPE_INFO', action) %}
                                        blue-grey
                                   {% endif %}
                                   {% if notification.read %}lighten-3{% endif %}
                                    {% endspaceless %}" href="{{ path('notification-archive-redirect', {'redirection': action.link, 'notification': notification.id}) }}">{{ action.label | trans(notification.parameters) }}</a>
                        {% endfor %}
                    </div>
                </li>
                {% endfor %}
            </ul>
        </div>
        <a href="{{ path('notification-archive-all') }}" class="btn-light waves-effect waves-light right"><i class="material-icons">done_all</i> {{ 'notifications.list.mark_all_as_read' | trans }}</a>
        <a class="waves-effect waves-light btn view-more" href="{{ path('notifications-all') }}">{{ 'notifications.sidebar.view_more' | trans }}</a>
        {% else %}
            <div class="no-notifications grey-text">{{ 'notifications.list.none' | trans }}</div>
        {% endif %}
    </div>
{% endblock %}

{% block footer %}
    <footer class="page-footer cyan darken-2">
        <div class="footer-copyright">
            <div class="container">
                <div class="row">
                    <div class="col m12 l8 hide-on-small-only">
                        <p title="{{ display_stats() | raw | striptags }}">
                            {{ display_stats() }}
                        </p>
                    </div>
                    <div class="col s12 l4">
                        <p>
                            {{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a><a class="grey-text text-lighten-4" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans|lower }}</a>
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </footer>
{% endblock %}