Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/snippets_controller.rb8
-rw-r--r--app/models/issue.rb2
-rw-r--r--app/views/layouts/snippets.html.haml20
-rw-r--r--app/views/snippets/current_user_index.html.haml7
-rw-r--r--app/views/snippets/index.html.haml8
-rw-r--r--doc/api/README.md24
6 files changed, 32 insertions, 37 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb
index 49b740af046..b91f68aab5e 100644
--- a/app/controllers/snippets_controller.rb
+++ b/app/controllers/snippets_controller.rb
@@ -7,8 +7,12 @@ class SnippetsController < ApplicationController
# Allow destroy snippet
before_filter :authorize_admin_snippet!, only: [:destroy]
+ before_filter :set_title
+
respond_to :html
+ layout 'navless'
+
def index
@snippets = Snippet.public.fresh.non_expired.page(params[:page]).per(20)
end
@@ -98,4 +102,8 @@ class SnippetsController < ApplicationController
def authorize_admin_snippet!
return render_404 unless can?(current_user, :admin_personal_snippet, @snippet)
end
+
+ def set_title
+ @title = 'Snippets'
+ end
end
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 91dd6477b04..de6e015c68e 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -27,7 +27,7 @@ class Issue < ActiveRecord::Base
scope :cared, ->(user) { where(assignee_id: user) }
scope :authored, ->(user) { where(author_id: user) }
- scope :open_for, ->(user) { opened.assigned(user) }
+ scope :open_for, ->(user) { opened.assigned_to(user) }
state_machine :state, initial: :opened do
event :close do
diff --git a/app/views/layouts/snippets.html.haml b/app/views/layouts/snippets.html.haml
deleted file mode 100644
index e98aba445af..00000000000
--- a/app/views/layouts/snippets.html.haml
+++ /dev/null
@@ -1,20 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: "Snipepts"
- %body{class: "#{app_theme} application", :'data-page' => body_data_page}
- = render "layouts/head_panel", title: "Snippets"
- = render "layouts/flash"
- %nav.main-nav
- .container
- %ul
- = nav_link(path: 'snippets#user_index', html_options: {class: 'home'}) do
- = link_to user_snippets_path(current_user), title: "My Snippets" do
- %i.icon-home
- = nav_link(path: 'snippets#new') do
- = link_to new_snippet_path do
- New snippet
- = nav_link(path: 'snippets#index') do
- = link_to snippets_path do
- Discover snippets
- .container
- .content= yield
diff --git a/app/views/snippets/current_user_index.html.haml b/app/views/snippets/current_user_index.html.haml
index 912f4c77a4b..cf5c3084dc4 100644
--- a/app/views/snippets/current_user_index.html.haml
+++ b/app/views/snippets/current_user_index.html.haml
@@ -1,8 +1,11 @@
%h3.page_title
My Snippets
%small share code pastes with others out of git repository
- = link_to new_snippet_path, class: "btn btn-small add_new pull-right", title: "New Snippet" do
- Add new snippet
+ .pull-right
+ = link_to new_snippet_path, class: "btn btn-small add_new grouped btn-primary", title: "New Snippet" do
+ Add new snippet
+ = link_to snippets_path, class: "btn btn-small grouped" do
+ Discover snippets
%hr
diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml
index 97f7b39877e..4301f90f9d6 100644
--- a/app/views/snippets/index.html.haml
+++ b/app/views/snippets/index.html.haml
@@ -1,8 +1,12 @@
%h3.page_title
Public snippets
%small share code pastes with others out of git repository
- = link_to new_snippet_path, class: "btn btn-small add_new pull-right", title: "New Snippet" do
- Add new snippet
+
+ .pull-right
+ = link_to new_snippet_path, class: "btn btn-small add_new grouped btn-primary", title: "New Snippet" do
+ Add new snippet
+ = link_to user_snippets_path(current_user), class: "btn btn-small grouped" do
+ My snippets
%hr
.row
diff --git a/doc/api/README.md b/doc/api/README.md
index 9120fe3aea4..6faf6dcc7c2 100644
--- a/doc/api/README.md
+++ b/doc/api/README.md
@@ -69,15 +69,15 @@ When listing resources you can pass the following parameters:
## Contents
-+ [Users](doc/api/users.md)
-+ [Session](doc/api/session.md)
-+ [Projects](doc/api/projects.md)
-+ [Project Snippets](doc/api/project_snippets.md)
-+ [Repositories](doc/api/repositories.md)
-+ [Issues](doc/api/issues.md)
-+ [Milestones](doc/api/milestones.md)
-+ [Notes](doc/api/notes.md)
-+ [Deploy Keys](doc/api/deploy_keys.md)
-+ [System Hooks](doc/api/system_hooks.md)
-+ [Groups](doc/api/groups.md)
-+ [User Teams](doc/api/user_teams.md)
++ [Users](users.md)
++ [Session](session.md)
++ [Projects](projects.md)
++ [Project Snippets](project_snippets.md)
++ [Repositories](repositories.md)
++ [Issues](issues.md)
++ [Milestones](milestones.md)
++ [Notes](notes.md)
++ [Deploy Keys](deploy_keys.md)
++ [System Hooks](system_hooks.md)
++ [Groups](groups.md)
++ [User Teams](user_teams.md)