diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/material/Entry')
7 files changed, 171 insertions, 111 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig new file mode 100644 index 00000000..56442116 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig | |||
@@ -0,0 +1,17 @@ | |||
1 | <div class="card-action"> | ||
2 | <span class="reading-time grey-text"> | ||
3 | <i class="material-icons" title="{{ 'entry.list.reading_time'|trans }}">timer</i> | ||
4 | {{ entry.readingTime / app.user.config.readingSpeed|round }} min | ||
5 | |||
6 | <i class="material-icons hide-on-med-and-down" title="{{ 'entry.view.created_at'|trans }}">today</i> | ||
7 | <span class="hide-on-med-and-down"> {{ entry.createdAt|date('Y-m-d') }}</span> | ||
8 | </span> | ||
9 | |||
10 | <ul class="tools right"> | ||
11 | <li> | ||
12 | <a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}redo{% endif %}</i></a> | ||
13 | <a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a> | ||
14 | <a title="{{ 'entry.list.delete'|trans }}" class="tool grey-text delete" href="{{ path('delete_entry', { 'id': entry.id }) }}"><i class="material-icons">delete</i></a> | ||
15 | </li> | ||
16 | </ul> | ||
17 | </div> | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_full_image.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_full_image.html.twig new file mode 100644 index 00000000..0fdd5996 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_full_image.html.twig | |||
@@ -0,0 +1,28 @@ | |||
1 | <div class="card"> | ||
2 | <div class="card-body"> | ||
3 | <div class="card-fullimage"> | ||
4 | <ul class="card-entry-labels"> | ||
5 | {% for tag in entry.tags | slice(0, 3) %} | ||
6 | <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li> | ||
7 | {% endfor %} | ||
8 | </ul> | ||
9 | <div class="preview activator" style="background-image: url({{ entry.previewPicture }})"></div> | ||
10 | </div> | ||
11 | |||
12 | <div class="card-content"> | ||
13 | <span class="card-title dot-ellipsis dot-resize-update"> | ||
14 | <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title | raw | striptags }}"> | ||
15 | {{ entry.title | raw | striptags | truncate(80, true, '…') }} | ||
16 | </a> | ||
17 | </span> | ||
18 | |||
19 | <div class="original grey-text"> | ||
20 | <a href="{{ entry.url|e }}" target="_blank" title="{{ entry.domainName|removeWww }}" class="tool original grey-text"> | ||
21 | <span>{{ entry.domainName|removeWww }}</span> | ||
22 | </a> | ||
23 | </div> | ||
24 | </div> | ||
25 | </div> | ||
26 | |||
27 | {% include "@WallabagCore/themes/material/Entry/_card_actions.html.twig" with {'entry': entry} only %} | ||
28 | </div> | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_no_preview.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_no_preview.html.twig new file mode 100644 index 00000000..19a400b4 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_no_preview.html.twig | |||
@@ -0,0 +1,26 @@ | |||
1 | <div class="card"> | ||
2 | <div class="card-body"> | ||
3 | <div class="card-content"> | ||
4 | <span class="card-title dot-ellipsis dot-resize-update"> | ||
5 | <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title | raw | striptags }}"> | ||
6 | {{ entry.title | raw | striptags | truncate(80, true, '…') }} | ||
7 | </a> | ||
8 | </span> | ||
9 | |||
10 | <div class="original grey-text"> | ||
11 | <a href="{{ entry.url|e }}" target="_blank" title="{{ entry.domainName|removeWww }}" class="tool original grey-text"> | ||
12 | <span>{{ entry.domainName|removeWww }}</span> | ||
13 | </a> | ||
14 | </div> | ||
15 | |||
16 | <p>{{ entry.content|striptags|slice(0, 250)|raw }}…</p> | ||
17 | <ul class="card-entry-labels-hidden"> | ||
18 | {% for tag in entry.tags | slice(0, 2) %} | ||
19 | <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li> | ||
20 | {% endfor %} | ||
21 | </ul> | ||
22 | </div> | ||
23 | </div> | ||
24 | |||
25 | {% include "@WallabagCore/themes/material/Entry/_card_actions.html.twig" with {'entry': entry} only %} | ||
26 | </div> | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_preview.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_preview.html.twig new file mode 100644 index 00000000..b0e3c06d --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_preview.html.twig | |||
@@ -0,0 +1,47 @@ | |||
1 | <div class="card"> | ||
2 | <div class="card-body"> | ||
3 | <div class="card-image waves-effect waves-block waves-light"> | ||
4 | <ul class="card-entry-labels"> | ||
5 | {% for tag in entry.tags | slice(0, 3) %} | ||
6 | <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li> | ||
7 | {% endfor %} | ||
8 | </ul> | ||
9 | <div class="preview activator" style="background-image: url({{ entry.previewPicture }})"></div> | ||
10 | </div> | ||
11 | |||
12 | <div class="card-content"> | ||
13 | <i class="grey-text text-darken-4 activator material-icons right">more_vert</i> | ||
14 | |||
15 | <span class="card-title dot-ellipsis dot-resize-update"> | ||
16 | <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title | raw | striptags }}"> | ||
17 | {{ entry.title| striptags | truncate(80, true, '…') | raw }} | ||
18 | </a> | ||
19 | </span> | ||
20 | |||
21 | <div class="original grey-text"> | ||
22 | <a href="{{ entry.url|e }}" target="_blank" title="{{ entry.domainName|removeWww }}" class="tool original grey-text"> | ||
23 | <span>{{ entry.domainName|removeWww }}</span> | ||
24 | </a> | ||
25 | </div> | ||
26 | </div> | ||
27 | </div> | ||
28 | |||
29 | <div class="card-reveal"> | ||
30 | <i class="card-title activator grey-text text-darken-4 material-icons right">clear</i> | ||
31 | <span class="card-title"> | ||
32 | <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title | raw | striptags }}"> | ||
33 | {{ entry.title | raw | striptags | truncate(80, true, '…') }} | ||
34 | </a> | ||
35 | </span> | ||
36 | |||
37 | <p>{{ entry.content|striptags|slice(0, 250)|raw }}…</p> | ||
38 | |||
39 | <ul class="card-entry-labels-hidden"> | ||
40 | {% for tag in entry.tags %} | ||
41 | <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li> | ||
42 | {% endfor %} | ||
43 | </ul> | ||
44 | </div> | ||
45 | |||
46 | {% include "@WallabagCore/themes/material/Entry/_card_actions.html.twig" with {'entry': entry} only %} | ||
47 | </div> | ||
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 a0205ffb..160dbf3d 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 | |||
@@ -9,93 +9,34 @@ | |||
9 | {% endblock %} | 9 | {% endblock %} |
10 | 10 | ||
11 | {% block content %} | 11 | {% block content %} |
12 | {% include "WallabagCoreBundle:Entry:pager.html.twig" with {'entries': entries} %} | 12 | <div class="results clearfix"> |
13 | <div class="nb-results left"> | ||
14 | {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }} | ||
15 | </div> | ||
16 | {% if entries.getNbPages > 1 %} | ||
17 | {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }} | ||
18 | {% endif %} | ||
19 | </div> | ||
20 | |||
13 | <br /> | 21 | <br /> |
14 | <ul class="row data"> | 22 | <ul class="row data"> |
15 | {% for entry in entries %} | 23 | {% for entry in entries %} |
16 | <li id="entry-{{ entry.id|e }}" class="col l4 m6 s12"> | 24 | <li id="entry-{{ entry.id|e }}" class="col l3 m6 s12"> |
17 | <div class="card"> | 25 | {% if entry.previewPicture is null %} |
18 | 26 | {% include "@WallabagCore/themes/material/Entry/_card_no_preview.html.twig" with {'entry': entry} only %} | |
19 | <div class="card-body"> | 27 | {% elseif not entry.previewPicture is null and entry.mimetype starts with 'image/' %} |
20 | {% if not entry.previewPicture is null %} | 28 | {% include "@WallabagCore/themes/material/Entry/_card_full_image.html.twig" with {'entry': entry} only %} |
21 | <div class="card-image waves-effect waves-block waves-light"> | 29 | {% elseif not entry.previewPicture is null %} |
22 | <ul class="card-entry-labels"> | 30 | {% include "@WallabagCore/themes/material/Entry/_card_preview.html.twig" with {'entry': entry} only %} |
23 | {% for tag in entry.tags | slice(0, 3) %} | 31 | {% endif %} |
24 | <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li> | ||
25 | {% endfor %} | ||
26 | </ul> | ||
27 | <div class="preview activator" style="background-image: url({{ entry.previewPicture }})"></div> | ||
28 | </div> | ||
29 | {% endif %} | ||
30 | |||
31 | <div class="card-content"> | ||
32 | {% if not entry.previewPicture is null %} | ||
33 | <i class="card-title grey-text text-darken-4 activator material-icons right">more_vert</i> | ||
34 | {% endif %} | ||
35 | |||
36 | <span class="card-title dot-ellipsis dot-resize-update"><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|striptags|raw }}</a></span> | ||
37 | |||
38 | <div class="estimatedTime grey-text"> | ||
39 | <span class="tool reading-time"> | ||
40 | {% set readingTime = entry.readingTime / app.user.config.readingSpeed %} | ||
41 | {% if readingTime > 0 %} | ||
42 | {{ 'entry.list.reading_time_minutes'|trans({'%readingTime%': readingTime|round}) }} | ||
43 | {% else %} | ||
44 | {{ 'entry.list.reading_time_less_one_minute'|trans|raw }} | ||
45 | {% endif %} | ||
46 | </span> | ||
47 | </div> | ||
48 | |||
49 | {% if entry.previewPicture is null %} | ||
50 | <p>{{ entry.content|striptags|slice(0, 300)|raw }}…</p> | ||
51 | <ul class="card-entry-labels-hidden"> | ||
52 | {% for tag in entry.tags | slice(0, 2) %} | ||
53 | <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li> | ||
54 | {% endfor %} | ||
55 | </ul> | ||
56 | {% endif %} | ||
57 | </div> | ||
58 | </div> | ||
59 | |||
60 | {% if not entry.previewPicture is null %} | ||
61 | <div class="card-reveal"> | ||
62 | <i class="card-title grey-text text-darken-4 material-icons right">clear</i> | ||
63 | <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|raw }}</a></span> | ||
64 | |||
65 | <div class="estimatedTime grey-text"> | ||
66 | <span class="tool reading-time"> | ||
67 | {% if readingTime > 0 %}{{ 'entry.list.reading_time_minutes'|trans({'%readingTime%': readingTime|round}) }}{% else %}{{ 'entry.list.reading_time_less_one_minute'|trans|raw }}{% endif %} | ||
68 | </span> | ||
69 | </div> | ||
70 | |||
71 | <p>{{ entry.content|striptags|slice(0, 300)|raw }}…</p> | ||
72 | |||
73 | <ul class="card-entry-labels-hidden"> | ||
74 | {% for tag in entry.tags %} | ||
75 | <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li> | ||
76 | {% endfor %} | ||
77 | </ul> | ||
78 | </div> | ||
79 | {% endif %} | ||
80 | |||
81 | <div class="card-action"> | ||
82 | <span class="bold"> | ||
83 | <a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.list.original_article'|trans }}: {{ entry.title|e }} - {{ entry.domainName|removeWww }}" class="tool original grey-text"><span>{{ entry.domainName|removeWww|truncate(18) }}</span></a> | ||
84 | </span> | ||
85 | |||
86 | <ul class="tools right"> | ||
87 | <li> | ||
88 | <a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}redo{% endif %}</i></a> | ||
89 | <a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a> | ||
90 | <a title="{{ 'entry.list.delete'|trans }}" class="tool grey-text delete" href="{{ path('delete_entry', { 'id': entry.id }) }}"><i class="material-icons">delete</i></a> | ||
91 | </li> | ||
92 | </ul> | ||
93 | </div> | ||
94 | </div> | ||
95 | </li> | 32 | </li> |
96 | {% endfor %} | 33 | {% endfor %} |
97 | </ul> | 34 | </ul> |
98 | 35 | ||
36 | {% if entries.getNbPages > 1 %} | ||
37 | {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }} | ||
38 | {% endif %} | ||
39 | |||
99 | <!-- Export --> | 40 | <!-- Export --> |
100 | <div id="export" class="side-nav fixed right-aligned"> | 41 | <div id="export" class="side-nav fixed right-aligned"> |
101 | {% set currentRoute = app.request.attributes.get('_route') %} | 42 | {% set currentRoute = app.request.attributes.get('_route') %} |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig index 7912caa9..bed0fdec 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig | |||
@@ -212,27 +212,38 @@ | |||
212 | <h1>{{ entry.title|raw }} <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}">✎</a></h1> | 212 | <h1>{{ entry.title|raw }} <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}">✎</a></h1> |
213 | </header> | 213 | </header> |
214 | <aside> | 214 | <aside> |
215 | {% set readingTime = entry.readingTime / app.user.config.readingSpeed %} | 215 | <ul class="tools"> |
216 | <i class="material-icons">timer</i> | 216 | <li> |
217 | <span class="link"> | 217 | {% set readingTime = entry.readingTime / app.user.config.readingSpeed %} |
218 | {% if readingTime > 0 %} | 218 | <i class="material-icons">timer</i> |
219 | {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }} | 219 | {% if readingTime > 0 %} |
220 | {% else %} | 220 | {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }} |
221 | {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }} | 221 | {% else %} |
222 | {% endif %} | 222 | {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }} |
223 | </span> | 223 | {% endif %} |
224 | <i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i><span class="link">{{ entry.createdAt|date('Y-m-d') }}</span> | 224 | </li> |
225 | <a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool"> | 225 | <li> |
226 | <i class="material-icons link">link</i> <span class="link">{{ entry.domainName|removeWww }}</span> | 226 | <i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i> |
227 | </a> | 227 | {{ entry.createdAt|date('Y-m-d') }} |
228 | <span class="tool"><i class="material-icons link">comment</i></span> <span class="link">{{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span> | 228 | </li> |
229 | <div id="list"> | 229 | <li> |
230 | {% for tag in entry.tags %} | 230 | <i class="material-icons link">link</i> |
231 | <div class="chip"> | 231 | <a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool"> |
232 | <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a> <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}"><i class="material-icons">delete</i></a> | 232 | {{ entry.domainName|removeWww }} |
233 | </div> | 233 | </a> |
234 | {% endfor %} | 234 | </li> |
235 | </div> | 235 | <li> |
236 | <i class="material-icons link">comment</i> | ||
237 | {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }} | ||
238 | </li> | ||
239 | <li id="list"> | ||
240 | {% for tag in entry.tags %} | ||
241 | <div class="chip"> | ||
242 | <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a> <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}"><i class="material-icons">delete</i></a> | ||
243 | </div> | ||
244 | {% endfor %} | ||
245 | </li> | ||
246 | </ul> | ||
236 | 247 | ||
237 | <div class="input-field nav-panel-add-tag" style="display: none"> | 248 | <div class="input-field nav-panel-add-tag" style="display: none"> |
238 | {{ render(controller( "WallabagCoreBundle:Tag:addTagForm", { 'id': entry.id } )) }} | 249 | {{ render(controller( "WallabagCoreBundle:Tag:addTagForm", { 'id': entry.id } )) }} |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/pager.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/pager.html.twig deleted file mode 100644 index 6f8e60fc..00000000 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/pager.html.twig +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | {% block pager %} | ||
2 | <div class="results clearfix"> | ||
3 | <div class="nb-results left"> | ||
4 | {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }} | ||
5 | </div> | ||
6 | {% if entries.getNbPages > 1 %} | ||
7 | {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }} | ||
8 | {% endif %} | ||
9 | </div> | ||
10 | {% endblock %} | ||