From a026ae5e6fb6ec04d536ec45347f9168f9bf56d4 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 5 Nov 2023 21:13:33 +0100 Subject: [PATCH 1/8] Hide spinner initially with a class --- app/assets/javascripts/spinnable.js | 9 +++++++-- app/views/admin/articles/index.html.erb | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/spinnable.js b/app/assets/javascripts/spinnable.js index b0d026a0..98527bb3 100644 --- a/app/assets/javascripts/spinnable.js +++ b/app/assets/javascripts/spinnable.js @@ -1,5 +1,10 @@ // Show and hide spinners on Ajax requests. $(document).ready(function(){ - $('form.spinnable').on('ajax:before', function(evt, xhr, status){ $('#spinner').show();}) - $('form.spinnable').on('ajax:complete', function(evt, xhr, status){ $('#spinner').hide();}) + $('#spinner').hide().removeClass("hidden"); + $('form.spinnable').on('ajax:before', function(evt, xhr, status){ + $('#spinner').show(); + }); + $('form.spinnable').on('ajax:complete', function(evt, xhr, status){ + $('#spinner').hide(); + }); }); diff --git a/app/views/admin/articles/index.html.erb b/app/views/admin/articles/index.html.erb index 088fb322..9410e31e 100644 --- a/app/views/admin/articles/index.html.erb +++ b/app/views/admin/articles/index.html.erb @@ -33,7 +33,7 @@
<%= submit_tag(t('.search'), class: 'btn btn-success') %> - +

From 9d0b8c347e7549c1af5bc7a4a72a36e7edf28369 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sun, 5 Nov 2023 21:13:46 +0100 Subject: [PATCH 2/8] Remove superfluous break --- app/views/search_sidebar/_content.html.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/search_sidebar/_content.html.erb b/app/views/search_sidebar/_content.html.erb index e953a451..7f14c806 100644 --- a/app/views/search_sidebar/_content.html.erb +++ b/app/views/search_sidebar/_content.html.erb @@ -7,4 +7,3 @@ <% end %> -
From 68cf5e4bd72259eaed464e0b2f839024429ef1b7 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 11 Nov 2023 11:39:09 +0100 Subject: [PATCH 3/8] Hide optional comment form fields with JavaScript This changes removes inline styles, and makes the comment form show the optional fields when JavaScript is disabled. This is a good thing since otherwise these fields could never be filled in that case. --- app/assets/javascripts/optional_field_toggle.js | 1 + app/views/articles/_comment_form.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/optional_field_toggle.js b/app/assets/javascripts/optional_field_toggle.js index f6b85516..7a43a5f1 100644 --- a/app/assets/javascripts/optional_field_toggle.js +++ b/app/assets/javascripts/optional_field_toggle.js @@ -1,4 +1,5 @@ $(document).ready(function() { + $('.optional_field').hide(); $('.optional-field-toggle').on("click", function(e){ $('.optional_field').fadeToggle(); e.preventDefault(); diff --git a/app/views/articles/_comment_form.html.erb b/app/views/articles/_comment_form.html.erb index 25ad844d..7c1edf6a 100644 --- a/app/views/articles/_comment_form.html.erb +++ b/app/views/articles/_comment_form.html.erb @@ -16,11 +16,11 @@ - +

<%= text_field 'comment', 'url' %> - +

<%= text_field 'comment', 'email' %> From 98ce17b7cbbd05dac8fbeda9942db57d586f9457 Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 11 Nov 2023 11:41:09 +0100 Subject: [PATCH 4/8] Apply tag cloud styling using a class --- app/assets/stylesheets/publify.css.scss | 4 ++++ app/views/tag_sidebar/_content.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/publify.css.scss b/app/assets/stylesheets/publify.css.scss index b7270ecd..2b128f5c 100644 --- a/app/assets/stylesheets/publify.css.scss +++ b/app/assets/stylesheets/publify.css.scss @@ -28,3 +28,7 @@ .admin-tools-reveal:hover .admintools { display: block; } + +.tag-sidebar-tag-cloud { + overflow: hidden; +} diff --git a/app/views/tag_sidebar/_content.html.erb b/app/views/tag_sidebar/_content.html.erb index 987cab51..7b9f7373 100644 --- a/app/views/tag_sidebar/_content.html.erb +++ b/app/views/tag_sidebar/_content.html.erb @@ -1,7 +1,7 @@ <% unless sidebar.tags.blank? %>