#48 System folder of closed issue have got a lighter colour
This commit is contained in:
parent
57dcad1333
commit
c7d469b70f
@ -104,14 +104,8 @@ class DmsfFolder < ActiveRecord::Base
|
||||
return true if (User.current.admin? || folder.nil?)
|
||||
# System folder?
|
||||
if folder && folder.system
|
||||
if (!allow_system || !User.current.allowed_to?(:display_system_folders, folder.project))
|
||||
return false
|
||||
end
|
||||
issue_id = folder.title.to_i
|
||||
if issue_id > 0
|
||||
issue = Issue.find_by_id issue_id
|
||||
return false unless issue && issue.visible?(User.current)
|
||||
end
|
||||
return false if (!allow_system || !User.current.allowed_to?(:display_system_folders, folder.project))
|
||||
return false unless self.issue && self.issue.visible?(User.current)
|
||||
end
|
||||
# Permissions?
|
||||
if !folder.dmsf_folder || permissions?(folder.dmsf_folder, allow_system)
|
||||
@ -530,6 +524,16 @@ class DmsfFolder < ActiveRecord::Base
|
||||
l(:title_unlock_file)
|
||||
end
|
||||
|
||||
def issue
|
||||
unless @issue
|
||||
if self.system
|
||||
issue_id = self.title.to_i
|
||||
@issue = Issue.find_by_id(issue_id) if issue_id > 0
|
||||
end
|
||||
end
|
||||
@issue
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def self.directory_subtree(tree, folder, level, current_folder)
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
<% if obj.is_a? DmsfFolder %>
|
||||
<% classes << ' dmsf_system' if obj.system %>
|
||||
<% classes << ' dmsf_system_closed' if obj.issue && obj.issue.closed? %>
|
||||
<tr <%= id %> class="dir <%= classes %>">
|
||||
<%= render(:partial => 'dir',
|
||||
:locals => {
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @subfolders.each do |subfolder| %>
|
||||
<tr class="dir <%= 'dmsf_system' if subfolder.system %>">
|
||||
<tr class="dir <%= 'dmsf_system' if subfolder.system %> <%= 'dmsf_system_closed' if subfolder.issue && subfolder.issue.closed? %>">
|
||||
<%= render(:partial => 'dir',
|
||||
:locals => {
|
||||
:project => @project,
|
||||
|
||||
BIN
assets/images/folder_system_closed.png
Normal file
BIN
assets/images/folder_system_closed.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 393 B |
@ -208,6 +208,7 @@ div.dmsf_revision_inner_box .attribute .label {
|
||||
/* File types */
|
||||
.dmsf_gray .icon-folder { background-image: url(../images/folder_gray.png); }
|
||||
.dmsf_system .icon-folder { background-image: url(../images/folder_system.png); }
|
||||
.dmsf_system_closed .icon-folder { background-image: url(../images/folder_system_closed.png); }
|
||||
|
||||
.icon-file.filetype-doc, .icon-file.filetype-docx { background-image: url(../images/filetypes/doc.png); }
|
||||
.icon-file.filetype-xls, .icon-file.filetype-xlsx { background-image: url(../images/filetypes/xls.png); }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user