aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ExportController.php12
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php2
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php29
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig19
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig21
5 files changed, 52 insertions, 31 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php
index 282fd733..cec8d499 100644
--- a/src/Wallabag/CoreBundle/Controller/ExportController.php
+++ b/src/Wallabag/CoreBundle/Controller/ExportController.php
@@ -68,6 +68,18 @@ class ExportController extends Controller
68 ); 68 );
69 69
70 $title = 'Tag ' . $tag->getLabel(); 70 $title = 'Tag ' . $tag->getLabel();
71 } elseif ('search' === $category) {
72 $searchTerm = (isset($request->get('search_entry')['term']) ? $request->get('search_entry')['term'] : '');
73 $currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
74
75 $entries = $repository->getBuilderForSearchByUser(
76 $this->getUser()->getId(),
77 $searchTerm,
78 $currentRoute
79 )->getQuery()
80 ->getResult();
81
82 $title = 'Search ' . $searchTerm;
71 } else { 83 } else {
72 $entries = $repository 84 $entries = $repository
73 ->$methodBuilder($this->getUser()->getId()) 85 ->$methodBuilder($this->getUser()->getId())
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index 19045798..0e19a0c2 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -552,7 +552,7 @@ class Entry
552 * 552 *
553 * @return Entry 553 * @return Entry
554 */ 554 */
555 public function setCreatedAt(\DateTime $createdAt) 555 public function setCreatedAt(\DateTimeInterface $createdAt)
556 { 556 {
557 $this->createdAt = $createdAt; 557 $this->createdAt = $createdAt;
558 558
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
index 17070c59..61ad99a8 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
@@ -73,23 +73,22 @@ class EntryFilterType extends AbstractType
73 'label' => 'entry.filters.reading_time.label', 73 'label' => 'entry.filters.reading_time.label',
74 ]) 74 ])
75 ->add('createdAt', DateRangeFilterType::class, [ 75 ->add('createdAt', DateRangeFilterType::class, [
76 'left_date_options' => [ 76 'left_date_options' => [
77 'attr' => [ 77 'attr' => [
78 'placeholder' => 'dd/mm/yyyy', 78 'placeholder' => 'yyyy-mm-dd',
79 ],
80 'format' => 'dd/MM/yyyy',
81 'widget' => 'single_text',
82 ], 79 ],
83 'right_date_options' => [ 80 'format' => 'yyyy-MM-dd',
84 'attr' => [ 81 'widget' => 'single_text',
85 'placeholder' => 'dd/mm/yyyy', 82 ],
86 ], 83 'right_date_options' => [
87 'format' => 'dd/MM/yyyy', 84 'attr' => [
88 'widget' => 'single_text', 85 'placeholder' => 'yyyy-mm-dd',
89 ], 86 ],
90 'label' => 'entry.filters.created_at.label', 87 'format' => 'yyyy-MM-dd',
91 ] 88 'widget' => 'single_text',
92 ) 89 ],
90 'label' => 'entry.filters.created_at.label',
91 ])
93 ->add('domainName', TextFilterType::class, [ 92 ->add('domainName', TextFilterType::class, [
94 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 93 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
95 $value = $values['value']; 94 $value = $values['value'];
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 b747ed84..4182628f 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
@@ -96,16 +96,21 @@
96 {% if tag is defined %} 96 {% if tag is defined %}
97 {% set currentTag = tag %} 97 {% set currentTag = tag %}
98 {% endif %} 98 {% endif %}
99 {% set exportSearchTerm = null %}
100 {% if searchTerm is defined %}
101 {% set exportSearchTerm = searchTerm %}
102 {% endif %}
103 {% set previousRoute = app.request.attributes.get('currentRoute') %}
99 <h2>{{ 'entry.list.export_title'|trans }}</h2> 104 <h2>{{ 'entry.list.export_title'|trans }}</h2>
100 <a href="javascript: void(null);" id="download-form-close" class="close-button--popup close-button">&times;</a> 105 <a href="javascript: void(null);" id="download-form-close" class="close-button--popup close-button">&times;</a>
101 <ul> 106 <ul>
102 {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub', 'tag' : currentTag }) }}">EPUB</a></li>{% endif %} 107 {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">EPUB</a></li>{% endif %}
103 {% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'mobi', 'tag' : currentTag }) }}">MOBI</a></li>{% endif %} 108 {% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'mobi', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">MOBI</a></li>{% endif %}
104 {% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'pdf', 'tag' : currentTag }) }}">PDF</a></li>{% endif %} 109 {% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'pdf', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">PDF</a></li>{% endif %}
105 {% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'json', 'tag' : currentTag }) }}">JSON</a></li>{% endif %} 110 {% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'json', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">JSON</a></li>{% endif %}
106 {% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'csv', 'tag' : currentTag }) }}">CSV</a></li>{% endif %} 111 {% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'csv', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">CSV</a></li>{% endif %}
107 {% if craue_setting('export_txt') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'txt', 'tag' : currentTag }) }}">TXT</a></li>{% endif %} 112 {% if craue_setting('export_txt') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'txt', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">TXT</a></li>{% endif %}
108 {% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'xml', 'tag' : currentTag }) }}">XML</a></li>{% endif %} 113 {% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'xml', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">XML</a></li>{% endif %}
109 </ul> 114 </ul>
110 </aside> 115 </aside>
111 116
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 3906e1e0..0cd00cfd 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
@@ -39,7 +39,7 @@
39 39
40 <ul class="{% if listMode == 1 %}collection{% else %}row data{% endif %}"> 40 <ul class="{% if listMode == 1 %}collection{% else %}row data{% endif %}">
41 {% for entry in entries %} 41 {% for entry in entries %}
42 <li id="entry-{{ entry.id|e }}" class="col {% if listMode == 0 %}l3 m6{% else %}collection-item{% endif %} s12"> 42 <li id="entry-{{ entry.id|e }}" class="entry col {% if listMode == 0 %}l3 m6{% else %}collection-item{% endif %} s12">
43 {% if listMode == 1 %} 43 {% if listMode == 1 %}
44 {% include "@WallabagCore/themes/material/Entry/_card_list.html.twig" with {'entry': entry} only %} 44 {% include "@WallabagCore/themes/material/Entry/_card_list.html.twig" with {'entry': entry} only %}
45 {% elseif not entry.previewPicture is null and entry.mimetype starts with 'image/' %} 45 {% elseif not entry.previewPicture is null and entry.mimetype starts with 'image/' %}
@@ -63,15 +63,20 @@
63 {% if tag is defined %} 63 {% if tag is defined %}
64 {% set currentTag = tag.slug %} 64 {% set currentTag = tag.slug %}
65 {% endif %} 65 {% endif %}
66 {% set exportSearchTerm = null %}
67 {% if searchTerm is defined %}
68 {% set exportSearchTerm = searchTerm %}
69 {% endif %}
70 {% set previousRoute = app.request.attributes.get('currentRoute') %}
66 <h4 class="center">{{ 'entry.list.export_title'|trans }}</h4> 71 <h4 class="center">{{ 'entry.list.export_title'|trans }}</h4>
67 <ul> 72 <ul>
68 {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub', 'tag' : currentTag }) }}">EPUB</a></li>{% endif %} 73 {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">EPUB</a></li>{% endif %}
69 {% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'mobi', 'tag' : currentTag }) }}">MOBI</a></li>{% endif %} 74 {% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'mobi', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">MOBI</a></li>{% endif %}
70 {% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'pdf', 'tag' : currentTag }) }}">PDF</a></li>{% endif %} 75 {% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'pdf', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">PDF</a></li>{% endif %}
71 {% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'json', 'tag' : currentTag }) }}">JSON</a></li>{% endif %} 76 {% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'json', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">JSON</a></li>{% endif %}
72 {% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'csv', 'tag' : currentTag }) }}">CSV</a></li>{% endif %} 77 {% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'csv', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">CSV</a></li>{% endif %}
73 {% if craue_setting('export_txt') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'txt', 'tag' : currentTag }) }}">TXT</a></li>{% endif %} 78 {% if craue_setting('export_txt') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'txt', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">TXT</a></li>{% endif %}
74 {% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'xml', 'tag' : currentTag }) }}">XML</a></li>{% endif %} 79 {% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'xml', 'tag' : currentTag, 'search_entry[term]' : exportSearchTerm, 'currentRoute' : previousRoute }) }}">XML</a></li>{% endif %}
75 </ul> 80 </ul>
76 </div> 81 </div>
77 82