wallabag/templates/layout.html.twig

205 lines
12 KiB
Twig
Raw Normal View History

2024-02-19 00:03:14 +01:00
{% extends "base.html.twig" %}
2015-08-04 16:18:15 +02:00
{% block css %}
{{ parent() }}
{% if not app.debug %}
<link rel="stylesheet" href="{{ asset('wallassets/material.css') }}">
{% endif %}
2015-08-04 16:18:15 +02:00
{% endblock %}
{% block scripts %}
{{ parent() }}
<script src="{{ asset('wallassets/material' ~ (app.debug ? '.dev' : '') ~ '.js') }}"></script>
2015-08-04 16:18:15 +02:00
{% endblock %}
{% block header %}
{% endblock %}
2015-08-07 23:16:14 +02:00
{% block messages %}
2022-05-03 23:28:20 +02:00
{% for flash_message in app.session.flashbag.get('notice') %}
2015-08-07 23:16:14 +02:00
<script>
2022-05-03 23:28:20 +02:00
Materialize.toast('{{ flash_message|trans }}', 4000);
2015-08-07 23:16:14 +02:00
</script>
{% endfor %}
{% endblock %}
2023-06-06 23:25:43 +02:00
{% block body_class %}index{% endblock %}
2015-08-07 23:16:14 +02:00
{% block menu %}
<nav class="cyan darken-1">
2023-06-06 22:53:56 +02:00
<ul id="slide-out" class="left-bar side-nav fixed">
2015-08-07 23:16:14 +02:00
{% block logo %}
<li class="logo border-bottom">
2024-03-23 15:34:02 +01:00
{% if is_granted('LIST_ENTRIES') %}
<a title="{{ 'menu.left.back_to_unread'|trans }}" href="{{ path('unread') }}">
<img src="{{ asset('img/logo-square.svg') }}" alt="wallabag logo" />
</a>
{% else %}
<img src="{{ asset('img/logo-square.svg') }}" alt="wallabag logo"/>
{% endif %}
2015-08-07 23:16:14 +02:00
</li>
{% endblock %}
2022-05-03 23:28:20 +02:00
{% set current_route = app.request.attributes.get('_route') %}
{% set current_route_from_query_params = app.request.query.get('currentRoute') %}
2015-08-07 23:16:14 +02:00
2022-05-03 23:28:20 +02:00
{% set active_route = null %}
{% if current_route == 'all' or current_route_from_query_params == 'all' %}
{% set active_route = 'all' %}
{% elseif current_route == 'annotated' or current_route_from_query_params == 'annotated' %}
{% set active_route = 'annotated' %}
{% elseif current_route == 'archive' or current_route_from_query_params == 'archive' %}
{% set active_route = 'archive' %}
{% elseif current_route == 'starred' or current_route_from_query_params == 'starred' %}
{% set active_route = 'starred' %}
{% elseif current_route == 'unread' or current_route == 'homepage' or current_route_from_query_params == 'unread' %}
{% set active_route = 'unread' %}
{% elseif current_route == 'untagged' %}
{% set active_route = 'untagged' %}
{% endif %}
2024-03-23 15:34:02 +01:00
{% if is_granted('LIST_ENTRIES') %}
<li class="bold {% if active_route == 'unread' %}active{% endif %}">
<a class="waves-effect" href="{{ path('unread') }}">{{ 'menu.left.unread'|trans }} <span class="items-number grey-text">{{ count_entries('unread') }}</span></a>
</li>
<li class="bold {% if active_route == 'starred' %}active{% endif %}">
<a class="waves-effect" href="{{ path('starred') }}">{{ 'menu.left.starred'|trans }} <span class="items-number grey-text">{{ count_entries('starred') }}</span></a>
</li>
<li class="bold {% if active_route == 'archive' %}active{% endif %}">
<a class="waves-effect" href="{{ path('archive') }}">{{ 'menu.left.archive'|trans }} <span class="items-number grey-text">{{ count_entries('archive') }}</span></a>
</li>
<li class="bold {% if active_route == 'annotated' %}active{% endif %}">
<a class="waves-effect" href="{{ path('annotated') }}">{{ 'menu.left.with_annotations'|trans }} <span class="items-number grey-text">{{ count_entries('annotated') }}</span></a>
</li>
<li class="bold {% if active_route == 'all' %}active{% endif %}">
<a class="waves-effect" href="{{ path('all') }}">{{ 'menu.left.all_articles'|trans }} <span class="items-number grey-text">{{ count_entries('all') }}</span></a>
</li>
{% endif %}
2022-05-03 23:28:20 +02:00
<li class="bold {% if current_route == 'tags' %}active{% endif %}">
2023-06-06 22:53:56 +02:00
<a class="waves-effect" href="{{ path('tag') }}">{{ 'menu.left.tags'|trans }} <span class="items-number grey-text">{{ count_tags() }}</span></a>
</li>
2015-08-07 23:16:14 +02:00
</ul>
<div class="nav-panels">
<div class="nav-panel-actions nav-panel-item">
<div class="nav-panel-top">
<button data-activates="slide-out" class="nav-panel-menu button-collapse"><i class="material-icons">menu</i></button>
<h1 class="left action">
{% block title %}
{% endblock %}
</h1>
</div>
<ul class="input-field nav-panel-buttom">
<li class="bold toggle-add-url-container">
<a class="waves-effect tooltipped toggle-add-url" 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>
2024-03-23 15:34:02 +01:00
{% if active_route and is_granted('LIST_ENTRIES') %}
<li id="button_random">
2022-05-03 23:28:20 +02:00
<a class="waves-effect tooltipped js-random-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.random_entry'|trans }}" href="{{ path('random_entry', {'type': active_route}) }}">
2019-01-21 10:20:19 +01:00
<i class="material-icons">casino</i>
</a>
</li>
{% endif %}
2023-06-06 22:53:56 +02:00
<li id="button_filters" class="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>
2023-06-06 22:53:56 +02:00
<li id="button_export" class="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>
<li class="bold">
<a class="wave-effect tooltipped dropdown-button" data-beloworigin="true" data-constrainwidth="false" data-activates="dropdown-account" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.account'|trans }}" href="#" id="news_menu">
<i class="material-icons" id="news_link">account_circle</i>
</a>
</li>
</ul>
<ul id="dropdown-account" class="dropdown-content">
<li><a href="{{ path('config') }}"><i class="material-icons">settings</i> {{ 'menu.left.config'|trans }}</a></li>
<li><a href="{{ path('developer') }}"><i class="material-icons">smartphone</i> {{ 'menu.left.developer'|trans }}</a></li>
<li><a href="{{ path('import') }}"><i class="material-icons">import_export</i> {{ 'menu.left.import'|trans }}</a></li>
{% if craue_setting('restricted_access') and is_granted('LIST_SITE_CREDENTIALS') %}
<li><a href="{{ path('site_credentials_index') }}"><i class="material-icons">vpn_key</i> {{ 'menu.left.site_credentials'|trans }}</a></li>
{% endif %}
<li class="divider"></li>
{% set can_list_user = is_granted('LIST_USERS') %}
{% set is_super_admin = is_granted('ROLE_SUPER_ADMIN') %}
{% set can_list_ignore_origin_instance_rules = is_granted('LIST_IGNORE_ORIGIN_INSTANCE_RULES') %}
{% if can_list_user %}
<li><a href="{{ path('user_index') }}"><i class="material-icons">people</i>{{ 'menu.left.users_management'|trans }}</a></li>
2024-02-05 22:02:50 +01:00
{% endif %}
{% if is_super_admin %}
<li><a href="{{ path('craue_config_settings_modify') }}"><i class="material-icons">settings</i> {{ 'menu.left.internal_settings'|trans }}</a></li>
{% endif %}
{% if can_list_ignore_origin_instance_rules %}
<li><a href="{{ path('ignore_origin_instance_rules_index') }}"><i class="material-icons">build</i> {{ 'menu.left.ignore_origin_instance_rules'|trans }}</a></li>
{% endif %}
{% if can_list_user or is_super_admin or can_list_ignore_origin_instance_rules %}
2020-11-19 11:38:02 +01:00
<li class="divider"></li>
{% endif %}
2020-11-19 11:38:02 +01:00
<li>
<a href="#" class="js-theme-toggle" data-theme="light">
<i class="theme-toggle-icon material-icons tiny">brightness_high</i>
<span>{{ 'menu.left.theme_toggle_light'|trans }}</span>
</a>
</li>
<li>
<a href="#" class="js-theme-toggle" data-theme="dark">
<i class="theme-toggle-icon material-icons tiny">brightness_low</i>
<span>{{ 'menu.left.theme_toggle_dark'|trans }}</span>
</a>
</li>
<li>
<a href="#" class="js-theme-toggle" data-theme="auto">
<i class="theme-toggle-icon material-icons tiny">brightness_auto</i>
<span>{{ 'menu.left.theme_toggle_auto'|trans }}</span>
</a>
</li>
<li class="divider"></li>
<li><a href="{{ path('howto') }}"><i class="material-icons">live_help</i> {{ 'menu.left.howto'|trans }}</a></li>
<li><a href="{{ path('quickstart') }}"><i class="material-icons">assistant_photo</i> {{ 'menu.left.quickstart'|trans }}</a></li>
<li class="divider"></li>
<li><a href="{{ path('fos_user_security_logout') }}"><i class="material-icons">input</i> {{ 'menu.left.logout'|trans }}</a></li>
</ul>
2015-08-12 08:22:30 +02:00
</div>
2024-03-23 15:34:02 +01:00
{% if is_granted('LIST_ENTRIES') %}
{{ render(controller('Wallabag\\Controller\\EntryController::searchFormAction', {'currentRoute': current_route})) }}
{% endif %}
{% if is_granted('CREATE_ENTRIES') %}
{{ render(controller('Wallabag\\Controller\\EntryController::addEntryFormAction')) }}
{% endif %}
2015-08-07 23:16:14 +02:00
</div>
</nav>
{% endblock %}
2015-10-01 11:38:59 +02:00
{% block footer %}
2016-09-15 11:11:24 +02:00
<footer class="page-footer cyan darken-2">
<div class="footer-copyright">
<div class="container">
2016-10-01 15:58:26 +02:00
<div class="row">
2017-12-06 22:46:24 +01:00
<div class="col m12 l8">
<p class="footer-text">
2016-10-01 15:58:26 +02:00
{{ display_stats() }}
</p>
</div>
<div class="col s12 l4">
2017-12-06 22:46:24 +01:00
<p class="footer-text">
{{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" rel="noopener" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a>
2016-10-01 15:58:26 +02:00
<a class="grey-text text-lighten-4" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans|lower }}</a>
</p>
</div>
</div>
2016-09-15 11:11:24 +02:00
</div>
</div>
</footer>
2015-10-01 11:38:59 +02:00
{% endblock %}