##// END OF EJS Templates
pull request comments: implement 'close' as a checkbox that always is visible but sometimes disabled
Mads Kiilerich -
r4048:1e7befa6 default
parent child Browse files
Show More
@@ -3698,6 +3698,10 b' div.gravatar img {'
3698 border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
3698 border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
3699 }
3699 }
3700
3700
3701 label.disabled {
3702 color: #aaa;
3703 }
3704
3701 .ui-btn.blue.hidden {
3705 .ui-btn.blue.hidden {
3702 display: none;
3706 display: none;
3703 }
3707 }
@@ -159,6 +159,10 b''
159 <label for="${status}">${lbl}</label>
159 <label for="${status}">${lbl}</label>
160 </div>
160 </div>
161 %endfor
161 %endfor
162 %if close_btn and change_status:
163 <input id="save_close" type="checkbox" name="save_close" disabled="${'1' if cur_status in ['not_reviewed','under_review'] else ''}">
164 <label id="save_close_label" for="save_close" class="${'disabled' if cur_status in ['not_reviewed','under_review'] else ''}">${_("Close (when approved or rejected)")}</label>
165 %endif
162 </div>
166 </div>
163 %endif
167 %endif
164 <div class="mentions-container" id="mentions_container"></div>
168 <div class="mentions-container" id="mentions_container"></div>
@@ -175,9 +179,6 b''
175
179
176 <div class="comment-button">
180 <div class="comment-button">
177 ${h.submit('save', _('Comment'), class_="ui-btn large")}
181 ${h.submit('save', _('Comment'), class_="ui-btn large")}
178 %if close_btn and change_status:
179 ${h.submit('save_close', _('Comment and close'), class_='ui-btn blue large %s' % ('hidden' if cur_status in ['not_reviewed','under_review'] else ''))}
180 %endif
181 </div>
182 </div>
182 ${h.end_form()}
183 ${h.end_form()}
183 </div>
184 </div>
@@ -196,9 +197,11 b' YUE.onDOMReady(function () {'
196 YUE.on(YUQ('.status_change_radio'), 'change',function(e){
197 YUE.on(YUQ('.status_change_radio'), 'change',function(e){
197 var val = e.currentTarget.value;
198 var val = e.currentTarget.value;
198 if (val == 'approved' || val == 'rejected') {
199 if (val == 'approved' || val == 'rejected') {
199 YUD.removeClass('save_close', 'hidden');
200 YUD.removeClass('save_close_label', 'disabled');
201 YUD.get('save_close').disabled = false;
200 }else{
202 }else{
201 YUD.addClass('save_close', 'hidden');
203 YUD.addClass('save_close_label', 'disabled');
204 YUD.get('save_close').disabled = true;
202 }
205 }
203 })
206 })
204 YUE.on('preview-btn', 'click', function(e){
207 YUE.on('preview-btn', 'click', function(e){
General Comments 0
You need to be logged in to leave comments. Login now