diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/material/Entry')
5 files changed, 122 insertions, 68 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..9f696d06 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig | |||
@@ -0,0 +1,14 @@ | |||
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 | </span> | ||
6 | |||
7 | <ul class="tools right"> | ||
8 | <li> | ||
9 | <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> | ||
10 | <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> | ||
11 | <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> | ||
12 | </li> | ||
13 | </ul> | ||
14 | </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 498234b9..c610c8d2 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 | |||
@@ -22,74 +22,13 @@ | |||
22 | <ul class="row data"> | 22 | <ul class="row data"> |
23 | {% for entry in entries %} | 23 | {% for entry in entries %} |
24 | <li id="entry-{{ entry.id|e }}" class="col l3 m6 s12"> | 24 | <li id="entry-{{ entry.id|e }}" class="col l3 m6 s12"> |
25 | <div class="card"> | 25 | {% if entry.previewPicture is null %} |
26 | 26 | {% include "@WallabagCore/themes/material/Entry/_card_no_preview.html.twig" with {'entry': entry} only %} | |
27 | <div class="card-body"> | 27 | {% elseif not entry.previewPicture is null and entry.mimetype starts with 'image/' %} |
28 | {% if not entry.previewPicture is null %} | 28 | {% include "@WallabagCore/themes/material/Entry/_card_full_image.html.twig" with {'entry': entry} only %} |
29 | <div class="card-image waves-effect waves-block waves-light"> | 29 | {% elseif not entry.previewPicture is null %} |
30 | <ul class="card-entry-labels"> | 30 | {% include "@WallabagCore/themes/material/Entry/_card_preview.html.twig" with {'entry': entry} only %} |
31 | {% for tag in entry.tags | slice(0, 3) %} | 31 | {% endif %} |
32 | <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li> | ||
33 | {% endfor %} | ||
34 | </ul> | ||
35 | <div class="preview activator" style="background-image: url({{ entry.previewPicture }})"></div> | ||
36 | </div> | ||
37 | {% endif %} | ||
38 | |||
39 | <div class="card-content"> | ||
40 | {% if not entry.previewPicture is null %} | ||
41 | <i class="grey-text text-darken-4 activator material-icons right">more_vert</i> | ||
42 | {% endif %} | ||
43 | |||
44 | <span class="card-title dot-ellipsis dot-resize-update"><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title | raw | striptags }}">{{ entry.title| striptags | truncate(80, true, '…') | raw }}</a></span> | ||
45 | |||
46 | <div class="original grey-text"> | ||
47 | <a href="{{ entry.url|e }}" target="_blank" title="{{ entry.domainName|removeWww }}" class="tool original grey-text"> | ||
48 | <span>{{ entry.domainName|removeWww }}</span> | ||
49 | </a> | ||
50 | </div> | ||
51 | |||
52 | {% if entry.previewPicture is null %} | ||
53 | <p>{{ entry.content|striptags|slice(0, 250)|raw }}…</p> | ||
54 | <ul class="card-entry-labels-hidden"> | ||
55 | {% for tag in entry.tags | slice(0, 2) %} | ||
56 | <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li> | ||
57 | {% endfor %} | ||
58 | </ul> | ||
59 | {% endif %} | ||
60 | </div> | ||
61 | </div> | ||
62 | |||
63 | {% if not entry.previewPicture is null %} | ||
64 | <div class="card-reveal"> | ||
65 | <i class="card-title activator grey-text text-darken-4 material-icons right">clear</i> | ||
66 | <span class="card-title" title="{{ entry.title | raw | striptags }}"><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title | raw | striptags | truncate(90, true, '…') }}</a></span> | ||
67 | |||
68 | <p>{{ entry.content|striptags|slice(0, 250)|raw }}…</p> | ||
69 | |||
70 | <ul class="card-entry-labels-hidden"> | ||
71 | {% for tag in entry.tags %} | ||
72 | <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li> | ||
73 | {% endfor %} | ||
74 | </ul> | ||
75 | </div> | ||
76 | {% endif %} | ||
77 | |||
78 | <div class="card-action"> | ||
79 | <span class="reading-time grey-text"> | ||
80 | <i class="material-icons" title="{{ 'entry.list.reading_time'|trans }}">timer</i> | ||
81 | {{ entry.readingTime / app.user.config.readingSpeed|round }} min | ||
82 | </span> | ||
83 | |||
84 | <ul class="tools right"> | ||
85 | <li> | ||
86 | <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> | ||
87 | <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> | ||
88 | <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> | ||
89 | </li> | ||
90 | </ul> | ||
91 | </div> | ||
92 | </div> | ||
93 | </li> | 32 | </li> |
94 | {% endfor %} | 33 | {% endfor %} |
95 | </ul> | 34 | </ul> |