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
Tatuya Kamada
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
Hide 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
...
@@ -26,15 +26,15 @@ class SnippetsController < ApplicationController
if
@user
==
current_user
if
@user
==
current_user
@snippets
=
case
params
[
:scope
]
@snippets
=
case
params
[
:scope
]
when
'public'
then
when
'
is_
public'
then
@snippets
.
public
@snippets
.
is_
public
when
'private'
then
when
'
is_
private'
then
@snippets
.
private
@snippets
.
is_
private
else
else
@snippets
@snippets
end
end
else
else
@snippets
=
@snippets
.
public
@snippets
=
@snippets
.
is_
public
end
end
@snippets
=
@snippets
.
page
(
params
[
:page
]).
per
(
20
)
@snippets
=
@snippets
.
page
(
params
[
:page
]).
per
(
20
)
...
...
app/views/snippets/current_user_index.html.haml
View file @
79f8abc5
...
@@ -18,16 +18,16 @@
...
@@ -18,16 +18,16 @@
All
All
%span
.pull-right
%span
.pull-right
=
@user
.
snippets
.
count
=
@user
.
snippets
.
count
=
nav_tab
:scope
,
'private'
do
=
nav_tab
:scope
,
'
is_
private'
do
=
link_to
user_snippets_path
(
@user
,
scope:
'private'
)
do
=
link_to
user_snippets_path
(
@user
,
scope:
'
is_
private'
)
do
Private
Private
%span
.pull-right
%span
.pull-right
=
@user
.
snippets
.
private
.
count
=
@user
.
snippets
.
is_
private
.
count
=
nav_tab
:scope
,
'public'
do
=
nav_tab
:scope
,
'
is_
public'
do
=
link_to
user_snippets_path
(
@user
,
scope:
'public'
)
do
=
link_to
user_snippets_path
(
@user
,
scope:
'
is_
public'
)
do
Public
Public
%span
.pull-right
%span
.pull-right
=
@user
.
snippets
.
public
.
count
=
@user
.
snippets
.
is_
public
.
count
.col-md-9.my-snippets
.col-md-9.my-snippets
=
render
'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