[issue #64] Added Wiki seeding on create.
This commit is contained in:
parent
a03690a9f7
commit
022a013b79
|
@ -164,7 +164,12 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def create_wiki
|
||||
Grit::Repo.init_bare(wiki_path) if has_wiki && !FileTest.exist?(wiki_path)
|
||||
if has_wiki && !FileTest.exist?(wiki_path)
|
||||
Grit::Repo.init_bare(wiki_path)
|
||||
wiki = Gollum::Wiki.new(wiki_path, {:base_path => Rails.application.routes.url_helpers.project_wiki_index_path(self)})
|
||||
wiki.write_page('Home', :markdown, I18n.t("wiki.seed.welcome_content"),
|
||||
{:name => owner.name, :email => owner.email, :message => 'Initial commit'})
|
||||
end
|
||||
end
|
||||
|
||||
def destroy_wiki
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
en:
|
||||
wiki:
|
||||
seed:
|
||||
welcome_content: |
|
||||
# Welcome to **Wiki** #
|
||||
|
||||
Edit this page and create new ones.
|
|
@ -0,0 +1,7 @@
|
|||
ru:
|
||||
wiki:
|
||||
seed:
|
||||
welcome_content: |
|
||||
# Добро пожаловать в **Wiki** #
|
||||
|
||||
Отредактируйте эту страницу и создайте новые.
|
Loading…
Reference in New Issue