From 605633e0f7cef6e27ac7b7389d58b6abba66de12 Mon Sep 17 00:00:00 2001
From: Julen Landa Alustiza <jlanda@fedoraproject.org>
Date: Aug 28 2019 10:31:02 +0000
Subject: [PATCH 1/4] themes/srcfpo: fix capitalization incoherency


---

diff --git a/pagure/themes/srcfpo/templates/repo_master_sidebar.html b/pagure/themes/srcfpo/templates/repo_master_sidebar.html
index 13c12f5..472bb24 100644
--- a/pagure/themes/srcfpo/templates/repo_master_sidebar.html
+++ b/pagure/themes/srcfpo/templates/repo_master_sidebar.html
@@ -102,7 +102,7 @@
             <span class="fa fa-fw"></span>
           </div>
           <div class="media-body">
-            monitoring and scratch builds
+            Monitoring and scratch builds
           </div>
         </div>
       </a>

From 8bdc7f8f6e64a11205a7f79cf7bdec32264145d3 Mon Sep 17 00:00:00 2001
From: Julen Landa Alustiza <jlanda@fedoraproject.org>
Date: Aug 28 2019 10:31:02 +0000
Subject: [PATCH 2/4] themes/srcfpo: show release-monitoring choice dropdown only on authenticated sessions


---

diff --git a/pagure/themes/srcfpo/templates/repo_master_sidebar.html b/pagure/themes/srcfpo/templates/repo_master_sidebar.html
index 472bb24..ced753d 100644
--- a/pagure/themes/srcfpo/templates/repo_master_sidebar.html
+++ b/pagure/themes/srcfpo/templates/repo_master_sidebar.html
@@ -69,6 +69,7 @@
   <div class="col-xs-2 line-height-1"></div>
   <p>Monitoring status:</p>
   <div class="btn-group">
+    {% if g.authenticated %}
     <a href="#" title="Monitoring status"
         class="btn btn-sm dropdown-toggle btn-outline-primary"
         data-toggle="dropdown" id="monitoring-button">
@@ -107,6 +108,13 @@
         </div>
       </a>
     </div>
+    {% else %}
+    <button title="Monitoring status" class="btn btn-sm btn-outline-primary disabled"
+        id="monitoring-button">
+      <i id="monitoring-icon" class="fa fa-fw fa-eye"></i>
+      <span id="monitoring-label" class="fa fa-circle-o-notch fa-spin fa-1x fa-fw"></span>
+    </button>
+    {% endif %}
   </div>
 
   {% if g.authenticated and repo.user.user == "orphan" %}

From e10e70607485a3fbd412f58b0558d026f3045027 Mon Sep 17 00:00:00 2001
From: Julen Landa Alustiza <jlanda@fedoraproject.org>
Date: Aug 28 2019 10:31:02 +0000
Subject: [PATCH 3/4] themes/srcfpo: fix error callback on release-monitoring button ajax


---

diff --git a/pagure/themes/srcfpo/templates/repo_master_sidebar.html b/pagure/themes/srcfpo/templates/repo_master_sidebar.html
index ced753d..50aca40 100644
--- a/pagure/themes/srcfpo/templates/repo_master_sidebar.html
+++ b/pagure/themes/srcfpo/templates/repo_master_sidebar.html
@@ -182,7 +182,7 @@
             set_up_monitoring(res.monitoring)
           },
           error: function() {
-            alert('Unable to change the monitoring status! ' + error);
+            alert('Unable to change the monitoring status!');
           }
         });
       });

From 521047706a4131b8646eb5b25d27d2134aebdea1 Mon Sep 17 00:00:00 2001
From: Julen Landa Alustiza <jlanda@fedoraproject.org>
Date: Aug 28 2019 10:31:02 +0000
Subject: [PATCH 4/4] themes/srcfpo: fix some csp errors


---

diff --git a/pagure/themes/srcfpo/templates/repo_info.html b/pagure/themes/srcfpo/templates/repo_info.html
index 889471d..4ea0565 100644
--- a/pagure/themes/srcfpo/templates/repo_info.html
+++ b/pagure/themes/srcfpo/templates/repo_info.html
@@ -124,8 +124,7 @@
 
                 <div class="btn-group">
                   {% if g.authenticated and not g.repo_starred %}
-                    <a href="#" class="btn btn-sm btn-outline-primary font-weight-bold"
-                    onclick="$('#star_project').submit();">
+                    <a href="#" class="btn btn-sm btn-outline-primary font-weight-bold star_btn">
                       <i class="fa fa-star-o fa-fw"></i>Star
                       <form method="POST" name="star_project" id="star_project"
                       action="{{ url_for(
@@ -144,8 +143,7 @@
                                   namespace=repo.namespace,
                       )}}" class="btn btn-sm btn-primary font-weight-bold">{{ repo.stargazers|length }}</a>
                   {% elif g.authenticated and g.repo_starred %}
-                    <a href="#" class="btn btn-sm btn-outline-primary font-weight-bold"
-                      onclick="$('#unstar_project').submit();">
+                    <a href="#" class="btn btn-sm btn-outline-primary font-weight-bold unstar_btn">
                       <form method="POST" name="unstar_project" id="unstar_project"
                         action="{{ url_for(
                         'ui_ns.star_project',
@@ -453,6 +451,8 @@ git push -u origin master</pre>
 {{ super() }}
 <script type="text/javascript" nonce="{{ g.nonce }}">
 $(document).ready(function() {
+    $('.star_btn').click( function() { $('#star_project').submit()} );
+    $('.unstar_btn').click( function() { $('#unstar_project').submit()} );
     {% if g.repo_watch_levels %}
         var currentWatchStatusButton = $('#watch_{{ g.repo_watch_levels | join('_') }}_button .check-icon span');
     {% else %}

