Commit 55795b7c297c08b4b3f7f6dc3ee98cd0d29c6748

Authored by Dmitriy Zaporozhets
1 parent 1555146a

Improve breadcrumbs

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/assets/stylesheets/generic/common.scss
... ... @@ -59,12 +59,6 @@ pre {
59 59 color: #FFF
60 60 }
61 61  
62   -.breadcrumb > li + li:before {
63   - content: "/";
64   - padding: 0;
65   - color: #666;
66   -}
67   -
68 62 .str-truncated {
69 63 @include str-truncated;
70 64 }
... ...
app/assets/stylesheets/gl_bootstrap.scss
... ... @@ -199,20 +199,6 @@ $list-group-active-bg: $bg_style_color;
199 199 color: #3c763d;
200 200 }
201 201  
202   -// Breadcrumb
203   -ul.breadcrumb {
204   - background: white;
205   - border: none;
206   - li {
207   - display: inline;
208   - text-shadow: 0 1px 0 white
209   - }
210   -
211   - a {
212   - font-size: 16px;
213   - }
214   -}
215   -
216 202 /**
217 203 * fix to keep tooltips position in top navigation bar
218 204 *
... ...
app/assets/stylesheets/sections/commits.scss
... ... @@ -115,10 +115,6 @@
115 115 line-height: 2;
116 116 }
117 117  
118   -.commit-breadcrumb {
119   - padding: 0;
120   -}
121   -
122 118 .commit-info-row {
123 119 margin-bottom: 10px;
124 120 .avatar {
... ... @@ -210,3 +206,10 @@ li.commit {
210 206 }
211 207 }
212 208 }
  209 +
  210 +.commits-feed-holder {
  211 + float: right;
  212 + .btn {
  213 + padding: 4px 12px;
  214 + }
  215 +}
... ...
app/assets/stylesheets/sections/projects.scss
... ... @@ -239,3 +239,15 @@ ul.nav.nav-projects-tabs {
239 239 .vs-private {
240 240 color: $bg_success;
241 241 }
  242 +
  243 +.breadcrumb.repo-breadcrumb {
  244 + padding: 2px 0;
  245 + background: white;
  246 + border: none;
  247 + font-size: 16px;
  248 +
  249 + > li + li:before {
  250 + padding: 0 3px;
  251 + color: #999;
  252 + }
  253 +}
... ...
app/assets/stylesheets/sections/tree.scss
... ... @@ -4,10 +4,6 @@
4 4 width: 100%;
5 5 }
6 6  
7   - .breadcrumb {
8   - padding: 2px 0;
9   - }
10   -
11 7 .tree_progress {
12 8 display: none;
13 9 margin: 20px;
... ...
app/helpers/commits_helper.rb
... ... @@ -76,15 +76,13 @@ module CommitsHelper
76 76  
77 77 # Add the root project link and the arrow icon
78 78 crumbs = content_tag(:li) do
79   - content_tag(:span, nil, class: 'arrow') +
80   - link_to(@project.name, project_commits_path(@project, @ref))
  79 + link_to(@project.path, project_commits_path(@project, @ref))
81 80 end
82 81  
83 82 if @path
84 83 parts = @path.split('/')
85 84  
86 85 parts.each_with_index do |part, i|
87   - crumbs += content_tag(:span, ' / ', class: 'divider')
88 86 crumbs += content_tag(:li) do
89 87 # The text is just the individual part, but the link needs all the parts before it
90 88 link_to part, project_commits_path(@project, tree_join(@ref, parts[0..i].join('/')))
... ... @@ -195,11 +193,11 @@ module CommitsHelper
195 193 def commit_person_link(commit, options = {})
196 194 source_name = commit.send "#{options[:source]}_name".to_sym
197 195 source_email = commit.send "#{options[:source]}_email".to_sym
198   -
  196 +
199 197 user = User.find_for_commit(source_email, source_name)
200 198 person_name = user.nil? ? source_name : user.name
201 199 person_email = user.nil? ? source_email : user.email
202   -
  200 +
203 201 text = if options[:avatar]
204 202 avatar = image_tag(avatar_icon(person_email, options[:size]), class: "avatar #{"s#{options[:size]}" if options[:size]}", width: options[:size], alt: "")
205 203 %Q{#{avatar} <span class="commit-#{options[:source]}-name">#{person_name}</span>}
... ...
app/views/projects/commits/_head.html.haml
1 1 %ul.nav.nav-tabs
2   - %li= render partial: 'shared/ref_switcher', locals: {destination: 'commits'}
3   -
4 2 = nav_link(controller: [:commit, :commits]) do
5 3 = link_to 'Commits', project_commits_path(@project, @repository.root_ref)
6 4 = nav_link(controller: :compare) do
... ... @@ -19,9 +17,3 @@
19 17 = nav_link(controller: :repositories, action: :stats) do
20 18 = link_to stats_project_repository_path(@project) do
21 19 Stats
22   -
23   -
24   - - if current_user && current_controller?(:commits) && current_user.private_token
25   - %li.pull-right.hidden-sm
26   - = link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed" do
27   - %i.icon-rss
... ...
app/views/projects/commits/show.html.haml
1 1 = render "head"
2 2  
3   -- if @path.present?
4   - %ul.breadcrumb.commit-breadcrumb
5   - %li.light
6   - History for
7   - = commits_breadcrumbs
  3 +.tree-ref-holder
  4 + = render 'shared/ref_switcher', destination: 'commits'
  5 +
  6 +- if current_user && current_user.private_token
  7 + .commits-feed-holder.hidden-xs.hidden-sm
  8 + = link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed", class: 'btn' do
  9 + %i.icon-rss
  10 + Commits feed
  11 +
  12 +%ul.breadcrumb.repo-breadcrumb
  13 + = commits_breadcrumbs
  14 + %li.active
  15 + commits
8 16  
9 17 %div{id: dom_id(@project)}
10 18 #commits-list= render "commits"
... ...
app/views/projects/tree/_tree.html.haml
1   -%ul.breadcrumb
  1 +%ul.breadcrumb.repo-breadcrumb
2 2 %li
3 3 = link_to project_tree_path(@project, @ref) do
4 4 = @project.path
... ...
app/views/projects/tree/show.html.haml
... ... @@ -3,7 +3,7 @@
3 3  
4 4 - if can? current_user, :download_code, @project
5 5 .tree-download-holder
6   - = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-small pull-right hidden-xs', split_button: true
  6 + = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-small pull-right hidden-xs hidden-sm', split_button: true
7 7  
8 8 #tree-holder.tree-holder.clearfix
9 9 = render "tree", tree: @tree
... ...