##// END OF EJS Templates
summary: don't load size on container expand, only on manual action....
marcink -
r3334:6301d8bb default
parent child Browse files
Show More
@@ -96,7 +96,7 b' class CustomLockFactory(FileLock):'
96 # set non-blocking, this will cause an exception if we cannot acquire a lock
96 # set non-blocking, this will cause an exception if we cannot acquire a lock
97 operation |= fcntl.LOCK_NB
97 operation |= fcntl.LOCK_NB
98 start_lock_time = time.time()
98 start_lock_time = time.time()
99 timeout = 60 * 5 # 5min
99 timeout = 60 * 15 # 15min
100 while True:
100 while True:
101 try:
101 try:
102 flock_org(fd, operation)
102 flock_org(fd, operation)
@@ -76,6 +76,7 b' var showRepoSize = function(target, repo'
76 var url = pyroutes.url('repo_stats',
76 var url = pyroutes.url('repo_stats',
77 {"repo_name": repo_name, "commit_id": commit_id});
77 {"repo_name": repo_name, "commit_id": commit_id});
78
78
79 container.show();
79 if (!container.hasClass('loaded')) {
80 if (!container.hasClass('loaded')) {
80 $.ajax({url: url})
81 $.ajax({url: url})
81 .complete(function (data) {
82 .complete(function (data) {
@@ -83,9 +83,9 b''
83 </div>
83 </div>
84 </div>
84 </div>
85
85
86 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
86 <div class="fieldset">
87 <div class="left-label-summary">
87 <div class="left-label-summary">
88 ${_('Information')}:
88 &nbsp;
89 </div>
89 </div>
90 <div class="right-content">
90 <div class="right-content">
91 <div class="commit-info">
91 <div class="commit-info">
@@ -105,28 +105,42 b''
105 ## commits
105 ## commits
106 <span class="tag">
106 <span class="tag">
107 % if commit_rev == -1:
107 % if commit_rev == -1:
108 ${_ungettext('%(num)s Commit', '%(num)s Commits', 0) % {'num': 0}},
108 ${_ungettext('%(num)s Commit', '%(num)s Commits', 0) % {'num': 0}}
109 % else:
109 % else:
110 <a href="${h.route_path('repo_changelog', repo_name=c.repo_name)}">
110 <a href="${h.route_path('repo_changelog', repo_name=c.repo_name)}">
111 ${_ungettext('%(num)s Commit', '%(num)s Commits', commit_rev) % {'num': commit_rev}}</a>,
111 ${_ungettext('%(num)s Commit', '%(num)s Commits', commit_rev) % {'num': commit_rev}}</a>
112 % endif
112 % endif
113 </span>
113 </span>
114
114
115 ## forks
115 ## forks
116 <span class="tag">
116 <span class="tag">
117 <a title="${_('Number of Repository Forks')}" href="${h.route_path('repo_forks_show_all', repo_name=c.repo_name)}">
117 <a title="${_('Number of Repository Forks')}" href="${h.route_path('repo_forks_show_all', repo_name=c.repo_name)}">
118 ${c.repository_forks} ${_ungettext('Fork', 'Forks', c.repository_forks)}</a>,
118 ${c.repository_forks} ${_ungettext('Fork', 'Forks', c.repository_forks)}</a>
119 </span>
119 </span>
120
120
121 </div>
122 </div>
123 </div>
124 </div>
125
126 <div class="fieldset collapsable-content" data-toggle="summary-details" style="display: none;">
127 <div class="left-label-summary">
128 ${_('Repository size')}:
129 </div>
130 <div class="right-content">
131 <div class="commit-info">
132 <div class="tags">
121 ## repo size
133 ## repo size
122 % if commit_rev == -1:
134 % if commit_rev == -1:
123 <span class="stats-bullet">0 B</span>
135 <span class="stats-bullet">0 B</span>
124 % else:
136 % else:
125 <span class="stats-bullet" id="repo_size_container">
137 <span>
138 <a href="#showSize" onclick="calculateSize(); $(this).hide(); return false" id="show-repo-size">Show repository size</a>
139 </span>
140 <span class="stats-bullet" id="repo_size_container" style="display:none">
126 ${_('Calculating Repository Size...')}
141 ${_('Calculating Repository Size...')}
127 </span>
142 </span>
128 % endif
143 % endif
129
130 </div>
144 </div>
131 </div>
145 </div>
132 </div>
146 </div>
@@ -106,8 +106,8 b''
106 });
106 });
107
107
108
108
109 // load details on summary page expand
109 // calculate size of repository
110 $('#summary_details_expand').on('click', function() {
110 calculateSize = function () {
111
111
112 var callback = function (data) {
112 var callback = function (data) {
113 % if c.show_stats:
113 % if c.show_stats:
@@ -115,13 +115,9 b''
115 % endif
115 % endif
116 };
116 };
117
117
118 showRepoSize(
118 showRepoSize('repo_size_container', templateContext.repo_name, templateContext.repo_landing_commit, callback);
119 'repo_size_container',
120 templateContext.repo_name,
121 templateContext.repo_landing_commit,
122 callback);
123
119
124 })
120 }
125
121
126 })
122 })
127 </script>
123 </script>
General Comments 0
You need to be logged in to leave comments. Login now