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
cc5440e8
Commit
cc5440e8
authored
Jun 18, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use navless layout for snippets page
parent
68b601f6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
24 deletions
+19
-24
app/controllers/snippets_controller.rb
app/controllers/snippets_controller.rb
+8
-0
app/views/layouts/snippets.html.haml
app/views/layouts/snippets.html.haml
+0
-20
app/views/snippets/current_user_index.html.haml
app/views/snippets/current_user_index.html.haml
+5
-2
app/views/snippets/index.html.haml
app/views/snippets/index.html.haml
+6
-2
No files found.
app/controllers/snippets_controller.rb
View file @
cc5440e8
...
@@ -7,8 +7,12 @@ class SnippetsController < ApplicationController
...
@@ -7,8 +7,12 @@ class SnippetsController < ApplicationController
# Allow destroy snippet
# Allow destroy snippet
before_filter
:authorize_admin_snippet!
,
only:
[
:destroy
]
before_filter
:authorize_admin_snippet!
,
only:
[
:destroy
]
before_filter
:set_title
respond_to
:html
respond_to
:html
layout
'navless'
def
index
def
index
@snippets
=
Snippet
.
public
.
fresh
.
non_expired
.
page
(
params
[
:page
]).
per
(
20
)
@snippets
=
Snippet
.
public
.
fresh
.
non_expired
.
page
(
params
[
:page
]).
per
(
20
)
end
end
...
@@ -98,4 +102,8 @@ class SnippetsController < ApplicationController
...
@@ -98,4 +102,8 @@ class SnippetsController < ApplicationController
def
authorize_admin_snippet!
def
authorize_admin_snippet!
return
render_404
unless
can?
(
current_user
,
:admin_personal_snippet
,
@snippet
)
return
render_404
unless
can?
(
current_user
,
:admin_personal_snippet
,
@snippet
)
end
end
def
set_title
@title
=
'Snippets'
end
end
end
app/views/layouts/snippets.html.haml
deleted
100644 → 0
View file @
68b601f6
!!! 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
app/views/snippets/current_user_index.html.haml
View file @
cc5440e8
%h3
.page_title
%h3
.page_title
My Snippets
My Snippets
%small
share code pastes with others out of git repository
%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
.pull-right
=
link_to
new_snippet_path
,
class:
"btn btn-small add_new grouped btn-primary"
,
title:
"New Snippet"
do
Add new snippet
Add new snippet
=
link_to
snippets_path
,
class:
"btn btn-small grouped"
do
Discover snippets
%hr
%hr
...
...
app/views/snippets/index.html.haml
View file @
cc5440e8
%h3
.page_title
%h3
.page_title
Public snippets
Public snippets
%small
share code pastes with others out of git repository
%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
.pull-right
=
link_to
new_snippet_path
,
class:
"btn btn-small add_new grouped btn-primary"
,
title:
"New Snippet"
do
Add new snippet
Add new snippet
=
link_to
user_snippets_path
(
current_user
),
class:
"btn btn-small grouped"
do
My snippets
%hr
%hr
.row
.row
...
...
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