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
Léo-Paul Géneau
gitlab-ce
Commits
bdc42488
Commit
bdc42488
authored
Feb 20, 2012
by
vsizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wiki is done
parent
2e1f119f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
7 deletions
+42
-7
app/assets/stylesheets/main.scss
app/assets/stylesheets/main.scss
+2
-0
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+4
-0
app/assets/stylesheets/wiki.scss
app/assets/stylesheets/wiki.scss
+5
-0
app/controllers/wikis_controller.rb
app/controllers/wikis_controller.rb
+2
-3
app/helpers/wikis_helper.rb
app/helpers/wikis_helper.rb
+5
-0
app/views/wikis/show.html.haml
app/views/wikis/show.html.haml
+9
-3
config/routes.rb
config/routes.rb
+1
-1
db/schema.rb
db/schema.rb
+14
-0
No files found.
app/assets/stylesheets/main.scss
View file @
bdc42488
...
@@ -65,4 +65,6 @@ $hover: #FDF5D9;
...
@@ -65,4 +65,6 @@ $hover: #FDF5D9;
@import
"highlight.css.scss"
;
@import
"highlight.css.scss"
;
@import
"highlight.black.css.scss"
;
@import
"highlight.black.css.scss"
;
@import
"wiki.scss"
;
app/assets/stylesheets/projects.css.scss
View file @
bdc42488
...
@@ -221,3 +221,7 @@ input.git_clone_url {
...
@@ -221,3 +221,7 @@ input.git_clone_url {
width
:
270px
;
width
:
270px
;
background
:
#fff
!
important
;
background
:
#fff
!
important
;
}
}
.span12
hr
{
margin-top
:
2px
;
}
app/assets/stylesheets/wiki.scss
0 → 100644
View file @
bdc42488
p
.time
{
color
:
#999
;
font-size
:
90%
;
margin
:
30px
3px
3px
2px
;
}
app/controllers/wikis_controller.rb
View file @
bdc42488
...
@@ -42,11 +42,10 @@ class WikisController < ApplicationController
...
@@ -42,11 +42,10 @@ class WikisController < ApplicationController
end
end
def
destroy
def
destroy
@wiki
=
@project
.
wikis
.
find
(
params
[
:id
])
@wikis
=
@project
.
wikis
.
where
(
:slug
=>
params
[
:id
]).
delete_all
@wiki
.
destroy
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
{
redirect_to
wikis_url
}
format
.
html
{
redirect_to
project_wiki_path
(
@project
,
:index
),
notice:
"Page was successfully deleted"
}
end
end
end
end
end
end
app/helpers/wikis_helper.rb
0 → 100644
View file @
bdc42488
module
WikisHelper
def
markdown_to_html
(
text
)
RDiscount
.
new
(
text
).
to_html
.
html_safe
end
end
app/views/wikis/show.html.haml
View file @
bdc42488
%h3
%h3
=
@wiki
.
title
=
@wiki
.
title
=
link_to
edit_project_wiki_path
(
@project
,
@wiki
),
:class
=>
"right btn small"
do
Edit
-
if
can?
current_user
,
:write_wiki
,
@project
-
if
can?
current_user
,
:write_wiki
,
@project
=
link_to
history_project_wiki_path
(
@project
,
@wiki
),
:class
=>
"right btn small"
do
=
link_to
history_project_wiki_path
(
@project
,
@wiki
),
:class
=>
"right btn small"
do
History
History
=
link_to
edit_project_wiki_path
(
@project
,
@wiki
),
:class
=>
"right btn small"
do
%hr
Edit
=
markdown_to_html
@wiki
.
content
=
markdown
@wiki
.
content
%p
.time
Last edited by
#{
@wiki
.
user
.
name
}
, in
#{
time_ago_in_words
@wiki
.
created_at
}
-
if
can?
current_user
,
:write_wiki
,
@project
=
link_to
project_wiki_path
(
@project
,
@wiki
),
:confirm
=>
"Are you sure you want to delete this page?"
,
:method
=>
:delete
do
Delete this page
config/routes.rb
View file @
bdc42488
db/schema.rb
View file @
bdc42488
...
@@ -159,6 +159,20 @@ ActiveRecord::Schema.define(:version => 20120219193300) do
...
@@ -159,6 +159,20 @@ ActiveRecord::Schema.define(:version => 20120219193300) do
t
.
datetime
"updated_at"
t
.
datetime
"updated_at"
end
end
create_table
"wiki_pages"
,
:force
=>
true
do
|
t
|
t
.
string
"slug"
t
.
string
"title"
t
.
text
"content"
t
.
integer
"author_id"
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
end
add_index
"wiki_pages"
,
[
"author_id"
],
:name
=>
"index_wiki_pages_on_author_id"
add_index
"wiki_pages"
,
[
"project_id"
],
:name
=>
"index_wiki_pages_on_project_id"
add_index
"wiki_pages"
,
[
"slug"
],
:name
=>
"index_wiki_pages_on_slug"
,
:unique
=>
true
create_table
"wikis"
,
:force
=>
true
do
|
t
|
create_table
"wikis"
,
:force
=>
true
do
|
t
|
t
.
string
"title"
t
.
string
"title"
t
.
text
"content"
t
.
text
"content"
...
...
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