#183 Long file names
This commit is contained in:
parent
e6d86d256e
commit
2686222ba1
@ -374,4 +374,11 @@ class DmsfFile < ActiveRecord::Base
|
||||
[results, results_count]
|
||||
end
|
||||
|
||||
def display_name
|
||||
if self.name.length > 50
|
||||
return "#{self.name[0, 25]}...#{self.name[-25, 25]}"
|
||||
end
|
||||
self.name
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@ -79,6 +79,9 @@ class DmsfLink < ActiveRecord::Base
|
||||
path = folder.dmsf_path_str if folder
|
||||
end
|
||||
path.insert(0, "#{self.target_project.name}:") if self.project_id != self.target_project_id && path
|
||||
if path.length > 50
|
||||
return "#{path[0, 25]}...#{path[-25, 25]}"
|
||||
end
|
||||
path
|
||||
end
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
:class => "icon icon-file #{DmsfHelper.filetype_css(file.name)}",
|
||||
:title => l(:title_title_version_version_download, :title => h(file.title), :version => file.version),
|
||||
'data-downloadurl' => "#{file.last_revision.detect_content_type}:#{h(file.name)}:#{file_download_url}") %>
|
||||
<div class="filename" title="<%= l(:title_filename_for_download)%>"><%= h(link ? link.path : file.name) %></div>
|
||||
<div class="filename" title="<%= l(:title_filename_for_download)%>"><%= h(link ? link.path : file.display_name) %></div>
|
||||
</td>
|
||||
<td class="size"><%= number_to_human_size(file.last_revision.size) %></td>
|
||||
<td class="modified">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user