2011-10-29 16:19:11 +04:00
|
|
|
#-- encoding: UTF-8
|
2011-05-30 00:11:52 +04:00
|
|
|
#-- copyright
|
|
|
|
# ChiliProject is a project management system.
|
2011-05-30 22:52:25 +04:00
|
|
|
#
|
2012-01-03 23:36:40 +04:00
|
|
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
2011-05-30 22:52:25 +04:00
|
|
|
#
|
2011-05-30 00:11:52 +04:00
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2011-05-30 22:52:25 +04:00
|
|
|
#
|
2011-05-30 00:11:52 +04:00
|
|
|
# See doc/COPYRIGHT.rdoc for more details.
|
|
|
|
#++
|
|
|
|
|
2007-09-14 15:34:08 +04:00
|
|
|
class WikisController < ApplicationController
|
2008-01-19 14:53:43 +03:00
|
|
|
menu_item :settings
|
2007-09-14 15:34:08 +04:00
|
|
|
before_filter :find_project, :authorize
|
2011-05-30 22:52:25 +04:00
|
|
|
|
2007-09-14 15:34:08 +04:00
|
|
|
# Create or update a project's wiki
|
|
|
|
def edit
|
|
|
|
@wiki = @project.wiki || Wiki.new(:project => @project)
|
2012-03-07 00:34:38 +04:00
|
|
|
@wiki.safe_attributes = params[:wiki]
|
2007-12-15 01:00:03 +03:00
|
|
|
@wiki.save if request.post?
|
2007-09-14 15:34:08 +04:00
|
|
|
render(:update) {|page| page.replace_html "tab-content-wiki", :partial => 'projects/settings/wiki'}
|
|
|
|
end
|
|
|
|
|
|
|
|
# Delete a project's wiki
|
|
|
|
def destroy
|
|
|
|
if request.post? && params[:confirm] && @project.wiki
|
|
|
|
@project.wiki.destroy
|
|
|
|
redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'wiki'
|
2011-05-30 22:52:25 +04:00
|
|
|
end
|
2007-09-14 15:34:08 +04:00
|
|
|
end
|
|
|
|
end
|