use toolbar component in repositories

Signed-off-by: Florian Kraft <f.kraft@finn.de>
pull/3000/head
Florian Kraft 10 years ago
parent a8d15897ba
commit d0102cdc37
  1. 69
      app/views/repositories/_navigation.html.erb
  2. 4
      app/views/repositories/annotate.html.erb
  3. 8
      app/views/repositories/changes.html.erb
  4. 2
      app/views/repositories/committers.html.erb
  5. 19
      app/views/repositories/diff.html.erb
  6. 6
      app/views/repositories/entry.html.erb
  7. 4
      app/views/repositories/revision.html.erb
  8. 4
      app/views/repositories/revisions.html.erb
  9. 6
      app/views/repositories/show.html.erb
  10. 2
      app/views/repositories/stats.html.erb

@ -30,37 +30,44 @@ See doc/COPYRIGHT.rdoc for more details.
<% content_for :header_tags do %>
<%= javascript_include_tag 'repository_navigation' %>
<% end %>
<% content_for :toolbar do %>
<li class="toolbar-item">
<%= link_to stats_project_repository_path(@project), class: 'button' do %>
<i class="icon icon-stats1"></i> <%= l(:label_statistics) %>
<% end %>
</li>
<%# rev => nil prevents overwriting the rev parameter queried for in the form with the parameter from the request %>
<%= form_tag({:action => controller.action_name, :project_id => @project, :path => to_path_param(@path), :rev => nil}, {:method => :get, :id => 'revision_selector'}) do -%>
<!-- Branches Dropdown -->
<% if !@repository.branches.nil? && @repository.branches.length > 0 -%>
<div class="toolbar-container">
<div id="toolbar">
<div class="title-container">
<% merge ||= {} %>
<h2><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :revision => @rev }.merge(merge) %></h2>
</div>
<ul id="toolbar-items">
<li class="toolbar-item">
<%= label_tag :branch, l(:label_branch), class: 'hidden-for-sighted' %>
<%= select_tag :branch, options_for_select([''] + @repository.branches, @rev), id: 'branch' %>
<%= link_to stats_project_repository_path(@project), class: 'button' do %>
<i class="icon icon-stats1"></i> <%= l(:label_statistics) %>
<% end %>
</li>
<% end -%>
<%# rev => nil prevents overwriting the rev parameter queried for in the form with the parameter from the request %>
<%= form_tag({:action => controller.action_name, :project_id => @project, :path => to_path_param(@path), :rev => nil}, {:method => :get, :id => 'revision_selector'}) do -%>
<!-- Branches Dropdown -->
<% if !@repository.branches.nil? && @repository.branches.length > 0 -%>
<li class="toolbar-item">
<%= label_tag :branch, l(:label_branch), class: 'hidden-for-sighted' %>
<%= select_tag :branch, options_for_select([''] + @repository.branches, @rev), id: 'branch' %>
</li>
<% end -%>
<% if !@repository.tags.nil? && @repository.tags.length > 0 -%>
<li class="toolbar-item">
<%= label_tag :tag, l(:label_tag), class: 'hidden-for-sighted' %>
<%= select_tag :tag, options_for_select([''] + @repository.tags, @rev), id: 'tag' %>
</li>
<% end -%>
<li class="toolbar-item">
<%= label_tag :rev, l(:label_revision), class: 'hidden-for-sighted' %>
<%= text_field_tag :rev, @rev, placeholder: l(:label_revision) %>
</li>
<% if User.current.impaired? %>
<li class="toolbar-item">
<%= button_tag 'OK', type: :submit, class: 'button -highlight' %>
</li>
<% end %>
<% end -%>
<% end %>
<% if !@repository.tags.nil? && @repository.tags.length > 0 -%>
<li class="toolbar-item">
<%= label_tag :tag, l(:label_tag), class: 'hidden-for-sighted' %>
<%= select_tag :tag, options_for_select([''] + @repository.tags, @rev), id: 'tag' %>
</li>
<% end -%>
<li class="toolbar-item">
<%= label_tag :rev, l(:label_revision), class: 'hidden-for-sighted' %>
<%= text_field_tag :rev, @rev, placeholder: l(:label_revision) %>
</li>
<% if User.current.impaired? %>
<li class="toolbar-item">
<%= button_tag 'OK', type: :submit, class: 'button -highlight' %>
</li>
<% end %>
<% end -%>
</ul>
</div>
</div>

