Feature #26035 » 0002-Add-download-link-to-no-preview-message.patch
| app/views/attachments/other.html.erb | ||
|---|---|---|
|
<%= 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 %>
|
||
| app/views/common/_other.html.erb | ||
|---|---|---|
|
<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>
|
||
| app/views/repositories/entry.html.erb | ||
|---|---|---|
|
<% 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 %>
|
||
| config/locales/de.yml | ||
|---|---|---|
|
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
|
||
| config/locales/en.yml | ||
|---|---|---|
|
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
|
||
| config/locales/fr.yml | ||
|---|---|---|
|
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
|
||
| test/functional/attachments_controller_test.rb | ||
|---|---|---|
|
get :show, :id => 4
|
||
|
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
|
||
| ... | ... | |
|
@request.session[:user_id] = 2
|
||
|
get :show, :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
|
||