diff --git a/app/assets/stylesheets/content/work_packages/single_view/_single_view.sass b/app/assets/stylesheets/content/work_packages/single_view/_single_view.sass
index 9315362c51..ba200a2774 100644
--- a/app/assets/stylesheets/content/work_packages/single_view/_single_view.sass
+++ b/app/assets/stylesheets/content/work_packages/single_view/_single_view.sass
@@ -174,7 +174,12 @@ i
page-break-inside: avoid
break-inside: avoid
+ @supports (column-span: all)
// Let some elements still span both columns
- &.-span-all-columns
+ .attributes-key-value.-span-all-columns
column-span: all
-
+ .attributes-key-value--key
+ flex-basis: calc(16.65% - (4rem / 6))
+ .attributes-key-value--value-container
+ flex-basis: calc(83.35% + (4rem / 6))
+ max-width: calc(83.35% + (4rem / 6))
diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb
index 59d7e0c061..384ded0331 100644
--- a/app/helpers/repositories_helper.rb
+++ b/app/helpers/repositories_helper.rb
@@ -104,8 +104,8 @@ module RepositoriesHelper
def calculate_folder_action(tree)
seen = Set.new
tree.each do |_, entry|
- if folderStyle = change_action_mapping[entry[:c].try(:action)]
- seen << folderStyle
+ if folder_style = change_action_mapping[entry[:c].try(:action)]
+ seen << folder_style
end
end
@@ -115,8 +115,7 @@ module RepositoriesHelper
def render_changes_tree(tree)
return '' if tree.nil?
- output = ''
- output << '
'
+ output = ''
tree.keys.sort.each do |file|
style = 'change'
text = File.basename(h(file))
@@ -124,11 +123,9 @@ module RepositoriesHelper
style << ' folder'
path_param = without_leading_slash(to_path_param(@repository.relative_path(file)))
text = link_to(h(text),
- { controller: '/repositories',
- action: 'show',
- project_id: @project,
- path: path_param,
- rev: @changeset.identifier },
+ show_revisions_path_project_repository_path(project_id: @project,
+ path: path_param,
+ rev: @changeset.identifier),
title: l(:label_folder))
output << "- #{text}
"
@@ -136,50 +133,29 @@ module RepositoriesHelper
elsif c = tree[file][:c]
style << " change-#{c.action}"
path_param = without_leading_slash(to_path_param(@repository.relative_path(c.path)))
- case c.action
- when 'A'
- title_text = l(:label_added)
- when 'D'
- title_text = l(:label_deleted)
- when 'C'
- title_text = l(:label_copied)
- when 'R'
- title_text = l(:label_renamed)
- else
- title_text = l(:label_modified)
+
+ unless c.action == 'D'
+ title_text = changes_tree_change_title c.action
+
+ text = link_to(h(text),
+ entry_revision_project_repository_path(project_id: @project,
+ path: path_param,
+ rev: @changeset.identifier),
+ title: title_text)
end
- text = link_to(h(text),
- { controller: '/repositories',
- action: 'entry',
- project_id: @project,
- path: path_param,
- rev: @changeset.identifier },
- title: title_text) unless c.action == 'D'
+
text << raw(" - #{h(c.revision)}") unless c.revision.blank?
- text << raw(' (' + link_to(l(:label_diff),
- controller: '/repositories',
- action: 'diff',
- project_id: @project,
- path: path_param,
- rev: @changeset.identifier) + ') ') if c.action == 'M'
- text << raw(' ' + content_tag('span', h(c.from_path), class: 'copied-from')) unless c.from_path.blank?
- case c.action
- when 'A'
- output << "- #{text}
"
- when 'D'
- output << "- #{text}
"
- when 'C'
- output << "- #{text}
"
- when 'R'
- output << "- #{text}
"
- else
- output << "- #{text}
"
+
+ if c.action == 'M'
+ text << raw(' (' + link_to(l(:label_diff),
+ diff_revision_project_repository_path(project_id: @project,
+ path: path_param,
+ rev: @changeset.identifier)) + ') ')
end
+
+ text << raw(' ' + content_tag('span', h(c.from_path), class: 'copied-from')) unless c.from_path.blank?
+
+ output << changes_tree_li_element(c.action, text, style)
end
end
output << '
'
@@ -296,4 +272,37 @@ module RepositoriesHelper
def without_leading_slash(path)
path.gsub(%r{\A/+}, '')
end
+
+ def changes_tree_change_title(action)
+ case action
+ when 'A'
+ l(:label_added)
+ when 'D'
+ l(:label_deleted)
+ when 'C'
+ l(:label_copied)
+ when 'R'
+ l(:label_renamed)
+ else
+ l(:label_modified)
+ end
+ end
+
+ def changes_tree_li_element(action, text, style)
+ icon_name = case action
+ when 'A'
+ 'icon-add'
+ when 'D'
+ 'icon-delete'
+ when 'C'
+ 'icon-copy'
+ when 'R'
+ 'icon-rename'
+ else
+ 'icon-arrow-left-right'
+ end
+
+ "- #{text}
"
+ end
end