summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/attachments/other.html.erb10
-rw-r--r--app/views/common/_other.html.erb8
-rw-r--r--app/views/repositories/entry.html.erb10
3 files changed, 25 insertions, 3 deletions
diff --git a/app/views/attachments/other.html.erb b/app/views/attachments/other.html.erb
index e6244c16e..608bbf232 100644
--- a/app/views/attachments/other.html.erb
+++ b/app/views/attachments/other.html.erb
@@ -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 %>
diff --git a/app/views/common/_other.html.erb b/app/views/common/_other.html.erb
index fe0228a50..74d87a60a 100644
--- a/app/views/common/_other.html.erb
+++ b/app/views/common/_other.html.erb
@@ -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>
diff --git a/app/views/repositories/entry.html.erb b/app/views/repositories/entry.html.erb
index b495dd4ae..16bebc79c 100644
--- a/app/views/repositories/entry.html.erb
+++ b/app/views/repositories/entry.html.erb
@@ -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 %>