summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/sidebar.js.coffee1
-rw-r--r--app/assets/stylesheets/base/mixins.scss7
-rw-r--r--app/assets/stylesheets/generic/header.scss (renamed from app/assets/stylesheets/pages/header.scss)90
-rw-r--r--app/assets/stylesheets/generic/sidebar.scss (renamed from app/assets/stylesheets/generic/nav_sidebar.scss)24
-rw-r--r--app/assets/stylesheets/pages/profile.scss2
-rw-r--r--app/assets/stylesheets/themes/dark-theme.scss63
-rw-r--r--app/assets/stylesheets/themes/gitlab-theme.scss75
-rw-r--r--app/assets/stylesheets/themes/ui_basic.scss24
-rw-r--r--app/assets/stylesheets/themes/ui_blue.scss2
-rw-r--r--app/assets/stylesheets/themes/ui_color.scss2
-rw-r--r--app/assets/stylesheets/themes/ui_gray.scss2
-rw-r--r--app/assets/stylesheets/themes/ui_mars.scss2
-rw-r--r--app/assets/stylesheets/themes/ui_modern.scss2
-rw-r--r--app/controllers/snippets_controller.rb36
-rw-r--r--app/helpers/application_helper.rb8
-rw-r--r--app/helpers/nav_helper.rb16
-rw-r--r--app/views/explore/projects/trending.html.haml8
-rw-r--r--app/views/layouts/_empty_head_panel.html.haml5
-rw-r--r--app/views/layouts/_head_panel.html.haml3
-rw-r--r--app/views/layouts/_page.html.haml30
-rw-r--r--app/views/layouts/_public_head_panel.html.haml3
-rw-r--r--app/views/layouts/devise.html.haml2
-rw-r--r--app/views/layouts/explore.html.haml22
-rw-r--r--app/views/layouts/nav/_explore.html.haml18
-rw-r--r--app/views/layouts/nav/_snippets.html.haml11
-rw-r--r--app/views/layouts/navless.html.haml5
-rw-r--r--app/views/layouts/snippets.html.haml6
-rw-r--r--app/views/profiles/design.html.haml6
-rw-r--r--app/views/snippets/current_user_index.html.haml51
-rw-r--r--app/views/snippets/index.html.haml1
-rw-r--r--config/routes.rb3
-rw-r--r--features/steps/snippets/user.rb6
-rw-r--r--spec/routing/routing_spec.rb2
33 files changed, 290 insertions, 248 deletions
diff --git a/app/assets/javascripts/sidebar.js.coffee b/app/assets/javascripts/sidebar.js.coffee
index 2e3f5608257..fb08016fbae 100644
--- a/app/assets/javascripts/sidebar.js.coffee
+++ b/app/assets/javascripts/sidebar.js.coffee
@@ -4,6 +4,7 @@ $(document).on("click", '.toggle-nav-collapse', (e) ->
expanded = 'page-sidebar-expanded'
$('.page-with-sidebar').toggleClass("#{collapsed} #{expanded}")
+ $('header').toggleClass("header-collapsed header-expanded")
$('.toggle-nav-collapse i').toggleClass("fa-angle-right fa-angle-left")
$.cookie("collapsed_nav", $('.page-with-sidebar').hasClass(collapsed), { path: '/' })
)
diff --git a/app/assets/stylesheets/base/mixins.scss b/app/assets/stylesheets/base/mixins.scss
index 216f25cdcd5..feff931156c 100644
--- a/app/assets/stylesheets/base/mixins.scss
+++ b/app/assets/stylesheets/base/mixins.scss
@@ -50,13 +50,6 @@
@include box-shadow(0 0 0 3px #f1f1f1);
}
-@mixin header-font {
- color: $style_color;
- font-size: 16px;
- line-height: 44px;
- font-weight: normal;
-}
-
@mixin md-typography {
font-size: 15px;
line-height: 1.5;
diff --git a/app/assets/stylesheets/pages/header.scss b/app/assets/stylesheets/generic/header.scss
index dde19b801f8..a86c01d4ce5 100644
--- a/app/assets/stylesheets/pages/header.scss
+++ b/app/assets/stylesheets/generic/header.scss
@@ -11,9 +11,55 @@ header {
width: 100%;
.navbar-inner {
+ background: #FFF;
+ border-bottom: 1px solid #DDD;
filter: none;
+ .title {
+ position: relative;
+ float: left;
+ margin: 0;
+ margin-left: 25px;
+ font-size: 18px;
+ line-height: 44px;
+ font-weight: normal;
+ color: #555;
+
+ @include str-truncated(37%);
+
+ a {
+ color: #555;
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+ }
+
+ .app_logo {
+ border-bottom: 1px solid transparent;
+ margin-bottom: -1px;
+
+ a {
+ padding: 5px 8px;
+
+ img {
+ float: left;
+ }
+
+ h3 {
+ width: 158px;
+ float: left;
+ margin: 0;
+ margin-left: 20px;
+ font-size: 18px;
+ line-height: 34px;
+ font-weight: normal;
+ }
+ }
+ }
+
.nav > li > a {
+ color: #666;
font-size: 14px;
line-height: 32px;
padding: 6px 10px;
@@ -100,10 +146,8 @@ header {
a {
float: left;
- padding: 5px 0;
height: 46px;
- width: 52px;
- text-align: center;
+ width: 100%;
img {
width: 36px;
@@ -115,20 +159,6 @@ header {
}
}
- /**
- *
- * Project / Area name
- *
- */
- .title {
- position: relative;
- float: left;
- margin: 0;
- margin-left: 5px;
- @include header-font;
- @include str-truncated(37%);
- }
-
.profile-pic {
padding: 0px !important;
width: 46px;
@@ -164,9 +194,10 @@ header {
padding-left: 25px;
font-size: 13px;
@include border-radius(3px);
- border: 1px solid #c6c6c6;
+ border: 1px solid #DDD;
box-shadow: none;
@include transition(all 0.15s ease-in 0s);
+ background-color: #f5f5f5;
}
}
}
@@ -192,3 +223,26 @@ header {
right: 35px !important;
}
}
+
+@media (max-width: $screen-md-max) {
+ .header-collapsed, .header-expanded {
+ width: 52px;
+
+ h3 {
+ display: none;
+ }
+ }
+}
+
+@media(min-width: $screen-md-max) {
+ .header-collapsed {
+ width: 52px;
+
+ h3 {
+ display: none;
+ }
+ }
+
+ .header-expanded {
+ }
+}
diff --git a/app/assets/stylesheets/generic/nav_sidebar.scss b/app/assets/stylesheets/generic/sidebar.scss
index 3bcb7b81333..36552083851 100644
--- a/app/assets/stylesheets/generic/nav_sidebar.scss
+++ b/app/assets/stylesheets/generic/sidebar.scss
@@ -6,7 +6,6 @@
top: 0;
left: 0;
height: 100%;
- border-right: 1px solid $border-color;
}
}
@@ -38,28 +37,10 @@
}
.nav-sidebar li {
- &.active a {
- color: $text-color;
- background: #FFF !important;
- font-weight: bold;
- border: 1px solid #EEE;
- border-right: 1px solid transparent;
- border-left: 3px solid $style_color;
-
- &.no-highlight {
- background: none !important;
- border: none;
- }
-
- i {
- color: $text-color;
- }
- }
}
.nav-sidebar li {
&.separate-item {
- border-top: 1px solid $border-color;
padding-top: 10px;
margin-top: 10px;
}
@@ -75,8 +56,6 @@
&:hover {
text-decoration: none;
- color: $text-color;
- background: $border-color;
}
&:active, &:focus {
@@ -158,9 +137,6 @@
left: 198px;
font-size: 13px;
background: transparent;
- color: black;
- border-left: 1px solid $border-color;
- border-bottom: 1px solid $border-color;
}
.collapse-nav a:hover {
diff --git a/app/assets/stylesheets/pages/profile.scss b/app/assets/stylesheets/pages/profile.scss
index 65655d4bfa3..280e8b57174 100644
--- a/app/assets/stylesheets/pages/profile.scss
+++ b/app/assets/stylesheets/pages/profile.scss
@@ -37,7 +37,7 @@
}
&.default {
- background: #f1f1f1;
+ background: #888888;
}
&.modern {
diff --git a/app/assets/stylesheets/themes/dark-theme.scss b/app/assets/stylesheets/themes/dark-theme.scss
deleted file mode 100644
index b7b22a8724e..00000000000
--- a/app/assets/stylesheets/themes/dark-theme.scss
+++ /dev/null
@@ -1,63 +0,0 @@
-@mixin dark-theme($color-light, $color, $color-darker, $color-dark) {
- header {
- &.navbar-gitlab {
- .navbar-inner {
- background: $color;
-
- .navbar-toggle {
- color: #FFF;
- }
-
- .app_logo, .navbar-toggle {
- &:hover {
- background-color: $color-darker;
- }
- }
-
- .app_logo {
- background-color: $color-dark;
- }
-
- .title {
- color: #FFF;
-
- a {
- color: #FFF;
- &:hover {
- text-decoration: underline;
- }
- }
- }
-
- .search {
- .search-input {
- background-color: $color-light;
- background-color: rgba(255, 255, 255, 0.5);
- border: 1px solid $color-light;
-
- &:focus {
- background-color: white;
- }
- }
- }
-
- .search-input::-webkit-input-placeholder {
- color: #666;
- }
-
- .nav > li > a {
- color: $color-light;
-
- &:hover, &:focus, &:active {
- background: none;
- color: #FFF;
- }
- }
-
- .search-input {
- border-color: $color-light;
- }
- }
- }
- }
-}
diff --git a/app/assets/stylesheets/themes/gitlab-theme.scss b/app/assets/stylesheets/themes/gitlab-theme.scss
new file mode 100644
index 00000000000..929c4fa9c30
--- /dev/null
+++ b/app/assets/stylesheets/themes/gitlab-theme.scss
@@ -0,0 +1,75 @@
+@mixin gitlab-theme($color-light, $color, $color-darker, $color-dark) {
+ header {
+ &.navbar-gitlab {
+ .navbar-inner {
+ .navbar-toggle {
+ color: #FFF;
+ }
+
+ .app_logo, .navbar-toggle {
+ a {
+ color: $color-light;
+ }
+ background-color: $color-darker;
+
+ &:hover {
+ background-color: $color-dark;
+ a {
+ color: #FFF;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ .page-with-sidebar {
+ background: $color-darker;
+
+ .collapse-nav a {
+ color: #FFF;
+ background: $color;
+ }
+
+ .sidebar-wrapper {
+ background: $color-darker;
+ border-right: 1px solid $color-darker;
+ }
+
+ .nav-sidebar li {
+ a {
+ color: $color-light;
+
+ &:hover, &:focus, &:active {
+ background: $color-dark;
+ }
+
+ i {
+ color: $color-light;
+ }
+
+ .count {
+ color: $color-light;
+ background: $color-dark;
+ }
+ }
+
+ &.separate-item {
+ border-top: 1px solid $color;
+ }
+
+ &.active a {
+ color: #FFF;
+ font-weight: bold;
+
+ &.no-highlight {
+ border: none;
+ }
+
+ i {
+ color: #FFF
+ }
+ }
+ }
+ }
+}
diff --git a/app/assets/stylesheets/themes/ui_basic.scss b/app/assets/stylesheets/themes/ui_basic.scss
index 097d5c5b73c..63e8dce1e92 100644
--- a/app/assets/stylesheets/themes/ui_basic.scss
+++ b/app/assets/stylesheets/themes/ui_basic.scss
@@ -4,27 +4,5 @@
*
*/
.ui_basic {
- header {
- &.navbar-gitlab {
- .navbar-inner {
- background: #F1F1F1;
- border-bottom: 1px solid #DDD;
-
- .title {
- color: #555;
-
- a {
- color: #555;
- &:hover {
- text-decoration: underline;
- }
- }
- }
-
- .nav > li > a {
- color: $style_color;
- }
- }
- }
- }
+ @include gitlab-theme(#CCCCCC, #888888, #777777, #666666);
}
diff --git a/app/assets/stylesheets/themes/ui_blue.scss b/app/assets/stylesheets/themes/ui_blue.scss
index e223058be8b..cf995622b6b 100644
--- a/app/assets/stylesheets/themes/ui_blue.scss
+++ b/app/assets/stylesheets/themes/ui_blue.scss
@@ -2,5 +2,5 @@
* Blue GitLab UI theme
*/
.ui_blue {
- @include dark-theme(#BECDE9, #2980b9, #1970a9, #096099);
+ @include gitlab-theme(#BECDE9, #2980b9, #1970a9, #096099);
}
diff --git a/app/assets/stylesheets/themes/ui_color.scss b/app/assets/stylesheets/themes/ui_color.scss
index 7ac6903b2e4..6babccec0da 100644
--- a/app/assets/stylesheets/themes/ui_color.scss
+++ b/app/assets/stylesheets/themes/ui_color.scss
@@ -2,5 +2,5 @@
* Violet GitLab UI theme
*/
.ui_color {
- @include dark-theme(#98C, #548, #436, #325);
+ @include gitlab-theme(#98C, #548, #436, #325);
}
diff --git a/app/assets/stylesheets/themes/ui_gray.scss b/app/assets/stylesheets/themes/ui_gray.scss
index 9257e5f4d40..f8e4a6ea7da 100644
--- a/app/assets/stylesheets/themes/ui_gray.scss
+++ b/app/assets/stylesheets/themes/ui_gray.scss
@@ -2,5 +2,5 @@
* Gray GitLab UI theme
*/
.ui_gray {
- @include dark-theme(#979797, #373737, #272727, #222222);
+ @include gitlab-theme(#979797, #373737, #272727, #222222);
}
diff --git a/app/assets/stylesheets/themes/ui_mars.scss b/app/assets/stylesheets/themes/ui_mars.scss
index 4caf5843d9b..fda96b64cd9 100644
--- a/app/assets/stylesheets/themes/ui_mars.scss
+++ b/app/assets/stylesheets/themes/ui_mars.scss
@@ -2,5 +2,5 @@
* Classic GitLab UI theme
*/
.ui_mars {
- @include dark-theme(#979DA7, #474D57, #373D47, #24272D);
+ @include gitlab-theme(#979DA7, #474D57, #373D47, #24272D);
}
diff --git a/app/assets/stylesheets/themes/ui_modern.scss b/app/assets/stylesheets/themes/ui_modern.scss
index 70449882317..8261e80b35f 100644
--- a/app/assets/stylesheets/themes/ui_modern.scss
+++ b/app/assets/stylesheets/themes/ui_modern.scss
@@ -2,5 +2,5 @@
* Modern GitLab UI theme
*/
.ui_modern {
- @include dark-theme(#ADC, #019875, #018865, #017855);
+ @include gitlab-theme(#ADC, #019875, #018865, #017855);
}
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb
index 1eff3dd29de..a5259466cb8 100644
--- a/app/controllers/snippets_controller.rb
+++ b/app/controllers/snippets_controller.rb
@@ -16,24 +16,24 @@ class SnippetsController < ApplicationController
layout :determine_layout
def index
- @snippets = SnippetsFinder.new.execute(current_user, filter: :all).page(params[:page]).per(PER_PAGE)
- end
-
- def user_index
- @user = User.find_by(username: params[:username])
-
- render_404 and return unless @user
-
- @snippets = SnippetsFinder.new.execute(current_user, {
- filter: :by_user,
- user: @user,
- scope: params[:scope] }).
- page(params[:page]).per(PER_PAGE)
-
- if @user == current_user
- render 'current_user_index'
+ if params[:username].present?
+ @user = User.find_by(username: params[:username])
+
+ render_404 and return unless @user
+
+ @snippets = SnippetsFinder.new.execute(current_user, {
+ filter: :by_user,
+ user: @user,
+ scope: params[:scope] }).
+ page(params[:page]).per(PER_PAGE)
+
+ if @user == current_user
+ render 'current_user_index'
+ else
+ render 'user_index'
+ end
else
- render 'user_index'
+ @snippets = SnippetsFinder.new.execute(current_user, filter: :all).page(params[:page]).per(PER_PAGE)
end
end
@@ -108,6 +108,6 @@ class SnippetsController < ApplicationController
end
def determine_layout
- current_user ? 'navless' : 'public_users'
+ current_user ? 'snippets' : 'public_users'
end
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 2b41d421610..a6844b2a47b 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -318,12 +318,4 @@ module ApplicationHelper
profile_key_path(key)
end
end
-
- def nav_sidebar_class
- if nav_menu_collapsed?
- "page-sidebar-collapsed"
- else
- "page-sidebar-expanded"
- end
- end
end
diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb
index 2b03269800e..9b1dd8b8e54 100644
--- a/app/helpers/nav_helper.rb
+++ b/app/helpers/nav_helper.rb
@@ -2,4 +2,20 @@ module NavHelper
def nav_menu_collapsed?
cookies[:collapsed_nav] == 'true'
end
+
+ def nav_sidebar_class
+ if nav_menu_collapsed?
+ "page-sidebar-collapsed"
+ else
+ "page-sidebar-expanded"
+ end
+ end
+
+ def nav_header_class
+ if nav_menu_collapsed?
+ "header-collapsed"
+ else
+ "header-expanded"
+ end
+ end
end
diff --git a/app/views/explore/projects/trending.html.haml b/app/views/explore/projects/trending.html.haml
index 9cad9238933..18749ac00ae 100644
--- a/app/views/explore/projects/trending.html.haml
+++ b/app/views/explore/projects/trending.html.haml
@@ -1,3 +1,9 @@
+.explore-title
+ %h3
+ Explore GitLab
+ %p.lead
+ Discover projects and groups. Share your projects with others
+%hr
.explore-trending-block
%p.lead
%i.fa.fa-comments-o
@@ -7,5 +13,5 @@
%ul.bordered-list
= render @trending_projects
- .center
+ .center.append-bottom-20
= link_to 'Show all projects', explore_projects_path, class: 'btn btn-primary'
diff --git a/app/views/layouts/_empty_head_panel.html.haml b/app/views/layouts/_empty_head_panel.html.haml
new file mode 100644
index 00000000000..b81c2d0364b
--- /dev/null
+++ b/app/views/layouts/_empty_head_panel.html.haml
@@ -0,0 +1,5 @@
+%header.navbar.navbar-fixed-top.navbar-gitlab
+ .navbar-inner
+ .container
+ %h4.center
+ = image_tag 'logo-white.png', width: 32, height: 32
diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml
index d58582c107a..281ce31fe9c 100644
--- a/app/views/layouts/_head_panel.html.haml
+++ b/app/views/layouts/_head_panel.html.haml
@@ -1,9 +1,10 @@
-%header.navbar.navbar-fixed-top.navbar-gitlab
+%header.navbar.navbar-fixed-top.navbar-gitlab{ class: nav_header_class }
.navbar-inner
.container
%div.app_logo
= link_to root_path, class: "home has_bottom_tooltip", title: "Dashboard" do
= brand_header_logo
+ %h3 GitLab
%h1.title= title
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", type: "button"}
diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml
index 422966cdc55..1c164800b0e 100644
--- a/app/views/layouts/_page.html.haml
+++ b/app/views/layouts/_page.html.haml
@@ -1,20 +1,18 @@
-- if defined?(sidebar)
- .page-with-sidebar{ class: nav_sidebar_class }
- = render "layouts/broadcast"
- .sidebar-wrapper
+.page-with-sidebar{ class: nav_sidebar_class }
+ = render "layouts/broadcast"
+ .sidebar-wrapper
+ - if defined?(sidebar)
= render(sidebar)
- .collapse-nav
- = render partial: 'layouts/collapse_button'
- .content-wrapper
- .container-fluid
- .content
- = render "layouts/flash"
- .clearfix
- = yield
-- else
- .container.navless-container
- .content
- = yield
+ - elsif current_user
+ = render 'layouts/nav/dashboard'
+ .collapse-nav
+ = render partial: 'layouts/collapse_button'
+ .content-wrapper
+ .container-fluid
+ .content
+ = render "layouts/flash"
+ .clearfix
+ = yield
= yield :embedded_scripts
diff --git a/app/views/layouts/_public_head_panel.html.haml b/app/views/layouts/_public_head_panel.html.haml
index 3d6d2bfc00a..98a87a39bd4 100644
--- a/app/views/layouts/_public_head_panel.html.haml
+++ b/app/views/layouts/_public_head_panel.html.haml
@@ -1,9 +1,10 @@
-%header.navbar.navbar-fixed-top.navbar-gitlab
+%header.navbar.navbar-fixed-top.navbar-gitlab{ class: nav_header_class }
.navbar-inner
.container
%div.app_logo
= link_to explore_root_path, class: "home" do
= brand_header_logo
+ %h3 GitLab
%h1.title= title
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", type: "button"}
diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml
index 6f805f1c9d1..5a59c9fd59a 100644
--- a/app/views/layouts/devise.html.haml
+++ b/app/views/layouts/devise.html.haml
@@ -2,8 +2,8 @@
%html{ lang: "en"}
= render "layouts/head"
%body.ui_mars.login-page.application
+ = render "layouts/empty_head_panel"
= render "layouts/broadcast"
- = render "layouts/public_head_panel", title: ''
.container.navless-container
.content
= render "layouts/flash"
diff --git a/app/views/layouts/explore.html.haml b/app/views/layouts/explore.html.haml
index 2bd0b8d85c9..ca79382324e 100644
--- a/app/views/layouts/explore.html.haml
+++ b/app/views/layouts/explore.html.haml
@@ -1,4 +1,4 @@
-- page_title = 'Explore'
+- page_title = 'Explore GitLab'
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: page_title
@@ -8,23 +8,5 @@
= render "layouts/head_panel", title: link_to(page_title, explore_root_path)
- else
= render "layouts/public_head_panel", title: link_to(page_title, explore_root_path)
- .container.navless-container
- .content
- .explore-title
- %h3
- Explore GitLab
- %p.lead
- Discover projects and groups. Share your projects with others
-
- %ul.nav.nav-tabs
- = nav_link(path: 'projects#trending') do
- = link_to 'Trending Projects', explore_root_path
- = nav_link(path: 'projects#starred') do
- = link_to 'Most Starred Projects', starred_explore_projects_path
- = nav_link(path: 'projects#index') do
- = link_to 'All Projects', explore_projects_path
- = nav_link(controller: :groups) do
- = link_to 'All Groups', explore_groups_path
-
- = yield
+ = render 'layouts/page', sidebar: 'layouts/nav/explore'
diff --git a/app/views/layouts/nav/_explore.html.haml b/app/views/layouts/nav/_explore.html.haml
new file mode 100644
index 00000000000..7ab370dbcd0
--- /dev/null
+++ b/app/views/layouts/nav/_explore.html.haml
@@ -0,0 +1,18 @@
+%ul.nav.nav-sidebar
+ = nav_link(path: 'projects#trending') do
+ = link_to explore_root_path do
+ %i.fa.fa-comments
+ %span Trending Projects
+ = nav_link(path: 'projects#starred') do
+ = link_to starred_explore_projects_path do
+ %i.fa.fa-star
+ %span Most Starred Projects
+ = nav_link(path: 'projects#index') do
+ = link_to explore_projects_path do
+ %i.fa.fa-bookmark
+ %span All Projects
+ = nav_link(controller: :groups) do
+ = link_to explore_groups_path do
+ %i.fa.fa-group
+ %span All Groups
+
diff --git a/app/views/layouts/nav/_snippets.html.haml b/app/views/layouts/nav/_snippets.html.haml
new file mode 100644
index 00000000000..e71967bc725
--- /dev/null
+++ b/app/views/layouts/nav/_snippets.html.haml
@@ -0,0 +1,11 @@
+%ul.nav.nav-sidebar
+ = nav_link(path: user_snippets_path(current_user), html_options: {class: 'home'}) do
+ = link_to user_snippets_path(current_user), title: 'Your snippets' do
+ %i.fa.fa-dashboard
+ %span
+ Your Snippets
+ = nav_link(path: snippets_path) do
+ = link_to snippets_path, title: 'Discover snippets' do
+ %i.fa.fa-globe
+ %span
+ Discover Snippets
diff --git a/app/views/layouts/navless.html.haml b/app/views/layouts/navless.html.haml
index 4d0278251a6..10a0fcea2f8 100644
--- a/app/views/layouts/navless.html.haml
+++ b/app/views/layouts/navless.html.haml
@@ -4,7 +4,4 @@
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/broadcast"
= render "layouts/head_panel", title: defined?(@title_url) ? link_to(@title, @title_url) : @title
- .container.navless-container
- .content
- = render "layouts/flash"
- = yield
+ = render 'layouts/page'
diff --git a/app/views/layouts/snippets.html.haml b/app/views/layouts/snippets.html.haml
new file mode 100644
index 00000000000..fbd29eb23a7
--- /dev/null
+++ b/app/views/layouts/snippets.html.haml
@@ -0,0 +1,6 @@
+!!! 5
+%html{ lang: "en"}
+ = render "layouts/head", title: "Dashboard"
+ %body{class: "#{app_theme} application", :'data-page' => body_data_page }
+ = render "layouts/head_panel", title: link_to("Snippets", snippets_path)
+ = render 'layouts/page', sidebar: 'layouts/nav/snippets'
diff --git a/app/views/profiles/design.html.haml b/app/views/profiles/design.html.haml
index cc00d08d03b..646576c3164 100644
--- a/app/views/profiles/design.html.haml
+++ b/app/views/profiles/design.html.haml
@@ -12,17 +12,17 @@
= label_tag do
.prev.default
= f.radio_button :theme_id, 1
- Default
+ Graphite
= label_tag do
.prev.classic
= f.radio_button :theme_id, 2
- Classic
+ Charcoal
= label_tag do
.prev.modern
= f.radio_button :theme_id, 3
- Modern
+ Green
= label_tag do
.prev.gray
diff --git a/app/views/snippets/current_user_index.html.haml b/app/views/snippets/current_user_index.html.haml
index 0df5ade500d..6bb2237a759 100644
--- a/app/views/snippets/current_user_index.html.haml
+++ b/app/views/snippets/current_user_index.html.haml
@@ -3,37 +3,32 @@
.pull-right
= link_to new_snippet_path, class: "btn btn-new btn-grouped", title: "New Snippet" do
Add new snippet
- = link_to snippets_path, class: "btn btn-grouped" do
- Discover snippets
%p.light
Share code pastes with others out of git repository
-%hr
-.row
- .col-md-3
- %ul.nav.nav-pills.nav-stacked
- = nav_tab :scope, nil do
- = link_to user_snippets_path(@user) do
- All
- %span.pull-right
- = @user.snippets.count
- = nav_tab :scope, 'are_private' do
- = link_to user_snippets_path(@user, scope: 'are_private') do
- Private
- %span.pull-right
- = @user.snippets.are_private.count
- = nav_tab :scope, 'are_internal' do
- = link_to user_snippets_path(@user, scope: 'are_internal') do
- Internal
- %span.pull-right
- = @user.snippets.are_internal.count
- = nav_tab :scope, 'are_public' do
- = link_to user_snippets_path(@user, scope: 'are_public') do
- Public
- %span.pull-right
- = @user.snippets.are_public.count
+%ul.nav.nav-tabs
+ = nav_tab :scope, nil do
+ = link_to user_snippets_path(@user) do
+ All
+ %span.badge
+ = @user.snippets.count
+ = nav_tab :scope, 'are_private' do
+ = link_to user_snippets_path(@user, scope: 'are_private') do
+ Private
+ %span.badge
+ = @user.snippets.are_private.count
+ = nav_tab :scope, 'are_internal' do
+ = link_to user_snippets_path(@user, scope: 'are_internal') do
+ Internal
+ %span.badge
+ = @user.snippets.are_internal.count
+ = nav_tab :scope, 'are_public' do
+ = link_to user_snippets_path(@user, scope: 'are_public') do
+ Public
+ %span.badge
+ = @user.snippets.are_public.count
- .col-md-9.my-snippets
- = render 'snippets'
+.my-snippets
+ = render 'snippets'
diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml
index 5cd8ae26cf9..108dd0cca3e 100644
--- a/app/views/snippets/index.html.haml
+++ b/app/views/snippets/index.html.haml
@@ -2,7 +2,6 @@
Public snippets
.pull-right
-
- if current_user
= link_to new_snippet_path, class: "btn btn-new btn-grouped", title: "New Snippet" do
Add new snippet
diff --git a/config/routes.rb b/config/routes.rb
index 82b376aecbc..86939a1d7ea 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -52,7 +52,8 @@ Gitlab::Application.routes.draw do
get 'raw'
end
end
- get '/s/:username' => 'snippets#user_index', as: :user_snippets, constraints: { username: /.*/ }
+
+ get '/s/:username' => 'snippets#index', as: :user_snippets, constraints: { username: /.*/ }
#
# Invites
diff --git a/features/steps/snippets/user.rb b/features/steps/snippets/user.rb
index 866f637ab6c..146cc535d88 100644
--- a/features/steps/snippets/user.rb
+++ b/features/steps/snippets/user.rb
@@ -32,19 +32,19 @@ class Spinach::Features::SnippetsUser < Spinach::FeatureSteps
end
step 'I click "Internal" filter' do
- within('.nav-stacked') do
+ within('.nav-tabs') do
click_link "Internal"
end
end
step 'I click "Private" filter' do
- within('.nav-stacked') do
+ within('.nav-tabs') do
click_link "Private"
end
end
step 'I click "Public" filter' do
- within('.nav-stacked') do
+ within('.nav-tabs') do
click_link "Public"
end
end
diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb
index e219a57c29e..953c8dd8ddc 100644
--- a/spec/routing/routing_spec.rb
+++ b/spec/routing/routing_spec.rb
@@ -28,7 +28,7 @@ end
# DELETE /snippets/:id(.:format) snippets#destroy
describe SnippetsController, "routing" do
it "to #user_index" do
- expect(get("/s/User")).to route_to('snippets#user_index', username: 'User')
+ expect(get("/s/User")).to route_to('snippets#index', username: 'User')
end
it "to #raw" do