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