summaryrefslogtreecommitdiff
path: root/app/views/snippets
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-09-08 14:49:20 +0100
committerDouwe Maan <douwe@gitlab.com>2015-09-08 14:49:20 +0100
commit5d785457db3017a17722314a52433543dd925164 (patch)
treea030699b752fcd1f161118be70a9df0f625fa0ef /app/views/snippets
parent260fcd45209b59ace6b3fd6dcca6c32c2c75a8f1 (diff)
downloadgitlab-ce-5d785457db3017a17722314a52433543dd925164.tar.gz
Clean up overlap between dashboard and explore.
- Split up SnippetsController into separate dashboard and explore sections. - Use consistent page titles, header titles and sidebars between dashboard and explore sections when signed in or not.
Diffstat (limited to 'app/views/snippets')
-rw-r--r--app/views/snippets/_head.html.haml7
-rw-r--r--app/views/snippets/current_user_index.html.haml36
-rw-r--r--app/views/snippets/index.html.haml24
-rw-r--r--app/views/snippets/show.html.haml4
-rw-r--r--app/views/snippets/user_index.html.haml13
5 files changed, 13 insertions, 71 deletions
diff --git a/app/views/snippets/_head.html.haml b/app/views/snippets/_head.html.haml
deleted file mode 100644
index 0adf6b91f2c..00000000000
--- a/app/views/snippets/_head.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-%ul.center-top-menu
- = nav_link(page: user_snippets_path(current_user), html_options: {class: 'home'}) do
- = link_to user_snippets_path(current_user), title: 'Your snippets', data: {placement: 'right'} do
- Your Snippets
- = nav_link(page: snippets_path) do
- = link_to snippets_path, title: 'Explore snippets', data: {placement: 'right'} do
- Explore Snippets
diff --git a/app/views/snippets/current_user_index.html.haml b/app/views/snippets/current_user_index.html.haml
deleted file mode 100644
index d704407c4dd..00000000000
--- a/app/views/snippets/current_user_index.html.haml
+++ /dev/null
@@ -1,36 +0,0 @@
-- page_title "Your Snippets"
-= render 'head'
-
-.gray-content-block
- .pull-right
- = link_to new_snippet_path, class: "btn btn-new", title: "New Snippet" do
- Add new snippet
-
- .oneline
- Share code pastes with others out of git repository
-
-%ul.nav.nav-tabs.prepend-top-20
- = 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
-
-.my-snippets
- = render 'snippets'
-
diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml
index 3b62dd2a6e1..7e4918a6085 100644
--- a/app/views/snippets/index.html.haml
+++ b/app/views/snippets/index.html.haml
@@ -1,15 +1,13 @@
-- page_title "Public Snippets"
-- if current_user
- = render 'head'
-
-.gray-content-block
- - if current_user
- .pull-right
- = link_to new_snippet_path, class: "btn btn-new", title: "New Snippet" do
- Add new snippet
-
- .oneline
- Public snippets created by you and other users are listed here
+- page_title "By #{@user.name}", "Snippets"
+
+%ol.breadcrumb
+ %li
+ = link_to snippets_path do
+ Snippets
+ %li
+ = @user.name
+ .pull-right.hidden-xs
+ = link_to user_path(@user) do
+ #{@user.name} profile page
= render 'snippets'
-
diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml
index aed00f9caeb..97374e073dc 100644
--- a/app/views/snippets/show.html.haml
+++ b/app/views/snippets/show.html.haml
@@ -20,10 +20,10 @@
.back-link
- if @snippet.author == current_user
- = link_to user_snippets_path(current_user) do
+ = link_to dashboard_snippets_path do
&larr; your snippets
- else
- = link_to snippets_path do
+ = link_to explore_snippets_path do
&larr; explore snippets
.file-holder
diff --git a/app/views/snippets/user_index.html.haml b/app/views/snippets/user_index.html.haml
deleted file mode 100644
index 7af5352da34..00000000000
--- a/app/views/snippets/user_index.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-- page_title "Snippets", @user.name
-
-%ol.breadcrumb
- %li
- = link_to snippets_path do
- Snippets
- %li
- = @user.name
- .pull-right.hidden-xs
- = link_to user_path(@user) do
- #{@user.name} profile page
-
-= render 'snippets'