Show More
@@ -1,448 +1,450 b'' | |||||
1 | ## DATA TABLE RE USABLE ELEMENTS |
|
1 | ## DATA TABLE RE USABLE ELEMENTS | |
2 | ## usage: |
|
2 | ## usage: | |
3 | ## <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
3 | ## <%namespace name="dt" file="/data_table/_dt_elements.mako"/> | |
4 | <%namespace name="base" file="/base/base.mako"/> |
|
4 | <%namespace name="base" file="/base/base.mako"/> | |
5 |
|
5 | |||
6 | <%def name="metatags_help()"> |
|
6 | <%def name="metatags_help()"> | |
7 | <table> |
|
7 | <table> | |
8 | <% |
|
8 | <% | |
9 | example_tags = [ |
|
9 | example_tags = [ | |
10 | ('state','[stable]'), |
|
10 | ('state','[stable]'), | |
11 | ('state','[stale]'), |
|
11 | ('state','[stale]'), | |
12 | ('state','[featured]'), |
|
12 | ('state','[featured]'), | |
13 | ('state','[dev]'), |
|
13 | ('state','[dev]'), | |
14 | ('state','[dead]'), |
|
14 | ('state','[dead]'), | |
15 | ('state','[deprecated]'), |
|
15 | ('state','[deprecated]'), | |
16 |
|
16 | |||
17 | ('label','[personal]'), |
|
17 | ('label','[personal]'), | |
18 | ('generic','[v2.0.0]'), |
|
18 | ('generic','[v2.0.0]'), | |
19 |
|
19 | |||
20 | ('lang','[lang => JavaScript]'), |
|
20 | ('lang','[lang => JavaScript]'), | |
21 | ('license','[license => LicenseName]'), |
|
21 | ('license','[license => LicenseName]'), | |
22 |
|
22 | |||
23 | ('ref','[requires => RepoName]'), |
|
23 | ('ref','[requires => RepoName]'), | |
24 | ('ref','[recommends => GroupName]'), |
|
24 | ('ref','[recommends => GroupName]'), | |
25 | ('ref','[conflicts => SomeName]'), |
|
25 | ('ref','[conflicts => SomeName]'), | |
26 | ('ref','[base => SomeName]'), |
|
26 | ('ref','[base => SomeName]'), | |
27 | ('url','[url => [linkName](https://rhodecode.com)]'), |
|
27 | ('url','[url => [linkName](https://rhodecode.com)]'), | |
28 | ('see','[see => http://rhodecode.com]'), |
|
28 | ('see','[see => http://rhodecode.com]'), | |
29 | ] |
|
29 | ] | |
30 | %> |
|
30 | %> | |
31 | % for tag_type, tag in example_tags: |
|
31 | % for tag_type, tag in example_tags: | |
32 | <tr> |
|
32 | <tr> | |
33 | <td>${tag|n}</td> |
|
33 | <td>${tag|n}</td> | |
34 | <td>${h.style_metatag(tag_type, tag)|n}</td> |
|
34 | <td>${h.style_metatag(tag_type, tag)|n}</td> | |
35 | </tr> |
|
35 | </tr> | |
36 | % endfor |
|
36 | % endfor | |
37 | </table> |
|
37 | </table> | |
38 | </%def> |
|
38 | </%def> | |
39 |
|
39 | |||
40 | ## REPOSITORY RENDERERS |
|
40 | ## REPOSITORY RENDERERS | |
41 | <%def name="quick_menu(repo_name)"> |
|
41 | <%def name="quick_menu(repo_name)"> | |
42 | <i class="icon-more"></i> |
|
42 | <i class="icon-more"></i> | |
43 | <div class="menu_items_container hidden"> |
|
43 | <div class="menu_items_container hidden"> | |
44 | <ul class="menu_items"> |
|
44 | <ul class="menu_items"> | |
45 | <li> |
|
45 | <li> | |
46 | <a title="${_('Summary')}" href="${h.route_path('repo_summary',repo_name=repo_name)}"> |
|
46 | <a title="${_('Summary')}" href="${h.route_path('repo_summary',repo_name=repo_name)}"> | |
47 | <span>${_('Summary')}</span> |
|
47 | <span>${_('Summary')}</span> | |
48 | </a> |
|
48 | </a> | |
49 | </li> |
|
49 | </li> | |
50 | <li> |
|
50 | <li> | |
51 | <a title="${_('Changelog')}" href="${h.route_path('repo_changelog',repo_name=repo_name)}"> |
|
51 | <a title="${_('Changelog')}" href="${h.route_path('repo_changelog',repo_name=repo_name)}"> | |
52 | <span>${_('Changelog')}</span> |
|
52 | <span>${_('Changelog')}</span> | |
53 | </a> |
|
53 | </a> | |
54 | </li> |
|
54 | </li> | |
55 | <li> |
|
55 | <li> | |
56 | <a title="${_('Files')}" href="${h.route_path('repo_files:default_commit',repo_name=repo_name)}"> |
|
56 | <a title="${_('Files')}" href="${h.route_path('repo_files:default_commit',repo_name=repo_name)}"> | |
57 | <span>${_('Files')}</span> |
|
57 | <span>${_('Files')}</span> | |
58 | </a> |
|
58 | </a> | |
59 | </li> |
|
59 | </li> | |
60 | <li> |
|
60 | <li> | |
61 | <a title="${_('Fork')}" href="${h.route_path('repo_fork_new',repo_name=repo_name)}"> |
|
61 | <a title="${_('Fork')}" href="${h.route_path('repo_fork_new',repo_name=repo_name)}"> | |
62 | <span>${_('Fork')}</span> |
|
62 | <span>${_('Fork')}</span> | |
63 | </a> |
|
63 | </a> | |
64 | </li> |
|
64 | </li> | |
65 | </ul> |
|
65 | </ul> | |
66 | </div> |
|
66 | </div> | |
67 | </%def> |
|
67 | </%def> | |
68 |
|
68 | |||
69 | <%def name="repo_name(name,rtype,rstate,private,archived,fork_of,short_name=False,admin=False)"> |
|
69 | <%def name="repo_name(name,rtype,rstate,private,archived,fork_of,short_name=False,admin=False)"> | |
70 | <% |
|
70 | <% | |
71 | def get_name(name,short_name=short_name): |
|
71 | def get_name(name,short_name=short_name): | |
72 | if short_name: |
|
72 | if short_name: | |
73 | return name.split('/')[-1] |
|
73 | return name.split('/')[-1] | |
74 | else: |
|
74 | else: | |
75 | return name |
|
75 | return name | |
76 | %> |
|
76 | %> | |
77 | <div class="${'repo_state_pending' if rstate == 'repo_state_pending' else ''} truncate"> |
|
77 | <div class="${'repo_state_pending' if rstate == 'repo_state_pending' else ''} truncate"> | |
78 | ##NAME |
|
78 | ##NAME | |
79 | <a href="${h.route_path('edit_repo',repo_name=name) if admin else h.route_path('repo_summary',repo_name=name)}"> |
|
79 | <a href="${h.route_path('edit_repo',repo_name=name) if admin else h.route_path('repo_summary',repo_name=name)}"> | |
80 |
|
80 | |||
81 | ##TYPE OF REPO |
|
81 | ##TYPE OF REPO | |
82 | %if h.is_hg(rtype): |
|
82 | %if h.is_hg(rtype): | |
83 | <span title="${_('Mercurial repository')}"><i class="icon-hg" style="font-size: 14px;"></i></span> |
|
83 | <span title="${_('Mercurial repository')}"><i class="icon-hg" style="font-size: 14px;"></i></span> | |
84 | %elif h.is_git(rtype): |
|
84 | %elif h.is_git(rtype): | |
85 | <span title="${_('Git repository')}"><i class="icon-git" style="font-size: 14px"></i></span> |
|
85 | <span title="${_('Git repository')}"><i class="icon-git" style="font-size: 14px"></i></span> | |
86 | %elif h.is_svn(rtype): |
|
86 | %elif h.is_svn(rtype): | |
87 | <span title="${_('Subversion repository')}"><i class="icon-svn" style="font-size: 14px"></i></span> |
|
87 | <span title="${_('Subversion repository')}"><i class="icon-svn" style="font-size: 14px"></i></span> | |
88 | %endif |
|
88 | %endif | |
89 |
|
89 | |||
90 | ##PRIVATE/PUBLIC |
|
90 | ##PRIVATE/PUBLIC | |
91 | %if private is True and c.visual.show_private_icon: |
|
91 | %if private is True and c.visual.show_private_icon: | |
92 | <i class="icon-lock" title="${_('Private repository')}"></i> |
|
92 | <i class="icon-lock" title="${_('Private repository')}"></i> | |
93 | %elif private is False and c.visual.show_public_icon: |
|
93 | %elif private is False and c.visual.show_public_icon: | |
94 | <i class="icon-unlock-alt" title="${_('Public repository')}"></i> |
|
94 | <i class="icon-unlock-alt" title="${_('Public repository')}"></i> | |
95 | %else: |
|
95 | %else: | |
96 | <span></span> |
|
96 | <span></span> | |
97 | %endif |
|
97 | %endif | |
98 | ${get_name(name)} |
|
98 | ${get_name(name)} | |
99 | </a> |
|
99 | </a> | |
100 | %if fork_of: |
|
100 | %if fork_of: | |
101 | <a href="${h.route_path('repo_summary',repo_name=fork_of.repo_name)}"><i class="icon-code-fork"></i></a> |
|
101 | <a href="${h.route_path('repo_summary',repo_name=fork_of.repo_name)}"><i class="icon-code-fork"></i></a> | |
102 | %endif |
|
102 | %endif | |
103 | %if rstate == 'repo_state_pending': |
|
103 | %if rstate == 'repo_state_pending': | |
104 | <span class="creation_in_progress tooltip" title="${_('This repository is being created in a background task')}"> |
|
104 | <span class="creation_in_progress tooltip" title="${_('This repository is being created in a background task')}"> | |
105 | (${_('creating...')}) |
|
105 | (${_('creating...')}) | |
106 | </span> |
|
106 | </span> | |
107 | %endif |
|
107 | %endif | |
108 |
|
108 | |||
109 | </div> |
|
109 | </div> | |
110 | </%def> |
|
110 | </%def> | |
111 |
|
111 | |||
112 | <%def name="repo_desc(description, stylify_metatags)"> |
|
112 | <%def name="repo_desc(description, stylify_metatags)"> | |
113 | <% |
|
113 | <% | |
114 | tags, description = h.extract_metatags(description) |
|
114 | tags, description = h.extract_metatags(description) | |
115 | %> |
|
115 | %> | |
116 |
|
116 | |||
117 | <div class="truncate-wrap"> |
|
117 | <div class="truncate-wrap"> | |
118 | % if stylify_metatags: |
|
118 | % if stylify_metatags: | |
119 | % for tag_type, tag in tags: |
|
119 | % for tag_type, tag in tags: | |
120 | ${h.style_metatag(tag_type, tag)|n} |
|
120 | ${h.style_metatag(tag_type, tag)|n} | |
121 | % endfor |
|
121 | % endfor | |
122 | % endif |
|
122 | % endif | |
123 | ${description} |
|
123 | ${description} | |
124 | </div> |
|
124 | </div> | |
125 |
|
125 | |||
126 | </%def> |
|
126 | </%def> | |
127 |
|
127 | |||
128 | <%def name="last_change(last_change)"> |
|
128 | <%def name="last_change(last_change)"> | |
129 | ${h.age_component(last_change, time_is_local=True)} |
|
129 | ${h.age_component(last_change, time_is_local=True)} | |
130 | </%def> |
|
130 | </%def> | |
131 |
|
131 | |||
132 | <%def name="revision(name,rev,tip,author,last_msg, commit_date)"> |
|
132 | <%def name="revision(name,rev,tip,author,last_msg, commit_date)"> | |
133 | <div> |
|
133 | <div> | |
134 | %if rev >= 0: |
|
134 | %if rev >= 0: | |
135 | <code><a title="${h.tooltip('%s\n%s\n\n%s' % (author, commit_date, last_msg))}" class="tooltip" href="${h.route_path('repo_commit',repo_name=name,commit_id=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a></code> |
|
135 | <code><a title="${h.tooltip('%s\n%s\n\n%s' % (author, commit_date, last_msg))}" class="tooltip" href="${h.route_path('repo_commit',repo_name=name,commit_id=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a></code> | |
136 | %else: |
|
136 | %else: | |
137 | ${_('No commits yet')} |
|
137 | ${_('No commits yet')} | |
138 | %endif |
|
138 | %endif | |
139 | </div> |
|
139 | </div> | |
140 | </%def> |
|
140 | </%def> | |
141 |
|
141 | |||
142 | <%def name="rss(name)"> |
|
142 | <%def name="rss(name)"> | |
143 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
143 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
144 | <a title="${h.tooltip(_('Subscribe to %s rss feed')% name)}" href="${h.route_path('rss_feed_home', repo_name=name, _query=dict(auth_token=c.rhodecode_user.feed_token))}"><i class="icon-rss-sign"></i></a> |
|
144 | <a title="${h.tooltip(_('Subscribe to %s rss feed')% name)}" href="${h.route_path('rss_feed_home', repo_name=name, _query=dict(auth_token=c.rhodecode_user.feed_token))}"><i class="icon-rss-sign"></i></a> | |
145 | %else: |
|
145 | %else: | |
146 | <a title="${h.tooltip(_('Subscribe to %s rss feed')% name)}" href="${h.route_path('rss_feed_home', repo_name=name)}"><i class="icon-rss-sign"></i></a> |
|
146 | <a title="${h.tooltip(_('Subscribe to %s rss feed')% name)}" href="${h.route_path('rss_feed_home', repo_name=name)}"><i class="icon-rss-sign"></i></a> | |
147 | %endif |
|
147 | %endif | |
148 | </%def> |
|
148 | </%def> | |
149 |
|
149 | |||
150 | <%def name="atom(name)"> |
|
150 | <%def name="atom(name)"> | |
151 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
151 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
152 | <a title="${h.tooltip(_('Subscribe to %s atom feed')% name)}" href="${h.route_path('atom_feed_home', repo_name=name, _query=dict(auth_token=c.rhodecode_user.feed_token))}"><i class="icon-rss-sign"></i></a> |
|
152 | <a title="${h.tooltip(_('Subscribe to %s atom feed')% name)}" href="${h.route_path('atom_feed_home', repo_name=name, _query=dict(auth_token=c.rhodecode_user.feed_token))}"><i class="icon-rss-sign"></i></a> | |
153 | %else: |
|
153 | %else: | |
154 | <a title="${h.tooltip(_('Subscribe to %s atom feed')% name)}" href="${h.route_path('atom_feed_home', repo_name=name)}"><i class="icon-rss-sign"></i></a> |
|
154 | <a title="${h.tooltip(_('Subscribe to %s atom feed')% name)}" href="${h.route_path('atom_feed_home', repo_name=name)}"><i class="icon-rss-sign"></i></a> | |
155 | %endif |
|
155 | %endif | |
156 | </%def> |
|
156 | </%def> | |
157 |
|
157 | |||
158 | <%def name="user_gravatar(email, size=16)"> |
|
158 | <%def name="user_gravatar(email, size=16)"> | |
159 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> |
|
159 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> | |
160 | ${base.gravatar(email, 16)} |
|
160 | ${base.gravatar(email, 16)} | |
161 | </div> |
|
161 | </div> | |
162 | </%def> |
|
162 | </%def> | |
163 |
|
163 | |||
164 | <%def name="repo_actions(repo_name, super_user=True)"> |
|
164 | <%def name="repo_actions(repo_name, super_user=True)"> | |
165 | <div> |
|
165 | <div> | |
166 | <div class="grid_edit"> |
|
166 | <div class="grid_edit"> | |
167 | <a href="${h.route_path('edit_repo',repo_name=repo_name)}" title="${_('Edit')}"> |
|
167 | <a href="${h.route_path('edit_repo',repo_name=repo_name)}" title="${_('Edit')}"> | |
168 | <i class="icon-pencil"></i>Edit</a> |
|
168 | <i class="icon-pencil"></i>Edit</a> | |
169 | </div> |
|
169 | </div> | |
170 | <div class="grid_delete"> |
|
170 | <div class="grid_delete"> | |
171 | ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=repo_name), request=request)} |
|
171 | ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=repo_name), request=request)} | |
172 | ${h.submit('remove_%s' % repo_name,_('Delete'),class_="btn btn-link btn-danger", |
|
172 | ${h.submit('remove_%s' % repo_name,_('Delete'),class_="btn btn-link btn-danger", | |
173 | onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")} |
|
173 | onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")} | |
174 | ${h.end_form()} |
|
174 | ${h.end_form()} | |
175 | </div> |
|
175 | </div> | |
176 | </div> |
|
176 | </div> | |
177 | </%def> |
|
177 | </%def> | |
178 |
|
178 | |||
179 | <%def name="repo_state(repo_state)"> |
|
179 | <%def name="repo_state(repo_state)"> | |
180 | <div> |
|
180 | <div> | |
181 | %if repo_state == 'repo_state_pending': |
|
181 | %if repo_state == 'repo_state_pending': | |
182 | <div class="tag tag4">${_('Creating')}</div> |
|
182 | <div class="tag tag4">${_('Creating')}</div> | |
183 | %elif repo_state == 'repo_state_created': |
|
183 | %elif repo_state == 'repo_state_created': | |
184 | <div class="tag tag1">${_('Created')}</div> |
|
184 | <div class="tag tag1">${_('Created')}</div> | |
185 | %else: |
|
185 | %else: | |
186 | <div class="tag alert2" title="${h.tooltip(repo_state)}">invalid</div> |
|
186 | <div class="tag alert2" title="${h.tooltip(repo_state)}">invalid</div> | |
187 | %endif |
|
187 | %endif | |
188 | </div> |
|
188 | </div> | |
189 | </%def> |
|
189 | </%def> | |
190 |
|
190 | |||
191 |
|
191 | |||
192 | ## REPO GROUP RENDERERS |
|
192 | ## REPO GROUP RENDERERS | |
193 | <%def name="quick_repo_group_menu(repo_group_name)"> |
|
193 | <%def name="quick_repo_group_menu(repo_group_name)"> | |
194 | <i class="icon-more"></i> |
|
194 | <i class="icon-more"></i> | |
195 | <div class="menu_items_container hidden"> |
|
195 | <div class="menu_items_container hidden"> | |
196 | <ul class="menu_items"> |
|
196 | <ul class="menu_items"> | |
197 | <li> |
|
197 | <li> | |
198 | <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}">${_('Summary')}</a> |
|
198 | <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}">${_('Summary')}</a> | |
199 | </li> |
|
199 | </li> | |
200 |
|
200 | |||
201 | </ul> |
|
201 | </ul> | |
202 | </div> |
|
202 | </div> | |
203 | </%def> |
|
203 | </%def> | |
204 |
|
204 | |||
205 | <%def name="repo_group_name(repo_group_name, children_groups=None)"> |
|
205 | <%def name="repo_group_name(repo_group_name, children_groups=None)"> | |
206 | <div> |
|
206 | <div> | |
207 | <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}"> |
|
207 | <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}"> | |
208 | <i class="icon-folder-close" title="${_('Repository group')}" style="font-size: 16px"></i> |
|
208 | <i class="icon-folder-close" title="${_('Repository group')}" style="font-size: 16px"></i> | |
209 | %if children_groups: |
|
209 | %if children_groups: | |
210 | ${h.literal(' » '.join(children_groups))} |
|
210 | ${h.literal(' » '.join(children_groups))} | |
211 | %else: |
|
211 | %else: | |
212 | ${repo_group_name} |
|
212 | ${repo_group_name} | |
213 | %endif |
|
213 | %endif | |
214 | </a> |
|
214 | </a> | |
215 | </div> |
|
215 | </div> | |
216 | </%def> |
|
216 | </%def> | |
217 |
|
217 | |||
218 | <%def name="repo_group_desc(description, personal, stylify_metatags)"> |
|
218 | <%def name="repo_group_desc(description, personal, stylify_metatags)"> | |
219 |
|
219 | |||
220 | <% |
|
220 | <% | |
221 | tags, description = h.extract_metatags(description) |
|
221 | tags, description = h.extract_metatags(description) | |
222 | %> |
|
222 | %> | |
223 |
|
223 | |||
224 | <div class="truncate-wrap"> |
|
224 | <div class="truncate-wrap"> | |
225 | % if personal: |
|
225 | % if personal: | |
226 | <div class="metatag" tag="personal">${_('personal')}</div> |
|
226 | <div class="metatag" tag="personal">${_('personal')}</div> | |
227 | % endif |
|
227 | % endif | |
228 |
|
228 | |||
229 | % if stylify_metatags: |
|
229 | % if stylify_metatags: | |
230 | % for tag_type, tag in tags: |
|
230 | % for tag_type, tag in tags: | |
231 | ${h.style_metatag(tag_type, tag)|n} |
|
231 | ${h.style_metatag(tag_type, tag)|n} | |
232 | % endfor |
|
232 | % endfor | |
233 | % endif |
|
233 | % endif | |
234 | ${description} |
|
234 | ${description} | |
235 | </div> |
|
235 | </div> | |
236 |
|
236 | |||
237 | </%def> |
|
237 | </%def> | |
238 |
|
238 | |||
239 | <%def name="repo_group_actions(repo_group_id, repo_group_name, gr_count)"> |
|
239 | <%def name="repo_group_actions(repo_group_id, repo_group_name, gr_count)"> | |
240 | <div class="grid_edit"> |
|
240 | <div class="grid_edit"> | |
241 | <a href="${h.route_path('edit_repo_group',repo_group_name=repo_group_name)}" title="${_('Edit')}">Edit</a> |
|
241 | <a href="${h.route_path('edit_repo_group',repo_group_name=repo_group_name)}" title="${_('Edit')}">Edit</a> | |
242 | </div> |
|
242 | </div> | |
243 | <div class="grid_delete"> |
|
243 | <div class="grid_delete"> | |
244 | ${h.secure_form(h.route_path('edit_repo_group_advanced_delete', repo_group_name=repo_group_name), request=request)} |
|
244 | ${h.secure_form(h.route_path('edit_repo_group_advanced_delete', repo_group_name=repo_group_name), request=request)} | |
245 | ${h.submit('remove_%s' % repo_group_name,_('Delete'),class_="btn btn-link btn-danger", |
|
245 | ${h.submit('remove_%s' % repo_group_name,_('Delete'),class_="btn btn-link btn-danger", | |
246 | onclick="return confirm('"+_ungettext('Confirm to delete this group: %s with %s repository','Confirm to delete this group: %s with %s repositories',gr_count) % (repo_group_name, gr_count)+"');")} |
|
246 | onclick="return confirm('"+_ungettext('Confirm to delete this group: %s with %s repository','Confirm to delete this group: %s with %s repositories',gr_count) % (repo_group_name, gr_count)+"');")} | |
247 | ${h.end_form()} |
|
247 | ${h.end_form()} | |
248 | </div> |
|
248 | </div> | |
249 | </%def> |
|
249 | </%def> | |
250 |
|
250 | |||
251 |
|
251 | |||
252 | <%def name="user_actions(user_id, username)"> |
|
252 | <%def name="user_actions(user_id, username)"> | |
253 | <div class="grid_edit"> |
|
253 | <div class="grid_edit"> | |
254 | <a href="${h.route_path('user_edit',user_id=user_id)}" title="${_('Edit')}"> |
|
254 | <a href="${h.route_path('user_edit',user_id=user_id)}" title="${_('Edit')}"> | |
255 | <i class="icon-pencil"></i>${_('Edit')}</a> |
|
255 | <i class="icon-pencil"></i>${_('Edit')}</a> | |
256 | </div> |
|
256 | </div> | |
257 | <div class="grid_delete"> |
|
257 | <div class="grid_delete"> | |
258 | ${h.secure_form(h.route_path('user_delete', user_id=user_id), request=request)} |
|
258 | ${h.secure_form(h.route_path('user_delete', user_id=user_id), request=request)} | |
259 | ${h.submit('remove_',_('Delete'),id="remove_user_%s" % user_id, class_="btn btn-link btn-danger", |
|
259 | ${h.submit('remove_',_('Delete'),id="remove_user_%s" % user_id, class_="btn btn-link btn-danger", | |
260 | onclick="return confirm('"+_('Confirm to delete this user: %s') % username+"');")} |
|
260 | onclick="return confirm('"+_('Confirm to delete this user: %s') % username+"');")} | |
261 | ${h.end_form()} |
|
261 | ${h.end_form()} | |
262 | </div> |
|
262 | </div> | |
263 | </%def> |
|
263 | </%def> | |
264 |
|
264 | |||
265 | <%def name="user_group_actions(user_group_id, user_group_name)"> |
|
265 | <%def name="user_group_actions(user_group_id, user_group_name)"> | |
266 | <div class="grid_edit"> |
|
266 | <div class="grid_edit"> | |
267 | <a href="${h.route_path('edit_user_group', user_group_id=user_group_id)}" title="${_('Edit')}">Edit</a> |
|
267 | <a href="${h.route_path('edit_user_group', user_group_id=user_group_id)}" title="${_('Edit')}">Edit</a> | |
268 | </div> |
|
268 | </div> | |
269 | <div class="grid_delete"> |
|
269 | <div class="grid_delete"> | |
270 | ${h.secure_form(h.route_path('user_groups_delete', user_group_id=user_group_id), request=request)} |
|
270 | ${h.secure_form(h.route_path('user_groups_delete', user_group_id=user_group_id), request=request)} | |
271 | ${h.submit('remove_',_('Delete'),id="remove_group_%s" % user_group_id, class_="btn btn-link btn-danger", |
|
271 | ${h.submit('remove_',_('Delete'),id="remove_group_%s" % user_group_id, class_="btn btn-link btn-danger", | |
272 | onclick="return confirm('"+_('Confirm to delete this user group: %s') % user_group_name+"');")} |
|
272 | onclick="return confirm('"+_('Confirm to delete this user group: %s') % user_group_name+"');")} | |
273 | ${h.end_form()} |
|
273 | ${h.end_form()} | |
274 | </div> |
|
274 | </div> | |
275 | </%def> |
|
275 | </%def> | |
276 |
|
276 | |||
277 |
|
277 | |||
278 | <%def name="user_name(user_id, username)"> |
|
278 | <%def name="user_name(user_id, username)"> | |
279 | ${h.link_to(h.person(username, 'username_or_name_or_email'), h.route_path('user_edit', user_id=user_id))} |
|
279 | ${h.link_to(h.person(username, 'username_or_name_or_email'), h.route_path('user_edit', user_id=user_id))} | |
280 | </%def> |
|
280 | </%def> | |
281 |
|
281 | |||
282 | <%def name="user_profile(username)"> |
|
282 | <%def name="user_profile(username)"> | |
283 | ${base.gravatar_with_user(username, 16)} |
|
283 | ${base.gravatar_with_user(username, 16)} | |
284 | </%def> |
|
284 | </%def> | |
285 |
|
285 | |||
286 | <%def name="user_group_name(user_group_name)"> |
|
286 | <%def name="user_group_name(user_group_name)"> | |
287 | <div> |
|
287 | <div> | |
288 | <i class="icon-user-group" title="${_('User group')}"></i> |
|
288 | <i class="icon-user-group" title="${_('User group')}"></i> | |
289 | ${h.link_to_group(user_group_name)} |
|
289 | ${h.link_to_group(user_group_name)} | |
290 | </div> |
|
290 | </div> | |
291 | </%def> |
|
291 | </%def> | |
292 |
|
292 | |||
293 |
|
293 | |||
294 | ## GISTS |
|
294 | ## GISTS | |
295 |
|
295 | |||
296 | <%def name="gist_gravatar(full_contact)"> |
|
296 | <%def name="gist_gravatar(full_contact)"> | |
297 | <div class="gist_gravatar"> |
|
297 | <div class="gist_gravatar"> | |
298 | ${base.gravatar(full_contact, 30)} |
|
298 | ${base.gravatar(full_contact, 30)} | |
299 | </div> |
|
299 | </div> | |
300 | </%def> |
|
300 | </%def> | |
301 |
|
301 | |||
302 | <%def name="gist_access_id(gist_access_id, full_contact)"> |
|
302 | <%def name="gist_access_id(gist_access_id, full_contact)"> | |
303 | <div> |
|
303 | <div> | |
304 | <b> |
|
304 | <b> | |
305 | <a href="${h.route_path('gist_show', gist_id=gist_access_id)}">gist: ${gist_access_id}</a> |
|
305 | <a href="${h.route_path('gist_show', gist_id=gist_access_id)}">gist: ${gist_access_id}</a> | |
306 | </b> |
|
306 | </b> | |
307 | </div> |
|
307 | </div> | |
308 | </%def> |
|
308 | </%def> | |
309 |
|
309 | |||
310 | <%def name="gist_author(full_contact, created_on, expires)"> |
|
310 | <%def name="gist_author(full_contact, created_on, expires)"> | |
311 | ${base.gravatar_with_user(full_contact, 16)} |
|
311 | ${base.gravatar_with_user(full_contact, 16)} | |
312 | </%def> |
|
312 | </%def> | |
313 |
|
313 | |||
314 |
|
314 | |||
315 | <%def name="gist_created(created_on)"> |
|
315 | <%def name="gist_created(created_on)"> | |
316 | <div class="created"> |
|
316 | <div class="created"> | |
317 | ${h.age_component(created_on, time_is_local=True)} |
|
317 | ${h.age_component(created_on, time_is_local=True)} | |
318 | </div> |
|
318 | </div> | |
319 | </%def> |
|
319 | </%def> | |
320 |
|
320 | |||
321 | <%def name="gist_expires(expires)"> |
|
321 | <%def name="gist_expires(expires)"> | |
322 | <div class="created"> |
|
322 | <div class="created"> | |
323 | %if expires == -1: |
|
323 | %if expires == -1: | |
324 | ${_('never')} |
|
324 | ${_('never')} | |
325 | %else: |
|
325 | %else: | |
326 | ${h.age_component(h.time_to_utcdatetime(expires))} |
|
326 | ${h.age_component(h.time_to_utcdatetime(expires))} | |
327 | %endif |
|
327 | %endif | |
328 | </div> |
|
328 | </div> | |
329 | </%def> |
|
329 | </%def> | |
330 |
|
330 | |||
331 | <%def name="gist_type(gist_type)"> |
|
331 | <%def name="gist_type(gist_type)"> | |
332 | %if gist_type != 'public': |
|
332 | %if gist_type != 'public': | |
333 | <div class="tag">${_('Private')}</div> |
|
333 | <div class="tag">${_('Private')}</div> | |
334 | %endif |
|
334 | %endif | |
335 | </%def> |
|
335 | </%def> | |
336 |
|
336 | |||
337 | <%def name="gist_description(gist_description)"> |
|
337 | <%def name="gist_description(gist_description)"> | |
338 | ${gist_description} |
|
338 | ${gist_description} | |
339 | </%def> |
|
339 | </%def> | |
340 |
|
340 | |||
341 |
|
341 | |||
342 | ## PULL REQUESTS GRID RENDERERS |
|
342 | ## PULL REQUESTS GRID RENDERERS | |
343 |
|
343 | |||
344 | <%def name="pullrequest_target_repo(repo_name)"> |
|
344 | <%def name="pullrequest_target_repo(repo_name)"> | |
345 | <div class="truncate"> |
|
345 | <div class="truncate"> | |
346 | ${h.link_to(repo_name,h.route_path('repo_summary',repo_name=repo_name))} |
|
346 | ${h.link_to(repo_name,h.route_path('repo_summary',repo_name=repo_name))} | |
347 | </div> |
|
347 | </div> | |
348 | </%def> |
|
348 | </%def> | |
349 | <%def name="pullrequest_status(status)"> |
|
349 | <%def name="pullrequest_status(status)"> | |
350 | <div class="${'flag_status %s' % status} pull-left"></div> |
|
350 | <div class="${'flag_status %s' % status} pull-left"></div> | |
351 | </%def> |
|
351 | </%def> | |
352 |
|
352 | |||
353 | <%def name="pullrequest_title(title, description)"> |
|
353 | <%def name="pullrequest_title(title, description)"> | |
354 | ${title} |
|
354 | ${title} | |
355 | </%def> |
|
355 | </%def> | |
356 |
|
356 | |||
357 | <%def name="pullrequest_comments(comments_nr)"> |
|
357 | <%def name="pullrequest_comments(comments_nr)"> | |
358 | <i class="icon-comment"></i> ${comments_nr} |
|
358 | <i class="icon-comment"></i> ${comments_nr} | |
359 | </%def> |
|
359 | </%def> | |
360 |
|
360 | |||
361 | <%def name="pullrequest_name(pull_request_id, target_repo_name, short=False)"> |
|
361 | <%def name="pullrequest_name(pull_request_id, target_repo_name, short=False)"> | |
362 | <a href="${h.route_path('pullrequest_show',repo_name=target_repo_name,pull_request_id=pull_request_id)}"> |
|
362 | <a href="${h.route_path('pullrequest_show',repo_name=target_repo_name,pull_request_id=pull_request_id)}"> | |
363 | % if short: |
|
363 | % if short: | |
364 | #${pull_request_id} |
|
364 | #${pull_request_id} | |
365 | % else: |
|
365 | % else: | |
366 | ${_('Pull request #%(pr_number)s') % {'pr_number': pull_request_id,}} |
|
366 | ${_('Pull request #%(pr_number)s') % {'pr_number': pull_request_id,}} | |
367 | % endif |
|
367 | % endif | |
368 | </a> |
|
368 | </a> | |
369 | </%def> |
|
369 | </%def> | |
370 |
|
370 | |||
371 | <%def name="pullrequest_updated_on(updated_on)"> |
|
371 | <%def name="pullrequest_updated_on(updated_on)"> | |
372 | ${h.age_component(h.time_to_utcdatetime(updated_on))} |
|
372 | ${h.age_component(h.time_to_utcdatetime(updated_on))} | |
373 | </%def> |
|
373 | </%def> | |
374 |
|
374 | |||
375 | <%def name="pullrequest_author(full_contact)"> |
|
375 | <%def name="pullrequest_author(full_contact)"> | |
376 | ${base.gravatar_with_user(full_contact, 16)} |
|
376 | ${base.gravatar_with_user(full_contact, 16)} | |
377 | </%def> |
|
377 | </%def> | |
378 |
|
378 | |||
379 |
|
379 | |||
380 | ## ARTIFACT RENDERERS |
|
380 | ## ARTIFACT RENDERERS | |
381 |
|
381 | |||
382 | <%def name="repo_artifact_uid(file_uid)"> |
|
382 | <%def name="repo_artifact_uid(file_uid)"> | |
383 | <code><a href="${h.route_path('download_file', fid=file_uid)}">${file_uid}</a></code> |
|
383 | <code><a href="${h.route_path('download_file', fid=file_uid)}">${file_uid}</a></code> | |
384 | </%def> |
|
384 | </%def> | |
385 |
|
385 | |||
386 | <%def name="repo_artifact_uid_action(file_uid)"> |
|
386 | <%def name="repo_artifact_uid_action(file_uid)"> | |
387 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${h.route_url('download_file', fid=file_uid)}" title="${_('Copy the full url')}"></i> |
|
387 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${h.route_url('download_file', fid=file_uid)}" title="${_('Copy the full url')}"></i> | |
388 | </%def> |
|
388 | </%def> | |
389 |
|
389 | |||
390 | <%def name="repo_artifact_actions(repo_name, file_store_id, file_uid)"> |
|
390 | <%def name="repo_artifact_actions(repo_name, file_store_id, file_uid)"> | |
391 | ## <div class="grid_edit"> |
|
391 | ## <div class="grid_edit"> | |
392 | ## <a href="#Edit" title="${_('Edit')}">${_('Edit')}</a> |
|
392 | ## <a href="#Edit" title="${_('Edit')}">${_('Edit')}</a> | |
393 | ## </div> |
|
393 | ## </div> | |
|
394 | % if h.HasRepoPermissionAny('repository.admin')(c.repo_name): | |||
394 | <div class="grid_delete"> |
|
395 | <div class="grid_delete"> | |
395 | ${h.secure_form(h.route_path('repo_artifacts_delete', repo_name=repo_name, uid=file_store_id), request=request)} |
|
396 | ${h.secure_form(h.route_path('repo_artifacts_delete', repo_name=repo_name, uid=file_store_id), request=request)} | |
396 | ${h.submit('remove_',_('Delete'),id="remove_artifact_%s" % file_store_id, class_="btn btn-link btn-danger", |
|
397 | ${h.submit('remove_',_('Delete'),id="remove_artifact_%s" % file_store_id, class_="btn btn-link btn-danger", | |
397 | onclick="return confirm('"+_('Confirm to delete this artifact: %s') % file_uid+"');")} |
|
398 | onclick="return confirm('"+_('Confirm to delete this artifact: %s') % file_uid+"');")} | |
398 | ${h.end_form()} |
|
399 | ${h.end_form()} | |
399 | </div> |
|
400 | </div> | |
|
401 | % endif | |||
400 | </%def> |
|
402 | </%def> | |
401 |
|
403 | |||
402 | <%def name="markup_form(form_id, form_text='', help_text=None)"> |
|
404 | <%def name="markup_form(form_id, form_text='', help_text=None)"> | |
403 |
|
405 | |||
404 | <div class="markup-form"> |
|
406 | <div class="markup-form"> | |
405 | <div class="markup-form-area"> |
|
407 | <div class="markup-form-area"> | |
406 | <div class="markup-form-area-header"> |
|
408 | <div class="markup-form-area-header"> | |
407 | <ul class="nav-links clearfix"> |
|
409 | <ul class="nav-links clearfix"> | |
408 | <li class="active"> |
|
410 | <li class="active"> | |
409 | <a href="#edit-text" tabindex="-1" id="edit-btn_${form_id}">${_('Write')}</a> |
|
411 | <a href="#edit-text" tabindex="-1" id="edit-btn_${form_id}">${_('Write')}</a> | |
410 | </li> |
|
412 | </li> | |
411 | <li class=""> |
|
413 | <li class=""> | |
412 | <a href="#preview-text" tabindex="-1" id="preview-btn_${form_id}">${_('Preview')}</a> |
|
414 | <a href="#preview-text" tabindex="-1" id="preview-btn_${form_id}">${_('Preview')}</a> | |
413 | </li> |
|
415 | </li> | |
414 | </ul> |
|
416 | </ul> | |
415 | </div> |
|
417 | </div> | |
416 |
|
418 | |||
417 | <div class="markup-form-area-write" style="display: block;"> |
|
419 | <div class="markup-form-area-write" style="display: block;"> | |
418 | <div id="edit-container_${form_id}"> |
|
420 | <div id="edit-container_${form_id}"> | |
419 | <textarea id="${form_id}" name="${form_id}" class="comment-block-ta ac-input">${form_text if form_text else ''}</textarea> |
|
421 | <textarea id="${form_id}" name="${form_id}" class="comment-block-ta ac-input">${form_text if form_text else ''}</textarea> | |
420 | </div> |
|
422 | </div> | |
421 | <div id="preview-container_${form_id}" class="clearfix" style="display: none;"> |
|
423 | <div id="preview-container_${form_id}" class="clearfix" style="display: none;"> | |
422 | <div id="preview-box_${form_id}" class="preview-box"></div> |
|
424 | <div id="preview-box_${form_id}" class="preview-box"></div> | |
423 | </div> |
|
425 | </div> | |
424 | </div> |
|
426 | </div> | |
425 |
|
427 | |||
426 | <div class="markup-form-area-footer"> |
|
428 | <div class="markup-form-area-footer"> | |
427 | <div class="toolbar"> |
|
429 | <div class="toolbar"> | |
428 | <div class="toolbar-text"> |
|
430 | <div class="toolbar-text"> | |
429 | ${(_('Parsed using %s syntax') % ( |
|
431 | ${(_('Parsed using %s syntax') % ( | |
430 | ('<a href="%s">%s</a>' % (h.route_url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())), |
|
432 | ('<a href="%s">%s</a>' % (h.route_url('%s_help' % c.visual.default_renderer), c.visual.default_renderer.upper())), | |
431 | ) |
|
433 | ) | |
432 | )|n} |
|
434 | )|n} | |
433 | </div> |
|
435 | </div> | |
434 | </div> |
|
436 | </div> | |
435 | </div> |
|
437 | </div> | |
436 | </div> |
|
438 | </div> | |
437 |
|
439 | |||
438 | <div class="markup-form-footer"> |
|
440 | <div class="markup-form-footer"> | |
439 | % if help_text: |
|
441 | % if help_text: | |
440 | <span class="help-block">${help_text}</span> |
|
442 | <span class="help-block">${help_text}</span> | |
441 | % endif |
|
443 | % endif | |
442 | </div> |
|
444 | </div> | |
443 | </div> |
|
445 | </div> | |
444 | <script type="text/javascript"> |
|
446 | <script type="text/javascript"> | |
445 | new MarkupForm('${form_id}'); |
|
447 | new MarkupForm('${form_id}'); | |
446 | </script> |
|
448 | </script> | |
447 |
|
449 | |||
448 | </%def> |
|
450 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now