#3309 fix formatting on the waiting pages
Merged 5 years ago by pingou. Opened 5 years ago by ryanlerch.
ryanlerch/pagure wait-pages  into  master

file modified
+2 -2
@@ -795,11 +795,11 @@ 

      user = pagure.lib.get_user(session, args.username)

  

      print('The user `%s` will be blocked from all interaction with this '

-     'pagure instance until: %s.', user.username, date.isoformat())

+           'pagure instance until: %s.', user.username, date.isoformat())

      if not _ask_confirmation():

          return

  

-     user.refuse_sessions_before = date

+     user.refuse_sessions_before = date.datetime

      session.add(user)

      session.commit()

  

file modified
+19 -17
@@ -5,24 +5,25 @@ 

  {% block content %}

  <div class="container">

    <div class="row">

-     <div class="col-md-8 col-md-offset-2">

-       <div class="card m-t-3">

-         <div class="card-header">

-           <strong>Waiting</strong>

-         </div>

-         <div class="card-block">

-           <p>

-             We are waiting for your task to finish.

-             This page should be refreshed automatically, but if not click

-             <a href="{{ url_for('ui_ns.wait_task', taskid=task.id) }}">Here</a>

-           </p>

-           <p>

-               Your task is currently <span id="status">{{ task.status }}</span>

-           </p>

-           <p id="slow" class="hidden">

-             This is taking longer than usual... Sorry for that

-           </p>

+     <div class="col-md-7 mx-auto">

+       <div class="alert alert-info text-center mt-5">

+         <div class="mb-3">

+           <i class="fa fa-circle-o-notch fa-spin fa-3x fa-fw"></i>

          </div>

+         <h3 class="font-weight-bold mb-3">

+           Waiting

+         </h3>

+         <p>

+           We are waiting for your task to finish.

+           This page should be refreshed automatically, but if not click

+           <a href="{{ url_for('ui_ns.wait_task', taskid=task.id) }}">Here</a>

+         </p>

+         <p class="font-weight-bold">

+           Your task is currently <span id="status">{{ task.status }}</span>

+         </p>

+         <p id="slow" class="hidden">

+           This is taking longer than usual... Sorry for that.

+         </p>

        </div>

      </div>

    </div>
@@ -53,6 +54,7 @@ 

        _cnt = res.count;

        if (_cnt > 30) {

          $('#slow').show();

+         $('.alert.alert-info').toggleClass("alert-info alert-warning");

        }

        $('#status').text(res.status);

        window.setTimeout(check_task_status, _delay);

@@ -5,31 +5,32 @@ 

  {% block content %}

  <div class="container">

    <div class="row">

-     <div class="col-md-8 col-md-offset-2">

-       <div class="card m-t-3">

-         <div class="card-header">

-           <strong>Waiting</strong>

-         </div>

-         <div class="card-block">

-           <form action="{{ form_action }}" method="POST" id="waitform">

-             <input type="hidden" name="taskid" value="{{ taskid }}">

-             {% for field in form_data %}

-               <input type="hidden" name="{{ field }}" value="{{ form_data[field] }}">

-             {% endfor %}

-             {{ csrf }}

-             <p>

-               We are waiting for your task to finish.

-               This page should be refreshed automatically, but if not click

-               <input type="submit" value="Here">.

-             </p>

-             <p id="status_p" class="hidden">

-               Your task is currently <span id="status"></span>

-             </p>

-             <p id="slow" class="hidden">

-               This is taking longer than usual... Sorry for that

-             </p>

-           </form>

+     <div class="col-md-7 mx-auto">

+       <div class="alert alert-info text-center mt-5">

+         <div class="mb-3">

+           <i class="fa fa-circle-o-notch fa-spin fa-3x fa-fw"></i>

          </div>

+         <h3 class="font-weight-bold mb-3">

+           Waiting

+         </h3>

+         <form action="{{ form_action }}" method="POST" id="waitform">

+           <input type="hidden" name="taskid" value="{{ taskid }}">

+           {% for field in form_data %}

+             <input type="hidden" name="{{ field }}" value="{{ form_data[field] }}">

+           {% endfor %}

+           {{ csrf }}

+           <p>

+             We are waiting for your task to finish.

+             This page should be refreshed automatically, but if not click

+             <input type="submit" value="Here">.

+           </p>

+           <p id="status_p font-weight-bold" class="hidden">

+             Your task is currently <span id="status"></span>

+           </p>

+           <p id="slow" class="hidden">

+             This is taking longer than usual... Sorry for that.

+           </p>

+         </form>

        </div>

      </div>

    </div>
@@ -62,6 +63,7 @@ 

            _cnt = res.count;

            if (_cnt > 30) {

              $('#slow').show();

+             $('.alert.alert-info').toggleClass("alert-info alert-warning");

            }

            $('#status').text(res.status);

            $('#status_p').show();

file modified
+2 -1
@@ -1379,6 +1379,7 @@ 

          user = pagure.lib.get_user(self.session, 'pingou')

          self.assertIsNone(user.refuse_sessions_before)

  

+     @patch('pagure.cli.admin._ask_confirmation', MagicMock(return_value=True))

      def test_block_user(self):

          """ Test the block-user function of pagure-admin when all arguments

          are provided correctly.
@@ -1392,7 +1393,7 @@ 

          pagure.cli.admin.do_block_user(args)

  

          user = pagure.lib.get_user(self.session, 'pingou')

-         self.assertIsNone(user.refuse_sessions_before)

+         self.assertIsNotNone(user.refuse_sessions_before)

  

  

  if __name__ == '__main__':

Add an exclamation point at the end.

Looks like I broke the tests, I'll open a PR for this

1 new commit added

  • fix the test_block_user test
5 years ago

1 new commit added

  • add a full stop after the waiting message.
5 years ago

@ngompa there was no punctuation there at all before either. IMHO, it needs a full stop, if anything, so i added that.

That's fine. Since you were touching it, I noticed the punctuation error. :)

1 new commit added

  • Fix setting the refuse_sessions_before, it requires a datetime object
5 years ago

Pretty please pagure-ci rebuild

1 new commit added

  • Fix flake8 error in pagure-admin block-user
5 years ago

Running the tests locally and will merge if they pass :)

rebased onto 3168a46

5 years ago

Pull-Request has been merged by pingou

5 years ago