@ -27,9 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
<%= render :partial => 'navigation' %>
<h2><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
<%= render :partial => 'layouts/action_menu_specific' %>
<%= render :partial => 'navigation', locals: { merge: { kind: 'file' } } %>
<p><%= render :partial => 'link_to_functions' %></p>
<% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
<div class="autoscroll">

@ -29,13 +29,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
<%= render :partial => 'navigation' %>
<h2>
<%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %>
</h2>
<%= render :partial => 'layouts/action_menu_specific' %>
<%= render :partial => 'navigation', locals: { merge: { kind: (@entry ? @entry.kind : nil) } } %>
<p><%= render :partial => 'link_to_functions' %></p>

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<h2><%= l(:label_repository) %></h2>
<%= toolbar title: l(:label_repository) %>
<%= simple_format(l(:text_repository_usernames_mapping)) %>
<% if @committers.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>

@ -27,27 +27,16 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<% content_for :action_menu_specific do %>
<li>
<!-- Choose view type -->
<%= form_tag({:path => to_path_param(@path)}, :method => 'get') do %>
<%= toolbar title: "#{l(:label_revision)} #{@diff_format_revisions} #{@path}" do %>
<li class="toolbar-item">
<%= form_tag({path: to_path_param(@path)}, method: :get) do %>
<%= hidden_field_tag('rev', params[:rev]) if params[:rev] %>
<%= hidden_field_tag('rev_to', params[:rev_to]) if params[:rev_to] %>
<span class='legacy-actions--inline-label'>
<label class='form-label -transparent'><%= l(:label_view_diff) %></label>
<%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %></p>
</span>
<%= styled_select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %>
<% end %>
</li>
<% end %>
<h2><%= l(:label_revision) %> <%= @diff_format_revisions %> <%=h @path %></h2>
<%= render :partial => 'layouts/action_menu_specific' %>
<span class="clear"></span>
<% cache(@cache_key) do -%>
<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
<% end -%>

@ -29,11 +29,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
<%= render :partial => 'navigation' %>
<h2><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
<%= render :partial => 'layouts/action_menu_specific' %>
<%= render :partial => 'navigation', locals: { merge: { kind: 'file'} } %>
<p><%= render :partial => 'link_to_functions' %></p>

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<% content_for :toolbar do %>
<%= toolbar title: "#{l(:label_revision)} #{format_revision(@changeset)}" do %>
<li class="toolbar-item">
<% if @changeset.previous.nil? %>
<button class="button" disabled="disabled"><%= l(:label_previous) %></button>
@ -48,8 +48,6 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %>
</li>
<% end %>
<h2><%= l(:label_revision) %> <%= format_revision(@changeset) %></h2>
<%= render :partial => 'layouts/toolbar' %>
<p><% if @changeset.scmid %>ID: <%= h(@changeset.scmid) %><br />
<% end %>
<span class="author"><%= authoring(@changeset.committed_on, @changeset.author) %></span></p>

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<% content_for :toolbar do %>
<%= toolbar title: l(:label_revision_plural) do %>
<%= form_tag({ action: 'revision', id: @project }, { method: :get }) do %>
<li class="toolbar-item">
<%= label_tag :rev, l(:label_revision), class: 'hidden-for-sighted' %>
@ -37,8 +37,6 @@ See doc/COPYRIGHT.rdoc for more details.
</li>
<% end %>
<% end %>
<h2><%= l(:label_revision_plural) %></h2>
<%= render :partial => 'layouts/toolbar' %>
<%= render :partial => 'revisions', :locals => {:project => @project, :path => '', :revisions => @changesets, :entry => nil }%>
<%= pagination_links_full @changesets %>
<% content_for :header_tags do %>

@ -29,11 +29,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
<%= render :partial => 'navigation' %>
<h2><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'dir', :revision => @rev } %></h2>
<%= render :partial => 'layouts/toolbar' %>
<%= render :partial => 'navigation', locals: { merge: { kind: 'dir' } } %>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<%= render :partial => 'dir_list' %>

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<h2><%= l(:label_statistics) %></h2>
<%= toolbar title: l(:label_statistics) %>
<p>
<%= tag("embed", :width => 800,

Loading…
Cancel
Save