Changeset - 77f13ea8ad3b
[Not reviewed]
default
0 2 0
Thomas De Schampheleire - 8 years ago 2017-10-25 09:10:30
thomas.de.schampheleire@gmail.com
Grafted from: a77373ff8f7b
style: mark failed comment submissions with red panel heading

Make it more obvious to the user that a comment submission failed: mark the
panel of the failed comment as "panel-danger" so the color of the comment panel
heading changes to red.

Previously, only the user and comment text would fade a bit.
2 files changed with 2 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/front-end/style.less
Show inline comments
 
@@ -561,16 +561,12 @@ input.status_change_radio {
 
    background-position: 0 0;
 
  }
 
  100% {
 
    background-position: 20px 0;
 
  }
 
}
 
.comment-preview.failed .user,
 
.comment-preview.failed .panel-body {
 
  color: #666;
 
}
 
.comment-preview .comment-submission-status {
 
  float: right;
 
}
 
.comment-preview .comment-submission-status .btn-group {
 
  margin-left: 10px;
 
}
kallithea/public/js/base.js
Show inline comments
 
@@ -664,13 +664,13 @@ function _comment_div_append_form($comme
 
                    comment_div_state($comment_div, f_path, line_no, false);
 
                    location.reload(true);
 
                }
 
            }
 
        }
 
        function failure(x, s, e) {
 
            $preview.removeClass('submitting').addClass('failed');
 
            $preview.removeClass('submitting').children('.panel').addClass('panel-danger');
 
            var $status = $preview.find('.comment-submission-status');
 
            $('<span>', {
 
                'title': e,
 
                text: _TM['Unable to post']
 
            }).replaceAll($status.contents());
 
            $('<div>', {
 
@@ -678,13 +678,13 @@ function _comment_div_append_form($comme
 
            }).append(
 
                $('<button>', {
 
                    'class': 'btn btn-default btn-xs',
 
                    text: _TM['Retry']
 
                }).click(function() {
 
                    $status.text(_TM['Submitting ...']);
 
                    $preview.addClass('submitting').removeClass('failed');
 
                    $preview.addClass('submitting').children('.panel').removeClass('panel-danger');
 
                    ajaxPOST(AJAX_COMMENT_URL, postData, success, failure);
 
                }),
 
                $('<button>', {
 
                    'class': 'btn btn-default btn-xs',
 
                    text: _TM['Cancel']
 
                }).click(function() {
0 comments (0 inline, 0 general)