##// END OF EJS Templates
make user listing have edit button to be consistent...
marcink -
r3800:6e38d107 beta
parent child Browse files
Show More
@@ -1,143 +1,150 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.html"/>
3 ## <%namespace name="dt" file="/data_table/_dt_elements.html"/>
4
4
5 <%def name="quick_menu(repo_name)">
5 <%def name="quick_menu(repo_name)">
6 <ul class="menu_items hidden">
6 <ul class="menu_items hidden">
7 <li style="border-top:1px solid #003367;margin-left:18px;padding-left:-99px"></li>
7 <li style="border-top:1px solid #003367;margin-left:18px;padding-left:-99px"></li>
8 <li>
8 <li>
9 <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=repo_name)}">
9 <a title="${_('Summary')}" href="${h.url('summary_home',repo_name=repo_name)}">
10 <span class="icon">
10 <span class="icon">
11 <img src="${h.url('/images/icons/clipboard_16.png')}" alt="${_('Summary')}" />
11 <img src="${h.url('/images/icons/clipboard_16.png')}" alt="${_('Summary')}" />
12 </span>
12 </span>
13 <span>${_('Summary')}</span>
13 <span>${_('Summary')}</span>
14 </a>
14 </a>
15 </li>
15 </li>
16 <li>
16 <li>
17 <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=repo_name)}">
17 <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=repo_name)}">
18 <span class="icon">
18 <span class="icon">
19 <img src="${h.url('/images/icons/time.png')}" alt="${_('Changelog')}" />
19 <img src="${h.url('/images/icons/time.png')}" alt="${_('Changelog')}" />
20 </span>
20 </span>
21 <span>${_('Changelog')}</span>
21 <span>${_('Changelog')}</span>
22 </a>
22 </a>
23 </li>
23 </li>
24 <li>
24 <li>
25 <a title="${_('Files')}" href="${h.url('files_home',repo_name=repo_name)}">
25 <a title="${_('Files')}" href="${h.url('files_home',repo_name=repo_name)}">
26 <span class="icon">
26 <span class="icon">
27 <img src="${h.url('/images/icons/file.png')}" alt="${_('Files')}" />
27 <img src="${h.url('/images/icons/file.png')}" alt="${_('Files')}" />
28 </span>
28 </span>
29 <span>${_('Files')}</span>
29 <span>${_('Files')}</span>
30 </a>
30 </a>
31 </li>
31 </li>
32 <li>
32 <li>
33 <a title="${_('Fork')}" href="${h.url('repo_fork_home',repo_name=repo_name)}">
33 <a title="${_('Fork')}" href="${h.url('repo_fork_home',repo_name=repo_name)}">
34 <span class="icon">
34 <span class="icon">
35 <img src="${h.url('/images/icons/arrow_divide.png')}" alt="${_('Fork')}" />
35 <img src="${h.url('/images/icons/arrow_divide.png')}" alt="${_('Fork')}" />
36 </span>
36 </span>
37 <span>${_('Fork')}</span>
37 <span>${_('Fork')}</span>
38 </a>
38 </a>
39 </li>
39 </li>
40 </ul>
40 </ul>
41 </%def>
41 </%def>
42
42
43 <%def name="repo_name(name,rtype,private,fork_of,short_name=False,admin=False)">
43 <%def name="repo_name(name,rtype,private,fork_of,short_name=False,admin=False)">
44 <%
44 <%
45 def get_name(name,short_name=short_name):
45 def get_name(name,short_name=short_name):
46 if short_name:
46 if short_name:
47 return name.split('/')[-1]
47 return name.split('/')[-1]
48 else:
48 else:
49 return name
49 return name
50 %>
50 %>
51 <div style="white-space: nowrap">
51 <div style="white-space: nowrap">
52 ##TYPE OF REPO
52 ##TYPE OF REPO
53 %if h.is_hg(rtype):
53 %if h.is_hg(rtype):
54 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
54 <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
55 %elif h.is_git(rtype):
55 %elif h.is_git(rtype):
56 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
56 <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
57 %endif
57 %endif
58
58
59 ##PRIVATE/PUBLIC
59 ##PRIVATE/PUBLIC
60 %if private and c.visual.show_private_icon:
60 %if private and c.visual.show_private_icon:
61 <img class="icon" title="${_('Private repository')}" alt="${_('Private repository')}" src="${h.url('/images/icons/lock.png')}"/>
61 <img class="icon" title="${_('Private repository')}" alt="${_('Private repository')}" src="${h.url('/images/icons/lock.png')}"/>
62 %elif not private and c.visual.show_public_icon:
62 %elif not private and c.visual.show_public_icon:
63 <img class="icon" title="${_('Public repository')}" alt="${_('Public repository')}" src="${h.url('/images/icons/lock_open.png')}"/>
63 <img class="icon" title="${_('Public repository')}" alt="${_('Public repository')}" src="${h.url('/images/icons/lock_open.png')}"/>
64 %endif
64 %endif
65
65
66 ##NAME
66 ##NAME
67 %if admin:
67 %if admin:
68 ${h.link_to(get_name(name),h.url('edit_repo',repo_name=name),class_="repo_name")}
68 ${h.link_to(get_name(name),h.url('edit_repo',repo_name=name),class_="repo_name")}
69 %else:
69 %else:
70 ${h.link_to(get_name(name),h.url('summary_home',repo_name=name),class_="repo_name")}
70 ${h.link_to(get_name(name),h.url('summary_home',repo_name=name),class_="repo_name")}
71 %endif
71 %endif
72 %if fork_of:
72 %if fork_of:
73 <a href="${h.url('summary_home',repo_name=fork_of.repo_name)}">
73 <a href="${h.url('summary_home',repo_name=fork_of.repo_name)}">
74 <img class="icon" alt="${_('Fork')}" title="${_('Fork of %s') % fork_of.repo_name}" src="${h.url('/images/icons/arrow_divide.png')}"/></a>
74 <img class="icon" alt="${_('Fork')}" title="${_('Fork of %s') % fork_of.repo_name}" src="${h.url('/images/icons/arrow_divide.png')}"/></a>
75 %endif
75 %endif
76 </div>
76 </div>
77 </%def>
77 </%def>
78
78
79 <%def name="last_change(last_change)">
79 <%def name="last_change(last_change)">
80 <span class="tooltip" date="${last_change}" title="${h.tooltip(h.fmt_date(last_change))}">${h.age(last_change)}</span>
80 <span class="tooltip" date="${last_change}" title="${h.tooltip(h.fmt_date(last_change))}">${h.age(last_change)}</span>
81 </%def>
81 </%def>
82
82
83 <%def name="revision(name,rev,tip,author,last_msg)">
83 <%def name="revision(name,rev,tip,author,last_msg)">
84 <div>
84 <div>
85 %if rev >= 0:
85 %if rev >= 0:
86 <pre><a title="${h.tooltip('%s:\n\n%s' % (author,last_msg))}" class="tooltip" href="${h.url('changeset_home',repo_name=name,revision=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a></pre>
86 <pre><a title="${h.tooltip('%s:\n\n%s' % (author,last_msg))}" class="tooltip" href="${h.url('changeset_home',repo_name=name,revision=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a></pre>
87 %else:
87 %else:
88 ${_('No changesets yet')}
88 ${_('No changesets yet')}
89 %endif
89 %endif
90 </div>
90 </div>
91 </%def>
91 </%def>
92
92
93 <%def name="rss(name)">
93 <%def name="rss(name)">
94 %if c.rhodecode_user.username != 'default':
94 %if c.rhodecode_user.username != 'default':
95 <a title="${_('Subscribe to %s rss feed')% name}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=name,api_key=c.rhodecode_user.api_key)}"></a>
95 <a title="${_('Subscribe to %s rss feed')% name}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=name,api_key=c.rhodecode_user.api_key)}"></a>
96 %else:
96 %else:
97 <a title="${_('Subscribe to %s rss feed')% name}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=name)}"></a>
97 <a title="${_('Subscribe to %s rss feed')% name}" class="rss_icon" href="${h.url('rss_feed_home',repo_name=name)}"></a>
98 %endif
98 %endif
99 </%def>
99 </%def>
100
100
101 <%def name="atom(name)">
101 <%def name="atom(name)">
102 %if c.rhodecode_user.username != 'default':
102 %if c.rhodecode_user.username != 'default':
103 <a title="${_('Subscribe to %s atom feed')% name}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=name,api_key=c.rhodecode_user.api_key)}"></a>
103 <a title="${_('Subscribe to %s atom feed')% name}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=name,api_key=c.rhodecode_user.api_key)}"></a>
104 %else:
104 %else:
105 <a title="${_('Subscribe to %s atom feed')% name}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=name)}"></a>
105 <a title="${_('Subscribe to %s atom feed')% name}" class="atom_icon" href="${h.url('atom_feed_home',repo_name=name)}"></a>
106 %endif
106 %endif
107 </%def>
107 </%def>
108
108
109 <%def name="user_gravatar(email, size=24)">
109 <%def name="user_gravatar(email, size=24)">
110 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(email, size)}"/> </div>
110 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(email, size)}"/> </div>
111 </%def>
111 </%def>
112
112
113 <%def name="repo_actions(repo_name, super_user=True)">
113 <%def name="repo_actions(repo_name, super_user=True)">
114 <div>
114 <div>
115 <div style="float:left">
115 <div style="float:left">
116 <a href="${h.url('edit_repo',repo_name=repo_name)}" title="${_('edit')}">
116 <a href="${h.url('edit_repo',repo_name=repo_name)}" title="${_('edit')}">
117 ${h.submit('edit_%s' % repo_name,_('edit'),class_="edit_icon action_button")}
117 ${h.submit('edit_%s' % repo_name,_('edit'),class_="edit_icon action_button")}
118 </a>
118 </a>
119 </div>
119 </div>
120 <div style="float:left">
120 <div style="float:left">
121 ${h.form(h.url('repo', repo_name=repo_name),method='delete')}
121 ${h.form(h.url('repo', repo_name=repo_name),method='delete')}
122 ${h.submit('remove_%s' % repo_name,_('delete'),class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")}
122 ${h.submit('remove_%s' % repo_name,_('delete'),class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")}
123 ${h.end_form()}
123 ${h.end_form()}
124 </div>
124 </div>
125 </div>
125 </div>
126 </%def>
126 </%def>
127
127
128 <%def name="user_actions(user_id, username)">
128 <%def name="user_actions(user_id, username)">
129 <div style="float:left">
130 <a href="${h.url('edit_user',id=user_id)}" title="${_('edit')}">
131 ${h.submit('edit_%s' % username,_('edit'),class_="edit_icon action_button")}
132 </a>
133 </div>
134 <div style="float:left">
129 ${h.form(h.url('delete_user', id=user_id),method='delete')}
135 ${h.form(h.url('delete_user', id=user_id),method='delete')}
130 ${h.submit('remove_',_('delete'),id="remove_user_%s" % user_id,
136 ${h.submit('remove_',_('delete'),id="remove_user_%s" % user_id,
131 class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this user: %s') % username+"');")}
137 class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this user: %s') % username+"');")}
132 ${h.end_form()}
138 ${h.end_form()}
139 </div>
133 </%def>
140 </%def>
134
141
135 <%def name="user_name(user_id, username)">
142 <%def name="user_name(user_id, username)">
136 ${h.link_to(username,h.url('edit_user', id=user_id))}
143 ${h.link_to(username,h.url('edit_user', id=user_id))}
137 </%def>
144 </%def>
138
145
139 <%def name="toggle_follow(repo_id)">
146 <%def name="toggle_follow(repo_id)">
140 <span id="follow_toggle_${repo_id}" class="following" title="${_('Stop following this repository')}"
147 <span id="follow_toggle_${repo_id}" class="following" title="${_('Stop following this repository')}"
141 onclick="javascript:toggleFollowingRepo(this, ${repo_id},'${str(h.get_token())}')">
148 onclick="javascript:toggleFollowingRepo(this, ${repo_id},'${str(h.get_token())}')">
142 </span>
149 </span>
143 </%def>
150 </%def>
General Comments 0
You need to be logged in to leave comments. Login now