From 63dfeb9d4c0b166f6a4235a4cfc3aa095d40ea12 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 12 Oct 2023 04:30:43 +0300 Subject: [PATCH] update torrent page --- public/asset/default/css/common.css | 6 +- src/Controller/TorrentController.php | 16 ++---- src/Controller/UserController.php | 2 +- templates/default/torrent/info.html.twig | 65 +++++++++++++--------- templates/default/torrent/submit.html.twig | 53 ++++++++---------- templates/default/user/settings.html.twig | 9 ++- 6 files changed, 79 insertions(+), 72 deletions(-) diff --git a/public/asset/default/css/common.css b/public/asset/default/css/common.css index ab8b9d6..71856f1 100644 --- a/public/asset/default/css/common.css +++ b/public/asset/default/css/common.css @@ -59,6 +59,10 @@ textarea { opacity: .96; } +input[type="file"] { + padding: 4px 8px; +} + /* main input, main button, @@ -121,4 +125,4 @@ header a.logo { header a.logo > span { color: #96d9a1; -} +} \ No newline at end of file diff --git a/src/Controller/TorrentController.php b/src/Controller/TorrentController.php index 848b595..8373b16 100644 --- a/src/Controller/TorrentController.php +++ b/src/Controller/TorrentController.php @@ -96,6 +96,7 @@ class TorrentController extends AbstractController 'torrent' => [ 'id' => $torrent->getId(), + 'md5file' => $torrent->getMd5File(), 'added' => $torrent->getAdded(), /* 'user' => @@ -227,29 +228,22 @@ class TorrentController extends AbstractController [ 'locales' => [ - 'error' => [], + 'error' => [], 'attribute' => [ - 'value' => $request->get('locales') ? $request->get('locales') : [$request->get('_locale')], - 'placeholder' => $translator->trans('Content language') + 'value' => $request->get('locales') ? $request->get('locales') : [$request->get('_locale')], ] ], 'torrent' => [ - 'error' => [], - 'attribute' => - [ - 'value' => null, // is local file, there is no values passed - 'placeholder' => $translator->trans('Select torrent file') - ] + 'error' => [], ], 'sensitive' => [ 'error' => [], 'attribute' => [ - 'value' => $request->get('sensitive'), - 'placeholder' => $translator->trans('Apply sensitive filters to publication'), + 'value' => $request->get('sensitive'), ] ] ]; diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index a4a81ad..7e56711 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -67,7 +67,7 @@ class UserController extends AbstractController return $this->render( 'default/user/dashboard.html.twig', [ - 'activities' => $activityService->findLastActivities( + 'activities' => $activityService->findLastActivities( // @TODO locale/sensitive filters $user->getEvents(), $this->getParameter('app.pagination'), ($page - 1) * $this->getParameter('app.pagination') diff --git a/templates/default/torrent/info.html.twig b/templates/default/torrent/info.html.twig index 1a25401..8b213a5 100644 --- a/templates/default/torrent/info.html.twig +++ b/templates/default/torrent/info.html.twig @@ -20,12 +20,13 @@ {% endmacro %} {% from _self import recursive_file_tree %} {% extends 'default/layout.html.twig' %} -{% block title %}{{ 'Torrent' | trans }} #{{ torrent.id }}{% if pagination.page > 1 %} - {{ 'Page' | trans }} {{ pagination.page }}{% endif %} - {{ name }}{% endblock %} +{% block title %}{{ file.name }} - {{ 'Torrent' | trans }} #{{ torrent.id }}{% if pagination.page > 1 %} - {{ 'Page' | trans }} {{ pagination.page }}{% endif %} - {{ name }}{% endblock %} {% block main_content %}

- {{ 'Torrent'|trans }} #{{ torrent.id }} + {{ file.name }} + {#{{ 'Torrent' | trans }} #{{ torrent.id }}#}

@@ -86,16 +87,50 @@
- {% if file.name %} + + + + + + + + + {% if file.hash.v1 %} {% endif %} + {% if file.hash.v2 %} + + + + + {% endif %} + + + + {% if file.created %} {% endif %} - {% if file.hash.v1 %} - - - - - {% endif %} - {% if file.hash.v2 %} - - - - - {% endif %} {% if file.source %} @@ -92,12 +92,15 @@ {{ 'Events' | trans }} + + + {% for group, event in events %} - -
+ {{ 'ID'|trans }} + + #{{ torrent.id }} +
+ {{ 'MD5'|trans }} + + {{ torrent.md5file }} +
- {{ 'Filename'|trans }} + {{ 'Info hash v1'|trans }} - {{ file.name }} + {{ file.hash.v1 }}
+ {{ 'Info hash v2'|trans }} + + {{ file.hash.v2 }} +
+ {{ 'Filename'|trans }} + + {{ file.name }} +
@@ -127,26 +162,6 @@
- {{ 'Info hash v1'|trans }} - - {{ file.hash.v1 }} -
- {{ 'Info hash v2'|trans }} - - {{ file.hash.v2 }} -
diff --git a/templates/default/torrent/submit.html.twig b/templates/default/torrent/submit.html.twig index 81fe358..061411e 100644 --- a/templates/default/torrent/submit.html.twig +++ b/templates/default/torrent/submit.html.twig @@ -1,32 +1,25 @@ {% extends 'default/layout.html.twig' %} -{% block title %}{{'Submit torrent'|trans }} - {{ name }}{% endblock %} +{% block title %}{{'Submit torrent' | trans }} - {{ name }}{% endblock %} {% block main_content %}
-
-

{{'Submit torrent'|trans }}

+
+

{{'Submit torrent' | trans }}

- - - - - - {% for error in form.torrent.error %}
{{ error }}
{% endfor %} - +
+
- + @@ -37,32 +30,30 @@
{% endfor %}
- {% else %} - + {% endif %} - {% endfor %} - {# - - #} - + +
+ {% endfor %} + {# + {{'Other...'|trans }} + #}
-
+
+
- + diff --git a/templates/default/user/settings.html.twig b/templates/default/user/settings.html.twig index 74b6082..6853ed5 100644 --- a/templates/default/user/settings.html.twig +++ b/templates/default/user/settings.html.twig @@ -51,7 +51,7 @@
- {{ 'Search' | trans }} + {{ 'Filters' | trans }}
+ {{ group }} + {% for key, value in event %} {% if value in user.events %}