From 2cda8b0b7e78c5a2eca6a8845859a560c450e070 Mon Sep 17 00:00:00 2001 From: nonmakina Date: Mon, 28 Dec 2020 14:21:56 -0600 Subject: [PATCH 1/3] Fixes the sidebar so that it doesn't use iframes. --- templates/themes/categories/frames.html | 62 ++++++++++++++++++++++-- templates/themes/categories/news.html | 30 +++++------- templates/themes/categories/sidebar.html | 22 ++------- 3 files changed, 71 insertions(+), 43 deletions(-) diff --git a/templates/themes/categories/frames.html b/templates/themes/categories/frames.html index 25de9841..e35264c5 100644 --- a/templates/themes/categories/frames.html +++ b/templates/themes/categories/frames.html @@ -6,14 +6,66 @@ {{ settings.title }} - - + {{ include(settings.file_sidebar) }} + {{ include(settings.file_news) }} diff --git a/templates/themes/categories/news.html b/templates/themes/categories/news.html index dc6387c5..e0c1e4a6 100644 --- a/templates/themes/categories/news.html +++ b/templates/themes/categories/news.html @@ -1,18 +1,11 @@ {% filter remove_whitespace %} - - - - - {{ settings.title }} - - - - {{ boardlist.top }} +{{ boardlist.top }} +

{{ settings.title }}

{{ settings.subtitle }}
- +
{% if not news %}

{% trans %}(No news to show.){% endtrans %}

@@ -30,13 +23,12 @@ {% endfor %} {% endif %}
- -
-

- Tinyboard + - vichan {{ config.version }} - -
Tinyboard Copyright © 2010-2014 Tinyboard Development Group -
vichan Copyright © 2012-2016 vichan-devel

-
- - + +
+

- Tinyboard + + vichan {{ config.version }} - +
Tinyboard Copyright © 2010-2014 Tinyboard Development Group +
vichan Copyright © 2012-2016 vichan-devel

+
+
{% endfilter %} diff --git a/templates/themes/categories/sidebar.html b/templates/themes/categories/sidebar.html index 83199f8c..7552dd91 100644 --- a/templates/themes/categories/sidebar.html +++ b/templates/themes/categories/sidebar.html @@ -1,21 +1,5 @@ {% filter remove_whitespace %} - - - - - - {{ settings.title }} - - - - - + + {% endfilter %} From b3fd39a71216ef2b8cf3d17210b0858a94c9a736 Mon Sep 17 00:00:00 2001 From: towards-a-new-leftypol Date: Mon, 28 Dec 2020 22:44:51 -0500 Subject: [PATCH 2/3] fix categories array in categories theme --- templates/themes/categories/frames.html | 4 ++-- templates/themes/categories/theme.php | 29 +++++++++++++++++-------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/templates/themes/categories/frames.html b/templates/themes/categories/frames.html index e35264c5..4eee505a 100644 --- a/templates/themes/categories/frames.html +++ b/templates/themes/categories/frames.html @@ -65,7 +65,7 @@ {{ settings.title }} - {{ include(settings.file_sidebar) }} - {{ include(settings.file_news) }} + {% include 'themes/categories/' ~ settings.file_sidebar %} + {% include 'themes/categories/' ~ settings.file_news %} diff --git a/templates/themes/categories/theme.php b/templates/themes/categories/theme.php index 1ccfe451..3731badb 100644 --- a/templates/themes/categories/theme.php +++ b/templates/themes/categories/theme.php @@ -28,8 +28,15 @@ // Build homepage public static function homepage($settings) { global $config; - - return Element('themes/categories/frames.html', Array('config' => $config, 'settings' => $settings)); + + return Element( + 'themes/categories/frames.html', + Array( + 'config' => $config, + 'settings' => $settings, + 'categories' => Categories::getCategories($config) + ) + ); } // Build news page @@ -51,6 +58,14 @@ public static function sidebar($settings) { global $config, $board; + return Element('themes/categories/sidebar.html', Array( + 'settings' => $settings, + 'config' => $config, + 'categories' => Categories::getCategories($config) + )); + } + + private static function getCategories($config) { $categories = $config['categories']; foreach ($categories as &$boards) { @@ -61,13 +76,9 @@ $board = Array('title' => $title, 'uri' => sprintf($config['board_path'], $board)); } } - - return Element('themes/categories/sidebar.html', Array( - 'settings' => $settings, - 'config' => $config, - 'categories' => $categories - )); - } + + return $categories; + } }; ?> From 9543883f9f5f5228baa3306503d82c80ea0e980e Mon Sep 17 00:00:00 2001 From: nonmakina Date: Tue, 29 Dec 2020 02:44:47 -0600 Subject: [PATCH 3/3] Adds boardlist to homepage creation (top bar). Standardizes tabs or spaces in some files. Adds css rules for better mobile experience. --- templates/themes/categories/frames.html | 39 +++++++++++++++---------- templates/themes/categories/theme.php | 26 +++++++++-------- 2 files changed, 38 insertions(+), 27 deletions(-) diff --git a/templates/themes/categories/frames.html b/templates/themes/categories/frames.html index 4eee505a..4659e360 100644 --- a/templates/themes/categories/frames.html +++ b/templates/themes/categories/frames.html @@ -4,8 +4,8 @@ - - - {{ settings.title }} + @media (max-width:768px) { + .sidebar { + width: 80vw; + border: none; + } + .main { + flex-direction: column; + align-items: center; + } + + .boardlist { + display: none; + } + + footer { + display: none; + } + } + + {{ settings.title }} - {% include 'themes/categories/' ~ settings.file_sidebar %} - {% include 'themes/categories/' ~ settings.file_news %} + {% include 'themes/categories/' ~ settings.file_sidebar %} + {% include 'themes/categories/' ~ settings.file_news %} diff --git a/templates/themes/categories/theme.php b/templates/themes/categories/theme.php index 3731badb..14072bcc 100644 --- a/templates/themes/categories/theme.php +++ b/templates/themes/categories/theme.php @@ -29,14 +29,16 @@ public static function homepage($settings) { global $config; - return Element( - 'themes/categories/frames.html', - Array( - 'config' => $config, - 'settings' => $settings, - 'categories' => Categories::getCategories($config) - ) - ); + return Element( + 'themes/categories/frames.html', + Array( + 'config' => $config, + 'settings' => $settings, + 'categories' => Categories::getCategories($config), + 'boardlist' => createBoardlist(false) + + ) + ); } // Build news page @@ -50,7 +52,7 @@ 'settings' => $settings, 'config' => $config, 'news' => $news, - 'boardlist' => createBoardlist(false) + 'boardlist' => createBoardlist(false) )); } @@ -65,7 +67,7 @@ )); } - private static function getCategories($config) { + private static function getCategories($config) { $categories = $config['categories']; foreach ($categories as &$boards) { @@ -77,8 +79,8 @@ } } - return $categories; - } + return $categories; + } }; ?>