| |
@@ -35,6 +35,13 @@
|
| |
white-space: -o-pre-wrap; /* Opera 7 */
|
| |
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
| |
}
|
| |
+
|
| |
+ .disabled_branch a {
|
| |
+ color: #818a91;
|
| |
+ }
|
| |
+ .disabled_branch .new_pr_btn {
|
| |
+ display: none;
|
| |
+ }
|
| |
</style>
|
| |
|
| |
{% endblock %}
|
| |
@@ -144,7 +151,7 @@
|
| |
<h5><strong>Contributors</strong></h5>
|
| |
<div class="m-b-2">
|
| |
<div>
|
| |
- <a href="{{ url_for('view_user', username=repo.user.user)}}">
|
| |
+ <a href="{{ url_for('ui_ns.view_user', username=repo.user.user)}}">
|
| |
{{ repo.user.default_email | avatar(20) | safe }}
|
| |
{{ repo.user.fullname }} ({{ repo.user.user }})
|
| |
</a>
|
| |
@@ -153,7 +160,7 @@
|
| |
{% for access in repo.contributors %}
|
| |
{% for user in repo.contributors[access] %}
|
| |
<div>
|
| |
- <a href="{{ url_for('view_user', username=user.user)}}">
|
| |
+ <a href="{{ url_for('ui_ns.view_user', username=user.user)}}">
|
| |
{{ user.default_email | avatar(20) | safe }}
|
| |
{{ user.fullname }} ({{ user.user }})
|
| |
</a>
|
| |
@@ -164,7 +171,7 @@
|
| |
{% for access in repo.contributor_groups %}
|
| |
{% for group in repo.contributor_groups[access] %}
|
| |
<div>
|
| |
- <a href="{{ url_for('view_group', group=group.group_name)}}">
|
| |
+ <a href="{{ url_for('ui_ns.view_group', group=group.group_name)}}">
|
| |
@{{ group.group_name }}
|
| |
</a>
|
| |
- {{ access }}
|
| |
@@ -184,7 +191,7 @@
|
| |
{% else %}
|
| |
<span class="oi text-muted" data-glyph="random"
|
| |
title="Default branch"></span>
|
| |
- <a href="{{ url_for('view_repo_branch',
|
| |
+ <a href="{{ url_for('ui_ns.view_repo_branch',
|
| |
repo=repo.name,
|
| |
username=username,
|
| |
namespace=repo.namespace,
|
| |
@@ -206,7 +213,7 @@
|
| |
<div class="branch_name col-md-8">
|
| |
<span class="oi text-muted" data-glyph="random"></span>
|
| |
{% if branchname != branch %}
|
| |
- <a class="" href="{{ url_for('view_repo_branch',
|
| |
+ <a class="" href="{{ url_for('ui_ns.view_repo_branch',
|
| |
repo=repo.name,
|
| |
username=username,
|
| |
namespace=repo.namespace,
|
| |
@@ -221,7 +228,7 @@
|
| |
<div class="branch_del col-md-4">
|
| |
{% if g.repo_committer and branch != head and config.get('ALLOW_DELETE_BRANCH', True) %}
|
| |
<form id="delete_branch_form-{{ branch | replace('/', '__') }}" action="{{
|
| |
- url_for('.delete_branch',
|
| |
+ url_for('ui_ns.delete_branch',
|
| |
repo=repo.name,
|
| |
username=username,
|
| |
namespace=repo.namespace,
|
| |
@@ -329,7 +336,7 @@
|
| |
<div class="list-group list-group-flush">
|
| |
{% for commit in last_commits %}
|
| |
<a href="{{
|
| |
- url_for('view_commit',
|
| |
+ url_for('ui_ns.view_commit',
|
| |
repo=repo.name,
|
| |
username=username,
|
| |
namespace=repo.namespace,
|
| |
@@ -381,6 +388,35 @@
|
| |
});
|
| |
});
|
| |
|
| |
+ function disable_branches(){
|
| |
+ function get_branches(_url){
|
| |
+ $.ajax({
|
| |
+ url: _url,
|
| |
+ type: 'GET',
|
| |
+ dataType: 'json',
|
| |
+ success: function(res) {
|
| |
+ for (branch in res.results){
|
| |
+ branch = res.results[branch];
|
| |
+ var _it = $('#branch-' + branch.name);
|
| |
+ _it.addClass('disabled_branch');
|
| |
+ }
|
| |
+ if (res.next){
|
| |
+ get_branches(res.next);
|
| |
+ }
|
| |
+ }
|
| |
+ })
|
| |
+ }
|
| |
+ var _ns = '{{ repo.namespace }}';
|
| |
+ if (_ns == 'rpms') {
|
| |
+ _ns = 'rpm';
|
| |
+ } else if (_ns == 'modules') {
|
| |
+ _ns = 'modules';
|
| |
+ }
|
| |
+ var _url = 'https://pdc.fedoraproject.org/rest_api/v1/component-branches/'
|
| |
+ + '?active=false&type=' + _ns + '&global_component={{ repo.name }}';
|
| |
+ get_branches(_url);
|
| |
+ }
|
| |
+
|
| |
$(function() {
|
| |
$( "#more_gits" ).click(function() {
|
| |
if ($( "#more_gits" ).html() == 'more') {
|
| |
@@ -390,7 +426,7 @@
|
| |
}
|
| |
});
|
| |
|
| |
- {% if authenticated and g.repo_committer %}
|
| |
+ {% if g.authenticated and g.repo_committer %}
|
| |
$.ajax({
|
| |
url: '{{ url_for("internal_ns.get_pull_request_ready_branch") }}' ,
|
| |
type: 'POST',
|
| |
@@ -405,7 +441,7 @@
|
| |
if (res.code == 'OK'){
|
| |
for (branch in res.message.new_branch){
|
| |
var url = "{{ url_for(
|
| |
- 'new_request_pull',
|
| |
+ 'ui_ns.new_request_pull',
|
| |
repo=repo.name,
|
| |
username=repo.user.user if repo.is_fork else None,
|
| |
namespace=repo.namespace,
|
| |
@@ -424,16 +460,16 @@
|
| |
/*$($('.bodycontent').find('.row').children()[0]).before(html);*/
|
| |
{% if repo.is_fork %}
|
| |
html2 = ' \
|
| |
- <a class="small label label-sm label-primary" data-toggle="tooltip" \
|
| |
- href="' + url + branch + '"\
|
| |
+ <a class="small label label-sm label-primary new_pr_btn" data-toggle="tooltip" \
|
| |
+ href="' + url + branch + '"\
|
| |
title="' + branch +' contains '
|
| |
+ res.message.new_branch[branch].length+' \
|
| |
commit not in the upstream project. Click to create new PR now.'+'"> New PR</a> \
|
| |
</div>';
|
| |
{% else %}
|
| |
html2 = ' \
|
| |
- <a class="small label label-sm label-primary" data-toggle="tooltip" \
|
| |
- href="' + url + branch + '"\
|
| |
+ <a class="small label label-sm label-primary new_pr_btn" data-toggle="tooltip" \
|
| |
+ href="' + url + branch + '"\
|
| |
title="' + branch +' contains '
|
| |
+ res.message.new_branch[branch].length+' \
|
| |
commit not in the main branch. Click to create new PR now.'+'"> New PR</a> \
|
| |
@@ -445,7 +481,7 @@
|
| |
}
|
| |
for (branch in res.message.branch_w_pr){
|
| |
var url = "{{ url_for(
|
| |
- 'request_pull',
|
| |
+ 'ui_ns.request_pull',
|
| |
repo=repo.name,
|
| |
username=None,
|
| |
namespace=repo.namespace,
|
| |
@@ -454,7 +490,7 @@
|
| |
var html = ' \
|
| |
<a class="small label label-sm label-success" data-toggle="tooltip" \
|
| |
href="' + url + '"\
|
| |
- title="' + branch +' is already in an opened pull-request">'
|
| |
+ title="' + branch +' is already in an opened pull-request">'
|
| |
+ 'PR#' + res.message.branch_w_pr[branch] + ' </a> \
|
| |
</div>';
|
| |
$('#branch-' + branch.replace('.', '\\.').replace('/', '__')
|
| |
@@ -465,6 +501,9 @@
|
| |
}
|
| |
});
|
| |
{% endif %}
|
| |
+
|
| |
+ disable_branches();
|
| |
+
|
| |
});
|
| |
</script>
|
| |
{% endblock %}
|
| |