1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-09 09:01:31 +00:00

Add download link to no preview message (#26035).

Patch by Jan Schulz-Hofen.

git-svn-id: http://svn.redmine.org/redmine/trunk@16673 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2017-06-17 09:51:19 +00:00
parent 0a9b0dd46c
commit 580b591c57
7 changed files with 34 additions and 6 deletions

View File

@ -1,3 +1,11 @@
<%= render :layout => 'layouts/file' do %>
<%= render :partial => 'common/other' %>
<%= render :partial => 'common/other',
:locals => {
:download_link => link_to_attachment(
@attachment,
:text => l(:label_no_preview_download),
:download => true,
:class => 'icon icon-download'
)
} %>
<% end %>

View File

@ -1 +1,7 @@
<p class="nodata"><%= l(:label_no_preview) %></p>
<p class="nodata">
<% if defined? download_link %>
<%= t(:label_no_preview_alternative_html, link: download_link) %>
<% else %>
<%= l(:label_no_preview) %>
<% end %>
</p>

View File

@ -17,7 +17,15 @@
<% elsif @content %>
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
<% else %>
<%= render :partial => 'common/other' %>
<%= render :partial => 'common/other',
:locals => {
:download_link => @repository.supports_cat? ? link_to(
l(:label_no_preview_download),
{ :action => 'raw', :id => @project,
:repository_id => @repository.identifier_param,
:path => to_path_param(@path),
:rev => @rev },
:class => 'icon icon-download') : nil } %>
<% end %>
<% content_for :header_tags do %>

View File

@ -654,6 +654,8 @@ de:
label_no_change_option: (Keine Änderung)
label_no_data: Nichts anzuzeigen
label_no_preview: Keine Vorschau verfügbar
label_no_preview_alternative_html: Keine Vorschau verfügbar. Sie können die Datei stattdessen %{link}.
label_no_preview_download: herunterladen
label_no_issues_in_project: keine Tickets im Projekt
label_nobody: Niemand
label_none: kein

View File

@ -639,6 +639,8 @@ en:
label_attribute_plural: Attributes
label_no_data: No data to display
label_no_preview: No preview available
label_no_preview_alternative_html: No preview available. %{link} the file instead.
label_no_preview_download: Download
label_change_status: Change status
label_history: History
label_attachment: File

View File

@ -1224,6 +1224,8 @@ fr:
mail_body_security_notification_notify_enabled: Les notifications ont été activées pour l'adresse %{value}
mail_body_security_notification_notify_disabled: Les notifications ont été désactivées pour l'adresse %{value}
field_remote_ip: Adresse IP
label_no_preview: No preview available
label_no_preview: Aucun aperçu disponible
label_no_preview_alternative_html: Aucun aperçu disponible. Veuillez %{link} le fichier.
label_no_preview_download: télécharger
label_user_mail_option_only_assigned: Only for things I watch or I am assigned to
label_user_mail_option_only_owner: Only for things I watch or I am the owner of

View File

@ -207,7 +207,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest
}
assert_response :success
assert_equal 'text/html', @response.content_type
assert_select '.nodata', :text => 'No preview available'
assert_select '.nodata', :text => 'No preview available. Download the file instead.'
end
set_tmp_attachments_directory
end
@ -228,7 +228,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest
:id => 6
}
assert_equal 'text/html', @response.content_type
assert_select '.nodata', :text => 'No preview available'
assert_select '.nodata', :text => 'No preview available. Download the file instead.'
set_tmp_attachments_directory
end