Show More
@@ -126,6 +126,7 b' class SummaryController(BaseRepoControll' | |||||
126 | .filter(Statistics.repository == dbrepo)\ |
|
126 | .filter(Statistics.repository == dbrepo)\ | |
127 | .scalar() |
|
127 | .scalar() | |
128 |
|
128 | |||
|
129 | c.stats_percentage = 0 | |||
129 |
|
130 | |||
130 | if stats and stats.languages: |
|
131 | if stats and stats.languages: | |
131 | c.no_data = False is dbrepo.enable_statistics |
|
132 | c.no_data = False is dbrepo.enable_statistics | |
@@ -137,6 +138,14 b' class SummaryController(BaseRepoControll' | |||||
137 | key=lambda k: k[1])[:10] |
|
138 | key=lambda k: k[1])[:10] | |
138 | ) |
|
139 | ) | |
139 | ) |
|
140 | ) | |
|
141 | last_rev = stats.stat_on_revision | |||
|
142 | c.repo_last_rev = c.rhodecode_repo.count() - 1 \ | |||
|
143 | if c.rhodecode_repo.revisions else 0 | |||
|
144 | if last_rev == 0 or c.repo_last_rev == 0: | |||
|
145 | pass | |||
|
146 | else: | |||
|
147 | c.stats_percentage = '%.2f' % ((float((last_rev)) / | |||
|
148 | c.repo_last_rev) * 100) | |||
140 | else: |
|
149 | else: | |
141 | c.commit_data = json.dumps({}) |
|
150 | c.commit_data = json.dumps({}) | |
142 | c.overview_data = json.dumps([[ts_min_y, 0], [ts_max_y, 10] ]) |
|
151 | c.overview_data = json.dumps([[ts_min_y, 0], [ts_max_y, 10] ]) |
@@ -301,13 +301,17 b'' | |||||
301 | </div> |
|
301 | </div> | |
302 |
|
302 | |||
303 | <div class="table"> |
|
303 | <div class="table"> | |
|
304 | <div style="padding:0 10px 10px 15px;font-size: 1.2em;"> | |||
304 | %if c.no_data: |
|
305 | %if c.no_data: | |
305 | <div style="padding:0 10px 10px 15px;font-size: 1.2em;">${c.no_data_msg} |
|
306 | ${c.no_data_msg} | |
306 | %if h.HasPermissionAll('hg.admin')('enable stats on from summary'): |
|
307 | %if h.HasPermissionAll('hg.admin')('enable stats on from summary'): | |
307 | [${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name))}] |
|
308 | [${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name))}] | |
308 | %endif |
|
309 | %endif | |
|
310 | ||||
|
311 | %else: | |||
|
312 | ${_('Loaded in')} ${c.stats_percentage} % | |||
|
313 | %endif | |||
309 |
|
|
314 | </div> | |
310 | %endif: |
|
|||
311 | <div id="commit_history" style="width:460px;height:300px;float:left"></div> |
|
315 | <div id="commit_history" style="width:460px;height:300px;float:left"></div> | |
312 | <div style="clear: both;height: 10px"></div> |
|
316 | <div style="clear: both;height: 10px"></div> | |
313 | <div id="overview" style="width:460px;height:100px;float:left"></div> |
|
317 | <div id="overview" style="width:460px;height:100px;float:left"></div> |
General Comments 0
You need to be logged in to leave comments.
Login now