##// 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 @jsonify
349 @jsonify
350 def comment(self, repo_name, revision):
350 def comment(self, repo_name, revision):
351 status = request.POST.get('changeset_status')
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 c.co = comm = ChangesetCommentsModel().create(
354 c.co = comm = ChangesetCommentsModel().create(
355 text=text,
355 text=text,
@@ -696,7 +696,7 b' class PullrequestsController(BaseRepoCon'
696 if allowed_to_change_status:
696 if allowed_to_change_status:
697 status = request.POST.get('changeset_status')
697 status = request.POST.get('changeset_status')
698 close_pr = request.POST.get('save_close')
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 if close_pr:
700 if close_pr:
701 text = _('Closing.') + '\n' + text
701 text = _('Closing.') + '\n' + text
702
702
@@ -182,7 +182,7 b' class ChangesetCommentsModel(BaseModel):'
182 :param closing_pr: (for emails, not for comments)
182 :param closing_pr: (for emails, not for comments)
183 :param send_email: also send email
183 :param send_email: also send email
184 """
184 """
185 if not text:
185 if not status_change and not text:
186 log.warning('Missing text for comment, skipping...')
186 log.warning('Missing text for comment, skipping...')
187 return
187 return
188
188
@@ -4347,6 +4347,10 b' div.rst-block pre {'
4347 font-size: 16px;
4347 font-size: 16px;
4348 }
4348 }
4349
4349
4350 .automatic-comment {
4351 font-style: italic;
4352 }
4353
4350 /** comment form **/
4354 /** comment form **/
4351
4355
4352 .status-block {
4356 .status-block {
@@ -51,7 +51,13 b''
51 %endif
51 %endif
52 </div>
52 </div>
53 <div class="text">
53 <div class="text">
54 %if co.text:
54 ${h.rst_w_mentions(co.text)|n}
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 </div>
61 </div>
56 </div>
62 </div>
57 </div>
63 </div>
General Comments 0
You need to be logged in to leave comments. Login now