##// END OF EJS Templates
comments: avoid storing 'No comments' text when changing status...
Thomas De Schampheleire -
r5068:140f2811 default
parent child Browse files
Show More
@@ -349,7 +349,7 b' class ChangesetController(BaseRepoContro'
349 349 @jsonify
350 350 def comment(self, repo_name, revision):
351 351 status = request.POST.get('changeset_status')
352 text = request.POST.get('text', '').strip() or _('No comments.')
352 text = request.POST.get('text', '').strip()
353 353
354 354 c.co = comm = ChangesetCommentsModel().create(
355 355 text=text,
@@ -696,7 +696,7 b' class PullrequestsController(BaseRepoCon'
696 696 if allowed_to_change_status:
697 697 status = request.POST.get('changeset_status')
698 698 close_pr = request.POST.get('save_close')
699 text = request.POST.get('text', '').strip() or _('No comments.')
699 text = request.POST.get('text', '').strip()
700 700 if close_pr:
701 701 text = _('Closing.') + '\n' + text
702 702
@@ -182,7 +182,7 b' class ChangesetCommentsModel(BaseModel):'
182 182 :param closing_pr: (for emails, not for comments)
183 183 :param send_email: also send email
184 184 """
185 if not text:
185 if not status_change and not text:
186 186 log.warning('Missing text for comment, skipping...')
187 187 return
188 188
@@ -4347,6 +4347,10 b' div.rst-block pre {'
4347 4347 font-size: 16px;
4348 4348 }
4349 4349
4350 .automatic-comment {
4351 font-style: italic;
4352 }
4353
4350 4354 /** comment form **/
4351 4355
4352 4356 .status-block {
@@ -51,7 +51,13 b''
51 51 %endif
52 52 </div>
53 53 <div class="text">
54 %if co.text:
54 55 ${h.rst_w_mentions(co.text)|n}
56 %else:
57 <div class="rst-block automatic-comment">
58 <p>${_('No comments.')}</p>
59 </div>
60 %endif
55 61 </div>
56 62 </div>
57 63 </div>
General Comments 0
You need to be logged in to leave comments. Login now