Commit 55795b7c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve breadcrumbs

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 1555146a
...@@ -59,12 +59,6 @@ pre { ...@@ -59,12 +59,6 @@ pre {
color: #FFF color: #FFF
} }
.breadcrumb > li + li:before {
content: "/";
padding: 0;
color: #666;
}
.str-truncated { .str-truncated {
@include str-truncated; @include str-truncated;
} }
......
...@@ -199,20 +199,6 @@ $list-group-active-bg: $bg_style_color; ...@@ -199,20 +199,6 @@ $list-group-active-bg: $bg_style_color;
color: #3c763d; color: #3c763d;
} }
// Breadcrumb
ul.breadcrumb {
background: white;
border: none;
li {
display: inline;
text-shadow: 0 1px 0 white
}
a {
font-size: 16px;
}
}
/** /**
* fix to keep tooltips position in top navigation bar * fix to keep tooltips position in top navigation bar
* *
......
...@@ -115,10 +115,6 @@ ...@@ -115,10 +115,6 @@
line-height: 2; line-height: 2;
} }
.commit-breadcrumb {
padding: 0;
}
.commit-info-row { .commit-info-row {
margin-bottom: 10px; margin-bottom: 10px;
.avatar { .avatar {
...@@ -210,3 +206,10 @@ li.commit { ...@@ -210,3 +206,10 @@ li.commit {
} }
} }
} }
.commits-feed-holder {
float: right;
.btn {
padding: 4px 12px;
}
}
...@@ -239,3 +239,15 @@ ul.nav.nav-projects-tabs { ...@@ -239,3 +239,15 @@ ul.nav.nav-projects-tabs {
.vs-private { .vs-private {
color: $bg_success; color: $bg_success;
} }
.breadcrumb.repo-breadcrumb {
padding: 2px 0;
background: white;
border: none;
font-size: 16px;
> li + li:before {
padding: 0 3px;
color: #999;
}
}
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
width: 100%; width: 100%;
} }
.breadcrumb {
padding: 2px 0;
}
.tree_progress { .tree_progress {
display: none; display: none;
margin: 20px; margin: 20px;
......
...@@ -76,15 +76,13 @@ module CommitsHelper ...@@ -76,15 +76,13 @@ module CommitsHelper
# Add the root project link and the arrow icon # Add the root project link and the arrow icon
crumbs = content_tag(:li) do crumbs = content_tag(:li) do
content_tag(:span, nil, class: 'arrow') + link_to(@project.path, project_commits_path(@project, @ref))
link_to(@project.name, project_commits_path(@project, @ref))
end end
if @path if @path
parts = @path.split('/') parts = @path.split('/')
parts.each_with_index do |part, i| parts.each_with_index do |part, i|
crumbs += content_tag(:span, ' / ', class: 'divider')
crumbs += content_tag(:li) do crumbs += content_tag(:li) do
# The text is just the individual part, but the link needs all the parts before it # The text is just the individual part, but the link needs all the parts before it
link_to part, project_commits_path(@project, tree_join(@ref, parts[0..i].join('/'))) link_to part, project_commits_path(@project, tree_join(@ref, parts[0..i].join('/')))
...@@ -195,11 +193,11 @@ module CommitsHelper ...@@ -195,11 +193,11 @@ module CommitsHelper
def commit_person_link(commit, options = {}) def commit_person_link(commit, options = {})
source_name = commit.send "#{options[:source]}_name".to_sym source_name = commit.send "#{options[:source]}_name".to_sym
source_email = commit.send "#{options[:source]}_email".to_sym source_email = commit.send "#{options[:source]}_email".to_sym
user = User.find_for_commit(source_email, source_name) user = User.find_for_commit(source_email, source_name)
person_name = user.nil? ? source_name : user.name person_name = user.nil? ? source_name : user.name
person_email = user.nil? ? source_email : user.email person_email = user.nil? ? source_email : user.email
text = if options[:avatar] text = if options[:avatar]
avatar = image_tag(avatar_icon(person_email, options[:size]), class: "avatar #{"s#{options[:size]}" if options[:size]}", width: options[:size], alt: "") avatar = image_tag(avatar_icon(person_email, options[:size]), class: "avatar #{"s#{options[:size]}" if options[:size]}", width: options[:size], alt: "")
%Q{#{avatar} <span class="commit-#{options[:source]}-name">#{person_name}</span>} %Q{#{avatar} <span class="commit-#{options[:source]}-name">#{person_name}</span>}
......
%ul.nav.nav-tabs %ul.nav.nav-tabs
%li= render partial: 'shared/ref_switcher', locals: {destination: 'commits'}
= nav_link(controller: [:commit, :commits]) do = nav_link(controller: [:commit, :commits]) do
= link_to 'Commits', project_commits_path(@project, @repository.root_ref) = link_to 'Commits', project_commits_path(@project, @repository.root_ref)
= nav_link(controller: :compare) do = nav_link(controller: :compare) do
...@@ -19,9 +17,3 @@ ...@@ -19,9 +17,3 @@
= nav_link(controller: :repositories, action: :stats) do = nav_link(controller: :repositories, action: :stats) do
= link_to stats_project_repository_path(@project) do = link_to stats_project_repository_path(@project) do
Stats Stats
- if current_user && current_controller?(:commits) && current_user.private_token
%li.pull-right.hidden-sm
= link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed" do
%i.icon-rss
= render "head" = render "head"
- if @path.present? .tree-ref-holder
%ul.breadcrumb.commit-breadcrumb = render 'shared/ref_switcher', destination: 'commits'
%li.light
History for - if current_user && current_user.private_token
= commits_breadcrumbs .commits-feed-holder.hidden-xs.hidden-sm
= link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed", class: 'btn' do
%i.icon-rss
Commits feed
%ul.breadcrumb.repo-breadcrumb
= commits_breadcrumbs
%li.active
commits
%div{id: dom_id(@project)} %div{id: dom_id(@project)}
#commits-list= render "commits" #commits-list= render "commits"
......
%ul.breadcrumb %ul.breadcrumb.repo-breadcrumb
%li %li
= link_to project_tree_path(@project, @ref) do = link_to project_tree_path(@project, @ref) do
= @project.path = @project.path
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
- if can? current_user, :download_code, @project - if can? current_user, :download_code, @project
.tree-download-holder .tree-download-holder
= render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-small pull-right hidden-xs', split_button: true = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-small pull-right hidden-xs hidden-sm', split_button: true
#tree-holder.tree-holder.clearfix #tree-holder.tree-holder.clearfix
= render "tree", tree: @tree = render "tree", tree: @tree
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment