From c2257428b2188fc709c76ec8f531287888de9741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 12 Aug 2015 21:16:00 +0200 Subject: store domainName in database --- src/Wallabag/CoreBundle/Entity/Entry.php | 1 + .../CoreBundle/Resources/config/services.yml | 5 ---- .../Resources/views/Entry/entries.html.twig | 2 +- .../Resources/views/Entry/entry.html.twig | 4 +-- .../views/themes/material/Entry/entries.html.twig | 2 +- .../views/themes/material/Entry/entry.html.twig | 6 ++--- .../Twig/Extension/WallabagExtension.php | 30 ---------------------- 7 files changed, 8 insertions(+), 42 deletions(-) delete mode 100644 src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php (limited to 'src') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 9aebc55b..7d2d2027 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -266,6 +266,7 @@ class Entry { $this->content = $content; $this->readingTime = Tools::getReadingTime($content); + $this->domainName = parse_url($this->url, PHP_URL_HOST); return $this; } diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index d8bd8d52..08eae327 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -1,9 +1,4 @@ services: - wallabag_core.twig.extension: - class: Wallabag\CoreBundle\Twig\Extension\WallabagExtension - tags: - - { name: twig.extension } - wallabag_core.helper.detect_active_theme: class: Wallabag\CoreBundle\Helper\DetectActiveTheme arguments: diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig index ea4a9976..539c035f 100644 --- a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig @@ -35,7 +35,7 @@
  • {% trans %}Toggle mark as read{% endtrans %}
  • {% trans %}toggle favorite{% endtrans %}
  • {% trans %}delete{% endtrans %}
  • -
  • {{ entry.url | e | domainName }}
  • +
  • {{ entry.domainName }}
  • {{ entry.content|striptags|slice(0, 300) }}...

    diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig index f5c19ea3..00480d1a 100644 --- a/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entry.html.twig @@ -1,12 +1,12 @@ {% extends "WallabagCoreBundle::layout.html.twig" %} -{% block title %}{{ entry.title|raw }} ({{ entry.url | e | domainName }}){% endblock %} +{% block title %}{{ entry.title|raw }} ({{ entry.domainName }}){% endblock %} {% block content %}
    - {{ entry.url | e | domainName }} + {{ entry.domainName }}