aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-09-29 22:59:44 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-09-29 22:59:44 +0200
commit72fcaf8a6c7d53946a8912a99e86febc7df4b036 (patch)
tree2b2c6af2eb81f53f8223b396d95209175ea15da2 /src/Wallabag
parent917040d4a0b7694ca4f695c02243ffb4283d6901 (diff)
downloadwallabag-72fcaf8a6c7d53946a8912a99e86febc7df4b036.tar.gz
wallabag-72fcaf8a6c7d53946a8912a99e86febc7df4b036.tar.zst
wallabag-72fcaf8a6c7d53946a8912a99e86febc7df4b036.zip
remove www. on entries view
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Twig/WallabagExtension.php23
3 files changed, 25 insertions, 2 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 08f3fe60..abbcb389 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
@@ -36,7 +36,7 @@
36 <li><a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool icon-check icon {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li> 36 <li><a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool icon-check icon {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle mark as read{% endtrans %}</span></a></li>
37 <li><a title="{% trans %}toggle favorite{% endtrans %}" class="tool icon-star icon {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}toggle favorite{% endtrans %}</span></a></li> 37 <li><a title="{% trans %}toggle favorite{% endtrans %}" class="tool icon-star icon {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}toggle favorite{% endtrans %}</span></a></li>
38 <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}delete{% endtrans %}</span></a></li> 38 <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}delete{% endtrans %}</span></a></li>
39 <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.domainName }}</span></a></li> 39 <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.domainName|removeWww }}</span></a></li>
40 </ul> 40 </ul>
41 {% if entry.previewPicture is null %} 41 {% if entry.previewPicture is null %}
42 <p>{{ entry.content|striptags|slice(0, 300) }}&hellip;</p> 42 <p>{{ entry.content|striptags|slice(0, 300) }}&hellip;</p>
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 dcdf7c09..ff69e821 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
@@ -76,7 +76,7 @@
76 {% endif %} 76 {% endif %}
77 77
78 <div class="card-action"> 78 <div class="card-action">
79 <span class="bold"><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %}: {{ entry.title|e }} - {{ entry.domainName }}" class="tool original grey-text"><span>{{ entry.domainName | truncate(18) }}</span></a></bold> 79 <span class="bold"><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %}: {{ entry.title|e }} - {{ entry.domainName|removeWww }}" class="tool original grey-text"><span>{{ entry.domainName|removeWww|truncate(18) }}</span></a></bold>
80 80
81 <ul class="tools links right"> 81 <ul class="tools links right">
82 <li> 82 <li>
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
new file mode 100644
index 00000000..f8328860
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
@@ -0,0 +1,23 @@
1<?php
2
3namespace Wallabag\CoreBundle\Twig;
4
5class WallabagExtension extends \Twig_Extension
6{
7 public function getFilters()
8 {
9 return array(
10 new \Twig_SimpleFilter('removeWww', array($this, 'removeWww')),
11 );
12 }
13
14 public function removeWww($url)
15 {
16 return preg_replace('/^www\./i', '',$url);
17 }
18
19 public function getName()
20 {
21 return 'wallabag_extension';
22 }
23}