Browse Source

Change MD5 table header to Checksum (#25240).

Patch by Jens Krämer.

git-svn-id: http://svn.redmine.org/redmine/trunk@16456 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/3.4.0
Jean-Philippe Lang 7 years ago
parent
commit
1e179a9bbc
3 changed files with 8 additions and 2 deletions
  1. 5
    0
      app/models/attachment.rb
  2. 2
    2
      app/views/files/index.html.erb
  3. 1
    0
      config/locales/en.yml

+ 5
- 0
app/models/attachment.rb View File

self.class.extension_in?(File.extname(filename), extensions) self.class.extension_in?(File.extname(filename), extensions)
end end


# returns either MD5 or SHA256 depending on the way self.digest was computed
def digest_type
digest.size < 64 ? "MD5" : "SHA256" if digest.present?
end

private private


# Physically deletes the file from the file system # Physically deletes the file from the file system

+ 2
- 2
app/views/files/index.html.erb View File

<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %> <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %> <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
<%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %> <%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
<th>MD5</th>
<th><%= l(:field_digest) %></th>
<th></th> <th></th>
</tr></thead> </tr></thead>
<tbody> <tbody>
<td class="created_on"><%= format_time(file.created_on) %></td> <td class="created_on"><%= format_time(file.created_on) %></td>
<td class="filesize"><%= number_to_human_size(file.filesize) %></td> <td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="downloads"><%= file.downloads %></td> <td class="downloads"><%= file.downloads %></td>
<td class="digest"><%= file.digest %></td>
<td class="digest"><%= file.digest_type %>: <%= file.digest %></td>
<td class="buttons"> <td class="buttons">
<%= link_to(image_tag('delete.png'), attachment_path(file), <%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>

+ 1
- 0
config/locales/en.yml View File

field_updated_by: Updated by field_updated_by: Updated by
field_last_updated_by: Last updated by field_last_updated_by: Last updated by
field_full_width_layout: Full width layout field_full_width_layout: Full width layout
field_digest: Checksum


setting_app_title: Application title setting_app_title: Application title
setting_app_subtitle: Application subtitle setting_app_subtitle: Application subtitle

Loading…
Cancel
Save