From 4e6dd1df7a6a864009d7fc0023a340fceeb506b8 Mon Sep 17 00:00:00 2001 From: metalune Date: Sun, 18 Jul 2021 00:10:24 +0200 Subject: [PATCH] Use Grid for displaying results --- static/style.css | 20 +++++++- templates/accounts/video_channels.html | 30 ++++++------ templates/accounts/videos.html | 31 ++++++------ templates/instance/local.html | 37 +++++++------- templates/instance/most-liked.html | 37 +++++++------- templates/instance/recently-added.html | 38 +++++++-------- templates/instance/trending.html | 37 +++++++------- templates/search_results.html | 48 +++++++++---------- templates/simpleer_search_results.html | 33 +++++++------ templates/video_channels/base.html | 1 + templates/video_channels/video_playlists.html | 26 +++++----- templates/video_channels/videos.html | 30 +++++------- 12 files changed, 188 insertions(+), 180 deletions(-) mode change 100755 => 100644 static/style.css diff --git a/static/style.css b/static/style.css old mode 100755 new mode 100644 index 7de390f..db80e05 --- a/static/style.css +++ b/static/style.css @@ -1,10 +1,28 @@ body { - max-width: 800px; + max-width: 1200px; margin: 10px auto; padding-left: 5px; padding-right: 5px; } +/* search results related */ + +#wrap { + display: flex; + flex-wrap: wrap; +} + +.result-wrapper { + width: 300px; + margin: 10px; +} + +.result-info { + display: block; +} + +/* end of search results related */ + .tag { background-color: lightgray; padding: 3px 7px; diff --git a/templates/accounts/video_channels.html b/templates/accounts/video_channels.html index 74280a8..33f37c3 100644 --- a/templates/accounts/video_channels.html +++ b/templates/accounts/video_channels.html @@ -8,21 +8,21 @@

- -{% for channel in video_channels.data %} - - - - -{% endfor %} -
+ +
+ {% for channel in video_channels.data %} +
-
- - {{ channel.displayName }} - -
- {{ channel.followersCount }} Followers -
+ +
+ + {{ channel.displayName }} + +
+ {{ channel.followersCount }} Followers +
+ + {% endfor %} + {% endblock %} diff --git a/templates/accounts/videos.html b/templates/accounts/videos.html index c006573..4d60f62 100644 --- a/templates/accounts/videos.html +++ b/templates/accounts/videos.html @@ -8,24 +8,23 @@

- -{% for video in videos.data %} - - - - -{% endfor %} -
+
+ {% for video in videos.data %} +
-
- {{ video.name }} -
- {{ video.views }} Views -
- {{ video.channel.displayName }} - -
+ +
+ {{ video.name }} +
+ {{ video.views }} Views +
+ {{ video.channel.displayName }} + +
+ + {% endfor %} + {% endblock %} diff --git a/templates/instance/local.html b/templates/instance/local.html index 1a1cf1c..46838a1 100644 --- a/templates/instance/local.html +++ b/templates/instance/local.html @@ -4,27 +4,26 @@ {% block content %} - +
{% for video in videos.data %} -
- - - + +
+ {{ video.name }} +
+ {{ video.views }} Views +
+ + {{ video.channel.displayName }} + +
+ + {{ video.account.name }}@{{ video.account.host }} + +
+ {% endfor %} -
+
-
- {{ video.name }} -
- {{ video.views }} Views -
- - {{ video.channel.displayName }} - -
- - {{ video.account.name }}@{{ video.account.host }} - -
+ {% endblock %} diff --git a/templates/instance/most-liked.html b/templates/instance/most-liked.html index 24ed768..01bf0fd 100644 --- a/templates/instance/most-liked.html +++ b/templates/instance/most-liked.html @@ -4,27 +4,26 @@ {% block content %} - +
{% for video in videos.data %} -
- - - + +
+ {{ video.name }} +
+ {{ video.views }} Views +
+ + {{ video.channel.displayName }} + +
+ + {{ video.account.name }}@{{ video.account.host }} + +
+ {% endfor %} -
+
-
- {{ video.name }} -
- {{ video.views }} Views -
- - {{ video.channel.displayName }} - -
- - {{ video.account.name }}@{{ video.account.host }} - -
+ {% endblock %} diff --git a/templates/instance/recently-added.html b/templates/instance/recently-added.html index 114a530..8838f2a 100644 --- a/templates/instance/recently-added.html +++ b/templates/instance/recently-added.html @@ -4,27 +4,27 @@ {% block content %} - +
{% for video in videos.data %} -
- - - + +
+ {{ video.name }} +
+ {{ video.views }} Views +
+ + {{ video.channel.displayName }} + +
+ + {{ video.account.name }}@{{ video.account.host }} + +
+ + {% endfor %} -
+
-
- {{ video.name }} -
- {{ video.views }} Views -
- - {{ video.channel.displayName }} - -
- - {{ video.account.name }}@{{ video.account.host }} - -
+ {% endblock %} diff --git a/templates/instance/trending.html b/templates/instance/trending.html index e53fd5b..195257d 100644 --- a/templates/instance/trending.html +++ b/templates/instance/trending.html @@ -4,27 +4,26 @@ {% block content %} - +
{% for video in videos.data %} -
- - - + +
+ {{ video.name }} +
+ {{ video.views }} Views +
+ + {{ video.channel.displayName }} + +
+ + {{ video.account.name }}@{{ video.account.host }} + +
+ {% endfor %} -
+
-
- {{ video.name }} -
- {{ video.views }} Views -
- - {{ video.channel.displayName }} - -
- - {{ video.account.name }}@{{ video.account.host }} - -
+ {% endblock %} diff --git a/templates/search_results.html b/templates/search_results.html index 47be236..1041822 100644 --- a/templates/search_results.html +++ b/templates/search_results.html @@ -5,28 +5,28 @@ {% block content %}

