Skip to content

Commit

Permalink
#1575 Coloured icons
Browse files Browse the repository at this point in the history
  • Loading branch information
picman committed Jan 10, 2025
1 parent 14da15a commit 98cc324
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
20 changes: 14 additions & 6 deletions app/helpers/dmsf_queries_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ def column_value(column, item, value)
when 'project'
tag = h("[#{value}]")
tag = if item.project.module_enabled?(:dmsf)
link_to sprite_icon('folder', tag), dmsf_folder_path(id: item.project)
link_to(sprite_icon('folder', nil, icon_only: true), dmsf_folder_path(id: item.project)) +
link_to(tag, dmsf_folder_path(id: item.project), class: 'dmsf-label')
else
sprite_icon 'folder', tag
end
Expand Down Expand Up @@ -136,7 +137,9 @@ def column_value(column, item, value)
if item&.deleted?
tag = sprite_icon('folder', h(value))
else
tag = link_to(sprite_icon('folder', nil, icon_only: true),
tag = link_to(sprite_icon('folder', nil,
icon_only: true,
css_class: value.start_with?('.') ? 'dmsf-system' : ''),
dmsf_folder_path(id: item.project, folder_id: item.id))
tag += link_to(h(value), dmsf_folder_path(id: item.project, folder_id: item.id), class: 'dmsf-label')
unless filter_any?
Expand Down Expand Up @@ -169,7 +172,7 @@ def column_value(column, item, value)
tag = sprite_icon('folder', h(value))
else
# For links, we use revision_id containing dmsf_folder.id in fact
tag = link_to(sprite_icon('folder', nil, icon_only: true),
tag = link_to(sprite_icon('folder', nil, icon_only: true, css_class: 'dmsf-gray'),
dmsf_folder_path(id: item.project, folder_id: item.revision_id))
tag += link_to(h(value), dmsf_folder_path(id: item.project, folder_id: item.revision_id), class: 'dmsf-label')
tag = content_tag('span', '', class: 'dmsf-expander') + tag unless filter_any?
Expand All @@ -191,7 +194,12 @@ def column_value(column, item, value)
options[:target] = '_blank'
options[:rel] = 'noopener'
end
tag = link_to(sprite_icon(icon_name, nil, icon_only: true), file_view_url, options)
tag = link_to(sprite_icon(icon_name,
nil,
icon_only: true,
css_class: item.type == 'file-link' ? 'dmsf-gray' : ''),
file_view_url,
options)
tag += link_to(h(value), file_view_url, options)
tag = content_tag('span', '', class: 'dmsf-expander') + tag unless filter_any?
end
Expand All @@ -211,11 +219,11 @@ def column_value(column, item, value)
if item&.deleted?
tag = sprite_icon('link', h(value))
else
tag = link_to(sprite_icon('link', nil, icon_only: true),
tag = link_to(sprite_icon('link', nil, icon_only: true, css_class: 'dmsf-gray'),
item.filename,
target: '_blank',
rel: 'noopener')
tag += link_to(h(value), item.filename, target: '_blank', rel: 'noopener', class: 'dmsf-link')
tag += link_to(h(value), item.filename, target: '_blank', rel: 'noopener')
tag = content_tag('span', '', class: 'dmsf-expander') + tag unless filter_any?
end
tag + content_tag('div', item.filename, class: 'dmsf-filename', title: l(:field_url))
Expand Down
22 changes: 17 additions & 5 deletions assets/stylesheets/redmine_dmsf.css
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,27 @@ div[id*="revision_access_"] {
.icon-dmsf-file-revision { background-image: url("../../../images/document.png"); }

/* Links */
.dmsf-gray { color: #AAA }
.dmsf-gray,
.dmsf-gray a,
.dmsf-gray a:link,
.dmsf-gray a:visited {
color: gray;
}

.dmsf-gray a, .dmsf-gray a:link, .dmsf-gray a:visited {
color: #484848;
svg.dmsf-gray {
stroke: grey;
}

/* System folders */
.dmsf-system {
color: #5C82AD
.dmsf-system,
.dmsf-system a,
.dmsf-system a:link,
.dmsf-system a:visited {
color: darkviolet;
}

svg.dmsf-system {
stroke: darkviolet;
}

/* Search results */
Expand Down

0 comments on commit 98cc324

Please sign in to comment.