add active states to sidebar nav

This commit is contained in:
Mike Greiling 2016-11-15 01:44:43 -06:00
parent a167897bed
commit 48f4f76c16
2 changed files with 13 additions and 4 deletions

View file

@ -59,14 +59,21 @@
} }
} }
.active > a {
color: $black;
}
ul.wiki-pages, ul.wiki-pages,
ul.wiki-pages li { ul.wiki-pages li {
list-style: none; list-style: none;
display: block;
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
ul.wiki-pages li {
margin: 5px 0 10px;
}
.wiki-sidebar-header { .wiki-sidebar-header {
padding: 0 $gl-padding $gl-padding; padding: 0 $gl-padding $gl-padding;

View file

@ -3,7 +3,8 @@
%a.gutter-toggle.pull-right.visible-xs-block.visible-sm-block.js-sidebar-wiki-toggle{ href: "#" } %a.gutter-toggle.pull-right.visible-xs-block.visible-sm-block.js-sidebar-wiki-toggle{ href: "#" }
= icon('angle-double-right') = icon('angle-double-right')
= link_to namespace_project_wikis_git_access_path(@project.namespace, @project) do - git_access_url = namespace_project_wikis_git_access_path(@project.namespace, @project)
= link_to git_access_url, class: active_nav_link?(path: 'wikis#git_access') ? 'active' : '' do
= succeed ' ' do = succeed ' ' do
= icon('cloud-download') = icon('cloud-download')
Clone repository Clone repository
@ -11,9 +12,10 @@
.blocks-container .blocks-container
.block.block-first .block.block-first
%ul.wiki-pages %ul.wiki-pages
%li %li{ class: params[:id] == 'home' ? 'active' : '' }
= link_to 'Home', namespace_project_wiki_path(@project.namespace, @project, :home) = link_to 'Home', namespace_project_wiki_path(@project.namespace, @project, :home)
%li
%li{ class: active_nav_link?(path: 'wikis#pages') ? 'active' : '' }
= link_to 'Pages', namespace_project_wikis_pages_path(@project.namespace, @project) = link_to 'Pages', namespace_project_wikis_pages_path(@project.namespace, @project)
= render 'projects/wikis/new' = render 'projects/wikis/new'