# HG changeset patch # User Daniel Dourvaris # Date 2016-10-26 14:55:20 # Node ID dd921cafc34ad11bf24331c0254254798ca71b55 # Parent 14bd0daf9434184cb74da17ba1be072c24bbe64d ux: make the diffset header more pronounced and show commit details if a commit is available, also color it orange when a diff has been limited 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 @@ -676,6 +676,58 @@ input.filediff-collapse-state { display: block; } margin: 20px 0; + &:nth-child(2) { + margin: 0; + } + } +} +.cs_files { + clear: both; +} + +.diffset-menu { + margin-bottom: 20px; +} +.diffset { + margin: 20px auto; + .diffset-heading { + border: 1px solid @grey5; + margin-bottom: -1px; + // margin-top: 20px; + h2 { + margin: 0; + line-height: 38px; + padding-left: 10px; + } + .btn { + margin: 0; + } + background: @grey6; + display: block; + padding: 5px; + } + .diffset-heading-warning { + background: @alert3-inner; + border: 1px solid @alert3; + } +} +.pill { + display: block; + float: left; + padding: @pill-padding; +} +.pill-group { + .pill { + opacity: .8; + &:first-child { + border-radius: @border-radius 0 0 @border-radius; + } + &:last-child { + border-radius: 0 @border-radius @border-radius 0; + } + &:only-child { + border-radius: @border-radius; + } } } .filediff { @@ -740,25 +792,6 @@ input.filediff-collapse-state { } } .pill { - display: block; - float: left; - padding: @pill-padding; - } - .pill-group { - .pill { - opacity: .8; - &:first-child { - border-radius: @border-radius 0 0 @border-radius; - } - &:last-child { - border-radius: 0 @border-radius @border-radius 0; - } - &:only-child { - border-radius: @border-radius; - } - } - } - .pill { &[op="name"] { background: none; color: @grey2; diff --git a/rhodecode/public/css/helpers.less b/rhodecode/public/css/helpers.less --- a/rhodecode/public/css/helpers.less +++ b/rhodecode/public/css/helpers.less @@ -13,6 +13,13 @@ a { cursor: pointer; } } } +.clearinner:after { /* clears all floating divs inside a block */ + content: ""; + display: table; + clear: both; +} + + .linebreak { display: block; } diff --git a/rhodecode/templates/codeblocks/diffs.html b/rhodecode/templates/codeblocks/diffs.html --- a/rhodecode/templates/codeblocks/diffs.html +++ b/rhodecode/templates/codeblocks/diffs.html @@ -23,7 +23,7 @@ new_args.update(kw) return h.url('', **new_args) %> -<%def name="render_diffset(diffset, commit_id=None, +<%def name="render_diffset(diffset, commit=None, # collapse all file diff entries when there are more than this amount of files in the diff collapse_when_files_over=20, @@ -33,6 +33,7 @@ return h.url('', **new_args) # add a ruler at to the output ruler_at_chars=0, + )"> <% collapse_all = len(diffset.files) > collapse_when_files_over @@ -59,44 +60,26 @@ collapse_all = len(diffset.files) > coll left: ${ruler_at_chars + 5}ch; %endif -% if diffset.limited_diff: -
- ${_('The requested commit is too big and content was truncated.')} ${_('Show full diff')} -
-% endif
-
-
-
- - ${_('Side by Side')} - - - ${_('Unified')} + - -

+ %endif +

+ %if commit: + ${'r%s:%s' % (commit.revision,h.short_id(commit.raw_id))} - + ${h.age_component(commit.date)} - + %endif %if diffset.limited_diff: - ${ungettext('%(num)s file changed', '%(num)s files changed', diffset.changed_files) % {'num': diffset.changed_files}} + ${_('The requested commit is too big and content was truncated.')} + + ${ungettext('%(num)s file changed.', '%(num)s files changed.', diffset.changed_files) % {'num': diffset.changed_files}} + ${_('Show full diff')} %else: ${ungettext('%(num)s file changed: %(linesadd)s inserted, ''%(linesdel)s deleted', '%(num)s files changed: %(linesadd)s inserted, %(linesdel)s deleted', diffset.changed_files) % {'num': diffset.changed_files, 'linesadd': diffset.lines_added, 'linesdel': diffset.lines_deleted}} @@ -118,7 +101,7 @@ collapse_all = len(diffset.files) > coll
+ id="a_${h.FID(commit and commit.raw_id or '', filediff['patch']['filename'])}">