diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -3806,6 +3806,11 @@ class ChangesetComment(Base, BaseModel): return self.pull_request_version_id < version @property + def commit_id(self): + """New style naming to stop using .revision""" + return self.revision + + @property def resolved(self): return self.resolved_by[0] if self.resolved_by else None diff --git a/rhodecode/public/css/code-block.less b/rhodecode/public/css/code-block.less --- a/rhodecode/public/css/code-block.less +++ b/rhodecode/public/css/code-block.less @@ -1063,6 +1063,10 @@ input.filediff-collapse-state { background: @color5; color: white; } + &[op="comments"] { /* comments on file */ + background: @grey4; + color: white; + } } } diff --git a/rhodecode/public/css/comments.less b/rhodecode/public/css/comments.less --- a/rhodecode/public/css/comments.less +++ b/rhodecode/public/css/comments.less @@ -65,7 +65,7 @@ tr.inline-comments div { float: left; padding: 0.4em 0.4em; - margin: 3px 5px 0px -10px; + margin: 2px 4px 0px 0px; display: inline-block; min-height: 0; @@ -76,12 +76,13 @@ tr.inline-comments div { font-family: @text-italic; font-style: italic; background: #fff none; - color: @grey4; + color: @grey3; border: 1px solid @grey4; white-space: nowrap; text-transform: uppercase; - min-width: 40px; + min-width: 50px; + border-radius: 4px; &.todo { color: @color5; diff --git a/rhodecode/templates/changeset/changeset_file_comment.mako b/rhodecode/templates/changeset/changeset_file_comment.mako --- a/rhodecode/templates/changeset/changeset_file_comment.mako +++ b/rhodecode/templates/changeset/changeset_file_comment.mako @@ -33,46 +33,82 @@
-
+
+ + ## TODO COMMENT % if comment.comment_type == 'todo': % if comment.resolved: % else: -
+
+ ${comment.comment_type}
% endif + ## NOTE COMMENT % else: + ## RESOLVED NOTE % if comment.resolved_comment: - fix - - #${comment.resolved_comment.comment_id} - + + ## STATUS CHANGE NOTE + % elif not comment.is_inline and comment.status_change: + <% + if comment.pull_request: + status_change_title = 'Status of review for pull request !{}'.format(comment.pull_request.pull_request_id) + else: + status_change_title = 'Status of review for commit {}'.format(h.short_id(comment.commit_id)) + %> + + +
+ ${comment.status_change[0].status_lbl} +
% else: - ${comment.comment_type or 'note'} +
+ + ${(comment.comment_type or 'note')} +
% endif % endif +
+ % if 0 and comment.status_change: + + % endif +
${base.gravatar_with_user(comment.author.email, 16, tooltip=True)} +
- % if comment.pull_request and comment.pull_request.author.user_id == comment.author.user_id: - - ${_('author')} - - % endif - -
${h.age_component(comment.modified_at, time_is_local=True)}
+ + % if comment.pull_request and comment.pull_request.author.user_id == comment.author.user_id: + + ${_('author')} + + % endif + <% comment_version_selector = 'comment_versions_{}'.format(comment.comment_id) %> @@ -116,32 +152,6 @@ data-last-version="0">
%endif - % if inline: - - % else: -
- % if comment.pull_request: - - % if comment.status_change: - ${_('pull request !{}').format(comment.pull_request.pull_request_id)}: - % else: - ${_('pull request !{}').format(comment.pull_request.pull_request_id)} - % endif - - % else: - % if comment.status_change: - ${_('Status change on commit')}: - % endif - % endif -
- % endif - - % if comment.status_change: - -
- ${comment.status_change[0].status_lbl} -
- % endif @@ -150,17 +160,17 @@ % if inline: % if outdated_at_ver: - + outdated ${'v{}'.format(pr_index_ver)} | % elif pr_index_ver: - + ${'v{}'.format(pr_index_ver)} | % endif % else: - % if comment.pull_request_version_id and pr_index_ver: + % if pr_index_ver: % if comment.outdated: | % else: - diff --git a/rhodecode/templates/codeblocks/diffs.mako b/rhodecode/templates/codeblocks/diffs.mako --- a/rhodecode/templates/codeblocks/diffs.mako +++ b/rhodecode/templates/codeblocks/diffs.mako @@ -259,7 +259,10 @@ return '%s_%s_%i' % (h.md5_safe(commit+f %>
- ${len(total_file_comments)} + + + ${len(total_file_comments)} + ${diff_ops(filediff)}