Show More
@@ -408,29 +408,11 b' table.trending_language_tbl {' | |||
|
408 | 408 | |
|
409 | 409 | .trending_language { |
|
410 | 410 | position: relative; |
|
411 | width: 100%; | |
|
412 | height: 19px; | |
|
413 | 411 | overflow: hidden; |
|
414 | background-color: @grey6; | |
|
412 | color: @text-color; | |
|
413 | width: 400px; | |
|
415 | 414 | |
|
416 | span, b{ | |
|
417 | position: absolute; | |
|
418 | display: block; | |
|
419 | height: 12px; | |
|
420 | margin-bottom: 0px; | |
|
421 | white-space: pre; | |
|
422 | padding: floor(@basefontsize/4); | |
|
423 | top: 0; | |
|
424 | left: 0; | |
|
425 | } | |
|
426 | ||
|
427 | span{ | |
|
428 | color: @text-color; | |
|
429 | z-index: 0; | |
|
430 | min-width: 20px; | |
|
431 | } | |
|
432 | ||
|
433 | b { | |
|
415 | .lang-bar { | |
|
434 | 416 | z-index: 1; |
|
435 | 417 | overflow: hidden; |
|
436 | 418 | background-color: @rcblue; |
@@ -102,7 +102,7 b' var showRepoStats = function(target, dat' | |||
|
102 | 102 | var total = 0; |
|
103 | 103 | var no_data = true; |
|
104 | 104 | var tbl = document.createElement('table'); |
|
105 | tbl.setAttribute('class', 'trending_language_tbl'); | |
|
105 | tbl.setAttribute('class', 'trending_language_tbl rctable'); | |
|
106 | 106 | |
|
107 | 107 | $.each(data, function(key, val){ |
|
108 | 108 | total += val.count; |
@@ -120,54 +120,47 b' var showRepoStats = function(target, dat' | |||
|
120 | 120 | cnt += 1; |
|
121 | 121 | no_data = false; |
|
122 | 122 | |
|
123 | var hide = cnt > 2; | |
|
124 | 123 | var tr = document.createElement('tr'); |
|
125 | if (hide) { | |
|
126 | tr.setAttribute('style', 'display:none'); | |
|
127 | tr.setAttribute('class', 'stats_hidden'); | |
|
128 | } | |
|
129 | 124 | |
|
130 | 125 | var key = val[0]; |
|
131 | 126 | var obj = {"desc": val[1].desc, "count": val[1].count}; |
|
132 | 127 | |
|
133 | var percentage = Math.round((obj.count / total * 100), 2); | |
|
134 | ||
|
128 | // meta language names | |
|
135 | 129 | var td1 = document.createElement('td'); |
|
136 | td1.width = 300; | |
|
137 | 130 | var trending_language_label = document.createElement('div'); |
|
138 |
trending_language_label.innerHTML = obj.desc |
|
|
131 | trending_language_label.innerHTML = obj.desc; | |
|
139 | 132 | td1.appendChild(trending_language_label); |
|
140 | 133 | |
|
134 | // extensions | |
|
141 | 135 | var td2 = document.createElement('td'); |
|
142 |
var |
|
|
143 | var nr_files = obj.count +" "+ _ngettext('file', 'files', obj.count); | |
|
144 | ||
|
145 | trending_language.title = key + " " + nr_files; | |
|
136 | var extension = document.createElement('div'); | |
|
137 | extension.innerHTML = ".{0}".format(key) | |
|
138 | td2.appendChild(extension); | |
|
146 | 139 | |
|
147 | trending_language.innerHTML = "<span>" + percentage + "% " + nr_files | |
|
148 | + "</span><b>" + percentage + "% " + nr_files + "</b>"; | |
|
140 | // number of files | |
|
141 | var td3 = document.createElement('td'); | |
|
142 | var file_count = document.createElement('div'); | |
|
143 | var percentage_num = Math.round((obj.count / total * 100), 2); | |
|
144 | var label = _ngettext('file', 'files', obj.count); | |
|
145 | file_count.innerHTML = "{0} {1} ({2}%)".format(obj.count, label, percentage_num) ; | |
|
146 | td3.appendChild(file_count); | |
|
149 | 147 | |
|
150 | trending_language.setAttribute("class", 'trending_language'); | |
|
151 | $('b', trending_language)[0].style.width = percentage + "%"; | |
|
152 |
td |
|
|
148 | // percentage | |
|
149 | var td4 = document.createElement('td'); | |
|
150 | td4.setAttribute("class", 'trending_language'); | |
|
151 | ||
|
152 | var percentage = document.createElement('div'); | |
|
153 | percentage.setAttribute('class', 'lang-bar'); | |
|
154 | percentage.innerHTML = " "; | |
|
155 | percentage.style.width = percentage_num + '%'; | |
|
156 | td4.appendChild(percentage); | |
|
153 | 157 | |
|
154 | 158 | tr.appendChild(td1); |
|
155 | 159 | tr.appendChild(td2); |
|
160 | tr.appendChild(td3); | |
|
161 | tr.appendChild(td4); | |
|
156 | 162 | tbl.appendChild(tr); |
|
157 | if (cnt == 3) { | |
|
158 | var show_more = document.createElement('tr'); | |
|
159 | var td = document.createElement('td'); | |
|
160 | lnk = document.createElement('a'); | |
|
161 | 163 | |
|
162 | lnk.href = '#'; | |
|
163 | lnk.innerHTML = _gettext('Show more'); | |
|
164 | lnk.id = 'code_stats_show_more'; | |
|
165 | td.appendChild(lnk); | |
|
166 | ||
|
167 | show_more.appendChild(td); | |
|
168 | show_more.appendChild(document.createElement('td')); | |
|
169 | tbl.appendChild(show_more); | |
|
170 | } | |
|
171 | 164 | }); |
|
172 | 165 | |
|
173 | 166 | $(container).html(tbl); |
@@ -139,30 +139,21 b'' | |||
|
139 | 139 | </div> |
|
140 | 140 | </div> |
|
141 | 141 | </div> |
|
142 |
|
|
|
142 | </div> | |
|
143 | ## owner, description, downloads, statistics | |
|
143 | 144 | |
|
145 | ## Owner | |
|
144 | 146 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> |
|
145 | 147 | <div class="left-label-summary"> |
|
146 |
<p>${_(' |
|
|
147 | ||
|
148 | <p>${_('Owner')}</p> | |
|
148 | 149 | <div class="right-label-summary"> |
|
149 | <div class="tags"> | |
|
150 | ## repo size | |
|
151 | % if commit_rev == -1: | |
|
152 | <span class="stats-bullet">0 B</span> | |
|
153 | % else: | |
|
154 | <span> | |
|
155 | <a href="#showSize" onclick="calculateSize(); $(this).hide(); return false" id="show-repo-size">Show repository size</a> | |
|
156 | </span> | |
|
157 | <span class="stats-bullet" id="repo_size_container" style="display:none"> | |
|
158 | ${_('Calculating Repository Size...')} | |
|
159 | </span> | |
|
160 | % endif | |
|
161 | </div> | |
|
150 | ${base.gravatar_with_user(c.rhodecode_db_repo.user.email, 16)} | |
|
162 | 151 | </div> |
|
152 | ||
|
163 | 153 | </div> |
|
164 | 154 | </div> |
|
165 | 155 | |
|
156 | ## Description | |
|
166 | 157 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> |
|
167 | 158 | <div class="left-label-summary"> |
|
168 | 159 | <p>${_('Description')}</p> |
@@ -174,6 +165,7 b'' | |||
|
174 | 165 | </div> |
|
175 | 166 | </div> |
|
176 | 167 |
|
|
168 | ## Downloads | |
|
177 | 169 | % if show_downloads: |
|
178 | 170 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> |
|
179 | 171 | <div class="left-label-summary"> |
@@ -205,15 +197,53 b'' | |||
|
205 | 197 | </div> |
|
206 | 198 | % endif |
|
207 | 199 | |
|
200 | ## Context Action | |
|
201 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |
|
202 | <div class="left-label-summary"> | |
|
203 | <p>${_('Feed')}</p> | |
|
204 | ||
|
205 | <div class="right-label-summary"> | |
|
206 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
|
207 | <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> | |
|
208 | %else: | |
|
209 | <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> | |
|
210 | %endif | |
|
211 | </div> | |
|
212 | </div> | |
|
213 | </div> | |
|
214 | ||
|
215 | ## Repo size | |
|
216 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |
|
217 | <div class="left-label-summary"> | |
|
218 | <p>${_('Repository size')}</p> | |
|
219 | ||
|
220 | <div class="right-label-summary"> | |
|
221 | <div class="tags"> | |
|
222 | ## repo size | |
|
223 | % if commit_rev == -1: | |
|
224 | <span class="stats-bullet">0 B</span> | |
|
225 | % else: | |
|
226 | <span> | |
|
227 | <a href="#showSize" onclick="calculateSize(); $(this).hide(); return false" id="show-repo-size">Show repository size</a> | |
|
228 | </span> | |
|
229 | <span class="stats-bullet" id="repo_size_container" style="display:none"> | |
|
230 | ${_('Calculating Repository Size...')} | |
|
231 | </span> | |
|
232 | % endif | |
|
233 | </div> | |
|
234 | </div> | |
|
235 | </div> | |
|
236 | </div> | |
|
237 | ||
|
208 | 238 | ## Statistics |
|
209 | 239 |
|
|
210 | 240 | <div class="left-label-summary"> |
|
211 | <p>${_('Statistics')}</p> | |
|
241 | <p>${_('Code Statistics')}</p> | |
|
212 | 242 | |
|
213 | 243 | <div class="right-label-summary input ${summary(c.show_stats)} statistics"> |
|
214 | 244 | % if c.show_stats: |
|
215 | 245 | <div id="lang_stats" class="enabled"> |
|
216 | ${_('Calculating Code Statistics...')} | |
|
246 | <a href="#showSize" onclick="calculateSize(); $('#show-repo-size').hide(); $(this).hide(); return false" id="show-repo-size">Show code statistics</a> | |
|
217 | 247 | </div> |
|
218 | 248 | % else: |
|
219 | 249 | <span class="disabled"> |
@@ -228,26 +258,6 b'' | |||
|
228 | 258 | </div> |
|
229 | 259 | </div> |
|
230 | 260 | |
|
231 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |
|
232 | <div class="left-label-summary"> | |
|
233 | <p>${_('Owner')}</p> | |
|
234 | <div class="right-label-summary"> | |
|
235 | ${base.gravatar_with_user(c.rhodecode_db_repo.user.email, 16)} | |
|
236 | </div> | |
|
237 | ||
|
238 | </div> | |
|
239 | </div> | |
|
240 | ||
|
241 | ## Context Action | |
|
242 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |
|
243 | <div class="left-label-summary"> | |
|
244 | %if c.rhodecode_user.username != h.DEFAULT_USER: | |
|
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> | |
|
246 | %else: | |
|
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> | |
|
248 | %endif | |
|
249 | </div> | |
|
250 | </div> | |
|
251 | 261 | |
|
252 | 262 | </div><!--end summary-detail--> |
|
253 | 263 |
General Comments 0
You need to be logged in to leave comments.
Login now