summaryrefslogtreecommitdiffstats
path: root/app/views/repositories/_navigation.html.erb
blob: dfdac394932958f1cde4cd56fd5baeeed20357e1 (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
45
46
47
48
49
50
51
52
<% content_for :header_tags do %>
  <%= javascript_include_tag 'repository_navigation' %>
<% end %>

<% if @entry && !@entry.is_dir? && @repository.supports_cat? %>
  <% download_label = @entry.size ? "#{l :button_download} (#{number_to_human_size @entry.size})" : l(:button_download) %>
  <%= link_to(sprite_icon('download', download_label),
              {:action => 'raw', :id => @project,
               :repository_id => @repository.identifier_param,
               :path => to_path_param(@path),
               :rev => @rev}, class: 'icon icon-download') %>
<% end %>

<%= link_to sprite_icon('stats', l(:label_statistics)),
            {:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
            :class => 'icon icon-stats' if @repository.supports_history? %>

<%= actions_dropdown do %>
  <%= link_to_if_authorized sprite_icon('settings', l(:label_settings)),
                            {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'repositories'},
                            :class => 'icon icon-settings' if User.current.allowed_to?(:manage_repository, @project) %>
  <%= link_to sprite_icon('reload', l(:button_fetch_changesets)),
              {:action => :fetch_changesets, :id => @project, :repository_id => @repository.identifier_param},
              :class => 'icon icon-reload', :method => :post if User.current.allowed_to?(:manage_repository, @project) && !Setting.autofetch_changesets? %>
<% end %>

<%= form_tag({:action => controller.action_name,
             :id => @project,
             :repository_id => @repository.identifier_param,
             :path => to_path_param(@path),
             :rev => nil},
            {:method => :get, :id => 'revision_selector'}) do -%>
  <!-- Branches Dropdown -->
  <% if !@repository.branches.nil? && @repository.branches.length > 0 -%>
    | <%= l(:label_branch) %>:
    <%= select_tag :branch,
                   options_for_select([''] + @repository.branches, @rev),
                   :id => 'branch' %>
  <% end -%>

  <% if !@repository.tags.nil? && @repository.tags.length > 0 -%>
    | <%= l(:label_tag) %>:
    <%= select_tag :tag,
                   options_for_select([''] + @repository.tags, @rev),
                   :id => 'tag' %>
  <% end -%>

  <% if @repository.supports_history? %>
    | <%= l(:label_revision) %>:
    <%= text_field_tag 'rev', @rev, :size => 8 %>
  <% end %>
<% end -%>