# HG changeset patch # User Marcin Kuzminski # Date 2020-09-26 06:35:59 # Node ID e79c19d1549d3677ad5cbd38f02b8f6fd53d3946 # Parent 779812b23a5aec5888781ae82d83c69bb7c8ade0 sidebar: fixes to comment links, and new hovercard info about a comment. diff --git a/rhodecode/model/changeset_status.py b/rhodecode/model/changeset_status.py --- a/rhodecode/model/changeset_status.py +++ b/rhodecode/model/changeset_status.py @@ -212,10 +212,10 @@ class ChangesetStatusModel(BaseModel): # TODO(marcink): with group voting, how does rejected work, # do we ever get rejected state ? - if approved_votes_count == reviewers_number: + if approved_votes_count and (approved_votes_count == reviewers_number): return ChangesetStatus.STATUS_APPROVED - if rejected_votes_count == reviewers_number: + if rejected_votes_count and (rejected_votes_count == reviewers_number): return ChangesetStatus.STATUS_REJECTED return ChangesetStatus.STATUS_UNDER_REVIEW diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -3866,7 +3866,9 @@ class ChangesetComment(Base, BaseModel): @property def is_inline(self): - return self.line_no and self.f_path + if self.line_no and self.f_path: + return True + return False @property def last_version(self): diff --git a/rhodecode/public/js/src/rhodecode.js b/rhodecode/public/js/src/rhodecode.js --- a/rhodecode/public/js/src/rhodecode.js +++ b/rhodecode/public/js/src/rhodecode.js @@ -296,16 +296,25 @@ var tooltipActivate = function () { // we set a variable so the data is only loaded once via Ajax, not every time the tooltip opens if ($origin.data('loaded') !== true) { var hovercardUrl = $origin.data('hovercardUrl'); - var altHovercard =$origin.data('hovercardAlt'); + var altHovercard = $origin.data('hovercardAlt'); if (hovercardUrl !== undefined && hovercardUrl !== "") { - if (hovercardUrl.substr(0,12) === 'pyroutes.url'){ + var urlLoad = true; + if (hovercardUrl.substr(0, 12) === 'pyroutes.url') { hovercardUrl = eval(hovercardUrl) + } else if (hovercardUrl.substr(0, 11) === 'javascript:') { + var jsFunc = hovercardUrl.substr(11); + urlLoad = false; + loaded = true; + instance.content(eval(jsFunc)) } - var loaded = loadHoverCard(hovercardUrl, altHovercard, function (data) { - instance.content(data); - }) + if (urlLoad) { + var loaded = loadHoverCard(hovercardUrl, altHovercard, function (data) { + instance.content(data); + }) + } + } else { if ($origin.data('hovercardAltHtml')) { var data = atob($origin.data('hovercardAltHtml')); diff --git a/rhodecode/templates/base/sidebar.mako b/rhodecode/templates/base/sidebar.mako --- a/rhodecode/templates/base/sidebar.mako +++ b/rhodecode/templates/base/sidebar.mako @@ -84,34 +84,35 @@ - - ## NEW, since refresh % if existing_ids and comment_obj.comment_id not in existing_ids: NEW @@ -122,8 +123,13 @@ ${base.gravatar(comment_obj.author.email, 16, user=comment_obj.author, tooltip=True, extra_class=['no-margin'])} -
- ${h.chop_at_smart(comment_obj.text, '\n', suffix_if_chopped='...')} + diff --git a/rhodecode/templates/ejs_templates/templates.html b/rhodecode/templates/ejs_templates/templates.html --- a/rhodecode/templates/ejs_templates/templates.html +++ b/rhodecode/templates/ejs_templates/templates.html @@ -183,8 +183,51 @@ if (show_disabled) { + + + +##// END OF EJS Templates +
+ +