#3635 de-table the hooks settings form
Merged 2 years ago by pingou. Opened 2 years ago by ryanlerch.
ryanlerch/pagure detable-hooks-settings  into  master

@@ -71,17 +71,23 @@ 

  </div>

  {% endmacro %}

  

- {% macro render_field_in_row(field, after="", readonly=False) %}

- <tr>

-     <td style="padding-right:2em">{{ field.label }}</td>

-     <td>{{ field(class="form-control", readonly=readonly)|safe }}</td>

- {% if after %} <td>{{ after }}</td>{% endif %}

- {% if field.errors %}

- {% for error in field.errors %}

- <td class="errors">{{ error }}</td>

- {% endfor %}

- {% endif %}

- </tr>

+ {% macro render_field_in_row(field, readonly=False) %}

+   <div class="form-group row">

+     <label class="col-sm-2 col-form-label">{{ field.label }}</label>

+     <div class="col-sm-10">

+         {% if field.type == 'BooleanField' %}

+           {% set cssclass = 'form-check-input mt-2' %}

+         {% else %}

+           {% set cssclass = 'form-control pl-0' %}

+         {% endif %}

+         {{ field(class=cssclass, readonly=readonly)|safe }}

+     </div>

+   </div>

+   {% if field.errors %}

+     {% for error in field.errors %}

+       <div class="alert alert-danger">{{ error }}</div>

+     {% endfor %}

+   {% endif %}

  {% endmacro %}

  

  {% macro render_field_in_cell(field, after="") %}

@@ -20,7 +20,6 @@ 

          plugin=plugin.name) }}" method="post">

    {{ plugin.description | markdown | noJS | safe }}

  

-   <table>

      {% for field in fields %}

        {% if field.id in form_fields_readonly %}

        {{ render_field_in_row(field, readonly=True) }}
@@ -28,7 +27,6 @@ 

        {{ render_field_in_row(field) }}

        {% endif %}

      {% endfor %}

-   </table>

  

    {% if plugin.extra_info %}

    {{ plugin.extra_info | render(repo=repo, username=username) | safe }}

