##// END OF EJS Templates
ui: make readme header nicer
marcink -
r4097:60c6e373 default
parent child Browse files
Show More
@@ -1,257 +1,266 b''
1 /** README styling **/
1 /** README styling **/
2
3 .readme-title {
4 border: 1px solid @grey6;
5 padding: 10px 5px;
6 font-weight: 600;
7 margin-top: 30px;
8 margin-bottom: -1px;
9 }
10
2 div.readme_box {
11 div.readme_box {
3 clear: both;
12 clear: both;
4 overflow: hidden;
13 overflow: hidden;
5 margin: 0;
14 margin: 0;
6 padding: 3px 15px 3px;
15 padding: 3px 15px 3px;
7 }
16 }
8
17
9 div.readme_box h1,
18 div.readme_box h1,
10 div.readme_box h2,
19 div.readme_box h2,
11 div.readme_box h3,
20 div.readme_box h3,
12 div.readme_box h4,
21 div.readme_box h4,
13 div.readme_box h5,
22 div.readme_box h5,
14 div.readme_box h6 {
23 div.readme_box h6 {
15 border-bottom: none !important;
24 border-bottom: none !important;
16 padding: 0 !important;
25 padding: 0 !important;
17 overflow: visible !important;
26 overflow: visible !important;
18 }
27 }
19
28
20 div.readme_box h1,
29 div.readme_box h1,
21 div.readme_box h2 {
30 div.readme_box h2 {
22 border-bottom: 1px #e6e5e5 solid !important;
31 border-bottom: 1px #e6e5e5 solid !important;
23 }
32 }
24
33
25 div.readme_box h1 {
34 div.readme_box h1 {
26 font-size: 32px;
35 font-size: 32px;
27 margin: 15px 0 15px 0 !important;
36 margin: 15px 0 15px 0 !important;
28 padding-bottom: 5px !important;
37 padding-bottom: 5px !important;
29 }
38 }
30
39
31 div.readme_box h2 {
40 div.readme_box h2 {
32 font-size: 24px !important;
41 font-size: 24px !important;
33 margin: 34px 0 10px 0 !important;
42 margin: 34px 0 10px 0 !important;
34 padding-top: 15px !important;
43 padding-top: 15px !important;
35 padding-bottom: 8px !important;
44 padding-bottom: 8px !important;
36 }
45 }
37
46
38 div.readme_box h3 {
47 div.readme_box h3 {
39 font-size: 18px !important;
48 font-size: 18px !important;
40 margin: 30px 0 8px 0 !important;
49 margin: 30px 0 8px 0 !important;
41 padding-bottom: 2px !important;
50 padding-bottom: 2px !important;
42 }
51 }
43
52
44 div.readme_box h4 {
53 div.readme_box h4 {
45 font-size: 13px !important;
54 font-size: 13px !important;
46 margin: 18px 0 3px 0 !important;
55 margin: 18px 0 3px 0 !important;
47 }
56 }
48
57
49 div.readme_box h5 {
58 div.readme_box h5 {
50 font-size: 12px !important;
59 font-size: 12px !important;
51 margin: 15px 0 3px 0 !important;
60 margin: 15px 0 3px 0 !important;
52 }
61 }
53
62
54 div.readme_box h6 {
63 div.readme_box h6 {
55 font-size: 12px;
64 font-size: 12px;
56 color: #777777;
65 color: #777777;
57 margin: 15px 0 3px 0 !important;
66 margin: 15px 0 3px 0 !important;
58 }
67 }
59
68
60 div.readme_box hr {
69 div.readme_box hr {
61 border: 0;
70 border: 0;
62 color: #e6e5e5;
71 color: #e6e5e5;
63 background-color: #e6e5e5;
72 background-color: #e6e5e5;
64 height: 3px;
73 height: 3px;
65 margin-bottom: 13px;
74 margin-bottom: 13px;
66 }
75 }
67
76
68 div.readme_box ol,
77 div.readme_box ol,
69 div.readme_box ul,
78 div.readme_box ul,
70 div.readme_box p,
79 div.readme_box p,
71 div.readme_box blockquote,
80 div.readme_box blockquote,
72 div.readme_box dl,
81 div.readme_box dl,
73 div.readme_box li,
82 div.readme_box li,
74 div.readme_box table {
83 div.readme_box table {
75 margin: 3px 0px 13px 0px !important;
84 margin: 3px 0px 13px 0px !important;
76 color: #424242 !important;
85 color: #424242 !important;
77 font-size: 13px !important;
86 font-size: 13px !important;
78 font-family: @text-regular;
87 font-family: @text-regular;
79 font-weight: normal !important;
88 font-weight: normal !important;
80 overflow: visible !important;
89 overflow: visible !important;
81 line-height: 140% !important;
90 line-height: 140% !important;
82 }
91 }
83
92
84 div.readme_box pre {
93 div.readme_box pre {
85 margin: 3px 0px 13px 0px !important;
94 margin: 3px 0px 13px 0px !important;
86 padding: .5em;
95 padding: .5em;
87 color: #424242 !important;
96 color: #424242 !important;
88 font-size: 13px !important;
97 font-size: 13px !important;
89 overflow: visible !important;
98 overflow: visible !important;
90 line-height: 140% !important;
99 line-height: 140% !important;
91 }
100 }
92
101
93 div.readme_box img {
102 div.readme_box img {
94 border-style: none;
103 border-style: none;
95 background-color: #fff;
104 background-color: #fff;
96 padding-right: 20px;
105 padding-right: 20px;
97 max-width: 100%;
106 max-width: 100%;
98 }
107 }
99
108
100
109
101 div.readme_box strong {
110 div.readme_box strong {
102 font-weight: 600;
111 font-weight: 600;
103 margin: 0;
112 margin: 0;
104 }
113 }
105
114
106 div.readme_box ul,
115 div.readme_box ul,
107 div.readme_box ol {
116 div.readme_box ol {
108 padding-left: 30px !important;
117 padding-left: 30px !important;
109 margin-top: 0px !important;
118 margin-top: 0px !important;
110 margin-bottom: 18px !important;
119 margin-bottom: 18px !important;
111 }
120 }
112
121
113 div.readme_box ul li,
122 div.readme_box ul li,
114 div.readme_box ol li {
123 div.readme_box ol li {
115 list-style: disc !important;
124 list-style: disc !important;
116 margin: 6px !important;
125 margin: 6px !important;
117 padding: 0 !important;
126 padding: 0 !important;
118 }
127 }
119
128
120 div.readme_box ol li {
129 div.readme_box ol li {
121 list-style: decimal !important;
130 list-style: decimal !important;
122 }
131 }
123
132
124 /*
133 /*
125 div.readme_box a,
134 div.readme_box a,
126 div.readme_box a:visited {
135 div.readme_box a:visited {
127 color: #4183C4 !important;
136 color: #4183C4 !important;
128 background-color: inherit;
137 background-color: inherit;
129 text-decoration: none;
138 text-decoration: none;
130 }
139 }
131 */
140 */
132
141
133
142
134 div.readme_box button {
143 div.readme_box button {
135 font-size: @basefontsize;
144 font-size: @basefontsize;
136 padding: 4px 6px;
145 padding: 4px 6px;
137 .border-radius(@border-radius);
146 .border-radius(@border-radius);
138 border: @border-thickness solid @grey5;
147 border: @border-thickness solid @grey5;
139 background-color: @grey6;
148 background-color: @grey6;
140 }
149 }
141
150
142 div.readme_box code,
151 div.readme_box code,
143 div.readme_box pre {
152 div.readme_box pre {
144 font-family: @text-monospace;
153 font-family: @text-monospace;
145 font-size: 11px;
154 font-size: 11px;
146 .border-radius(@border-radius);
155 .border-radius(@border-radius);
147 background-color: white;
156 background-color: white;
148 color: @grey3;
157 color: @grey3;
149 }
158 }
150
159
151
160
152 div.readme_box code {
161 div.readme_box code {
153 border: @border-thickness solid @grey6;
162 border: @border-thickness solid @grey6;
154 margin: 0 2px;
163 margin: 0 2px;
155 padding: 0 5px;
164 padding: 0 5px;
156 }
165 }
157
166
158 div.readme_box pre {
167 div.readme_box pre {
159 border: @border-thickness solid #CBDBEB;
168 border: @border-thickness solid #CBDBEB;
160 overflow: auto;
169 overflow: auto;
161 padding: .5em;
170 padding: .5em;
162 background-color: #FCFEFF;
171 background-color: #FCFEFF;
163 }
172 }
164
173
165 div.readme_box pre > code {
174 div.readme_box pre > code {
166 border: 0;
175 border: 0;
167 margin: 0;
176 margin: 0;
168 padding: 0;
177 padding: 0;
169 }
178 }
170
179
171 /** RST STYLE **/
180 /** RST STYLE **/
172 div.rst-block {
181 div.rst-block {
173 clear: both;
182 clear: both;
174 overflow: hidden;
183 overflow: hidden;
175 margin: 0;
184 margin: 0;
176 padding: 3px 15px 3px;
185 padding: 3px 15px 3px;
177 }
186 }
178
187
179 div.rst-block h2 {
188 div.rst-block h2 {
180 font-weight: normal;
189 font-weight: normal;
181 }
190 }
182
191
183 div.rst-block h1,
192 div.rst-block h1,
184 div.rst-block h2,
193 div.rst-block h2,
185 div.rst-block h3,
194 div.rst-block h3,
186 div.rst-block h4,
195 div.rst-block h4,
187 div.rst-block h5,
196 div.rst-block h5,
188 div.rst-block h6 {
197 div.rst-block h6 {
189 border-bottom: 0 !important;
198 border-bottom: 0 !important;
190 margin: 0 !important;
199 margin: 0 !important;
191 padding: 0 !important;
200 padding: 0 !important;
192 line-height: 1.5em !important;
201 line-height: 1.5em !important;
193 }
202 }
194
203
195
204
196 div.rst-block h1:first-child {
205 div.rst-block h1:first-child {
197 padding-top: .25em !important;
206 padding-top: .25em !important;
198 }
207 }
199
208
200 div.rst-block h2,
209 div.rst-block h2,
201 div.rst-block h3 {
210 div.rst-block h3 {
202 margin: 1em 0 !important;
211 margin: 1em 0 !important;
203 }
212 }
204
213
205 div.rst-block h2 {
214 div.rst-block h2 {
206 margin-top: 1.5em !important;
215 margin-top: 1.5em !important;
207 border-top: 4px solid #e0e0e0 !important;
216 border-top: 4px solid #e0e0e0 !important;
208 padding-top: .5em !important;
217 padding-top: .5em !important;
209 }
218 }
210
219
211 div.rst-block p {
220 div.rst-block p {
212 color: black !important;
221 color: black !important;
213 margin: 1em 0 !important;
222 margin: 1em 0 !important;
214 line-height: 1.5em !important;
223 line-height: 1.5em !important;
215 }
224 }
216
225
217 div.rst-block ul {
226 div.rst-block ul {
218 list-style: disc !important;
227 list-style: disc !important;
219 margin: 1em 0 1em 2em !important;
228 margin: 1em 0 1em 2em !important;
220 clear: both;
229 clear: both;
221 }
230 }
222
231
223 div.rst-block ol {
232 div.rst-block ol {
224 list-style: decimal;
233 list-style: decimal;
225 margin: 1em 0 1em 2em !important;
234 margin: 1em 0 1em 2em !important;
226 }
235 }
227
236
228 div.rst-block pre,
237 div.rst-block pre,
229 div.rst-block code {
238 div.rst-block code {
230 font: 12px "Bitstream Vera Sans Mono","Courier",monospace;
239 font: 12px "Bitstream Vera Sans Mono","Courier",monospace;
231 }
240 }
232
241
233 div.rst-block code {
242 div.rst-block code {
234 font-size: 12px !important;
243 font-size: 12px !important;
235 background-color: ghostWhite !important;
244 background-color: ghostWhite !important;
236 color: #444 !important;
245 color: #444 !important;
237 padding: 0 .2em !important;
246 padding: 0 .2em !important;
238 border: 1px solid #dedede !important;
247 border: 1px solid #dedede !important;
239 }
248 }
240
249
241 div.rst-block pre code {
250 div.rst-block pre code {
242 padding: 0 !important;
251 padding: 0 !important;
243 font-size: 12px !important;
252 font-size: 12px !important;
244 background-color: #eee !important;
253 background-color: #eee !important;
245 border: none !important;
254 border: none !important;
246 }
255 }
247
256
248 div.rst-block pre {
257 div.rst-block pre {
249 margin: 1em 0;
258 margin: 1em 0;
250 padding: @padding;
259 padding: @padding;
251 border: 1px solid @grey6;
260 border: 1px solid @grey6;
252 .border-radius(@border-radius);
261 .border-radius(@border-radius);
253 overflow: auto;
262 overflow: auto;
254 font-size: 12px;
263 font-size: 12px;
255 color: #444;
264 color: #444;
256 background-color: @grey7;
265 background-color: @grey7;
257 } No newline at end of file
266 }
@@ -1,83 +1,84 b''
1
1
2 <div id="codeblock" class="browserblock">
2 <div id="codeblock" class="browserblock">
3 <div class="browser-header">
3 <div class="browser-header">
4 <div class="browser-nav">
4 <div class="browser-nav">
5
5
6 <div class="info_box">
6 <div class="info_box">
7
7
8 <div class="info_box_elem previous">
8 <div class="info_box_elem previous">
9 <a id="prev_commit_link" data-commit-id="${c.prev_commit.raw_id}" class=" ${('disabled' if c.url_prev == '#' else '')}" href="${c.url_prev}" title="${_('Previous commit')}"><i class="icon-left"></i></a>
9 <a id="prev_commit_link" data-commit-id="${c.prev_commit.raw_id}" class=" ${('disabled' if c.url_prev == '#' else '')}" href="${c.url_prev}" title="${_('Previous commit')}"><i class="icon-left"></i></a>
10 </div>
10 </div>
11
11
12 ${h.hidden('refs_filter')}
12 ${h.hidden('refs_filter')}
13
13
14 <div class="info_box_elem next">
14 <div class="info_box_elem next">
15 <a id="next_commit_link" data-commit-id="${c.next_commit.raw_id}" class=" ${('disabled' if c.url_next == '#' else '')}" href="${c.url_next}" title="${_('Next commit')}"><i class="icon-right"></i></a>
15 <a id="next_commit_link" data-commit-id="${c.next_commit.raw_id}" class=" ${('disabled' if c.url_next == '#' else '')}" href="${c.url_next}" title="${_('Next commit')}"><i class="icon-right"></i></a>
16 </div>
16 </div>
17 </div>
17 </div>
18
18
19 % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
19 % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
20 <div>
20 <div>
21 <a class="btn btn-primary new-file" href="${h.route_path('repo_files_upload_file',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}">
21 <a class="btn btn-primary new-file" href="${h.route_path('repo_files_upload_file',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}">
22 ${_('Upload File')}
22 ${_('Upload File')}
23 </a>
23 </a>
24 <a class="btn btn-primary new-file" href="${h.route_path('repo_files_add_file',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}">
24 <a class="btn btn-primary new-file" href="${h.route_path('repo_files_add_file',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}">
25 ${_('Add File')}
25 ${_('Add File')}
26 </a>
26 </a>
27 </div>
27 </div>
28 % endif
28 % endif
29
29
30 % if c.enable_downloads:
30 % if c.enable_downloads:
31 <% at_path = '{}'.format(request.GET.get('at') or c.commit.raw_id[:6]) %>
31 <% at_path = '{}'.format(request.GET.get('at') or c.commit.raw_id[:6]) %>
32 <div class="btn btn-default new-file">
32 <div class="btn btn-default new-file">
33 % if c.f_path == '/':
33 % if c.f_path == '/':
34 <a href="${h.route_path('repo_archivefile',repo_name=c.repo_name, fname='{}.zip'.format(c.commit.raw_id))}">
34 <a href="${h.route_path('repo_archivefile',repo_name=c.repo_name, fname='{}.zip'.format(c.commit.raw_id))}">
35 ${_('Download full tree ZIP')}
35 ${_('Download full tree ZIP')}
36 </a>
36 </a>
37 % else:
37 % else:
38 <a href="${h.route_path('repo_archivefile',repo_name=c.repo_name, fname='{}.zip'.format(c.commit.raw_id), _query={'at_path':c.f_path})}">
38 <a href="${h.route_path('repo_archivefile',repo_name=c.repo_name, fname='{}.zip'.format(c.commit.raw_id), _query={'at_path':c.f_path})}">
39 ${_('Download this tree ZIP')}
39 ${_('Download this tree ZIP')}
40 </a>
40 </a>
41 % endif
41 % endif
42 </div>
42 </div>
43 % endif
43 % endif
44
44
45 <div class="files-quick-filter">
45 <div class="files-quick-filter">
46 <ul class="files-filter-box">
46 <ul class="files-filter-box">
47 <li class="files-filter-box-path">
47 <li class="files-filter-box-path">
48 <i class="icon-search"></i>
48 <i class="icon-search"></i>
49 </li>
49 </li>
50 <li class="files-filter-box-input">
50 <li class="files-filter-box-input">
51 <input onkeydown="NodeFilter.initFilter(event)" class="init" type="text" placeholder="Quick filter" name="filter" size="25" id="node_filter" autocomplete="off">
51 <input onkeydown="NodeFilter.initFilter(event)" class="init" type="text" placeholder="Quick filter" name="filter" size="25" id="node_filter" autocomplete="off">
52 </li>
52 </li>
53 </ul>
53 </ul>
54 </div>
54 </div>
55 </div>
55 </div>
56
56
57 </div>
57 </div>
58
58
59 ## file tree is computed from caches, and filled in
59 ## file tree is computed from caches, and filled in
60 <div id="file-tree">
60 <div id="file-tree">
61 ${c.file_tree |n}
61 ${c.file_tree |n}
62 </div>
62 </div>
63
63
64 %if c.readme_data:
64 %if c.readme_data:
65 <div id="readme" class="anchor">
65 <div id="readme" class="anchor">
66 <div class="box">
66 <div class="box">
67 <div class="title" title="${h.tooltip(_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_rev[0], c.rhodecode_db_repo.landing_rev[1]))}">
67 <div class="readme-title" title="${h.tooltip(_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_rev[0], c.rhodecode_db_repo.landing_rev[1]))}">
68 <h3 class="breadcrumbs">
68 <div>
69 <i class="icon-file-text"></i>
69 <a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.landing_rev[1],f_path=c.readme_file)}">
70 <a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.landing_rev[1],f_path=c.readme_file)}">
70 ${c.readme_file}
71 ${c.readme_file}
71 </a>
72 </a>
72 </h3>
73 </div>
73 </div>
74 </div>
74 <div class="readme codeblock">
75 <div class="readme codeblock">
75 <div class="readme_box">
76 <div class="readme_box">
76 ${c.readme_data|n}
77 ${c.readme_data|n}
77 </div>
78 </div>
78 </div>
79 </div>
79 </div>
80 </div>
80 </div>
81 </div>
81 %endif
82 %endif
82
83
83 </div>
84 </div>
@@ -1,116 +1,118 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 <div class="title" title="${h.tooltip(_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_rev[0], c.rhodecode_db_repo.landing_rev[1]))}">
36
37 <h3 class="breadcrumbs">
37 <div class="readme-title" title="${h.tooltip(_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_rev[0], c.rhodecode_db_repo.landing_rev[1]))}">
38 <div>
39 <i class="icon-file-text"></i>
38 <a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.landing_rev[1],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_rev[1],f_path=c.readme_file)}">
39 ${c.readme_file}
41 ${c.readme_file}
40 </a>
42 </a>
41 </h3>
43 </div>
42 </div>
44 </div>
43 <div class="readme codeblock">
45 <div class="readme codeblock">
44 <div class="readme_box">
46 <div class="readme_box">
45 ${c.readme_data|n}
47 ${c.readme_data|n}
46 </div>
48 </div>
47 </div>
49 </div>
48 </div>
50 </div>
49 </div>
51 </div>
50 %endif
52 %endif
51
53
52 <script type="text/javascript">
54 <script type="text/javascript">
53 $(document).ready(function(){
55 $(document).ready(function(){
54
56
55 var showCloneField = function(clone_url_format){
57 var showCloneField = function(clone_url_format){
56 $.each(['http', 'http_id', 'ssh'], function (idx, val) {
58 $.each(['http', 'http_id', 'ssh'], function (idx, val) {
57 if(val === clone_url_format){
59 if(val === clone_url_format){
58 $('#clone_option_' + val).show();
60 $('#clone_option_' + val).show();
59 $('#clone_option').val(val)
61 $('#clone_option').val(val)
60 } else {
62 } else {
61 $('#clone_option_' + val).hide();
63 $('#clone_option_' + val).hide();
62 }
64 }
63 });
65 });
64 };
66 };
65 // default taken from session
67 // default taken from session
66 showCloneField(templateContext.session_attrs.clone_url_format);
68 showCloneField(templateContext.session_attrs.clone_url_format);
67
69
68 $('#clone_option').on('change', function(e) {
70 $('#clone_option').on('change', function(e) {
69 var selected = $(this).val();
71 var selected = $(this).val();
70
72
71 storeUserSessionAttr('rc_user_session_attr.clone_url_format', selected);
73 storeUserSessionAttr('rc_user_session_attr.clone_url_format', selected);
72 showCloneField(selected)
74 showCloneField(selected)
73 });
75 });
74
76
75 var initialCommitData = {
77 var initialCommitData = {
76 id: null,
78 id: null,
77 text: 'tip',
79 text: 'tip',
78 type: 'tag',
80 type: 'tag',
79 raw_id: null,
81 raw_id: null,
80 files_url: null
82 files_url: null
81 };
83 };
82
84
83 select2RefSwitcher('#download_options', initialCommitData);
85 select2RefSwitcher('#download_options', initialCommitData);
84
86
85 // on change of download options
87 // on change of download options
86 $('#download_options').on('change', function(e) {
88 $('#download_options').on('change', function(e) {
87 // format of Object {text: "v0.0.3", type: "tag", id: "rev"}
89 // format of Object {text: "v0.0.3", type: "tag", id: "rev"}
88 var ext = '.zip';
90 var ext = '.zip';
89 var selected_cs = e.added;
91 var selected_cs = e.added;
90 var fname = e.added.raw_id + ext;
92 var fname = e.added.raw_id + ext;
91 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});
92 // set new label
94 // set new label
93 $('#archive_link').html('{0}{1}'.format(escapeHtml(e.added.text), ext));
95 $('#archive_link').html('{0}{1}'.format(escapeHtml(e.added.text), ext));
94
96
95 // set new url to button,
97 // set new url to button,
96 $('#archive_link').attr('href', href)
98 $('#archive_link').attr('href', href)
97 });
99 });
98
100
99
101
100 // calculate size of repository
102 // calculate size of repository
101 calculateSize = function () {
103 calculateSize = function () {
102
104
103 var callback = function (data) {
105 var callback = function (data) {
104 % if c.show_stats:
106 % if c.show_stats:
105 showRepoStats('lang_stats', data);
107 showRepoStats('lang_stats', data);
106 % endif
108 % endif
107 };
109 };
108
110
109 showRepoSize('repo_size_container', templateContext.repo_name, templateContext.repo_landing_commit, callback);
111 showRepoSize('repo_size_container', templateContext.repo_name, templateContext.repo_landing_commit, callback);
110
112
111 }
113 }
112
114
113 })
115 })
114 </script>
116 </script>
115
117
116 </%def>
118 </%def>
General Comments 0
You need to be logged in to leave comments. Login now