From 6d1fc8e14be0e2d166c97f5a97748d892358145a Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Feb 04 2016 11:29:37 +0000 Subject: [PATCH 1/6] fix for #682: made the PR actions a buttonbar Made the PR actions at the top of the PR into a buttonbar to make it look similar to the other buttons in for eding comments. (but left them as coloured buttons) I had to move the form call outside of the button-group class as it was causing issues with the styling. --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 25e9a4b..6d5d515 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -27,25 +27,33 @@
{% if pull_request %}

PR#{{requestid}} {{ pull_request.title | noJS(ignore="img") | safe - }}{% if authenticated and (g.fas_user.username == pull_request.user.username - or repo_admin) and pull_request.status == 'Open' - %} + }} + {% if authenticated and (g.fas_user.username == pull_request.user.username + or repo_admin) and pull_request.status == 'Open'%} - edit - - {% if pull_request.status == 'Open' and authenticated and + {% if pull_request.status == 'Open' and authenticated and + (repo_admin or g.fas_user.username == pull_request.user.username) %} +
+ {% endif %} +
+ + {% if pull_request.status == 'Open' and authenticated and (repo_admin or g.fas_user.username == pull_request.user.username) %} - {{ mergeform.csrf_token }} - - + {% endif %} - - {% endif %} +
+ {% if pull_request.status == 'Open' and authenticated and + (repo_admin or g.fas_user.username == pull_request.user.username) %} + + {% endif %} +
+ {% endif %}

From a38c4e3ad993089bfbc1c717940fbbaf6ae474b0 Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Feb 04 2016 11:29:37 +0000 Subject: [PATCH 2/6] fix for #674: added a link back in for patch view --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 6d5d515..edf0faa 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -95,12 +95,6 @@ {% endif %} - {# - - - - #}
{% elif form and (repo_admin or remote_git) %} @@ -178,6 +172,12 @@ +
From 95a0a80fa5a40bcfd48c86ca9e2743adc704afe1 Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Feb 04 2016 11:29:37 +0000 Subject: [PATCH 3/6] fix for #675: improved how we show merged/closed status --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index edf0faa..55470ba 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -26,8 +26,11 @@
{% if pull_request %} -

PR#{{requestid}} {{ pull_request.title | noJS(ignore="img") | safe - }} +

PR#{{requestid}} + {% if pull_request.status != 'Open'%} + {{pull_request.status}} + {% endif %} + {{ pull_request.title | noJS(ignore="img") | safe}} {% if authenticated and (g.fas_user.username == pull_request.user.username or repo_admin) and pull_request.status == 'Open'%} @@ -54,7 +57,7 @@ {% endif %} {% endif %} -

+
Proposed {{ pull_request.date_created |humanize }} @@ -86,17 +89,6 @@ -
-
- {% if pull_request.status != 'Open' %} - {{ pull_request.status }} by - - {{ pull_request.closed_by.user if pull_request.closed_by else ''}} - - - {% endif %} -
-
{% elif form and (repo_admin or remote_git) %}

Create pull request

{% else %} @@ -386,6 +378,16 @@ {% endif %}
+ {% if pull_request.status != 'Open'%} + + {% endif %} {% if pull_request.flags %}
From 84ad89c96d9ed2c4421ef13e49e5fcce44675fe1 Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Feb 04 2016 11:29:37 +0000 Subject: [PATCH 4/6] added extra spacing before the "into" --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 55470ba..2568854 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -76,7 +76,7 @@ {{ pull_request.branch_from }} - into +  into {{ pull_request.project.fullname }} Patch + {% endif %}
From 137f65dcdc0912f1ec03ee0c72c2b31cc98c21b5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 04 2016 11:49:01 +0000 Subject: [PATCH 6/6] Adjust the unit-tests for the change in the PR page --- diff --git a/tests/test_pagure_flask_ui_fork.py b/tests/test_pagure_flask_ui_fork.py index 42239dd..8ac8484 100644 --- a/tests/test_pagure_flask_ui_fork.py +++ b/tests/test_pagure_flask_ui_fork.py @@ -231,8 +231,8 @@ class PagureFlaskForktests(tests.Modeltests): output = self.app.get('/test/pull-request/1') self.assertEqual(output.status_code, 200) self.assertIn( - '

PR#1 ' - 'PR from the feature branch

', output.data) + '

PR#1\n' + ' PR from the feature branch\n

', output.data) self.assertIn( 'title="View file as of 2a552b">View', output.data) @@ -259,8 +259,8 @@ class PagureFlaskForktests(tests.Modeltests): 'PR#1: PR from the feature branch - test\n - ' 'Pagure', output.data) self.assertIn( - '

PR#1 ' - 'PR from the feature branch

', output.data) + '

PR#1\n' + ' PR from the feature branch\n

', output.data) self.assertIn( 'title="View file as of 2a552b">View', output.data) @@ -318,8 +318,8 @@ class PagureFlaskForktests(tests.Modeltests): 'PR#1: PR from the feature branch - test\n - ' 'Pagure', output.data) self.assertIn( - '

PR#1 PR from ' - 'the feature branch ', + '

PR#1\n' + ' PR from the feature branch\n ', output.data) self.assertIn( '\n This request must be ' @@ -336,8 +336,8 @@ class PagureFlaskForktests(tests.Modeltests): '/test/pull-request/1/merge', data=data, follow_redirects=True) self.assertEqual(output.status_code, 200) self.assertIn( - '

PR#1 PR from ' - 'the feature branch ', + '

PR#1\n' + ' PR from the feature branch\n ', output.data) self.assertIn( '\n Only the assignee can ' @@ -354,8 +354,8 @@ class PagureFlaskForktests(tests.Modeltests): '/test/pull-request/1/merge', data=data, follow_redirects=True) self.assertEqual(output.status_code, 200) self.assertIn( - '

PR#1 PR from ' - 'the feature branch ', + '

PR#1\n' + ' PR from the feature branch\n ', output.data) self.assertIn( '\n This request does not ' @@ -439,8 +439,8 @@ class PagureFlaskForktests(tests.Modeltests): '/test/pull-request/1/merge', data=data, follow_redirects=True) self.assertEqual(output.status_code, 200) self.assertIn( - '

PR#1 PR from ' - 'the feature branch ', + '

PR#1\n' + ' PR from the feature branch\n ', output.data) self.assertIn( '\n Merge conflicts!', @@ -475,8 +475,9 @@ class PagureFlaskForktests(tests.Modeltests): '/test/pull-request/1/merge', data=data, follow_redirects=True) self.assertEqual(output.status_code, 200) self.assertIn( - '

PR#1 ' - 'PR from the master branch

', output.data) + '

PR#1\n' + ' Merged', + output.data) self.assertIn( '\n Nothing to do, changes ' 'were already merged', output.data) @@ -491,10 +492,9 @@ class PagureFlaskForktests(tests.Modeltests): output = self.app.get('/test/pull-request/1') self.assertEqual(output.status_code, 200) self.assertIn( - '

PR#1 ' - 'PR from the feature branch

', output.data) - self.assertIn( - 'Merged by', output.data) + '

PR#1\n' + ' ', output.data) + self.assertIn('
Merged by\n', output.data) self.assertIn( 'title="View file as of 2a552b">View', output.data) @@ -595,8 +595,8 @@ class PagureFlaskForktests(tests.Modeltests): output = self.app.get('/test/pull-request/1') self.assertEqual(output.status_code, 200) self.assertIn( - '

PR#1 ' - 'PR from the feature branch

', output.data) + '

PR#1\n' + ' PR from the feature branch\n

', output.data) self.assertTrue( output.data.count('PR#1: PR from the feature branch - test\n - ' 'Pagure', output.data) self.assertIn( - '

PR#1 ' - 'PR from the feature branch

', output.data) + '

PR#1\n' + ' PR from the feature branch\n

', output.data) self.assertNotIn( '\n Request assigned', output.data) @@ -1163,8 +1163,8 @@ index 0000000..2a552bb 'PR#1: PR from the feature branch - test\n - ' 'Pagure', output.data) self.assertIn( - '

PR#1 ' - 'PR from the feature branch

', output.data) + '

PR#1\n' + ' PR from the feature branch\n

', output.data) self.assertNotIn( '\n Request assigned', output.data) @@ -1183,8 +1183,8 @@ index 0000000..2a552bb 'PR#1: PR from the feature branch - test\n - ' 'Pagure', output.data) self.assertIn( - '

PR#1 ' - 'PR from the feature branch

', output.data) + '

PR#1\n' + ' PR from the feature branch\n

', output.data) self.assertIn( '\n No user "bar" found', output.data) @@ -1203,8 +1203,8 @@ index 0000000..2a552bb 'PR#1: PR from the feature branch - test\n - ' 'Pagure', output.data) self.assertIn( - '

PR#1 ' - 'PR from the feature branch

', output.data) + '

PR#1\n' + ' PR from the feature branch\n

', output.data) self.assertIn( '\n Request assigned', output.data) @@ -1529,8 +1529,8 @@ index 0000000..2a552bb '/test/pull-request/1/comment/drop', follow_redirects=True) self.assertEqual(output.status_code, 200) self.assertIn( - '

PR#1 ' - 'PR from the feature branch

', output.data) + '

PR#1\n' + ' PR from the feature branch\n

', output.data) #self.assertIn('href="#comment-1">ΒΆ', output.data) self.assertIn( '

This look alright but we can do better

', @@ -1563,8 +1563,8 @@ index 0000000..2a552bb follow_redirects=True) self.assertEqual(output.status_code, 200) self.assertIn( - '

PR#1 PR from ' - 'the feature branch ', + '

PR#1\n' + ' PR from the feature branch\n ', output.data) self.assertIn( '\n Comment removed', @@ -1620,8 +1620,8 @@ index 0000000..2a552bb self.assertEqual(output.status_code, 200) self.assertIn( - '

PR#1 PR from ' - 'the feature branch ', + '

PR#1\n' + ' PR from the feature branch\n ', output.data) self.assertIn( '\n Comment added', @@ -1651,8 +1651,8 @@ index 0000000..2a552bb self.assertIn( '

This look alright but we can do better than this.

', output.data) self.assertIn( - '

PR#1 PR from ' - 'the feature branch ', + '

PR#1\n' + ' PR from the feature branch\n ', output.data) # Checking if Edited by User is there or not self.assertIn(