From 5d0d97a432ed9c971a9ca4ba9acdca7d3b222d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gon=C3=A7alves?= Date: Sat, 13 Feb 2021 09:56:21 +0100 Subject: [PATCH] Update markup of templates to Bootstrap 5 (#173) * Update markup of all buttons, forms and input elements to Bootstrap 4 * Add documentByLine in the card-header. Add commentBody in the card-body * Update CHANGES.txt * Update @@manage-comments.pt moderation interface with Bootstrap 4 * bs5 form updates * add bootstrap icon from resolver * update bindings for button * update markup for bootstrap 5 * turn configlet portlets into menu * turn configlet portlets into menu (2) * bootstrap b1 changes * major version bump Co-authored-by: Peter Holzer Co-authored-by: Jens W. Klein Co-authored-by: Peter Mathis --- CHANGES.rst | 10 + plone/app/discussion/browser/comments.pt | 243 +++++++++--------- plone/app/discussion/browser/comments.py | 4 +- plone/app/discussion/browser/controlpanel.pt | 8 +- .../browser/javascripts/moderation.js | 6 +- plone/app/discussion/browser/moderation.pt | 129 ++++++---- .../profiles/default/controlpanel.xml | 2 +- setup.py | 2 +- 8 files changed, 217 insertions(+), 187 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 79fe536..09f355b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,16 @@ Changelog .. towncrier release notes start +3.4.4 (2020-10-09) +------------------ + +New features: + + +- Update templates markup to Bootstrap 4. + [andreesg] + + 3.4.3 (2020-09-28) ------------------ diff --git a/plone/app/discussion/browser/comments.pt b/plone/app/discussion/browser/comments.pt index 6635bcc..0c062da 100644 --- a/plone/app/discussion/browser/comments.pt +++ b/plone/app/discussion/browser/comments.pt @@ -17,16 +17,17 @@
- + i18n:translate="label_login_to_add_comments" + >Log in to add comments
@@ -46,131 +47,138 @@ id comment_id" tal:condition="python:canReview or review_state == 'published'"> -
- - - - +
+
+ + + + +
+ +
+ + + Poster Name + + + Anonymous + + says: +
+ 8/23/2001 12:40:44 PM +
+
+
+
-
- - - Poster Name - - - Anonymous - - says: -
- 8/23/2001 12:40:44 PM -
-
+ -
+
+
+ +
+
+ +
- + + + Edit +
+ +
+
-
-
- -
-
- -
- - - Edit -
+ - + +
-
- - - -
- - -
-
+
+
+
-
@@ -185,12 +193,13 @@
-
- +
diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index 68592d3..d8ee95f 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -140,9 +140,9 @@ class CommentForm(extensible.ExtensibleForm, form.Form): def updateActions(self): super(CommentForm, self).updateActions() - self.actions['cancel'].addClass('standalone') + self.actions['cancel'].addClass('btn btn-secondary') self.actions['cancel'].addClass('hide') - self.actions['comment'].addClass('context') + self.actions['comment'].addClass('btn btn-primary') def get_author(self, data): context = aq_inner(self.context) diff --git a/plone/app/discussion/browser/controlpanel.pt b/plone/app/discussion/browser/controlpanel.pt index d525fcb..798c6dc 100644 --- a/plone/app/discussion/browser/controlpanel.pt +++ b/plone/app/discussion/browser/controlpanel.pt @@ -8,7 +8,7 @@
+ metal:fill-slot="prefs_configlet_main">
- - Site Setup - -

View Title

diff --git a/plone/app/discussion/browser/javascripts/moderation.js b/plone/app/discussion/browser/javascripts/moderation.js index f74a2d6..cc6a547 100644 --- a/plone/app/discussion/browser/javascripts/moderation.js +++ b/plone/app/discussion/browser/javascripts/moderation.js @@ -22,7 +22,7 @@ require(["jquery", "pat-registry"], function($, registry) { /********************************************************************** * Delete a single comment. **********************************************************************/ - $("input[name='form.button.moderation.DeleteComment']").click(function(e) { + $("button[name='form.button.moderation.DeleteComment']").click(function(e) { e.preventDefault(); var row = $(this).closest("tr"); var path = row.find("[name='selected_obj_paths:list']").attr("value"); @@ -52,7 +52,7 @@ require(["jquery", "pat-registry"], function($, registry) { /********************************************************************** * Transmit a single comment. **********************************************************************/ - $('input[name="form.button.moderation.TransmitComment"]').click(function( + $('button[name="form.button.moderation.TransmitComment"]').click(function( e ) { e.preventDefault(); @@ -104,7 +104,7 @@ require(["jquery", "pat-registry"], function($, registry) { /********************************************************************** * Bulk actions for comments (delete, publish) **********************************************************************/ - $("input[name='form.button.BulkAction']").click(function(e) { + $("button[name='form.button.BulkAction']").click(function(e) { e.preventDefault(); var form = $(this).closest("form"); var target = $(form).attr("action"); diff --git a/plone/app/discussion/browser/moderation.pt b/plone/app/discussion/browser/moderation.pt index f6a67ca..6fc31d0 100644 --- a/plone/app/discussion/browser/moderation.pt +++ b/plone/app/discussion/browser/moderation.pt @@ -51,7 +51,7 @@
-
- +
+ +
+ +
+ +
+
+ + +
+
+ +
+
+ +
+ + +
+ +
+ + +
+
+
+
+ + +
+
- - - - - - - - - - - - - - + + + + + + + + @@ -202,6 +218,7 @@
-
- - - - - - -
-
- - - -
CommenterDateIn Response ToCommentLast Action
CommenterDateIn Response ToCommentLast Action
-
+
diff --git a/plone/app/discussion/profiles/default/controlpanel.xml b/plone/app/discussion/profiles/default/controlpanel.xml index 91f1500..e5dcbe8 100644 --- a/plone/app/discussion/profiles/default/controlpanel.xml +++ b/plone/app/discussion/profiles/default/controlpanel.xml @@ -11,7 +11,7 @@ appId="plone.app.discussion" category="plone-general" condition_expr="" - icon_expr="string:${portal_url}/discussionitem_icon.png" + icon_expr="string:chat-square-dots" url_expr="string:${portal_url}/@@discussion-controlpanel" visible="True" i18n:attributes="title"> diff --git a/setup.py b/setup.py index d4ea116..04e63aa 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import find_packages from setuptools import setup -version = '3.4.4.dev0' +version = '4.0.0.dev0' install_requires = [ 'setuptools',