From aa21f4cc6d487e2f27a7beb32ece188853ead1ea Mon Sep 17 00:00:00 2001 From: Dedushka Date: Mon, 18 Jan 2021 17:30:21 -0500 Subject: [PATCH] Allow posting from catalog. Addresses #134. The catalog template has been modified to use the board array, which is expected by the post form template. Because the overboard is a "virtual board", we created a "fake" overboard array to supply necessary information to the modified template. Javascript was also added to hide form on first visit. --- js/catalog.js | 5 +++++ templates/themes/catalog/catalog.html | 25 +++++++++++++++---------- templates/themes/catalog/theme.php | 27 +++++++++++++++++++++------ 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/js/catalog.js b/js/catalog.js index 9adaeaef..a6c5fb2a 100644 --- a/js/catalog.js +++ b/js/catalog.js @@ -45,4 +45,9 @@ if (active_page == 'catalog') $(function(){ $(this).css('width', 'auto'); } }); + + $('#post-form-opener').on('click', function(e) { + $('#post-form-container').css('display', 'unset'); + $('#post-form-opener').css('display', 'none'); + }); }); diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index e39debee..cfee935f 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -6,9 +6,9 @@ - {{ settings.title }} ( /{{ board }}/ ) + {{ settings.title }} ( /{{ board.title|e }}/ ) {% include 'header.html' %} @@ -16,10 +16,15 @@ {{ boardlist.top }}
-

{{ settings.title }} (/{{ board }}/)

+

{{ settings.title }} (/{{ board.title|e }}/)

{{ settings.subtitle }}
- + {% if not no_post_form %} +
[ {% trans 'Create new thread' %} ]
+ + {% endif %}