# HG changeset patch # User RhodeCode Admin # Date 2024-02-12 11:54:05 # Node ID 5bd3eb1a1171313979ba97bf3510c18ca77be6df # Parent 64e9d25818b578afa13a9db31a8f7d465c710eaa fix(ui): fixed issues with hover menus and diff download items. - the diff ops are now moved into context menu - the diff ops could be now used in PR context - fixed various UI problems with the old solution 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 @@ -863,7 +863,6 @@ input.filediff-collapse-state { .pill-group { .pill { - opacity: .8; margin-right: 3px; font-size: 12px; font-weight: normal; diff --git a/rhodecode/public/css/main.less b/rhodecode/public/css/main.less --- a/rhodecode/public/css/main.less +++ b/rhodecode/public/css/main.less @@ -3236,3 +3236,23 @@ details:not([open]) > :not(summary) { .old-comments-marker td { padding-top: 15px; } + +.inline-menu { + display: inline-flex; + list-style: none; + margin: 0; + padding: 0; +} + +.inline-menu-item { + display: inline-flex; + justify-content: center; + position: relative; +} + +.inline-menu-item-ellipsis { + overflow: hidden; + white-space: nowrap; /* Don't forget this one */ + text-overflow: ellipsis; + width: 130px; +} diff --git a/rhodecode/templates/changeset/changeset.mako b/rhodecode/templates/changeset/changeset.mako --- a/rhodecode/templates/changeset/changeset.mako +++ b/rhodecode/templates/changeset/changeset.mako @@ -124,24 +124,6 @@
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 @@ -277,12 +277,16 @@ return '%s_%s_%i' % (h.md5_safe(commit+f %>
- ## Comments/Options PILL + <% + from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE + %> + + + ${final_file_name} + + + ## Options PILL - - ${len(total_file_comments)} - -
@@ -290,24 +294,77 @@ return '%s_%s_%i' % (h.md5_safe(commit+f
+
+ ## Comments PILL + + + ${len(total_file_comments)} + - ${diff_ops(final_file_name, filediff)} + ## DIFF STATS PILL + + + ## ops pills + %if filediff.limited_diff: + limited diff + %endif + + %if NEW_FILENODE in filediff.patch['stats']['ops']: + created + %if filediff['target_mode'].startswith('120'): + symlink + %else: + ${nice_mode(filediff['target_mode'])} + %endif + %endif + + %if RENAMED_FILENODE in filediff.patch['stats']['ops']: + renamed + %endif + + %if COPIED_FILENODE in filediff.patch['stats']['ops']: + copied + %endif + + %if DEL_FILENODE in filediff.patch['stats']['ops']: + removed + %endif + + %if CHMOD_FILENODE in filediff.patch['stats']['ops']: + ${nice_mode(filediff['source_mode'])} ➡ ${nice_mode(filediff['target_mode'])} + %endif + + %if BIN_FILENODE in filediff.patch['stats']['ops']: + binary + %if MOD_FILENODE in filediff.patch['stats']['ops']: + modified + %endif + %endif + + ${('+' if filediff.patch['stats']['added'] else '')}${filediff.patch['stats']['added']} + ${((h.safe_int(filediff.patch['stats']['deleted']) or 0) * -1)} + @@ -506,64 +563,6 @@ return '%s_%s_%i' % (h.md5_safe(commit+f -<%def name="diff_ops(file_name, filediff)"> - <% - from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \ - MOD_FILENODE, RENAMED_FILENODE, CHMOD_FILENODE, BIN_FILENODE, COPIED_FILENODE - %> - - - ${file_name} - - - - - ## ops pills - %if filediff.limited_diff: - limited diff - %endif - - %if NEW_FILENODE in filediff.patch['stats']['ops']: - created - %if filediff['target_mode'].startswith('120'): - symlink - %else: - ${nice_mode(filediff['target_mode'])} - %endif - %endif - - %if RENAMED_FILENODE in filediff.patch['stats']['ops']: - renamed - %endif - - %if COPIED_FILENODE in filediff.patch['stats']['ops']: - copied - %endif - - %if DEL_FILENODE in filediff.patch['stats']['ops']: - removed - %endif - - %if CHMOD_FILENODE in filediff.patch['stats']['ops']: - - ${nice_mode(filediff['source_mode'])} ➡ ${nice_mode(filediff['target_mode'])} - - %endif - - %if BIN_FILENODE in filediff.patch['stats']['ops']: - binary - %if MOD_FILENODE in filediff.patch['stats']['ops']: - modified - %endif - %endif - - ${('+' if filediff.patch['stats']['added'] else '')}${filediff.patch['stats']['added']} - ${((h.safe_int(filediff.patch['stats']['deleted']) or 0) * -1)} - - - - - <%def name="nice_mode(filemode)"> ${(filemode.startswith('100') and filemode[3:] or filemode)} @@ -968,10 +967,9 @@ def get_comments_for(diff_type, comments -
- +