Parent: [ddf08c] (diff)

Download this file

repo_master.html    141 lines (130 with data), 5.0 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
{#-
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-#}
{% extends g.theme.master %}
{% if hasattr(c.app, 'repo') %}
{% set repo = c.app.repo %}
{% else %}
{% set repo = None %}
{% endif %}
{% if repo and repo.status != 'ready' %}
{% set hide_left_bar = True %}
{% endif %}
{% block extra_css %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{c.app.url}}feed.rss"/>
<link rel="alternate" type="application/atom+xml" title="Atom" href="{{c.app.url}}feed.atom"/>
{% endblock %}
{% block extra_js %}
<script type="text/javascript" src="{{g.forge_static('js/spin.min.js')}}"></script>
<script type="text/javascript">(function() {
$('#access_urls .btn').click(function(evt){
evt.preventDefault();
var parent = $(this).parents('.btn-bar');
$(parent).find('input').val($(this).attr('data-url'));
$(parent).find('span').text($(this).attr('title')+' access');
$(this).parent().children('.btn').removeClass('active');
$(this).addClass('active');
});
$('#access_urls .btn').first().click();
{% if repo %}
var repo_status = document.getElementById('repo_status');
// The repo_status div will only be present if repo.status != 'ready'
if (repo_status) {
var opts = {
lines: 9, // The number of lines to draw
length: 4, // The length of each line
width: 2, // The line thickness
radius: 3, // The radius of the inner circle
rotate: 0, // The rotation offset
color: '#555', // #rgb or #rrggbb
speed: 1, // Rounds per second
trail: 60, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: false, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
top: 10, // Top position relative to parent in px
left: 10 // Left position relative to parent in px
};
var spinner = new Spinner(opts).spin(repo_status);
function check_status() {
$.get('{{repo.url()}}status', function(data) {
if (data.status === 'ready') {
window.clearInterval(status_checker);
spinner.opts.speed = 0;
spinner.opts.opacity = 1;
spinner.spin(repo_status)
$('#repo_status h2').html('Repo status: ready. <a href=".">Click here to refresh this page.</a>');
}
else {
$('#repo_status h2 span').html(data.status);
}
});
}
// Check repo status every 15 seconds
var status_checker = window.setInterval(check_status, 15000);
{% endif %}
}
}());
</script>
{% endblock %}
{% block before_content %}
{% if repo and repo.status != 'ready' %}
<div id="repo_status">
<h2>Repo status: <span>{{repo.status}}</span>...</h2>
</div>
{% endif %}
{% endblock %}
{% macro clone_info(repo) %}
{% if repo %}
<div id="access_urls" class="btn-bar grid-19">
<div class="btn-set{% if not h.has_access(c.app, 'write')() %} duo{% endif %}">
{% if h.has_access(c.app, 'write')() %}
<a class="btn" data-url="{{repo.clone_command('rw')}}" title="Read/Write">
RW
</a>
<a href="#" class="btn" data-url="{{repo.clone_command('ro')}}" title="Read Only">
RO
</a>
<a href="#" class="btn" data-url="{{repo.clone_command('https')}}" title="HTTP">
HTTP
</a>
{% else %}
<a href="#" class="btn" data-url="{{repo.clone_command('ro')}}" title="Read Only">
RO
</a>
<a href="#" class="btn" data-url="{{repo.clone_command('https_anon')}}" title="HTTP">
HTTP
</a>
{% endif %}
</div>
<span></span>
<input id="access_url" readonly type="text"
class="selectText"
value=""/>
</div>
<hr>
{% endif %}
{% endmacro %}
{% macro commit_labels(commit) %}
{% set branches, tags = commit.symbolic_ids %}
{% for b in branches %}
<span class="scm-branch-label">{{b}}</span>
{% endfor %}
{% for t in tags %}
<span class="scm-tag-label">{{t}}</span>
{% endfor %}
{% endmacro %}