From c9f4c20a9c604e6c78f1cb0fb44b7a18c0ceae90 Mon Sep 17 00:00:00 2001 From: Jan Schulz-Hofen Date: Thu, 18 May 2017 12:14:02 +0200 Subject: [PATCH 4/4] Style links on repository entries as 2nd level tabs (like in settings) --- app/views/repositories/_link_to_functions.html.erb | 23 +++++++++++++++------- public/stylesheets/scm.css | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/views/repositories/_link_to_functions.html.erb b/app/views/repositories/_link_to_functions.html.erb index edb5e84..bdb5343 100644 --- a/app/views/repositories/_link_to_functions.html.erb +++ b/app/views/repositories/_link_to_functions.html.erb @@ -1,13 +1,22 @@ <% if @entry && @entry.kind == 'file' %> +<% +tabs = [] +tabs << { name: 'entry', label: :button_view, + url: {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } + } if @repository.supports_cat? + +tabs << { name: 'changes', label: :label_history, + url: {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } + } +tabs << { name: 'annotate', label: :button_annotate, + url: {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } + } if @repository.supports_annotate? +%> + +<%= render :partial => 'common/tabs', :locals => {:tabs => tabs, :selected_tab => action_name} %> +

-<% if @repository.supports_cat? %> - <%= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> | -<% end %> -<%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> | -<% if @repository.supports_annotate? %> - <%= link_to_if action_name != 'annotate', l(:button_annotate), {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> | -<% end %> <%= link_to(l(:button_download), {:action => 'raw', :id => @project, :repository_id => @repository.identifier_param, diff --git a/public/stylesheets/scm.css b/public/stylesheets/scm.css index f1c65f9..e360d17 100644 --- a/public/stylesheets/scm.css +++ b/public/stylesheets/scm.css @@ -67,7 +67,7 @@ table.filecontent td.line-code pre { table.filecontent tr:target th.line-num { background-color:#E0E0E0; color: #777; } table.filecontent tr:target td.line-code { background-color:#DDEEFF; } -img.filecontent { max-width: 100%; margin-top: 1em;} +img.filecontent { max-width: 100%; } /* 12 different colors for the annonate view */ table.annotate tr.bloc-0 {background: #FFFFBF;} -- 2.7.2