diff roundup/cgi/templating.py @ 5991:b0940ad50f43

issue2551075 Update jinja template to bootstrap 4. Updated to 4.1.3 (current boostrap version 4.4.1). The pull request has been around for a while. (Patch: Paul Spooner; templates merged by Christof Meerwald; other merged by John Rouillard)
author John Rouillard <rouilj@ieee.org>
date Fri, 20 Dec 2019 20:47:19 -0500
parents 39b8bc511ed7
children b4b5b7afacd9
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Mon Dec 16 21:45:37 2019 -0500
+++ b/roundup/cgi/templating.py	Fri Dec 20 20:47:19 2019 -0500
@@ -795,9 +795,12 @@
                (help_url, onclick, self.cgi_escape_attrs(**html_kwargs),
                 self._(label))
 
-    def submit(self, label=''"Submit New Entry", action="new"):
+    def submit(self, label=''"Submit New Entry", action="new", html_kwargs={}):
         """ Generate a submit button (and action hidden element)
 
+            "html_kwargs" specified additional html args for the
+            generated html <select>
+
         Generate nothing if we're not editable.
         """
         if not self.is_edit_ok():
@@ -805,7 +808,7 @@
 
         return \
             self.input(type="submit", name="submit_button",
-                              value=self._(label)) + \
+                              value=self._(label), **html_kwargs) + \
             '\n' + \
             self.input(type="hidden", name="@csrf",
                               value=anti_csrf_nonce(self._client)) + \
@@ -940,14 +943,17 @@
         """Is this item retired?"""
         return self._klass.is_retired(self._nodeid)
 
-    def submit(self, label=''"Submit Changes", action="edit"):
+    def submit(self, label=''"Submit Changes", action="edit", html_kwargs={}):
         """Generate a submit button.
 
+            "html_kwargs" specified additional html args for the
+            generated html <select>
+
         Also sneak in the lastactivity and action hidden elements.
         """
         return \
             self.input(type="submit", name="submit_button",
-                       value=self._(label)) + \
+                       value=self._(label), **html_kwargs) + \
             '\n' + \
             self.input(type="hidden", name="@lastactivity",
                        value=self.activity.local(0)) + \

Roundup Issue Tracker: http://roundup-tracker.org/