summaryrefslogtreecommitdiffstats
path: root/app/views/repositories/entry.html.erb
blob: 99c611104abba917c92872dc898f89f648d1234c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>

<div class="contextual">
  <%= render :partial => 'navigation' %>
</div>

<h2 class="breadcrumbs"><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>

<%= render :partial => 'link_to_functions' %>

<% if Redmine::MimeType.is_type?('image', @path) %>
  <%= render :partial => 'common/image', :locals => {:path => url_for(:action => 'raw',
                                                                      :id     => @project,
                                                                      :repository_id => @repository.identifier_param,
                                                                      :path   => @path,
                                                                      :rev    => @rev), :alt => @path} %>
<% elsif @content %>
  <%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
<% else %>
  <% kind = if Redmine::MimeType.is_type?('video', @path)
       'video'
     elsif Redmine::MimeType.is_type?('audio', @path)
       'audio'
     end %>
  <%= render :partial => 'common/other',
             :locals => {
               :path => (url_for(params.merge(:action => 'raw')) if @allow_download),
               :kind => kind,
               :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 %>

<span class="pagination filepreview">
  <%= render_pagination %>
</span>

<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>