{{ results.total }} results

- -{% for result in results.data %} - - - - -{% endfor %} -
- - - - - {{ result.name }} -
- {{ result.views }} Views -
- - {{ result.channel.displayName }} - -
- - {{ result.account.name }}@{{ result.account.host }} - -
+
+ {% for result in results.data %} + + {% endfor %} +
+ {% endblock %} diff --git a/templates/simpleer_search_results.html b/templates/simpleer_search_results.html index 8fb2eab..2aafbed 100644 --- a/templates/simpleer_search_results.html +++ b/templates/simpleer_search_results.html @@ -30,24 +30,23 @@
{{ results.total }} Results - - {% for result in results.data %} - - - - - {% endfor %} -
- - - - {{ result.name }} - -
- {{ result.views }} Views -
-
+
+ {% for result in results.data %} +
+ +
+ {{ result.name }} +
+ {% if result.views == 1%} + 1 View + {% else %} + {{ result.views }} Views + {% endif %} +
+
+ {% endfor %} +
{% if pages_total > 1 %} {% if page > 1 %} diff --git a/templates/video_channels/base.html b/templates/video_channels/base.html index 1e884f8..906c2b4 100644 --- a/templates/video_channels/base.html +++ b/templates/video_channels/base.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% block head_content %} +
diff --git a/templates/video_channels/video_playlists.html b/templates/video_channels/video_playlists.html index c31da4e..fb304f7 100644 --- a/templates/video_channels/video_playlists.html +++ b/templates/video_channels/video_playlists.html @@ -8,20 +8,18 @@

- -{% for playlist in video_playlists.data %} - - - - - -{% endfor %} -
+
+ {% for playlist in video_playlists.data %} +
-
- {{ playlist.displayName }} -
- {{ playlist.videosLength }} Videos -
+ +
+ {{ playlist.displayName }} +
+ {{ playlist.videosLength }} Videos +
+ + {% endfor %} + {% endblock %} diff --git a/templates/video_channels/videos.html b/templates/video_channels/videos.html index 93dae01..fc0c31e 100644 --- a/templates/video_channels/videos.html +++ b/templates/video_channels/videos.html @@ -8,25 +8,21 @@

- -{% for video in videos.data %} - - - - -{% endfor %} -
+
+ {% for video in videos.data %} +
- {{ video.name }} -
- {{ video.views }} Views -
- {{ video.channel.displayName }} - -
+
+ {{ video.name }} +
+ {{ video.views }} Views + +
+ + {% endfor %} + {% endblock %}