forked from perone/stallion
/
main.html
208 lines (163 loc) · 6.29 KB
/
main.html
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>Stallion, package manager for Python</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/redmond/jquery-ui-1.8.16.custom.css') }}">
<script type="text/javascript" src="{{ url_for('static', filename='jquery-1.7.1.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='jquery-ui-1.8.16.custom.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='ajax-queue.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='bootstrap-modal.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='bootstrap-buttons.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='bootstrap-dropdown.js') }}"></script>
<link rel="stylesheet" href="{{ url_for('static', filename='bootstrap.min.css') }}">
<link href="{{ url_for('static', filename='extra.css') }}" rel="stylesheet">
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
{% block head %}{% endblock %}
<script type="text/javascript">
// This is going to bind the events ajaxStart and ajaxStop into the
// global ajax progress animation on the left of the topbar navigation
$(document).ready(function() {
$("#ajax_load").bind("ajaxStart", function(){
$(this).show();
}).bind("ajaxStop", function(){
$(this).hide();
});
$('#progressbar').progressbar();
$('#topbar').dropdown();
});
// Sets the value of the progress bar
function set_progress_bar_value(prog_value)
{
$('#progressbar').progressbar({value: prog_value});
}
// Main function to check all updates, it is going to send multiple
// ajax requests to a queue
function check_all_updates()
{
set_progress_bar_value(0);
$("#check_updates").fadeIn("slow");
$('img[id^=img]').each(function(current_distr) {
var dist_id = "#" + $(this).prop("id");
var dist_key = $(this).attr("pname");
$.ajaxQueue({
url: '/pypi/check_update/' + dist_key,
dataType: "json",
cache: false,
beforeSend: function(a,b) {
$(dist_id).attr("src", "{{ url_for('static', filename='loader.gif') }}");
$(dist_id).parent().animate({"padding-left": "+=12px"}, "fast");
},
success: function(data) {
var prog_value = $("#progressbar").progressbar("option", "value");
if((current_distr+1) >= {{ distributions|length }})
$("#check_updates").fadeOut("slow");
prog_value = prog_value + 100.0/{{ distributions|length }};
set_progress_bar_value(prog_value);
if(data.has_update) {
$(dist_id).attr("src",
"{{ url_for('static', filename='down-arrow.png') }}")
.stop(true,true).hide().fadeIn();
} else {
$(dist_id).attr("src",
"{{ url_for('static', filename='box-icon.png') }}")
.stop(true,true).hide().fadeIn();
}
$(dist_id).parent().animate({"padding-left": "-=12px"}, "fast");
}
}); // ajax
}); // each img
}
</script>
{% block js %}{% endblock %}
</head>
<body>
<div class="topbar">
<div class="topbar-inner">
<div class="container">
<a class="brand" href="{{ url_for('index') }}">
<img src="{{ url_for('static', filename='stallion_icon.png') }}" class="midicon"> Stallion
</a>
<ul class="nav">
<li class="{{ menu_home }}"><a href="{{ url_for('index') }}">Home</a></li>
<li class="dropdown" data-dropdown="dropdown" >
<a href="#" class="dropdown-toggle">PyPI Repository</a>
<ul class="dropdown-menu">
<li><a href="javascript:check_all_updates();">Check all updates</a></li>
</ul>
</li>
<li class="{{ menu_about }}"><a href="{{ url_for('about') }}">About</a></li>
</ul>
<ul class="nav secondary-nav">
<li><a href="#"><span id="ajax_load" class="progress-span">
<img src="{{ url_for('static', filename='ajax-global.gif') }}" />
</span></a></li>
</ul>
</div>
</div>
</div>
<div class="container-fluid">
<div class="sidebar">
<div align="center">
<a href="{{ url_for('index') }}">
<img src="{{ url_for('static', filename='box.png') }}">
</a>
</div>
<div class="page-header">
<h3>Packages</h3>
</div>
<div id="check_updates" class="progress-span">
Checking for updates... <br />
<div id="progressbar" style="width: 220px; height: 19px;"></div>
<br />
</div>
<ul class="unstyled">
{% for dist_item in distributions|sort(attribute="project_name") %}
{% if dist_item.key|lower in pypi_update_cache %}
{% set img_src = url_for('static', filename='down-arrow.png') %}
{% else %}
{% set img_src = url_for('static', filename='box-icon.png') %}
{% endif %}
<li>
<a href="{{ url_for('distribution', dist_name=dist_item.key) }}">
<img id="img_{{ dist_item.key|lower|replace('.','-') }}" src="{{ img_src }}"
class="midicon" pname="{{ dist_item.project_name }}"/>
{% if dist and dist.key == dist_item.key %}
{{ dist_item.project_name }} {{ dist_item.version }} <img src="{{ url_for('static', filename='left-arrow.png') }}" class="midicon" />
{% else %}
{{ dist_item.project_name }} {{ dist_item.version }}
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</div>
<div class="content">
<div class="page-header">
<h1>Stallion<small> A Package Manager for Python</small></h1>
</div>
<ul class="breadcrumb">
{% for path in breadpath %}
{% if loop.last %}
<li class="active">{{ path.title }}</li>
{% else %}
<li><a href="{{ path.href }}">{{ path.title }}</a><span class="divider">/</span></li>
{% endif %}
{% endfor %}
</ul>
<div class="page-header">
<h2>{% block section_title %}{% endblock %}</h2>
</div>
{% block content %}{% endblock %}
<footer class="footer">
<p>
Created by <em>Christian S. Perone</em> 2011 <a href="http://twitter.com/tarantulae" target="_blank">@tarantulae</a>, <a href="http://pyevolve.sourceforge.net/wordpress" target="_blank">Pyevolve Blog</a>.<br />
Code licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">
Apache License v2.0</a>.
</p>
</footer>
</div>
</div>
</body>
</html>