Browse Source

add search results RSS feed support

main
ghost 1 year ago
parent
commit
3a14f29b38
  1. 10
      src/Controller/TorrentController.php
  2. 11
      templates/default/torrent/list.html.twig
  3. 4
      translations/messages+intl-icu.cs.xlf
  4. 4
      translations/messages+intl-icu.de.xlf
  5. 4
      translations/messages+intl-icu.en.xlf
  6. 4
      translations/messages+intl-icu.eo.xlf
  7. 4
      translations/messages+intl-icu.es.xlf
  8. 4
      translations/messages+intl-icu.fr.xlf
  9. 4
      translations/messages+intl-icu.he.xlf
  10. 4
      translations/messages+intl-icu.it.xlf
  11. 4
      translations/messages+intl-icu.ka.xlf
  12. 4
      translations/messages+intl-icu.lv.xlf
  13. 4
      translations/messages+intl-icu.pl.xlf
  14. 4
      translations/messages+intl-icu.pt.xlf
  15. 4
      translations/messages+intl-icu.ru.xlf
  16. 6
      translations/messages+intl-icu.uk.xlf

10
src/Controller/TorrentController.php

@ -552,9 +552,13 @@ class TorrentController extends AbstractController
$activityService $activityService
); );
// Init request
$query = $request->get('query') ? explode(' ', urldecode($request->get('query'))) : [];
$page = $request->get('page') ? (int) $request->get('page') : 1;
// Get total torrents // Get total torrents
$total = $torrentService->findTorrentsTotal( $total = $torrentService->findTorrentsTotal(
[], $query,
$user->getLocales(), $user->getLocales(),
!$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all
!$user->isModerator() ? true : null // show approved content only for regular users !$user->isModerator() ? true : null // show approved content only for regular users
@ -563,12 +567,12 @@ class TorrentController extends AbstractController
// Create torrents list // Create torrents list
$torrents = []; $torrents = [];
foreach ($torrentService->findTorrents( foreach ($torrentService->findTorrents(
[], $query,
$user->getLocales(), $user->getLocales(),
!$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all !$user->isModerator() && $user->isSensitive() ? false : null, // hide on sensitive mode enabled or show all
!$user->isModerator() ? true : null, // show approved content only for regular users !$user->isModerator() ? true : null, // show approved content only for regular users
$this->getParameter('app.pagination'), $this->getParameter('app.pagination'),
0 ($page - 1) * $this->getParameter('app.pagination')
) as $torrent) ) as $torrent)
{ {
// Read file // Read file

11
templates/default/torrent/list.html.twig

@ -2,6 +2,16 @@
{% block title %}{% if query %}{{ query }} - {{ 'Search' | trans }} - {% endif %}{{ name }}{% endblock %} {% block title %}{% if query %}{{ query }} - {{ 'Search' | trans }} - {% endif %}{{ name }}{% endblock %}
{% block main_content %} {% block main_content %}
<div class="text-right"> <div class="text-right">
{% if query %}
<h2>{{ 'Search results' | trans }}</h2>
<sub>
<a class="text-color-night margin-x-4-px" href="{{ path('rss_torrents_recent', { query : query | url_encode(true) }) }}" title="RSS">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm1.5 2.5c5.523 0 10 4.477 10 10a1 1 0 1 1-2 0 8 8 0 0 0-8-8 1 1 0 0 1 0-2zm0 4a6 6 0 0 1 6 6 1 1 0 1 1-2 0 4 4 0 0 0-4-4 1 1 0 0 1 0-2zm.5 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"/>
</svg>
</a>
</sub>
{% else %}
<h2>{{ 'Recent uploads' | trans }}</h2> <h2>{{ 'Recent uploads' | trans }}</h2>
<sub> <sub>
<a class="text-color-night margin-x-4-px" href="{{ path('rss_torrents_recent') }}" title="RSS"> <a class="text-color-night margin-x-4-px" href="{{ path('rss_torrents_recent') }}" title="RSS">
@ -10,6 +20,7 @@
</svg> </svg>
</a> </a>
</sub> </sub>
{% endif %}
</div> </div>
{% if torrents %} {% if torrents %}
{% for torrent in torrents %} {% for torrent in torrents %}

4
translations/messages+intl-icu.cs.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> seconds ago</target> <target> seconds ago</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Search results</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

4
translations/messages+intl-icu.de.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> seconds ago</target> <target> seconds ago</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Search results</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

4
translations/messages+intl-icu.en.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> seconds ago</target> <target> seconds ago</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Search results</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

4
translations/messages+intl-icu.eo.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> seconds ago</target> <target> seconds ago</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Search results</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

4
translations/messages+intl-icu.es.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> seconds ago</target> <target> seconds ago</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Search results</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

4
translations/messages+intl-icu.fr.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> seconds ago</target> <target> seconds ago</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Search results</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

4
translations/messages+intl-icu.he.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> seconds ago</target> <target> seconds ago</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Search results</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

4
translations/messages+intl-icu.it.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> seconds ago</target> <target> seconds ago</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Search results</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

4
translations/messages+intl-icu.ka.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> seconds ago</target> <target> seconds ago</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Search results</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

4
translations/messages+intl-icu.lv.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> seconds ago</target> <target> seconds ago</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Search results</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

4
translations/messages+intl-icu.pl.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> seconds ago</target> <target> seconds ago</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Search results</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

4
translations/messages+intl-icu.pt.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> seconds ago</target> <target> seconds ago</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Search results</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

4
translations/messages+intl-icu.ru.xlf

@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> секунд назад</target> <target> секунд назад</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Результаты поиска</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

6
translations/messages+intl-icu.uk.xlf

@ -7,7 +7,7 @@
<body> <body>
<trans-unit id="NSECGi6" resname="File not found"> <trans-unit id="NSECGi6" resname="File not found">
<source>File not found</source> <source>File not found</source>
<target>Файл не знайдений</target> <target>Файл не знайдено</target>
</trans-unit> </trans-unit>
<trans-unit id="awzJBNC" resname="Users"> <trans-unit id="awzJBNC" resname="Users">
<source>Users</source> <source>Users</source>
@ -717,6 +717,10 @@
<source> seconds ago</source> <source> seconds ago</source>
<target> секунд тому</target> <target> секунд тому</target>
</trans-unit> </trans-unit>
<trans-unit id="6XiwDeR" resname="Search results">
<source>Search results</source>
<target>Результати пошуку</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

Loading…
Cancel
Save