diff options
author | Nicolas Lœuillet <nicolas@loeuillet.org> | 2016-11-28 12:08:51 +0100 |
---|---|---|
committer | Nicolas Lœuillet <nicolas@loeuillet.org> | 2016-11-28 16:10:21 +0100 |
commit | 9aa991281ddd315f607cabcfc3b917401d3d2104 (patch) | |
tree | 278c6a17d808bd3d9aa132d9ef93d7e54842de58 /src | |
parent | 56a7ce17f3a9a22e0bfc8651cb690a14447e0afd (diff) | |
download | wallabag-9aa991281ddd315f607cabcfc3b917401d3d2104.tar.gz wallabag-9aa991281ddd315f607cabcfc3b917401d3d2104.tar.zst wallabag-9aa991281ddd315f607cabcfc3b917401d3d2104.zip |
Renamed view_mode by list_mode and hide excerpt
Diffstat (limited to 'src')
5 files changed, 25 insertions, 21 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index ea7cd883..68f30f6e 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php | |||
@@ -376,7 +376,7 @@ class ConfigController extends Controller | |||
376 | public function changeViewModeAction(Request $request) | 376 | public function changeViewModeAction(Request $request) |
377 | { | 377 | { |
378 | $user = $this->getUser(); | 378 | $user = $this->getUser(); |
379 | $user->getConfig()->setViewMode(!$user->getConfig()->getViewMode()); | 379 | $user->getConfig()->setListMode(!$user->getConfig()->getListMode()); |
380 | 380 | ||
381 | $em = $this->getDoctrine()->getManager(); | 381 | $em = $this->getDoctrine()->getManager(); |
382 | $em->persist($user); | 382 | $em->persist($user); |
diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index 70364ab6..0b75270d 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php | |||
@@ -100,9 +100,9 @@ class Config | |||
100 | /** | 100 | /** |
101 | * @var int | 101 | * @var int |
102 | * | 102 | * |
103 | * @ORM\Column(name="view_mode", type="integer", nullable=true) | 103 | * @ORM\Column(name="list_mode", type="integer", nullable=true) |
104 | */ | 104 | */ |
105 | private $viewMode; | 105 | private $listMode; |
106 | 106 | ||
107 | /** | 107 | /** |
108 | * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config") | 108 | * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config") |
@@ -349,19 +349,19 @@ class Config | |||
349 | /** | 349 | /** |
350 | * @return int | 350 | * @return int |
351 | */ | 351 | */ |
352 | public function getViewMode() | 352 | public function getListMode() |
353 | { | 353 | { |
354 | return $this->viewMode; | 354 | return $this->listMode; |
355 | } | 355 | } |
356 | 356 | ||
357 | /** | 357 | /** |
358 | * @param int $viewMode | 358 | * @param int $listMode |
359 | * | 359 | * |
360 | * @return Config | 360 | * @return Config |
361 | */ | 361 | */ |
362 | public function setViewMode($viewMode) | 362 | public function setListMode($listMode) |
363 | { | 363 | { |
364 | $this->viewMode = $viewMode; | 364 | $this->listMode = $listMode; |
365 | 365 | ||
366 | return $this; | 366 | return $this; |
367 | } | 367 | } |
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 33863920..a4a56e46 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 | |||
@@ -13,11 +13,11 @@ | |||
13 | 13 | ||
14 | {% block content %} | 14 | {% block content %} |
15 | 15 | ||
16 | {% set viewMode = app.user.config.viewMode %} | 16 | {% set listMode = app.user.config.listMode %} |
17 | <div class="results"> | 17 | <div class="results"> |
18 | <div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div> | 18 | <div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div> |
19 | <div class="pagination"> | 19 | <div class="pagination"> |
20 | <a href="{{ path('switch_view_mode') }}"><i class="viewmode-btn material-icons md-36">{% if viewMode == 0 %}list{% else %}view_module{% endif %}</i></a> | 20 | <a href="{{ path('switch_view_mode') }}"><i class="listMode-btn material-icons md-36">{% if listMode == 0 %}list{% else %}view_module{% endif %}</i></a> |
21 | <i class="btn-clickable download-btn material-icons md-36">file_download</i> | 21 | <i class="btn-clickable download-btn material-icons md-36">file_download</i> |
22 | <i class="btn-clickable filter-btn material-icons md-36">filter_list</i> | 22 | <i class="btn-clickable filter-btn material-icons md-36">filter_list</i> |
23 | {% if entries.getNbPages > 1 %} | 23 | {% if entries.getNbPages > 1 %} |
@@ -27,7 +27,7 @@ | |||
27 | </div> | 27 | </div> |
28 | 28 | ||
29 | {% for entry in entries %} | 29 | {% for entry in entries %} |
30 | <div id="entry-{{ entry.id|e }}" class="{% if viewMode == 0 %}entry{% else %}listmode entry{% endif %}"> | 30 | <div id="entry-{{ entry.id|e }}" class="{% if listMode == 0 %}entry{% else %}listmode entry{% endif %}"> |
31 | <h2><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|raw }}</a></h2> | 31 | <h2><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|raw }}</a></h2> |
32 | 32 | ||
33 | {% set readingTime = entry.readingTime / app.user.config.readingSpeed %} | 33 | {% set readingTime = entry.readingTime / app.user.config.readingSpeed %} |
@@ -52,13 +52,13 @@ | |||
52 | <li><a title="{{ 'entry.list.delete'|trans }}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{{ 'entry.list.delete'|trans }}</span></a></li> | 52 | <li><a title="{{ 'entry.list.delete'|trans }}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{{ 'entry.list.delete'|trans }}</span></a></li> |
53 | <li><a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.list.original_article'|trans }} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.domainName|removeWww }}</span></a></li> | 53 | <li><a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.list.original_article'|trans }} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.domainName|removeWww }}</span></a></li> |
54 | </ul> | 54 | </ul> |
55 | {% if (entry.previewPicture is null or viewMode == 1) %} | 55 | {% if (entry.previewPicture is null or listMode == 1) %} |
56 | <ul class="card-entry-tags"> | 56 | <ul class="card-entry-tags"> |
57 | {% for tag in entry.tags %} | 57 | {% for tag in entry.tags %} |
58 | <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li> | 58 | <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li> |
59 | {% endfor %} | 59 | {% endfor %} |
60 | </ul> | 60 | </ul> |
61 | <p {% if viewMode == 1 %}class="hide"{% endif %}>{{ entry.content|striptags|slice(0, 300) }}…</p> | 61 | <p {% if listMode == 1 %}class="hide"{% endif %}>{{ entry.content|striptags|slice(0, 300) }}…</p> |
62 | {% else %} | 62 | {% else %} |
63 | <ul class="card-entry-labels"> | 63 | <ul class="card-entry-labels"> |
64 | {% for tag in entry.tags | slice(0, 3) %} | 64 | {% for tag in entry.tags | slice(0, 3) %} |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig index b77cdc14..bb9b64ce 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig | |||
@@ -3,12 +3,16 @@ | |||
3 | <div class="card-content"> | 3 | <div class="card-content"> |
4 | <span class="card-title dot-ellipsis dot-resize-update"> | 4 | <span class="card-title dot-ellipsis dot-resize-update"> |
5 | <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title | raw | striptags }}"> | 5 | <a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title | raw | striptags }}"> |
6 | {{ entry.title| striptags | truncate(120, true, '…') | raw }} | 6 | {{ entry.title| striptags | truncate(120, true, '…') | raw }} |
7 | </a> | 7 | </a> |
8 | </span> | 8 | </span> |
9 | <p class="hide-on-med-and-down">{{ entry.content|striptags|slice(0, 500)|raw }}…</p> | 9 | <ul class="tools-list right"> |
10 | <li> | ||
11 | <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> | ||
12 | <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> | ||
13 | <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> | ||
14 | </li> | ||
15 | </ul> | ||
10 | </div> | 16 | </div> |
11 | |||
12 | {% include "@WallabagCore/themes/material/Entry/_card_actions.html.twig" with {'entry': entry} only %} | ||
13 | </div> | 17 | </div> |
14 | </div> | 18 | </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 2921d366..5fca53ae 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 | |||
@@ -12,11 +12,11 @@ | |||
12 | {% endblock %} | 12 | {% endblock %} |
13 | 13 | ||
14 | {% block content %} | 14 | {% block content %} |
15 | {% set viewMode = app.user.config.viewMode %} | 15 | {% set listMode = app.user.config.listMode %} |
16 | <div class="results clearfix"> | 16 | <div class="results clearfix"> |
17 | <div class="nb-results left"> | 17 | <div class="nb-results left"> |
18 | {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }} | 18 | {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }} |
19 | <a href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if viewMode == 0 %}view_list{% else %}view_module{% endif %}</i></a> | 19 | <a href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if listMode == 0 %}view_list{% else %}view_module{% endif %}</i></a> |
20 | </div> | 20 | </div> |
21 | {% if entries.getNbPages > 1 %} | 21 | {% if entries.getNbPages > 1 %} |
22 | {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }} | 22 | {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }} |
@@ -26,8 +26,8 @@ | |||
26 | <br /> | 26 | <br /> |
27 | <ul class="row data"> | 27 | <ul class="row data"> |
28 | {% for entry in entries %} | 28 | {% for entry in entries %} |
29 | <li id="entry-{{ entry.id|e }}" class="col {% if viewMode == 0 %}l3 m6{% endif %} s12"> | 29 | <li id="entry-{{ entry.id|e }}" class="col {% if listMode == 0 %}l3 m6{% endif %} s12"> |
30 | {% if viewMode == 1 %} | 30 | {% if listMode == 1 %} |
31 | {% include "@WallabagCore/themes/material/Entry/_card_list.html.twig" with {'entry': entry} only %} | 31 | {% include "@WallabagCore/themes/material/Entry/_card_list.html.twig" with {'entry': entry} only %} |
32 | {% elseif entry.previewPicture is null %} | 32 | {% elseif entry.previewPicture is null %} |
33 | {% include "@WallabagCore/themes/material/Entry/_card_no_preview.html.twig" with {'entry': entry} only %} | 33 | {% include "@WallabagCore/themes/material/Entry/_card_no_preview.html.twig" with {'entry': entry} only %} |