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
Jérome Perrin
gitlab-ce
Commits
57271da6
Commit
57271da6
authored
Feb 19, 2012
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wiki: design fixed
parent
4c1b8558
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
11 deletions
+18
-11
app/controllers/wikis_controller.rb
app/controllers/wikis_controller.rb
+1
-0
app/models/ability.rb
app/models/ability.rb
+5
-2
app/views/wikis/_form.html.haml
app/views/wikis/_form.html.haml
+6
-5
app/views/wikis/edit.html.haml
app/views/wikis/edit.html.haml
+0
-2
app/views/wikis/show.html.haml
app/views/wikis/show.html.haml
+6
-2
No files found.
app/controllers/wikis_controller.rb
View file @
57271da6
class
WikisController
<
ApplicationController
before_filter
:project
before_filter
:add_project_abilities
layout
"project"
def
show
...
...
app/models/ability.rb
View file @
57271da6
...
...
@@ -5,6 +5,7 @@ class Ability
when
"Issue"
then
issue_abilities
(
object
,
subject
)
when
"Note"
then
note_abilities
(
object
,
subject
)
when
"Snippet"
then
snippet_abilities
(
object
,
subject
)
when
"Wiki"
then
wiki_abilities
(
object
,
subject
)
else
[]
end
end
...
...
@@ -26,12 +27,14 @@ class Ability
:write_issue
,
:write_snippet
,
:write_merge_request
,
:write_note
:write_note
,
:write_wiki
]
if
project
.
allow_write_for?
(
user
)
rules
<<
[
:modify_issue
,
:modify_snippet
,
:modify_wiki
,
:admin_project
,
:admin_issue
,
:admin_snippet
,
...
...
@@ -48,7 +51,7 @@ class Ability
end
class
<<
self
[
:issue
,
:note
,
:snippet
,
:merge_request
].
each
do
|
name
|
[
:issue
,
:note
,
:snippet
,
:merge_request
,
:wiki
].
each
do
|
name
|
define_method
"
#{
name
}
_abilities"
do
|
user
,
subject
|
if
subject
.
author
==
user
[
...
...
app/views/wikis/_form.html.haml
View file @
57271da6
...
...
@@ -6,12 +6,13 @@
-
@wiki
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
.
field
.
clearfix
=
f
.
label
:title
=
f
.
text_field
:titl
e
.input
=
f
.
text_field
:title
,
:class
=>
:xxlarg
e
=
f
.
hidden_field
:slug
.
field
.
clearfix
=
f
.
label
:content
=
f
.
text_area
:content
.input
=
f
.
text_area
:content
,
:class
=>
:xxlarge
.actions
=
f
.
submit
'Save'
=
f
.
submit
'Save'
,
:class
=>
"primary btn"
=
link_to
"Cancel"
,
project_wiki_path
(
@project
,
:index
),
:class
=>
"btn"
app/views/wikis/edit.html.haml
View file @
57271da6
%h1
Editing page
=
render
'form'
=
link_to
'Show'
,
[
@project
,
@wiki
]
app/views/wikis/show.html.haml
View file @
57271da6
%h3
=
@wiki
.
title
-
if
can?
current_user
,
:write_wiki
,
@project
=
link_to
edit_project_wiki_path
(
@project
,
@wiki
),
:class
=>
"right btn small"
do
Edit
%p
#notice
=
notice
%h3
=
@wiki
.
title
=
@wiki
.
content
%br
=
link_to
'Edit'
,
edit_project_wiki_path
(
@project
,
@wiki
)
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