+/- icons

This commit is contained in:
karel.picman@lbcfree.net 2021-04-16 10:40:26 +02:00
parent ee98f0edb9
commit 77c1667835
2 changed files with 35 additions and 7 deletions

View File

@ -94,22 +94,22 @@ module DmsfQueriesHelper
end
unless filter_any?
tag = "<span class=\"dmsf-expander\" onclick=\"dmsfToggle(this, '#{item.id}', null,'#{escape_javascript(expand_folder_dmsf_path)}')\"></span>".html_safe + tag
tag = content_tag('div', tag, class: 'row-control')
tag = content_tag('div', tag, class: 'row-control dmsf-row-control')
end
tag + content_tag('div', item.filename, class: 'dmsf-filename', title: l(:title_filename_for_download))
when 'folder'
if item&.deleted > 0
if item&.deleted?
tag = content_tag('span', value, class: 'icon icon-folder')
else
tag = link_to(h(value), dmsf_folder_path(id: item.project, folder_id: item.id), class: 'icon icon-folder')
unless filter_any?
tag = "<span class=\"dmsf-expander\" onclick=\"dmsfToggle(this, '#{item.project.id}', '#{item.id}','#{escape_javascript(expand_folder_dmsf_path)}')\"></span>".html_safe + tag
tag = content_tag('div', tag, class: 'row-control')
tag = content_tag('div', tag, class: 'row-control dmsf-row-control')
end
end
tag + content_tag('div', item.filename, class: 'dmsf-filename', title: l(:title_filename_for_download))
when 'folder-link'
if item&.deleted > 0
if item&.deleted?
tag = content_tag('span', value, class: 'icon icon-folder')
else
# For links we use revision_id containing dmsf_folder.id in fact
@ -120,7 +120,7 @@ module DmsfQueriesHelper
end
tag + content_tag('div', item.filename, class: 'dmsf-filename', title: l(:label_target_folder))
when 'file', 'file-link'
if item&.deleted > 0
if item&.deleted?
tag = content_tag('span', value, class: "icon icon-file #{DmsfHelper.filetype_css(item.filename)}")
else
# For links we use revision_id containing dmsf_file.id in fact
@ -136,7 +136,7 @@ module DmsfQueriesHelper
end
tag + content_tag('div', item.filename, class: 'dmsf-filename', title: l(:title_filename_for_download))
when 'url-link'
if item&.deleted > 0
if item&.deleted?
tag = content_tag('span', value, class: 'icon icon-link')
else
tag = link_to(h(value), item.filename, target: '_blank', class: 'icon icon-link')
@ -152,7 +152,7 @@ module DmsfQueriesHelper
number_to_human_size value
when :workflow
if value
if item.workflow_id && (!(item&.deleted > 0))
if item.workflow_id && (!item&.deleted?)
if item.type == 'file'
url = log_dmsf_workflow_path(project_id: item.project_id, id: item.workflow_id, dmsf_file_id: item.id)
else

View File

@ -78,6 +78,34 @@ td.dmsf-title a.icon-folder::before {
color: #FFE9A2;
}
/* +/- icons */
.dmsf-row-control {
width: auto;
margin-right: 5px;
}
.dmsf-row-control > .dmsf-expander::before {
content: "\F0416" !important;
font-family: "Material Icons";
display: inline-block;
width: 1.5em !important;
font-size: 1.125em;
}
.dmsf-row-control > .dmsf-expander.open::before {
content: "\F0375" !important;
font-family: "Material Icons";
}
.dmsf-row-control > span.dmsf-expander:hover::before {
background-color: lightgreen;
color: white;
-moz-border-radius: 5000px;
-webkit-border-radius: 5000px;
border-radius: 5000px;
border: 1px solid green;
}
/* Approval workflows */
#tab-content-dmsf_workflow table.list ~ p .button {
margin-top: 10px;