##// END OF EJS Templates
strip: improved html output....
marcink -
r1662:db3a7961 default
parent child Browse files
Show More
@@ -23,7 +23,7 b''
23 23 <div id="results" style="display:none; padding: 10px 0px;"></div>
24 24
25 25 <div class="buttons">
26 <button class="btn btn-small btn-primary" onclick="checkCommits();return false">
26 <button id="strip_action" class="btn btn-small btn-primary" onclick="checkCommits();return false">
27 27 ${_('Check commits')}
28 28 </button>
29 29 </div>
@@ -111,27 +111,49 b' checkCommits = function() {'
111 111 $('#results').show();
112 112 $('#results').html('<h4>${_('Checking commits')}...</h4>');
113 113 var url = "${h.route_path('strip_check', repo_name=c.repo_info.repo_name)}";
114 var btn = $('button');
114 var btn = $('#strip_action');
115 115 btn.attr('disabled', 'disabled');
116 116 btn.addClass('disabled');
117 117
118 118 var success = function (data) {
119 119 result_data = {};
120 120 var i = 0;
121 result ='';
121 var result = '<ol>';
122 122 $.each(data, function(index, value){
123 123 i= index;
124 124 var box = $('#box-'+index);
125 125 if (value.rev){
126 126 result_data[index] = JSON.stringify(value);
127 msg = '${_("author")}: ' + value.author + ' ${_("comment")}: ' + value.comment;
128 result += '<h4><code>' +value.rev+ '</code>${_(' commit verified positive')}</br> '+ msg + '</h4>';
127
128 var verifiedHtml = (
129 '<li style="line-height:1.2em">' +
130 '<code>{0}</code>' +
131 '{1}' +
132 '<div style="white-space:pre">' +
133 'author: {2}\n' +
134 'description: {3}' +
135 '</div>' +
136 '</li>').format(
137 value.rev,
138 "${_(' commit verified positive')}",
139 value.author, value.comment
140 );
141 result += verifiedHtml;
129 142 }
130 else{
131 result += '<h4><code>' +value.commit+ '</code>${_(' commit verified negative')}' + '</h4>';
143 else {
144 var verifiedHtml = (
145 '<li style="line-height:1.2em">' +
146 '<code><strike>{0}</strike></code>' +
147 '{1}' +
148 '</li>').format(
149 value.commit,
150 "${_(' commit verified negative')}"
151 );
152 result += verifiedHtml;
132 153 }
133 154 box.remove();
134 155 });
156 result += '</ol>';
135 157 var box = $('#box-'+(parseInt(i)+1));
136 158 box.remove();
137 159 $('#results').html(result);
@@ -144,25 +166,28 b' checkCommits = function() {'
144 166 ajaxPOST(url, postData, success, null);
145 167 };
146 168
147 strip = function(){
169 strip = function() {
148 170 var url = "${h.route_path('strip_execute', repo_name=c.repo_info.repo_name)}";
149 var success = function(data){
150 result = '';
171 var success = function(data) {
172 var result = '<h4>Strip executed</h4><ol>';
151 173 $.each(data, function(index, value){
152 if(data[index]){
153 result += '<h4>' +index+ '${_(' commit striped successful')}' + '</h4>';
174 if(data[index]) {
175 result += '<li><code>' +index+ '</code> ${_(' commit striped successfully')}' + '</li>';
154 176 }
155 else{
156 result += '<h4>' +index+ '${_(' commit striped failed')}' + '</h4>';
177 else {
178 result += '<li><code>' +index+ '</code> ${_(' commit strip failed')}' + '</li>';
157 179 }
158 180 });
181 if ($.isEmptyObject(data)) {
182 result += '<li>Nothing done...</li>'
183 }
184 result += '</ol>';
159 185 $('#results').html(result);
160 186
161 187 };
162 188 ajaxPOST(url, result_data, success, null);
163 var btn = $('button');
164 btn.attr('disabled', 'disabled');
165 btn.addClass('disabled');
189 var btn = $('#strip_action');
190 btn.remove();
166 191
167 192 };
168 193 </script>
General Comments 0
You need to be logged in to leave comments. Login now