diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-14 19:02:16 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-06-14 19:02:16 +0300 |
commit | 55795b7c297c08b4b3f7f6dc3ee98cd0d29c6748 (patch) | |
tree | 54e6c8c911125ed352123a90466c962f36f04173 | |
parent | 1555146adf7e23085f04eda76f3c7f213a2e774c (diff) | |
download | gitlab-ce-55795b7c297c08b4b3f7f6dc3ee98cd0d29c6748.tar.gz |
Improve breadcrumbs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | app/assets/stylesheets/generic/common.scss | 6 | ||||
-rw-r--r-- | app/assets/stylesheets/gl_bootstrap.scss | 14 | ||||
-rw-r--r-- | app/assets/stylesheets/sections/commits.scss | 11 | ||||
-rw-r--r-- | app/assets/stylesheets/sections/projects.scss | 12 | ||||
-rw-r--r-- | app/assets/stylesheets/sections/tree.scss | 4 | ||||
-rw-r--r-- | app/helpers/commits_helper.rb | 8 | ||||
-rw-r--r-- | app/views/projects/commits/_head.html.haml | 8 | ||||
-rw-r--r-- | app/views/projects/commits/show.html.haml | 18 | ||||
-rw-r--r-- | app/views/projects/tree/_tree.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/tree/show.html.haml | 2 |
10 files changed, 37 insertions, 48 deletions
diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss index 3b034b757b4..da2c1b0cbd8 100644 --- a/app/assets/stylesheets/generic/common.scss +++ b/app/assets/stylesheets/generic/common.scss @@ -59,12 +59,6 @@ pre { color: #FFF } -.breadcrumb > li + li:before { - content: "/"; - padding: 0; - color: #666; -} - .str-truncated { @include str-truncated; } diff --git a/app/assets/stylesheets/gl_bootstrap.scss b/app/assets/stylesheets/gl_bootstrap.scss index 6c244afa50a..4271a7b310c 100644 --- a/app/assets/stylesheets/gl_bootstrap.scss +++ b/app/assets/stylesheets/gl_bootstrap.scss @@ -199,20 +199,6 @@ $list-group-active-bg: $bg_style_color; 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 * diff --git a/app/assets/stylesheets/sections/commits.scss b/app/assets/stylesheets/sections/commits.scss index e2503a8a165..ef8c5f089b9 100644 --- a/app/assets/stylesheets/sections/commits.scss +++ b/app/assets/stylesheets/sections/commits.scss @@ -115,10 +115,6 @@ line-height: 2; } -.commit-breadcrumb { - padding: 0; -} - .commit-info-row { margin-bottom: 10px; .avatar { @@ -210,3 +206,10 @@ li.commit { } } } + +.commits-feed-holder { + float: right; + .btn { + padding: 4px 12px; + } +} diff --git a/app/assets/stylesheets/sections/projects.scss b/app/assets/stylesheets/sections/projects.scss index 71f5f1663cc..34dd3448f53 100644 --- a/app/assets/stylesheets/sections/projects.scss +++ b/app/assets/stylesheets/sections/projects.scss @@ -239,3 +239,15 @@ ul.nav.nav-projects-tabs { .vs-private { color: $bg_success; } + +.breadcrumb.repo-breadcrumb { + padding: 2px 0; + background: white; + border: none; + font-size: 16px; + + > li + li:before { + padding: 0 3px; + color: #999; + } +} diff --git a/app/assets/stylesheets/sections/tree.scss b/app/assets/stylesheets/sections/tree.scss index 18a5f6204fe..b08f94f55a0 100644 --- a/app/assets/stylesheets/sections/tree.scss +++ b/app/assets/stylesheets/sections/tree.scss @@ -4,10 +4,6 @@ width: 100%; } - .breadcrumb { - padding: 2px 0; - } - .tree_progress { display: none; margin: 20px; diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index c4abdbdabc7..62aa6832371 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -76,15 +76,13 @@ module CommitsHelper # Add the root project link and the arrow icon crumbs = content_tag(:li) do - content_tag(:span, nil, class: 'arrow') + - link_to(@project.name, project_commits_path(@project, @ref)) + link_to(@project.path, project_commits_path(@project, @ref)) end if @path parts = @path.split('/') parts.each_with_index do |part, i| - crumbs += content_tag(:span, ' / ', class: 'divider') crumbs += content_tag(:li) do # 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('/'))) @@ -195,11 +193,11 @@ module CommitsHelper def commit_person_link(commit, options = {}) source_name = commit.send "#{options[:source]}_name".to_sym source_email = commit.send "#{options[:source]}_email".to_sym - + user = User.find_for_commit(source_email, source_name) person_name = user.nil? ? source_name : user.name person_email = user.nil? ? source_email : user.email - + 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: "") %Q{#{avatar} <span class="commit-#{options[:source]}-name">#{person_name}</span>} diff --git a/app/views/projects/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml index 1bb4d9bfab4..b636e8ffe16 100644 --- a/app/views/projects/commits/_head.html.haml +++ b/app/views/projects/commits/_head.html.haml @@ -1,6 +1,4 @@ %ul.nav.nav-tabs - %li= render partial: 'shared/ref_switcher', locals: {destination: 'commits'} - = nav_link(controller: [:commit, :commits]) do = link_to 'Commits', project_commits_path(@project, @repository.root_ref) = nav_link(controller: :compare) do @@ -19,9 +17,3 @@ = nav_link(controller: :repositories, action: :stats) do = link_to stats_project_repository_path(@project) do 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 diff --git a/app/views/projects/commits/show.html.haml b/app/views/projects/commits/show.html.haml index 3a4f304a255..482a845558f 100644 --- a/app/views/projects/commits/show.html.haml +++ b/app/views/projects/commits/show.html.haml @@ -1,10 +1,18 @@ = render "head" -- if @path.present? - %ul.breadcrumb.commit-breadcrumb - %li.light - History for - = commits_breadcrumbs +.tree-ref-holder + = render 'shared/ref_switcher', destination: 'commits' + +- if current_user && current_user.private_token + .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)} #commits-list= render "commits" diff --git a/app/views/projects/tree/_tree.html.haml b/app/views/projects/tree/_tree.html.haml index fe572260e0c..33cc40f475c 100644 --- a/app/views/projects/tree/_tree.html.haml +++ b/app/views/projects/tree/_tree.html.haml @@ -1,4 +1,4 @@ -%ul.breadcrumb +%ul.breadcrumb.repo-breadcrumb %li = link_to project_tree_path(@project, @ref) do = @project.path diff --git a/app/views/projects/tree/show.html.haml b/app/views/projects/tree/show.html.haml index 1ef3020f35f..fc4616da6ec 100644 --- a/app/views/projects/tree/show.html.haml +++ b/app/views/projects/tree/show.html.haml @@ -3,7 +3,7 @@ - if can? current_user, :download_code, @project .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 = render "tree", tree: @tree |