From 7b1ecb5b7d89b1345d9eb1a6430a244e7b73fe21 Mon Sep 17 00:00:00 2001
From: dhrish20 <dhrish20@gmail.com>
Date: Sep 24 2015 10:31:51 +0000
Subject: [PATCH 1/3] Swaps titles around when viewing PR


---

diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html
index b6d9a53..02361d4 100644
--- a/pagure/templates/pull_request.html
+++ b/pagure/templates/pull_request.html
@@ -20,20 +20,19 @@
 
 {% block repo %}
 
-<h2>Request pull
-  <a href="{{ url_for('view_repo', username=username, repo=repo.name)}}">
-    {{ repo.name }}
-  </a>
-
-  (<a href="{{ url_for('view_tree', username=username,
-               repo=repo.name, identifier=commitid) }}"
-    >tree</a>)
-
-</h2>
+<h2>Title: {{ pull_request.title | noJS("img") | safe }}</h2>
 
 {% if pull_request %}
 <div class="header">
-    <h3>Title: {{ pull_request.title | noJS("img") | safe }}</h3>
+    <h3>Request pull
+      <a href="{{ url_for('view_repo', username=username, repo=repo.name)}}">
+        {{ repo.name }}
+      </a>
+
+      (<a href="{{ url_for('view_tree', username=username,
+               repo=repo.name, identifier=commitid) }}"
+      >tree</a>)
+    </h3>
     <ul class="buttons">
   {% if pull_request.status == 'Open' and repo_admin %}
       <li>

From 920c7d7e12c2caea2db1596cd747ea58820a0599 Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Sep 24 2015 10:31:51 +0000
Subject: [PATCH 2/3] Rework the titles in the pull-request page


---

diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html
index 02361d4..145250a 100644
--- a/pagure/templates/pull_request.html
+++ b/pagure/templates/pull_request.html
@@ -20,19 +20,10 @@
 
 {% block repo %}
 
-<h2>Title: {{ pull_request.title | noJS("img") | safe }}</h2>
 
 {% if pull_request %}
+<h2>Pull Request: {{ pull_request.title | noJS("img") | safe }}</h2>
 <div class="header">
-    <h3>Request pull
-      <a href="{{ url_for('view_repo', username=username, repo=repo.name)}}">
-        {{ repo.name }}
-      </a>
-
-      (<a href="{{ url_for('view_tree', username=username,
-               repo=repo.name, identifier=commitid) }}"
-      >tree</a>)
-    </h3>
     <ul class="buttons">
   {% if pull_request.status == 'Open' and repo_admin %}
       <li>
@@ -64,6 +55,11 @@
       </li>
     </ul>
 </div>
+{% else %}
+<h2>Diff
+      (<a href="{{ url_for('view_tree', username=username,
+               repo=repo.name, identifier=commitid) }}"
+      >tree</a>)</h2>
 {% endif %}
 
 {% if form and repo_admin %}

From 97cbe0205d439ca2c770fd67905ee5d7cc2a8179 Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Sep 24 2015 10:31:51 +0000
Subject: [PATCH 3/3] Adjust unit-tests for the change in the PR page


---

diff --git a/tests/test_progit_flask_ui_fork.py b/tests/test_progit_flask_ui_fork.py
index e26f170..e1f605c 100644
--- a/tests/test_progit_flask_ui_fork.py
+++ b/tests/test_progit_flask_ui_fork.py
@@ -1088,7 +1088,8 @@ index 0000000..2a552bb
                 '<title>PR#1: PR from the feature branch - test - '
                 'Pagure</title>', output.data)
             self.assertIn(
-                '<h3>Title: PR from the feature branch</h3>', output.data)
+                '<h2>Pull Request: PR from the feature branch</h2>',
+                output.data)
             self.assertNotIn(
                 '<li class="message">Request assigned</li>', output.data)
 
@@ -1111,7 +1112,8 @@ index 0000000..2a552bb
                 '<title>PR#1: PR from the feature branch - test - '
                 'Pagure</title>', output.data)
             self.assertIn(
-                '<h3>Title: PR from the feature branch</h3>', output.data)
+                '<h2>Pull Request: PR from the feature branch</h2>',
+                output.data)
             self.assertNotIn(
                 '<li class="message">Request assigned</li>', output.data)
 
@@ -1129,7 +1131,8 @@ index 0000000..2a552bb
                 '<title>PR#1: PR from the feature branch - test - '
                 'Pagure</title>', output.data)
             self.assertIn(
-                '<h3>Title: PR from the feature branch</h3>', output.data)
+                '<h2>Pull Request: PR from the feature branch</h2>',
+                output.data)
             self.assertIn(
                 '<li class="error">No user &#34;bar&#34; found</li>',
                 output.data)
@@ -1148,7 +1151,8 @@ index 0000000..2a552bb
                 '<title>PR#1: PR from the feature branch - test - '
                 'Pagure</title>', output.data)
             self.assertIn(
-                '<h3>Title: PR from the feature branch</h3>', output.data)
+                '<h2>Pull Request: PR from the feature branch</h2>',
+                output.data)
             self.assertIn(
                 '<li class="message">Request assigned</li>', output.data)
 

