Show More
@@ -408,29 +408,11 b' table.trending_language_tbl {' | |||||
408 |
|
408 | |||
409 | .trending_language { |
|
409 | .trending_language { | |
410 | position: relative; |
|
410 | position: relative; | |
411 | width: 100%; |
|
|||
412 | height: 19px; |
|
|||
413 | overflow: hidden; |
|
411 | overflow: hidden; | |
414 | background-color: @grey6; |
|
412 | color: @text-color; | |
|
413 | width: 400px; | |||
415 |
|
414 | |||
416 | span, b{ |
|
415 | .lang-bar { | |
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 { |
|
|||
434 | z-index: 1; |
|
416 | z-index: 1; | |
435 | overflow: hidden; |
|
417 | overflow: hidden; | |
436 | background-color: @rcblue; |
|
418 | background-color: @rcblue; |
@@ -102,7 +102,7 b' var showRepoStats = function(target, dat' | |||||
102 | var total = 0; |
|
102 | var total = 0; | |
103 | var no_data = true; |
|
103 | var no_data = true; | |
104 | var tbl = document.createElement('table'); |
|
104 | var tbl = document.createElement('table'); | |
105 | tbl.setAttribute('class', 'trending_language_tbl'); |
|
105 | tbl.setAttribute('class', 'trending_language_tbl rctable'); | |
106 |
|
106 | |||
107 | $.each(data, function(key, val){ |
|
107 | $.each(data, function(key, val){ | |
108 | total += val.count; |
|
108 | total += val.count; | |
@@ -120,54 +120,47 b' var showRepoStats = function(target, dat' | |||||
120 | cnt += 1; |
|
120 | cnt += 1; | |
121 | no_data = false; |
|
121 | no_data = false; | |
122 |
|
122 | |||
123 | var hide = cnt > 2; |
|
|||
124 | var tr = document.createElement('tr'); |
|
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 | var key = val[0]; |
|
125 | var key = val[0]; | |
131 | var obj = {"desc": val[1].desc, "count": val[1].count}; |
|
126 | var obj = {"desc": val[1].desc, "count": val[1].count}; | |
132 |
|
127 | |||
133 | var percentage = Math.round((obj.count / total * 100), 2); |
|
128 | // meta language names | |
134 |
|
||||
135 | var td1 = document.createElement('td'); |
|
129 | var td1 = document.createElement('td'); | |
136 | td1.width = 300; |
|
|||
137 | var trending_language_label = document.createElement('div'); |
|
130 | var trending_language_label = document.createElement('div'); | |
138 |
trending_language_label.innerHTML = obj.desc |
|
131 | trending_language_label.innerHTML = obj.desc; | |
139 | td1.appendChild(trending_language_label); |
|
132 | td1.appendChild(trending_language_label); | |
140 |
|
133 | |||
|
134 | // extensions | |||
141 | var td2 = document.createElement('td'); |
|
135 | var td2 = document.createElement('td'); | |
142 |
var |
|
136 | var extension = document.createElement('div'); | |
143 | var nr_files = obj.count +" "+ _ngettext('file', 'files', obj.count); |
|
137 | extension.innerHTML = ".{0}".format(key) | |
144 |
|
138 | td2.appendChild(extension); | ||
145 | trending_language.title = key + " " + nr_files; |
|
|||
146 |
|
139 | |||
147 | trending_language.innerHTML = "<span>" + percentage + "% " + nr_files |
|
140 | // number of files | |
148 | + "</span><b>" + percentage + "% " + nr_files + "</b>"; |
|
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'); |
|
148 | // percentage | |
151 | $('b', trending_language)[0].style.width = percentage + "%"; |
|
149 | var td4 = document.createElement('td'); | |
152 |
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 | tr.appendChild(td1); |
|
158 | tr.appendChild(td1); | |
155 | tr.appendChild(td2); |
|
159 | tr.appendChild(td2); | |
|
160 | tr.appendChild(td3); | |||
|
161 | tr.appendChild(td4); | |||
156 | tbl.appendChild(tr); |
|
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 | $(container).html(tbl); |
|
166 | $(container).html(tbl); |
@@ -140,29 +140,20 b'' | |||||
140 | </div> |
|
140 | </div> | |
141 | </div> |
|
141 | </div> | |
142 |
|
|
142 | </div> | |
|
143 | ## owner, description, downloads, statistics | |||
143 |
|
144 | |||
|
145 | ## Owner | |||
144 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> |
|
146 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |
145 | <div class="left-label-summary"> |
|
147 | <div class="left-label-summary"> | |
146 |
<p>${_(' |
|
148 | <p>${_('Owner')}</p> | |
147 |
|
||||
148 | <div class="right-label-summary"> |
|
149 | <div class="right-label-summary"> | |
149 | <div class="tags"> |
|
150 | ${base.gravatar_with_user(c.rhodecode_db_repo.user.email, 16)} | |
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 |
|
|
151 | </div> | |
162 | </div> |
|
152 | ||
163 | </div> |
|
153 | </div> | |
164 | </div> |
|
154 | </div> | |
165 |
|
155 | |||
|
156 | ## Description | |||
166 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> |
|
157 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |
167 | <div class="left-label-summary"> |
|
158 | <div class="left-label-summary"> | |
168 | <p>${_('Description')}</p> |
|
159 | <p>${_('Description')}</p> | |
@@ -174,6 +165,7 b'' | |||||
174 | </div> |
|
165 | </div> | |
175 | </div> |
|
166 | </div> | |
176 |
|
|
167 | ||
|
168 | ## Downloads | |||
177 | % if show_downloads: |
|
169 | % if show_downloads: | |
178 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> |
|
170 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |
179 | <div class="left-label-summary"> |
|
171 | <div class="left-label-summary"> | |
@@ -205,15 +197,53 b'' | |||||
205 | </div> |
|
197 | </div> | |
206 | % endif |
|
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 | ## Statistics |
|
238 | ## Statistics | |
209 |
|
|
239 | <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;"> | |
210 | <div class="left-label-summary"> |
|
240 | <div class="left-label-summary"> | |
211 | <p>${_('Statistics')}</p> |
|
241 | <p>${_('Code Statistics')}</p> | |
212 |
|
242 | |||
213 | <div class="right-label-summary input ${summary(c.show_stats)} statistics"> |
|
243 | <div class="right-label-summary input ${summary(c.show_stats)} statistics"> | |
214 | % if c.show_stats: |
|
244 | % if c.show_stats: | |
215 | <div id="lang_stats" class="enabled"> |
|
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 | </div> |
|
247 | </div> | |
218 | % else: |
|
248 | % else: | |
219 | <span class="disabled"> |
|
249 | <span class="disabled"> | |
@@ -228,26 +258,6 b'' | |||||
228 | </div> |
|
258 | </div> | |
229 | </div> |
|
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 | </div><!--end summary-detail--> |
|
262 | </div><!--end summary-detail--> | |
253 |
|
263 |
General Comments 0
You need to be logged in to leave comments.
Login now