| |
@@ -79,7 +79,7 @@
|
| |
<a class="dropdown-item pl-2" id="no_monitoring_option_button">
|
| |
<div class="media">
|
| |
<div class="align-self-center check-icon pr-2">
|
| |
- <span class="fa fa-fw"></span>
|
| |
+ <span class="fa fa-fw"></span>
|
| |
</div>
|
| |
<div class="media-body">
|
| |
No-Monitoring
|
| |
@@ -89,26 +89,41 @@
|
| |
<a class="dropdown-item pl-2" id="monitoring_option_button">
|
| |
<div class="media">
|
| |
<div class="align-self-center check-icon pr-2">
|
| |
- <span class="fa fa-fw"></span>
|
| |
+ <span class="fa fa-fw"></span>
|
| |
</div>
|
| |
<div class="media-body">
|
| |
- Monitoring
|
| |
+ Monitoring
|
| |
</div>
|
| |
</div>
|
| |
</a>
|
| |
<a class="dropdown-item pl-2" id="monitoring_and_scratch_option_button">
|
| |
<div class="media">
|
| |
<div class="align-self-center check-icon pr-2">
|
| |
- <span class="fa fa-fw"></span>
|
| |
+ <span class="fa fa-fw"></span>
|
| |
</div>
|
| |
<div class="media-body">
|
| |
- monitoring and scratch builds
|
| |
+ monitoring and scratch builds
|
| |
</div>
|
| |
</div>
|
| |
</a>
|
| |
</div>
|
| |
</div>
|
| |
|
| |
+ {% if g.authenticated and repo.user.user == "orphan" %}
|
| |
+ <div id="take-orphan-section">
|
| |
+ <div class="col-xs-2" style="height:1em;"></div>
|
| |
+ <p>Orphaned:</p>
|
| |
+ <div class="btn-group">
|
| |
+ <a href="#" title="Adopt this orphaned package"
|
| |
+ class="btn btn-sm btn-outline-primary"
|
| |
+ id="take-orphan-button">
|
| |
+ <i id="take-orphan-icon" class="fa fa-fw fa-hand-paper-o"></i>
|
| |
+ Take
|
| |
+ </a>
|
| |
+ </div>
|
| |
+ </div>
|
| |
+ {% endif %}
|
| |
+
|
| |
<script type="text/javascript" nonce="{{ g.nonce }}">
|
| |
window.addEventListener('load', function() {
|
| |
|
| |
@@ -140,31 +155,53 @@
|
| |
|
| |
{% if g.authenticated %}
|
| |
$(".monitoring-menu a").click(function(){
|
| |
- var selectedValue = $(this).attr('id');
|
| |
- var _status = "no-monitoring";
|
| |
- if (selectedValue === "monitoring_option_button") {
|
| |
- _status = "monitoring";
|
| |
- } else if (selectedValue === "monitoring_and_scratch_option_button") {
|
| |
- _status = "monitoring-with-scratch"
|
| |
+ var selectedValue = $(this).attr('id');
|
| |
+ var _status = "no-monitoring";
|
| |
+ if (selectedValue === "monitoring_option_button") {
|
| |
+ _status = "monitoring";
|
| |
+ } else if (selectedValue === "monitoring_and_scratch_option_button") {
|
| |
+ _status = "monitoring-with-scratch"
|
| |
+ }
|
| |
+
|
| |
+ $.ajax({
|
| |
+ url: "{{ url_for('distgit_ns.anitya_patch_endpoint', repo=repo.name, namespace=repo.namespace) }}",
|
| |
+ type: 'PATCH',
|
| |
+ data: {
|
| |
+ anitya_status: _status,
|
| |
+ },
|
| |
+ dataType: 'json',
|
| |
+ success: function(res) {
|
| |
+ set_up_monitoring(res.monitoring)
|
| |
+ },
|
| |
+ error: function() {
|
| |
+ alert('Unable to change the monitoring status! ' + error);
|
| |
}
|
| |
+ });
|
| |
+ });
|
| |
+ {% endif %}
|
| |
|
| |
- $.ajax({
|
| |
- url: "{{ url_for('distgit_ns.anitya_patch_endpoint', repo=repo.name, namespace=repo.namespace) }}",
|
| |
- type: 'PATCH',
|
| |
- data: {
|
| |
- anitya_status: _status,
|
| |
- },
|
| |
- dataType: 'json',
|
| |
- success: function(res) {
|
| |
- set_up_monitoring(res.monitoring)
|
| |
- },
|
| |
- error: function() {
|
| |
- alert('Unable to change the monitoring status! ' + error);
|
| |
- }
|
| |
- });
|
| |
+ {% if g.authenticated and repo.user.user == "orphan" %}
|
| |
+ $("#take-orphan-button").click(function(){
|
| |
|
| |
+ $.ajax({
|
| |
+ url: "{{ url_for('distgit_ns.take_orphan_endpoint', repo=repo.name, namespace=repo.namespace) }}",
|
| |
+ type: 'POST',
|
| |
+ dataType: 'json',
|
| |
+ success: function(res) {
|
| |
+ $("#point_of_contact").html("{{ g.fas_user.username }}");
|
| |
+ $("#take-orphan-section").hide();
|
| |
+ },
|
| |
+ error: function(res) {
|
| |
+ if (res.responseJSON.errors) {
|
| |
+ alert('Unable to change the point of contact: ' + res.responseJSON.errors);
|
| |
+ } else {
|
| |
+ alert('Unable to change the point of contact: ' + res.responseJSON.error);
|
| |
+ }
|
| |
+ }
|
| |
+ });
|
| |
});
|
| |
{% endif %}
|
| |
+
|
| |
});
|
| |
</script>
|
| |
{% endif %}
|
| |