Commit f65adbbb authored by jplang's avatar jplang

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

Patch by Jan Schulz-Hofen.

git-svn-id: https://svn.redmine.org/redmine/trunk@16673 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 8f6871a3
<%= 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 %>
<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>
......@@ -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 %>
......
......@@ -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
......
......@@ -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
......
......@@ -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
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment