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