From 94b5d27ba54b9af4268bb43c5926994dd8b8e480 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Sun, 1 Jul 2018 04:01:53 +0300 Subject: [PATCH 1/2] Icon added to the column which is sorted by user. --- public/assets/magnetico-web/css/style.css | 2 +- templates/sortable_table_macro.html.twig | 10 ++++++++-- templates/torrent_list.html.twig | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/assets/magnetico-web/css/style.css b/public/assets/magnetico-web/css/style.css index 93e308f..e64a6da 100644 --- a/public/assets/magnetico-web/css/style.css +++ b/public/assets/magnetico-web/css/style.css @@ -1,3 +1,3 @@ #content { margin-top: 80px; -} \ No newline at end of file +} diff --git a/templates/sortable_table_macro.html.twig b/templates/sortable_table_macro.html.twig index eb4ff21..8a9f60d 100644 --- a/templates/sortable_table_macro.html.twig +++ b/templates/sortable_table_macro.html.twig @@ -17,14 +17,20 @@ {% set orderBy = app.request.query.get('order-by') %} {% set order = app.request.query.get('order') %} {% for column, property in columns %} + {% set isCurrent = (property == orderBy) %} {% if property is not null %} {{ column | raw }} + 'order': (order and isCurrent) ? ('asc' == order|lower ? 'desc' : 'asc') : 'asc' + }) }}"> + {% if order and isCurrent %} + + {% endif %} + {% if isCurrent %}{% endif %}{{ column | raw }}{% if isCurrent %}{% endif %} + {% else %} {{ column | raw }} {% endif %} diff --git a/templates/torrent_list.html.twig b/templates/torrent_list.html.twig index e858c80..7a7e13e 100644 --- a/templates/torrent_list.html.twig +++ b/templates/torrent_list.html.twig @@ -5,7 +5,7 @@ {{ pagerfanta(torrents) }} - +
{{ sortable.sortable_columns({ From 7b51940a0ada54af01e8cdd272932d9ac46d1705 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Sun, 1 Jul 2018 04:03:34 +0300 Subject: [PATCH 2/2] Torrents list table id updated. --- templates/torrent_list.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/torrent_list.html.twig b/templates/torrent_list.html.twig index 7a7e13e..1654d4d 100644 --- a/templates/torrent_list.html.twig +++ b/templates/torrent_list.html.twig @@ -5,7 +5,7 @@ {{ pagerfanta(torrents) }} -
+
{{ sortable.sortable_columns({