@@ -52,7 +52,7 @@ 

              self.assertIn(

                  '<title>Settings Fedmsg - test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              csrf_token = self.get_csrf(output=output)
@@ -65,7 +65,7 @@ 

              self.assertIn(

                  '<title>Settings Fedmsg - test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -103,7 +103,7 @@ 

              self.assertIn(

                  '<title>Settings Fedmsg - test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -147,7 +147,7 @@ 

              self.assertIn(

                  '<title>Settings Fedmsg - test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active" name="active" '

+                 '<input checked class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -186,7 +186,7 @@ 

              self.assertIn(

                  '<title>Settings Fedmsg - test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output.get_data(as_text=True))

  

              self.assertFalse(os.path.exists(os.path.join(

@@ -39,7 +39,7 @@ 

              self.assertIn(

                  '<title>Settings IRC - test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              csrf_token = output_text.split(
@@ -53,7 +53,7 @@ 

              self.assertIn(

                  '<title>Settings IRC - test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -78,7 +78,7 @@ 

              self.assertIn(

                  '<title>Settings IRC - test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -109,7 +109,7 @@ 

              self.assertIn(

                  '<title>Settings IRC - test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active" name="active" '

+                 '<input checked class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              # TODO: Fix this
@@ -133,7 +133,7 @@ 

              self.assertIn(

                  '<title>Settings IRC - test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(

@@ -44,7 +44,7 @@ 

                  '<label for="mail_to">Mail to</label>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              csrf_token = output_text.split(
@@ -60,7 +60,7 @@ 

              self.assertIn(

                  '<label for="mail_to">Mail to</label>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              data['csrf_token'] = csrf_token
@@ -84,7 +84,7 @@ 

              self.assertIn(

                  '<label for="mail_to">Mail to</label>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -103,16 +103,17 @@ 

                  'Hook activated', output_text)

              if self.get_wtforms_version() >= (2, 2):

                  self.assertIn(

-                     '<input class="form-control" id="mail_to" name="mail_to" '

+                     '<input class="form-check-input mt-2" id="mail_to" name="mail_to" '

                      'required type="text" value=""></td>\n<td class="errors">'

                      'This field is required.</td>', output_text)

              else:

                  self.assertIn(

-                     '<input class="form-control" id="mail_to" name="mail_to" '

-                     'type="text" value=""></td>\n<td class="errors">'

-                     'This field is required.</td>', output_text)

+                     '<div class="col-sm-10">\n        '

+                     '<input class="form-control pl-0" id="mail_to" name="mail_to" '

+                     'type="text" value="">\n    </div>\n  </div>\n      '

+                     '<div class="alert alert-danger">This field is required.</div>', output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active" name="active" '

+                 '<input checked class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -142,7 +143,7 @@ 

              self.assertIn(

                  '<label for="mail_to">Mail to</label>', output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active" name="active" '

+                 '<input checked class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertTrue(os.path.exists(os.path.join(
@@ -167,7 +168,7 @@ 

              self.assertIn(

                  '<label for="mail_to">Mail to</label>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(

@@ -47,7 +47,7 @@ 

                  '<title>Settings Mirroring - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              data = {}
@@ -59,7 +59,7 @@ 

                  '<title>Settings Mirroring - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -94,7 +94,7 @@ 

                  '<title>Settings Mirroring - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -126,15 +126,16 @@ 

                  output_text)

              if self.get_wtforms_version() >= (2, 2):

                  self.assertIn(

-                     '<td><input class="form-control" id="target" name="target" '

+                     '<td><input class="form-check-input mt-2" id="target" name="target" '

                      'required type="text" value="https://host.org/target">'

                      '</td>\n<td class="errors">Invalid input.</td>',

                      output_text)

              else:

                  self.assertIn(

-                     '<td><input class="form-control" id="target" name="target" '

-                     'type="text" value="https://host.org/target"></td>\n'

-                     '<td class="errors">Invalid input.</td>', output_text)

+                     '<div class="col-sm-10">\n        '

+                     '<input class="form-control pl-0" id="target" name="target" '

+                     'type="text" value="https://host.org/target">\n    </div>\n  '

+                     '</div>\n      <div class="alert alert-danger">Invalid input.</div>', output_text)

  

              output = self.app.get('/test/settings/Mirroring', data=data)

              output_text = output.get_data(as_text=True)
@@ -142,7 +143,7 @@ 

                  '<title>Settings Mirroring - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -181,7 +182,7 @@ 

                  '<title>Settings Mirroring - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active" name="active" '

+                 '<input checked class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertTrue(os.path.exists(os.path.join(
@@ -220,7 +221,7 @@ 

                  '<title>Settings Mirroring - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output.get_data(as_text=True))

  

              self.assertFalse(os.path.exists(os.path.join(

@@ -44,14 +44,14 @@ 

                  'Pagure</title>', output_text)

              if self.get_wtforms_version() >= (2, 2):

                  self.assertIn(

-                     '<input class="form-control" id="branches" name="branches" '

+                     '<input class="form-check-input mt-2" id="branches" name="branches" '

                      'required type="text" value=""></td>', output_text)

              else:

                  self.assertIn(

-                     '<input class="form-control" id="branches" name="branches" '

-                     'type="text" value=""></td>', output_text)

+                     '<input class="form-control pl-0" id="branches" name="branches" '

+                     'type="text" value="">', output_text)

              self.assertTrue(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">' in output_text)

  

              csrf_token = output_text.split(
@@ -68,14 +68,14 @@ 

                  'Pagure</title>', output_text)

              if self.get_wtforms_version() >= (2, 2):

                  self.assertIn(

-                     '<input class="form-control" id="branches" name="branches" '

+                     '<input class="form-check-input mt-2" id="branches" name="branches" '

                      'required type="text" value=""></td>', output_text)

              else:

                  self.assertIn(

-                     '<input class="form-control" id="branches" name="branches" '

-                     'type="text" value=""></td>', output_text)

+                     '<input class="form-control pl-0" id="branches" name="branches" '

+                     'type="text" value="">', output_text)

              self.assertTrue(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">' in output_text)

  

              data['csrf_token'] = csrf_token
@@ -102,14 +102,14 @@ 

                  'Pagure</title>', output_text)

              if self.get_wtforms_version() >= (2, 2):

                  self.assertIn(

-                     '<input class="form-control" id="branches" name="branches" '

+                     '<input class="form-check-input mt-2" id="branches" name="branches" '

                      'required type="text" value=""></td>', output_text)

              else:

                  self.assertIn(

-                     '<input class="form-control" id="branches" name="branches" '

-                     'type="text" value=""></td>', output_text)

+                     '<input class="form-control pl-0" id="branches" name="branches" '

+                     'type="text" value="">', output_text)

              self.assertTrue(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">' in output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -131,14 +131,14 @@ 

                  output_text)

              if self.get_wtforms_version() >= (2, 2):

                  self.assertIn(

-                     '<input class="form-control" id="branches" name="branches" '

+                     '<input class="form-check-input mt-2" id="branches" name="branches" '

                      'required type="text" value=""></td>', output_text)

              else:

                  self.assertIn(

-                     '<input class="form-control" id="branches" name="branches" '

-                     'type="text" value=""></td>', output_text)

+                     '<input class="form-control pl-0" id="branches" name="branches" '

+                     'type="text" value="">', output_text)

              self.assertTrue(

-                 '<input checked class="form-control" id="active" name="active" '

+                 '<input checked class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">' in output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -172,14 +172,14 @@ 

                  'Pagure</title>', output_text)

              if self.get_wtforms_version() >= (2, 2):

                  self.assertIn(

-                     '<input class="form-control" id="branches" name="branches" '

+                     '<input class="form-check-input mt-2" id="branches" name="branches" '

                      'required type="text" value="master"></td>', output_text)

              else:

                  self.assertIn(

-                     '<input class="form-control" id="branches" name="branches" '

-                     'type="text" value="master"></td>', output_text)

+                     '<input class="form-control pl-0" id="branches" name="branches" '

+                     'type="text" value="master">', output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active" name="active" '

+                 '<input checked class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertTrue(os.path.exists(os.path.join(
@@ -208,14 +208,14 @@ 

                  'Pagure</title>', output_text)

              if self.get_wtforms_version() >= (2, 2):

                  self.assertIn(

-                     '<input class="form-control" id="branches" name="branches" '

+                     '<input class="form-check-input mt-2" id="branches" name="branches" '

                      'required type="text" value="">', output_text)

              else:

                  self.assertIn(

-                     '<input class="form-control" id="branches" name="branches" '

+                     '<input class="form-control pl-0" id="branches" name="branches" '

                      'type="text" value="">', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(

@@ -36,10 +36,10 @@ 

                  '<label for="ci_job">Name of the job to trigger'

                  '</label>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active_commit" '

+                 '<input class="form-check-input mt-2" id="active_commit" '

                  'name="active_commit" type="checkbox" value="y">', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active_pr" '

+                 '<input class="form-check-input mt-2" id="active_pr" '

                  'name="active_pr" type="checkbox" value="y">', output_text)

  

              csrf_token = output_text.split(
@@ -60,10 +60,10 @@ 

                  '<label for="ci_job">Name of the job to trigger'

                  '</label>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active_commit" '

+                 '<input class="form-check-input mt-2" id="active_commit" '

                  'name="active_commit" type="checkbox" value="y">', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active_pr" '

+                 '<input class="form-check-input mt-2" id="active_pr" '

                  'name="active_pr" type="checkbox" value="y">', output_text)

  

              # Activate hook
@@ -88,10 +88,10 @@ 

                  '<label for="ci_job">Name of the job to trigger'

                  '</label>', output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active_commit" '

+                 '<input checked class="form-check-input mt-2" id="active_commit" '

                  'name="active_commit" type="checkbox" value="y">', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active_pr" '

+                 '<input class="form-check-input mt-2" id="active_pr" '

                  'name="active_pr" type="checkbox" value="y">', output_text)

  

              data['csrf_token'] = csrf_token
@@ -126,7 +126,7 @@ 

                  '<label for="ci_job">Name of the job to trigger'

                  '</label>', output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active_commit" '

+                 '<input checked class="form-check-input mt-2" id="active_commit" '

                  'name="active_commit" type="checkbox" value="y">', output_text)

              self.assertIn(

                  '<pre>\nhttp://localhost.localdomain/api/0/ci/jenkins/test/',
@@ -160,7 +160,7 @@ 

                  '<label for="ci_job">Name of the job to trigger'

                  '</label>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active_commit" '

+                 '<input class="form-check-input mt-2" id="active_commit" '

                  'name="active_commit" type="checkbox" value="y">', output_text)

  

              # Missing the required ci_url
@@ -190,17 +190,19 @@ 

                      output_text)

              else:

                  self.assertIn(

-                     '<td><input class="form-control" id="ci_url" '

-                     'name="ci_url" type="text" value="">'

-                     '</td>\n<td class="errors">This field is required.</td>',

+                     '<div class="col-sm-10">\n        '

+                     '<input class="form-control pl-0" id="ci_url" name="ci_url" '

+                     'type="text" value="">\n    </div>\n  </div>\n      '

+                     '<div class="alert alert-danger">This field is required.</div>',

                      output_text)

                  self.assertIn(

-                     '<td><input class="form-control" id="ci_job" '

-                     'name="ci_job" type="text" value="">'

-                     '</td>\n<td class="errors">This field is required.</td>',

+                     '<div class="col-sm-10">\n        '

+                     '<input class="form-control pl-0" id="ci_job" name="ci_job" '

+                     'type="text" value="">\n    </div>\n  </div>\n      '

+                     '<div class="alert alert-danger">This field is required.</div>',

                      output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active_commit" '

+                 '<input checked class="form-check-input mt-2" id="active_commit" '

                  'name="active_commit" type="checkbox" value="y">', output_text)

  

      def test_plugin_pagure_ci_namespaced(self):
@@ -224,7 +226,7 @@ 

                  '<label for="ci_job">Name of the job to trigger'

                  '</label>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active_pr" name="active_pr" '

+                 '<input class="form-check-input mt-2" id="active_pr" name="active_pr" '

                  'type="checkbox" value="y">', output_text)

  

              csrf_token = output_text.split(
@@ -270,7 +272,7 @@ 

                  '<label for="ci_job">Name of the job to trigger'

                  '</label>', output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active_pr" name="active_pr" '

+                 '<input checked class="form-check-input mt-2" id="active_pr" name="active_pr" '

                  'type="checkbox" value="y">', output_text)

              self.assertIn(

                  '<pre>\nhttp://localhost.localdomain/api/0/ci/jenkins/somenamespace/test3/',

@@ -53,7 +53,7 @@ 

                  '<title>Settings Pagure - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

      def test_plugin_mail_no_data(self):
@@ -71,7 +71,7 @@ 

                  '<title>Settings Pagure - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -114,7 +114,7 @@ 

                  '<title>Settings Pagure - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -161,7 +161,7 @@ 

                  '<title>Settings Pagure - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active" name="active" '

+                 '<input checked class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertTrue(os.path.exists(os.path.join(
@@ -203,7 +203,7 @@ 

                  '<title>Settings Pagure - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(

@@ -54,7 +54,7 @@ 

                  '<title>Settings Prevent creating new branches by git '

                  'push - test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              data = {}
@@ -68,7 +68,7 @@ 

                  '<title>Settings Prevent creating new branches by git push '

                  '- test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

      def test_plugin_pagure_ticket_deactivate(self):
@@ -97,7 +97,7 @@ 

                  '<title>Settings Prevent creating new branches by git push '

                  '- test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -134,7 +134,7 @@ 

                  '<title>Settings Prevent creating new branches by git push '

                  '- test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active" name="active" '

+                 '<input checked class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertTrue(os.path.exists(os.path.join(
@@ -163,7 +163,7 @@ 

                  '<title>Settings Prevent creating new branches by git push '

                  '- test - Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(

@@ -42,7 +42,7 @@ 

                  '<title>Settings Pagure requests - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              csrf_token = output.get_data(as_text=True).split(
@@ -57,7 +57,7 @@ 

                  '<title>Settings Pagure requests - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              data['csrf_token'] = csrf_token
@@ -84,7 +84,7 @@ 

                  '<title>Settings Pagure requests - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -116,7 +116,7 @@ 

                  '<title>Settings Pagure requests - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active" name="active" '

+                 '<input checked class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertTrue(os.path.exists(os.path.join(
@@ -144,7 +144,7 @@ 

                  '<title>Settings Pagure requests - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(

@@ -43,7 +43,7 @@ 

                  '<title>Settings Pagure tickets - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              csrf_token = output_text.split(
@@ -58,7 +58,7 @@ 

                  '<title>Settings Pagure tickets - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              data['csrf_token'] = csrf_token
@@ -85,7 +85,7 @@ 

                  '<title>Settings Pagure tickets - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -117,7 +117,7 @@ 

                  '<title>Settings Pagure tickets - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active" name="active" '

+                 '<input checked class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertTrue(os.path.exists(os.path.join(
@@ -145,7 +145,7 @@ 

                  '<title>Settings Pagure tickets - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(

@@ -42,7 +42,7 @@ 

                  '<title>Settings Read the Doc - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              csrf_token = output_text.split(
@@ -57,7 +57,7 @@ 

                  '<title>Settings Read the Doc - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              data['csrf_token'] = csrf_token
@@ -84,7 +84,7 @@ 

                  '<title>Settings Read the Doc - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -117,7 +117,7 @@ 

                  '<title>Settings Read the Doc - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input checked class="form-control" id="active" name="active" '

+                 '<input checked class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              # De-Activate hook
@@ -141,7 +141,7 @@ 

                  '<title>Settings Read the Doc - test - Pagure</title>',

                  output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(

@@ -43,7 +43,7 @@ 

                  '<title>Settings Block Un-Signed commits - test - '

                  'Pagure</title>', output_text)

              self.assertTrue(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">' in output_text)

  

              csrf_token = output_text.split(
@@ -59,7 +59,7 @@ 

                  '<title>Settings Block Un-Signed commits - test - '

                  'Pagure</title>', output_text)

              self.assertTrue(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">' in output_text)

  

              data['csrf_token'] = csrf_token
@@ -85,7 +85,7 @@ 

                  '<title>Settings Block Un-Signed commits - test - '

                  'Pagure</title>', output_text)

              self.assertTrue(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">' in output_text)

  

              self.assertFalse(os.path.exists(os.path.join(
@@ -132,7 +132,7 @@ 

                  '<title>Settings Block Un-Signed commits - test - '

                  'Pagure</title>', output_text)

              self.assertIn(

-                 '<input class="form-control" id="active" name="active" '

+                 '<input class="form-check-input mt-2" id="active" name="active" '

                  'type="checkbox" value="y">', output_text)

  

              self.assertFalse(os.path.exists(os.path.join(

Having the hooks settings items in a table was causing some
of the checkboxes not to appear on chrome.

This switches this out for form-rows, fixing the issue.

Fixes #3633

rebased onto 82bd7d4992af54fdb1e686458b5c2b657c44f338

2 years ago

rebased onto 5e660ead3a26c48c1244eee3227c79b26c0d34e0

2 years ago

Pretty please pagure-ci rebuild

rebased onto 80d10f50bdc2c641ee15cb5d920f08014c42eba0

2 years ago

Ok, tests pass locally, so let's merge :)

rebased onto 014c1cc

2 years ago

Pull-Request has been merged by pingou

2 years ago