From 5b743550468f0747505e7f8d5046c6e765f6e25c Mon Sep 17 00:00:00 2001 From: discomrade Date: Mon, 31 Jan 2022 23:45:07 -0100 Subject: [PATCH] Collapse post form by default on index page. This reduces wasted space as making threads is a relatively rare operation, and dissuades people from mistakenly making a thread instead of a reply. --- inc/config.php | 3 +++ js/thread-watcher.js | 2 +- templates/index.html | 6 +++++- templates/post_form_collapsed.html | 8 ++++++++ templates/themes/catalog/catalog.html | 9 +-------- 5 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 templates/post_form_collapsed.html diff --git a/inc/config.php b/inc/config.php index a595c822..94c411a6 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1023,6 +1023,9 @@ // Show thread subject in page title. $config['thread_subject_in_title'] = false; + + // Collapse the new thread form on the index page until clicked, like the catalog. + $config['index_collapse_post_form'] = true; // Additional lines added to the footer of all pages. $config['footer'][] = _('All trademarks, copyrights, comments, and images on this page are owned by and are the responsibility of their respective parties.'); diff --git a/js/thread-watcher.js b/js/thread-watcher.js index f45b4ced..2cb80a36 100644 --- a/js/thread-watcher.js +++ b/js/thread-watcher.js @@ -41,7 +41,7 @@ watchlist.render = function(reset) { } else { //If the watchlist has not yet been rendered, create it. var menuStyle = getComputedStyle($('.boardlist')[0]); - $((active_page == 'ukko') ? 'hr:first' : (active_page == 'catalog') ? 'body>span:first' : 'form[name="post"]').before( + $('header').after( $('
'+ '
'+ '['+_('Clear List')+'] '+ diff --git a/templates/index.html b/templates/index.html index 46fb2968..bc8c3e6b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -53,7 +53,11 @@ {{ config.ad.top }} {% if not no_post_form %} - {% include 'post_form.html' %} + {% if config.index_collapse_post_form %} + {% include 'post_form_collapsed.html' %} + {% else %} + {% include 'post_form.html' %} + {% endif %} {% else %} {% include 'boardlist.html' %} {% endif %} diff --git a/templates/post_form_collapsed.html b/templates/post_form_collapsed.html new file mode 100644 index 00000000..67891543 --- /dev/null +++ b/templates/post_form_collapsed.html @@ -0,0 +1,8 @@ +
+ +

[ {% trans 'Create new thread' %} ]

+
+
+ {% include 'post_form.html' %} +
+
\ No newline at end of file diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index 1833cf9b..7b5c9d42 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -18,14 +18,7 @@ {% if not no_post_form %} -
- -

[ {% trans 'Create new thread' %} ]

-
-
- {% include 'post_form.html' %} -
-
+ {% include 'post_form_collapsed.html' %} {% endif %} {% if config.announcements.show %}
{% endif %}