##// END OF EJS Templates
download: make use of default landing revision for downloads too.
marcink -
r4412:a05a39ec default
parent child Browse files
Show More
@@ -1,252 +1,254 b''
1 <%namespace name="base" file="/base/base.mako"/>
1 <%namespace name="base" file="/base/base.mako"/>
2
2
3 <%def name="refs_counters(branches, closed_branches, tags, bookmarks)">
3 <%def name="refs_counters(branches, closed_branches, tags, bookmarks)">
4 <span class="summary-branchtag summary-tag">
4 <span class="summary-branchtag summary-tag">
5 <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs">
5 <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs">
6 <i class="icon-branch"></i>
6 <i class="icon-branch"></i>
7 % if len(branches) == 1:
7 % if len(branches) == 1:
8 <span>${len(branches)}</span> ${_('Branch')}
8 <span>${len(branches)}</span> ${_('Branch')}
9 % else:
9 % else:
10 <span>${len(branches)}</span> ${_('Branches')}
10 <span>${len(branches)}</span> ${_('Branches')}
11 % endif
11 % endif
12 </a>
12 </a>
13 </span>
13 </span>
14
14
15 %if closed_branches:
15 %if closed_branches:
16 <span class="summary-branchtag summary-tag">
16 <span class="summary-branchtag summary-tag">
17 <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs">
17 <a href="${h.route_path('branches_home',repo_name=c.repo_name)}" class="childs">
18 <i class="icon-branch"></i>
18 <i class="icon-branch"></i>
19 % if len(closed_branches) == 1:
19 % if len(closed_branches) == 1:
20 <span>${len(closed_branches)}</span> ${_('Closed Branch')}
20 <span>${len(closed_branches)}</span> ${_('Closed Branch')}
21 % else:
21 % else:
22 <span>${len(closed_branches)}</span> ${_('Closed Branches')}
22 <span>${len(closed_branches)}</span> ${_('Closed Branches')}
23 % endif
23 % endif
24 </a>
24 </a>
25 </span>
25 </span>
26 %endif
26 %endif
27
27
28 <span class="summary-tagtag summary-tag">
28 <span class="summary-tagtag summary-tag">
29 <a href="${h.route_path('tags_home',repo_name=c.repo_name)}" class="childs">
29 <a href="${h.route_path('tags_home',repo_name=c.repo_name)}" class="childs">
30 <i class="icon-tag"></i>
30 <i class="icon-tag"></i>
31 % if len(tags) == 1:
31 % if len(tags) == 1:
32 <span>${len(tags)}</span> ${_('Tag')}
32 <span>${len(tags)}</span> ${_('Tag')}
33 % else:
33 % else:
34 <span>${len(tags)}</span> ${_('Tags')}
34 <span>${len(tags)}</span> ${_('Tags')}
35 % endif
35 % endif
36 </a>
36 </a>
37 </span>
37 </span>
38
38
39 %if bookmarks:
39 %if bookmarks:
40 <span class="summary-booktag summary-tag">
40 <span class="summary-booktag summary-tag">
41 <a href="${h.route_path('bookmarks_home',repo_name=c.repo_name)}" class="childs">
41 <a href="${h.route_path('bookmarks_home',repo_name=c.repo_name)}" class="childs">
42 <i class="icon-bookmark"></i>
42 <i class="icon-bookmark"></i>
43 % if len(bookmarks) == 1:
43 % if len(bookmarks) == 1:
44 <span>${len(bookmarks)}</span> ${_('Bookmark')}
44 <span>${len(bookmarks)}</span> ${_('Bookmark')}
45 % else:
45 % else:
46 <span>${len(bookmarks)}</span> ${_('Bookmarks')}
46 <span>${len(bookmarks)}</span> ${_('Bookmarks')}
47 % endif
47 % endif
48 </a>
48 </a>
49 </span>
49 </span>
50 %endif
50 %endif
51 </%def>
51 </%def>
52
52
53 <%def name="summary_detail(breadcrumbs_links, show_downloads=True)">
53 <%def name="summary_detail(breadcrumbs_links, show_downloads=True)">
54 <% summary = lambda n:{False:'summary-short'}.get(n) %>
54 <% summary = lambda n:{False:'summary-short'}.get(n) %>
55
55
56 <div id="summary-menu-stats" class="summary-detail">
56 <div id="summary-menu-stats" class="summary-detail">
57 <div class="fieldset">
57 <div class="fieldset">
58 <div class="left-content">
58 <div class="left-content">
59 <div class="left-clone">
59 <div class="left-clone">
60 <select id="clone_option" name="clone_option">
60 <select id="clone_option" name="clone_option">
61 <option value="http" selected="selected">HTTP</option>
61 <option value="http" selected="selected">HTTP</option>
62 <option value="http_id">HTTP UID</option>
62 <option value="http_id">HTTP UID</option>
63 % if c.ssh_enabled:
63 % if c.ssh_enabled:
64 <option value="ssh">SSH</option>
64 <option value="ssh">SSH</option>
65 % endif
65 % endif
66 </select>
66 </select>
67 </div>
67 </div>
68
68
69 <div class="right-clone">
69 <div class="right-clone">
70 <%
70 <%
71 maybe_disabled = ''
71 maybe_disabled = ''
72 if h.is_svn_without_proxy(c.rhodecode_db_repo):
72 if h.is_svn_without_proxy(c.rhodecode_db_repo):
73 maybe_disabled = 'disabled'
73 maybe_disabled = 'disabled'
74 %>
74 %>
75
75
76 <span id="clone_option_http">
76 <span id="clone_option_http">
77 <input type="text" class="input-monospace clone_url_input" ${maybe_disabled} readonly="readonly" value="${c.clone_repo_url}"/>
77 <input type="text" class="input-monospace clone_url_input" ${maybe_disabled} readonly="readonly" value="${c.clone_repo_url}"/>
78 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url}" title="${_('Copy the clone url')}"></i>
78 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url}" title="${_('Copy the clone url')}"></i>
79 </span>
79 </span>
80
80
81 <span style="display: none;" id="clone_option_http_id">
81 <span style="display: none;" id="clone_option_http_id">
82 <input type="text" class="input-monospace clone_url_input" ${maybe_disabled} readonly="readonly" value="${c.clone_repo_url_id}"/>
82 <input type="text" class="input-monospace clone_url_input" ${maybe_disabled} readonly="readonly" value="${c.clone_repo_url_id}"/>
83 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url_id}" title="${_('Copy the clone by id url')}"></i>
83 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url_id}" title="${_('Copy the clone by id url')}"></i>
84 </span>
84 </span>
85
85
86 <span style="display: none;" id="clone_option_ssh">
86 <span style="display: none;" id="clone_option_ssh">
87 <input type="text" class="input-monospace clone_url_input" ${maybe_disabled} readonly="readonly" value="${c.clone_repo_url_ssh}"/>
87 <input type="text" class="input-monospace clone_url_input" ${maybe_disabled} readonly="readonly" value="${c.clone_repo_url_ssh}"/>
88 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url_ssh}" title="${_('Copy the clone by ssh url')}"></i>
88 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.clone_repo_url_ssh}" title="${_('Copy the clone by ssh url')}"></i>
89 </span>
89 </span>
90
90
91 % if maybe_disabled:
91 % if maybe_disabled:
92 <p class="help-block">${_('SVN Protocol is disabled. To enable it, see the')} <a href="${h.route_url('enterprise_svn_setup')}" target="_blank">${_('documentation here')}</a>.</p>
92 <p class="help-block">${_('SVN Protocol is disabled. To enable it, see the')} <a href="${h.route_url('enterprise_svn_setup')}" target="_blank">${_('documentation here')}</a>.</p>
93 % endif
93 % endif
94 </div>
94 </div>
95 </div>
95 </div>
96
96
97 <div class="right-content">
97 <div class="right-content">
98 <div class="commit-info">
98 <div class="commit-info">
99 <div class="tags">
99 <div class="tags">
100 <% commit_rev = c.rhodecode_db_repo.changeset_cache.get('revision') %>
100 <% commit_rev = c.rhodecode_db_repo.changeset_cache.get('revision') %>
101 % if c.rhodecode_repo:
101 % if c.rhodecode_repo:
102 ${refs_counters(
102 ${refs_counters(
103 c.rhodecode_repo.branches,
103 c.rhodecode_repo.branches,
104 c.rhodecode_repo.branches_closed,
104 c.rhodecode_repo.branches_closed,
105 c.rhodecode_repo.tags,
105 c.rhodecode_repo.tags,
106 c.rhodecode_repo.bookmarks)}
106 c.rhodecode_repo.bookmarks)}
107 % else:
107 % else:
108 ## missing requirements can make c.rhodecode_repo None
108 ## missing requirements can make c.rhodecode_repo None
109 ${refs_counters([], [], [], [])}
109 ${refs_counters([], [], [], [])}
110 % endif
110 % endif
111
111
112 ## commits
112 ## commits
113 <span class="summary-tag">
113 <span class="summary-tag">
114 % if commit_rev == -1:
114 % if commit_rev == -1:
115 <i class="icon-history"></i>
115 <i class="icon-history"></i>
116 % if commit_rev == -1:
116 % if commit_rev == -1:
117 <span>0</span> ${_('Commit')}
117 <span>0</span> ${_('Commit')}
118 % else:
118 % else:
119 <span>0</span> ${_('Commits')}
119 <span>0</span> ${_('Commits')}
120 % endif
120 % endif
121 % else:
121 % else:
122 <a href="${h.route_path('repo_commits', repo_name=c.repo_name)}">
122 <a href="${h.route_path('repo_commits', repo_name=c.repo_name)}">
123 <i class="icon-history"></i>
123 <i class="icon-history"></i>
124 % if commit_rev == 1:
124 % if commit_rev == 1:
125 <span>${commit_rev}</span> ${_('Commit')}
125 <span>${commit_rev}</span> ${_('Commit')}
126 % else:
126 % else:
127 <span>${commit_rev}</span> ${_('Commits')}
127 <span>${commit_rev}</span> ${_('Commits')}
128 % endif
128 % endif
129 </a>
129 </a>
130 % endif
130 % endif
131 </span>
131 </span>
132
132
133 ## forks
133 ## forks
134 <span class="summary-tag">
134 <span class="summary-tag">
135 <a title="${_('Number of Repository Forks')}" href="${h.route_path('repo_forks_show_all', repo_name=c.repo_name)}">
135 <a title="${_('Number of Repository Forks')}" href="${h.route_path('repo_forks_show_all', repo_name=c.repo_name)}">
136 <i class="icon-code-fork"></i>
136 <i class="icon-code-fork"></i>
137 <span>${c.repository_forks}</span> ${_ungettext('Fork', 'Forks', c.repository_forks)}</a>
137 <span>${c.repository_forks}</span> ${_ungettext('Fork', 'Forks', c.repository_forks)}</a>
138 </span>
138 </span>
139 </div>
139 </div>
140 </div>
140 </div>
141 </div>
141 </div>
142 </div>
142 </div>
143 ## owner, description, downloads, statistics
143 ## owner, description, downloads, statistics
144
144
145 ## Owner
145 ## Owner
146 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
146 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
147 <div class="left-label-summary">
147 <div class="left-label-summary">
148 <p>${_('Owner')}</p>
148 <p>${_('Owner')}</p>
149 <div class="right-label-summary">
149 <div class="right-label-summary">
150 ${base.gravatar_with_user(c.rhodecode_db_repo.user.email, 16, tooltip=True)}
150 ${base.gravatar_with_user(c.rhodecode_db_repo.user.email, 16, tooltip=True)}
151 </div>
151 </div>
152
152
153 </div>
153 </div>
154 </div>
154 </div>
155
155
156 ## Description
156 ## Description
157 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
157 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
158 <div class="left-label-summary">
158 <div class="left-label-summary">
159 <p>${_('Description')}</p>
159 <p>${_('Description')}</p>
160
160
161 <div class="right-label-summary input ${summary(c.show_stats)}">
161 <div class="right-label-summary input ${summary(c.show_stats)}">
162 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
162 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
163 ${dt.repo_desc(c.rhodecode_db_repo.description_safe, c.visual.stylify_metatags)}
163 ${dt.repo_desc(c.rhodecode_db_repo.description_safe, c.visual.stylify_metatags)}
164 </div>
164 </div>
165 </div>
165 </div>
166 </div>
166 </div>
167
167
168 ## Downloads
168 ## Downloads
169 % if show_downloads:
169 % if show_downloads:
170 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
170 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
171 <div class="left-label-summary">
171 <div class="left-label-summary">
172 <p>${_('Downloads')}</p>
172 <p>${_('Downloads')}</p>
173
173
174 <div class="right-label-summary input ${summary(c.show_stats)} downloads">
174 <div class="right-label-summary input ${summary(c.show_stats)} downloads">
175 % if c.rhodecode_repo and len(c.rhodecode_repo.commit_ids) == 0:
175 % if c.rhodecode_repo and len(c.rhodecode_repo.commit_ids) == 0:
176 <span class="disabled">
176 <span class="disabled">
177 ${_('There are no downloads yet')}
177 ${_('There are no downloads yet')}
178 </span>
178 </span>
179 % elif not c.enable_downloads:
179 % elif not c.enable_downloads:
180 <span class="disabled">
180 <span class="disabled">
181 ${_('Downloads are disabled for this repository')}.
181 ${_('Downloads are disabled for this repository')}.
182 </span>
182 </span>
183 % if c.is_super_admin:
183 % if c.is_super_admin:
184 ${h.link_to(_('Enable downloads'),h.route_path('edit_repo',repo_name=c.repo_name, _anchor='repo_enable_downloads'))}
184 ${h.link_to(_('Enable downloads'),h.route_path('edit_repo',repo_name=c.repo_name, _anchor='repo_enable_downloads'))}
185 % endif
185 % endif
186 % else:
186 % else:
187 <span class="enabled">
187 <span class="enabled">
188 <a id="archive_link" class="btn btn-small" href="${h.route_path('repo_archivefile',repo_name=c.rhodecode_db_repo.repo_name,fname='tip.zip')}">
188
189 tip.zip
189 <a id="archive_link" class="btn btn-small" href="${h.route_path('repo_archivefile',repo_name=c.rhodecode_db_repo.repo_name, fname=c.rhodecode_db_repo.landing_ref_name+'.zip')}">
190 <i class="icon-download"></i>
191 ${c.rhodecode_db_repo.landing_ref_name}.zip
190 ## replaced by some JS on select
192 ## replaced by some JS on select
191 </a>
193 </a>
192 </span>
194 </span>
193 ${h.hidden('download_options')}
195 ${h.hidden('download_options')}
194 % endif
196 % endif
195 </div>
197 </div>
196 </div>
198 </div>
197 </div>
199 </div>
198 % endif
200 % endif
199
201
200 ## Repo size
202 ## Repo size
201 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
203 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
202 <div class="left-label-summary">
204 <div class="left-label-summary">
203 <p>${_('Repository size')}</p>
205 <p>${_('Repository size')}</p>
204
206
205 <div class="right-label-summary">
207 <div class="right-label-summary">
206 <div class="tags">
208 <div class="tags">
207 ## repo size
209 ## repo size
208 % if commit_rev == -1:
210 % if commit_rev == -1:
209 <span class="stats-bullet">0 B</span>
211 <span class="stats-bullet">0 B</span>
210 % else:
212 % else:
211 <span>
213 <span>
212 <a href="#showSize" onclick="calculateSize(); $(this).hide(); return false" id="show-repo-size">Show repository size</a>
214 <a href="#showSize" onclick="calculateSize(); $(this).hide(); return false" id="show-repo-size">Show repository size</a>
213 </span>
215 </span>
214 <span class="stats-bullet" id="repo_size_container" style="display:none">
216 <span class="stats-bullet" id="repo_size_container" style="display:none">
215 ${_('Calculating Repository Size...')}
217 ${_('Calculating Repository Size...')}
216 </span>
218 </span>
217 % endif
219 % endif
218 </div>
220 </div>
219 </div>
221 </div>
220 </div>
222 </div>
221 </div>
223 </div>
222
224
223 ## Statistics
225 ## Statistics
224 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
226 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
225 <div class="left-label-summary">
227 <div class="left-label-summary">
226 <p>${_('Code Statistics')}</p>
228 <p>${_('Code Statistics')}</p>
227
229
228 <div class="right-label-summary input ${summary(c.show_stats)} statistics">
230 <div class="right-label-summary input ${summary(c.show_stats)} statistics">
229 % if c.show_stats:
231 % if c.show_stats:
230 <div id="lang_stats" class="enabled">
232 <div id="lang_stats" class="enabled">
231 <a href="#showSize" onclick="calculateSize(); $('#show-repo-size').hide(); $(this).hide(); return false" id="show-repo-size">Show code statistics</a>
233 <a href="#showSize" onclick="calculateSize(); $('#show-repo-size').hide(); $(this).hide(); return false" id="show-repo-size">Show code statistics</a>
232 </div>
234 </div>
233 % else:
235 % else:
234 <span class="disabled">
236 <span class="disabled">
235 ${_('Statistics are disabled for this repository')}.
237 ${_('Statistics are disabled for this repository')}.
236 </span>
238 </span>
237 % if c.is_super_admin:
239 % if c.is_super_admin:
238 ${h.link_to(_('Enable statistics'),h.route_path('edit_repo',repo_name=c.repo_name, _anchor='repo_enable_statistics'))}
240 ${h.link_to(_('Enable statistics'),h.route_path('edit_repo',repo_name=c.repo_name, _anchor='repo_enable_statistics'))}
239 % endif
241 % endif
240 % endif
242 % endif
241 </div>
243 </div>
242
244
243 </div>
245 </div>
244 </div>
246 </div>
245
247
246
248
247 </div><!--end summary-detail-->
249 </div><!--end summary-detail-->
248
250
249 <div id="summary_details_expand" class="btn-collapse" data-toggle="summary-details">
251 <div id="summary_details_expand" class="btn-collapse" data-toggle="summary-details">
250 ${_('Show More')}
252 ${_('Show More')}
251 </div>
253 </div>
252 </%def>
254 </%def>
@@ -1,118 +1,119 b''
1 <%inherit file="/summary/summary_base.mako"/>
1 <%inherit file="/summary/summary_base.mako"/>
2
2
3 <%namespace name="components" file="/summary/components.mako"/>
3 <%namespace name="components" file="/summary/components.mako"/>
4
4
5
5
6 <%def name="menu_bar_subnav()">
6 <%def name="menu_bar_subnav()">
7 ${self.repo_menu(active='summary')}
7 ${self.repo_menu(active='summary')}
8 </%def>
8 </%def>
9
9
10 <%def name="main()">
10 <%def name="main()">
11
11
12 <div id="repo-summary" class="summary">
12 <div id="repo-summary" class="summary">
13 ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=True)}
13 ${components.summary_detail(breadcrumbs_links=self.breadcrumbs_links(), show_downloads=True)}
14 </div><!--end repo-summary-->
14 </div><!--end repo-summary-->
15
15
16
16
17 <div class="box">
17 <div class="box">
18 %if not c.repo_commits:
18 %if not c.repo_commits:
19 <div class="empty-repo">
19 <div class="empty-repo">
20 <div class="title">
20 <div class="title">
21 <h3>${_('Quick start')}</h3>
21 <h3>${_('Quick start')}</h3>
22 </div>
22 </div>
23 <div class="clear-fix"></div>
23 <div class="clear-fix"></div>
24 </div>
24 </div>
25 %endif
25 %endif
26 <div class="table">
26 <div class="table">
27 <div id="shortlog_data">
27 <div id="shortlog_data">
28 <%include file='summary_commits.mako'/>
28 <%include file='summary_commits.mako'/>
29 </div>
29 </div>
30 </div>
30 </div>
31 </div>
31 </div>
32
32
33 %if c.readme_data:
33 %if c.readme_data:
34 <div id="readme" class="anchor">
34 <div id="readme" class="anchor">
35 <div class="box">
35 <div class="box">
36
36
37 <div class="readme-title" title="${h.tooltip(_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_ref_type, c.rhodecode_db_repo.landing_ref_name))}">
37 <div class="readme-title" title="${h.tooltip(_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_ref_type, c.rhodecode_db_repo.landing_ref_name))}">
38 <div>
38 <div>
39 <i class="icon-file-text"></i>
39 <i class="icon-file-text"></i>
40 <a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.landing_ref_name,f_path=c.readme_file)}">
40 <a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.landing_ref_name,f_path=c.readme_file)}">
41 ${c.readme_file}
41 ${c.readme_file}
42 </a>
42 </a>
43 </div>
43 </div>
44 </div>
44 </div>
45 <div class="readme codeblock">
45 <div class="readme codeblock">
46 <div class="readme_box">
46 <div class="readme_box">
47 ${c.readme_data|n}
47 ${c.readme_data|n}
48 </div>
48 </div>
49 </div>
49 </div>
50 </div>
50 </div>
51 </div>
51 </div>
52 %endif
52 %endif
53
53
54 <script type="text/javascript">
54 <script type="text/javascript">
55 $(document).ready(function(){
55 $(document).ready(function(){
56
56
57 var showCloneField = function(clone_url_format){
57 var showCloneField = function(clone_url_format){
58 $.each(['http', 'http_id', 'ssh'], function (idx, val) {
58 $.each(['http', 'http_id', 'ssh'], function (idx, val) {
59 if(val === clone_url_format){
59 if(val === clone_url_format){
60 $('#clone_option_' + val).show();
60 $('#clone_option_' + val).show();
61 $('#clone_option').val(val)
61 $('#clone_option').val(val)
62 } else {
62 } else {
63 $('#clone_option_' + val).hide();
63 $('#clone_option_' + val).hide();
64 }
64 }
65 });
65 });
66 };
66 };
67 // default taken from session
67 // default taken from session
68 showCloneField(templateContext.session_attrs.clone_url_format);
68 showCloneField(templateContext.session_attrs.clone_url_format);
69
69
70 $('#clone_option').on('change', function(e) {
70 $('#clone_option').on('change', function(e) {
71 var selected = $(this).val();
71 var selected = $(this).val();
72
72
73 storeUserSessionAttr('rc_user_session_attr.clone_url_format', selected);
73 storeUserSessionAttr('rc_user_session_attr.clone_url_format', selected);
74 showCloneField(selected)
74 showCloneField(selected)
75 });
75 });
76
76
77 var initialCommitData = {
77 var initialCommitData = {
78 id: null,
78 id: null,
79 text: 'tip',
79 text: '${c.rhodecode_db_repo.landing_ref_name}',
80 type: 'tag',
80 type: '${c.rhodecode_db_repo.landing_ref_type}',
81 raw_id: null,
81 raw_id: null,
82 files_url: null
82 files_url: null
83 };
83 };
84
84
85 select2RefSwitcher('#download_options', initialCommitData);
85 select2RefSwitcher('#download_options', initialCommitData);
86
86
87 // on change of download options
87 // on change of download options
88 $('#download_options').on('change', function(e) {
88 $('#download_options').on('change', function(e) {
89 // format of Object {text: "v0.0.3", type: "tag", id: "rev"}
89 // format of Object {text: "v0.0.3", type: "tag", id: "rev"}
90 var ext = '.zip';
90 var ext = '.zip';
91 var selected_cs = e.added;
91 var selected_cs = e.added;
92 var fname = e.added.raw_id + ext;
92 var fname = e.added.raw_id + ext;
93 var href = pyroutes.url('repo_archivefile', {'repo_name': templateContext.repo_name, 'fname':fname});
93 var href = pyroutes.url('repo_archivefile', {'repo_name': templateContext.repo_name, 'fname':fname});
94 // set new label
94 // set new label
95 $('#archive_link').html('{0}{1}'.format(escapeHtml(e.added.text), ext));
95 var ico = '<i class="icon-download"></i>';
96 $('#archive_link').html(ico+' {0}{1}'.format(escapeHtml(e.added.text), ext));
96
97
97 // set new url to button,
98 // set new url to button,
98 $('#archive_link').attr('href', href)
99 $('#archive_link').attr('href', href)
99 });
100 });
100
101
101
102
102 // calculate size of repository
103 // calculate size of repository
103 calculateSize = function () {
104 calculateSize = function () {
104
105
105 var callback = function (data) {
106 var callback = function (data) {
106 % if c.show_stats:
107 % if c.show_stats:
107 showRepoStats('lang_stats', data);
108 showRepoStats('lang_stats', data);
108 % endif
109 % endif
109 };
110 };
110
111
111 showRepoSize('repo_size_container', templateContext.repo_name, templateContext.repo_landing_commit, callback);
112 showRepoSize('repo_size_container', templateContext.repo_name, templateContext.repo_landing_commit, callback);
112
113
113 }
114 }
114
115
115 })
116 })
116 </script>
117 </script>
117
118
118 </%def>
119 </%def>
General Comments 0
You need to be logged in to leave comments. Login now