diff options
author | Kevin Decherf <kevin@kdecherf.com> | 2019-01-22 18:30:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-22 18:30:02 +0100 |
commit | 3527c300215e6e6010efb8bb840b8b6f5c63a1cc (patch) | |
tree | d3c23a18c966831ecd5f956d6365a2c7126c98c8 /src/Wallabag/CoreBundle/Resources/views/themes | |
parent | c73025ad8b684de1ac21ba7583f1af6f1d185159 (diff) | |
parent | fe5850d6e27f8cf20e7efc5c56672974b4779d9f (diff) | |
download | wallabag-3527c300215e6e6010efb8bb840b8b6f5c63a1cc.tar.gz wallabag-3527c300215e6e6010efb8bb840b8b6f5c63a1cc.tar.zst wallabag-3527c300215e6e6010efb8bb840b8b6f5c63a1cc.zip |
Merge pull request #3526 from wallabag/add-random-article
Add random feature
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/views/themes')
3 files changed, 19 insertions, 7 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig index 832112be..fb296c9d 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig | |||
@@ -20,6 +20,9 @@ | |||
20 | 20 | ||
21 | {% block content %} | 21 | {% block content %} |
22 | {% set currentRoute = app.request.attributes.get('_route') %} | 22 | {% set currentRoute = app.request.attributes.get('_route') %} |
23 | {% if currentRoute == 'homepage' %} | ||
24 | {% set currentRoute = 'unread' %} | ||
25 | {% endif %} | ||
23 | {% set listMode = app.user.config.listMode %} | 26 | {% set listMode = app.user.config.listMode %} |
24 | <div class="results"> | 27 | <div class="results"> |
25 | <div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div> | 28 | <div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div> |
@@ -28,6 +31,9 @@ | |||
28 | {% if app.user.config.rssToken %} | 31 | {% if app.user.config.rssToken %} |
29 | {% include "@WallabagCore/themes/common/Entry/_rss_link.html.twig" %} | 32 | {% include "@WallabagCore/themes/common/Entry/_rss_link.html.twig" %} |
30 | {% endif %} | 33 | {% endif %} |
34 | {% if currentRoute in ['unread', 'starred', 'archive', 'untagged', 'all'] %} | ||
35 | <a href="{{ path('random_entry', { 'type': currentRoute }) }}"><i class="btn-clickable material-icons md-24 js-random-action">casino</i></a> | ||
36 | {% endif %} | ||
31 | <i class="btn-clickable download-btn material-icons md-24 js-export-action">file_download</i> | 37 | <i class="btn-clickable download-btn material-icons md-24 js-export-action">file_download</i> |
32 | <i class="btn-clickable filter-btn material-icons md-24 js-filters-action">filter_list</i> | 38 | <i class="btn-clickable filter-btn material-icons md-24 js-filters-action">filter_list</i> |
33 | {% if entries.getNbPages > 1 %} | 39 | {% if entries.getNbPages > 1 %} |
@@ -90,9 +96,6 @@ | |||
90 | {% if tag is defined %} | 96 | {% if tag is defined %} |
91 | {% set currentTag = tag %} | 97 | {% set currentTag = tag %} |
92 | {% endif %} | 98 | {% endif %} |
93 | {% if currentRoute == 'homepage' %} | ||
94 | {% set currentRoute = 'unread' %} | ||
95 | {% endif %} | ||
96 | <h2>{{ 'entry.list.export_title'|trans }}</h2> | 99 | <h2>{{ 'entry.list.export_title'|trans }}</h2> |
97 | <a href="javascript: void(null);" id="download-form-close" class="close-button--popup close-button">×</a> | 100 | <a href="javascript: void(null);" id="download-form-close" class="close-button--popup close-button">×</a> |
98 | <ul> | 101 | <ul> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index 742dd330..067c8975 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig | |||
@@ -21,6 +21,9 @@ | |||
21 | {% block content %} | 21 | {% block content %} |
22 | {% set listMode = app.user.config.listMode %} | 22 | {% set listMode = app.user.config.listMode %} |
23 | {% set currentRoute = app.request.attributes.get('_route') %} | 23 | {% set currentRoute = app.request.attributes.get('_route') %} |
24 | {% if currentRoute == 'homepage' %} | ||
25 | {% set currentRoute = 'unread' %} | ||
26 | {% endif %} | ||
24 | <div class="results"> | 27 | <div class="results"> |
25 | <div class="nb-results"> | 28 | <div class="nb-results"> |
26 | {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }} | 29 | {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }} |
@@ -60,9 +63,6 @@ | |||
60 | {% if tag is defined %} | 63 | {% if tag is defined %} |
61 | {% set currentTag = tag.slug %} | 64 | {% set currentTag = tag.slug %} |
62 | {% endif %} | 65 | {% endif %} |
63 | {% if currentRoute == 'homepage' %} | ||
64 | {% set currentRoute = 'unread' %} | ||
65 | {% endif %} | ||
66 | <h4 class="center">{{ 'entry.list.export_title'|trans }}</h4> | 66 | <h4 class="center">{{ 'entry.list.export_title'|trans }}</h4> |
67 | <ul> | 67 | <ul> |
68 | {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub', 'tag' : currentTag }) }}">EPUB</a></li>{% endif %} | 68 | {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub', 'tag' : currentTag }) }}">EPUB</a></li>{% endif %} |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig index 052a8c01..b9c45567 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig | |||
@@ -46,6 +46,8 @@ | |||
46 | {% set activeRoute = 'starred' %} | 46 | {% set activeRoute = 'starred' %} |
47 | {% elseif currentRoute == 'unread' or currentRoute == 'homepage' or currentRouteFromQueryParams == 'unread' %} | 47 | {% elseif currentRoute == 'unread' or currentRoute == 'homepage' or currentRouteFromQueryParams == 'unread' %} |
48 | {% set activeRoute = 'unread' %} | 48 | {% set activeRoute = 'unread' %} |
49 | {% elseif currentRoute == 'untagged' %} | ||
50 | {% set activeRoute = 'untagged' %} | ||
49 | {% endif %} | 51 | {% endif %} |
50 | 52 | ||
51 | <li class="bold {% if activeRoute == 'unread' %}active{% endif %}"> | 53 | <li class="bold {% if activeRoute == 'unread' %}active{% endif %}"> |
@@ -113,6 +115,13 @@ | |||
113 | <i class="material-icons">search</i> | 115 | <i class="material-icons">search</i> |
114 | </a> | 116 | </a> |
115 | </li> | 117 | </li> |
118 | {% if activeRoute %} | ||
119 | <li id="button_random"> | ||
120 | <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 }) }}"> | ||
121 | <i class="material-icons">casino</i> | ||
122 | </a> | ||
123 | </li> | ||
124 | {% endif %} | ||
116 | <li id="button_filters"> | 125 | <li id="button_filters"> |
117 | <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"> | 126 | <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"> |
118 | <i class="material-icons">filter_list</i> | 127 | <i class="material-icons">filter_list</i> |
@@ -125,7 +134,7 @@ | |||
125 | </li> | 134 | </li> |
126 | </ul> | 135 | </ul> |
127 | </div> | 136 | </div> |
128 | {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }} | 137 | {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': currentRoute})) }} |
129 | {{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }} | 138 | {{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }} |
130 | </div> | 139 | </div> |
131 | </nav> | 140 | </nav> |