Browse Source

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.
main
discomrade 2 years ago
parent
commit
5b74355046
  1. 3
      inc/config.php
  2. 2
      js/thread-watcher.js
  3. 6
      templates/index.html
  4. 8
      templates/post_form_collapsed.html
  5. 9
      templates/themes/catalog/catalog.html

3
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.');

2
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(
$('<div id="watchlist">'+
'<div class="watchlist-controls">'+
'<span><a id="clearList">['+_('Clear List')+']</a></span>&nbsp'+

6
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 %}

8
templates/post_form_collapsed.html

@ -0,0 +1,8 @@
<details id="post-form-details">
<summary style="list-style: none">
<center><h2><a style="text-decoration: none;">[ {% trans 'Create new thread' %} ] </a></h2></center>
</summary>
<div style="margin: 1em 0;">
{% include 'post_form.html' %}
</div>
</details>

9
templates/themes/catalog/catalog.html

@ -18,14 +18,7 @@
</header>
{% if not no_post_form %}
<details id="post-form-details">
<summary style="list-style: none">
<center><h2>[ <a>{% trans 'Create new thread' %}</a> ]</h2></center>
</summary>
<div style="margin: 1em 0;">
{% include 'post_form.html' %}
</div>
</details>
{% include 'post_form_collapsed.html' %}
{% endif %}
{% if config.announcements.show %}<table class="announcements" id="announcements"></table>{% endif %}

Loading…
Cancel
Save