Move icon into the top menu bar

Change the way to select a random entry:
- select all ids from the given user (with filters)
- choose randomly one in php
- find that entry
This commit is contained in:
Jeremy Benoist
2019-01-19 22:08:29 +01:00
parent 9a57653aec
commit 50f35f0db2
22 changed files with 57 additions and 28 deletions

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: 'Tilføj ny artikel'
search: 'Søg'
filter_entries: 'Filtrer artikler'
# random_entry: Jump to a random entry from that list
# export: 'Export'
search_form:
input_label: 'Indtast søgning'

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: 'Neuen Artikel hinzufügen'
search: 'Suche'
filter_entries: 'Artikel filtern'
# random_entry: Jump to a random entry from that list
export: 'Exportieren'
search_form:
input_label: 'Suchbegriff hier eingeben'

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: 'Add a new entry'
search: 'Search'
filter_entries: 'Filter entries'
random_entry: Jump to a random entry from that list
export: 'Export'
search_form:
input_label: 'Enter your search here'

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: 'Añadir un nuevo artículo'
search: 'Buscar'
filter_entries: 'Filtrar los artículos'
# random_entry: Jump to a random entry from that list
export: 'Exportar'
search_form:
input_label: 'Introduzca su búsqueda aquí'

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: 'افزودن مقالهٔ تازه'
search: 'جستجو'
filter_entries: 'فیلترکردن مقاله‌ها'
# random_entry: Jump to a random entry from that list
export: 'برون‌بری'
search_form:
input_label: 'جستجوی خود را این‌جا بنویسید:'

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: "Sauvegarder un nouvel article"
search: "Rechercher"
filter_entries: "Filtrer les articles"
random_entry: Aller à un article aléatoire de cette liste
export: "Exporter"
search_form:
input_label: "Saisissez votre terme de recherche"

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: 'Aggiungi un nuovo contenuto'
search: 'Cerca'
filter_entries: 'Filtra contenuti'
# random_entry: Jump to a random entry from that list
export: 'Esporta'
search_form:
input_label: 'Inserisci qui la tua ricerca'

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: 'Enregistrar un novèl article'
search: 'Cercar'
filter_entries: 'Filtrar los articles'
# random_entry: Jump to a random entry from that list
export: 'Exportar'
search_form:
input_label: 'Picatz vòstre mot-clau a cercar aquí'

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: 'Dodaj nowy wpis'
search: 'Szukaj'
filter_entries: 'Filtruj wpisy'
# random_entry: Jump to a random entry from that list
export: 'Eksportuj'
search_form:
input_label: 'Wpisz swoje zapytanie tutaj'

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: 'Adicionar uma nova entrada'
search: 'Pesquisa'
filter_entries: 'Filtrar entradas'
# random_entry: Jump to a random entry from that list
export: 'Exportar'
search_form:
input_label: 'Digite aqui sua pesquisa'

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: 'Introdu un nou articol'
search: 'Căutare'
filter_entries: 'Filtrează articolele'
# random_entry: Jump to a random entry from that list
# export: 'Export'
search_form:
input_label: 'Introdu căutarea ta'

View File

@ -36,6 +36,7 @@ menu:
add_new_entry: 'Добавить новую запись'
search: 'Поиск'
filter_entries: 'Фильтр записей'
# random_entry: Jump to a random entry from that list
export: 'Экспорт'
search_form:
input_label: 'Введите текст для поиска'

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: 'เพิ่มรายการใหม่'
search: 'ค้นหา'
filter_entries: 'ตัวกรองรายการ'
# random_entry: Jump to a random entry from that list
export: 'นำข้อมูลออก'
search_form:
input_label: 'ค้นหาที่นี้'

View File

@ -37,6 +37,7 @@ menu:
add_new_entry: 'Yeni bir makale ekle'
search: 'Ara'
filter_entries: 'Filtrele'
# random_entry: Jump to a random entry from that list
export: 'Dışa Aktar'
search_form:
input_label: 'Aramak istediğiniz herhangi bir şey yazın'

View File

@ -28,10 +28,12 @@
<div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div>
<div class="pagination">
<a href="{{ path('switch_view_mode') }}"><i class="listMode-btn material-icons md-24">{% if listMode == 0 %}list{% else %}view_module{% endif %}</i></a>
<a href="{{ path('random_entry', { 'type': currentRoute }) }}">random</a>
{% if app.user.config.rssToken %}
{% include "@WallabagCore/themes/common/Entry/_rss_link.html.twig" %}
{% endif %}
{% if currentRoute in ['unread', 'starred', 'archive', 'untagged', 'all'] %}
<a href="{{ path('random_entry', { 'type': currentRoute }) }}"><i class="btn-clickable material-icons md-24 js-random-action">shuffle</i></a>
{% endif %}
<i class="btn-clickable download-btn material-icons md-24 js-export-action">file_download</i>
<i class="btn-clickable filter-btn material-icons md-24 js-filters-action">filter_list</i>
{% if entries.getNbPages > 1 %}

View File

@ -28,7 +28,6 @@
<div class="nb-results">
{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
<a href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if listMode == 0 %}view_list{% else %}view_module{% endif %}</i></a>
<a href="{{ path('random_entry', { 'type': currentRoute }) }}" title="random"><i class="material-icons">shuffle</i></a>
{% if app.user.config.rssToken %}
{% include "@WallabagCore/themes/common/Entry/_rss_link.html.twig" %}
{% endif %}

View File

@ -46,6 +46,8 @@
{% set activeRoute = 'starred' %}
{% elseif currentRoute == 'unread' or currentRoute == 'homepage' or currentRouteFromQueryParams == 'unread' %}
{% set activeRoute = 'unread' %}
{% elseif currentRoute == 'untagged' %}
{% set activeRoute = 'untagged' %}
{% endif %}
<li class="bold {% if activeRoute == 'unread' %}active{% endif %}">
@ -113,6 +115,13 @@
<i class="material-icons">search</i>
</a>
</li>
{% if activeRoute %}
<li id="button_random">
<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': activeRoute }) }}">
<i class="material-icons">shuffle</i>
</a>
</li>
{% endif %}
<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>
@ -125,7 +134,7 @@
</li>
</ul>
</div>
{{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }}
{{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': currentRoute})) }}
{{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }}
</div>
</nav>