Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
79f8abc5
Commit
79f8abc5
authored
Jun 02, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace snippets scopes in view and controller.
parent
90c2e0d9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
app/controllers/snippets_controller.rb
app/controllers/snippets_controller.rb
+5
-5
app/views/snippets/current_user_index.html.haml
app/views/snippets/current_user_index.html.haml
+6
-6
No files found.
app/controllers/snippets_controller.rb
View file @
79f8abc5
...
...
@@ -26,15 +26,15 @@ class SnippetsController < ApplicationController
if
@user
==
current_user
@snippets
=
case
params
[
:scope
]
when
'public'
then
@snippets
.
public
when
'private'
then
@snippets
.
private
when
'
is_
public'
then
@snippets
.
is_
public
when
'
is_
private'
then
@snippets
.
is_
private
else
@snippets
end
else
@snippets
=
@snippets
.
public
@snippets
=
@snippets
.
is_
public
end
@snippets
=
@snippets
.
page
(
params
[
:page
]).
per
(
20
)
...
...
app/views/snippets/current_user_index.html.haml
View file @
79f8abc5
...
...
@@ -18,16 +18,16 @@
All
%span
.pull-right
=
@user
.
snippets
.
count
=
nav_tab
:scope
,
'private'
do
=
link_to
user_snippets_path
(
@user
,
scope:
'private'
)
do
=
nav_tab
:scope
,
'
is_
private'
do
=
link_to
user_snippets_path
(
@user
,
scope:
'
is_
private'
)
do
Private
%span
.pull-right
=
@user
.
snippets
.
private
.
count
=
nav_tab
:scope
,
'public'
do
=
link_to
user_snippets_path
(
@user
,
scope:
'public'
)
do
=
@user
.
snippets
.
is_
private
.
count
=
nav_tab
:scope
,
'
is_
public'
do
=
link_to
user_snippets_path
(
@user
,
scope:
'
is_
public'
)
do
Public
%span
.pull-right
=
@user
.
snippets
.
public
.
count
=
@user
.
snippets
.
is_
public
.
count
.col-md-9.my-snippets
=
render
'snippets'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment