2011-08-31 12:45:29 +04:00
|
|
|
# Redmine - project management software
|
2014-02-08 11:58:49 +04:00
|
|
|
# Copyright (C) 2006-2014 Jean-Philippe Lang
|
2007-09-14 15:34:08 +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-08-31 12:45:29 +04:00
|
|
|
#
|
2007-09-14 15:34:08 +04:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2011-08-31 12:45:29 +04:00
|
|
|
#
|
2007-09-14 15:34:08 +04:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
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-08-31 12:45:29 +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
|
|
|
end
|
|
|
|
|
|
|
|
# Delete a project's wiki
|
|
|
|
def destroy
|
|
|
|
if request.post? && params[:confirm] && @project.wiki
|
|
|
|
@project.wiki.destroy
|
2012-12-11 23:39:47 +04:00
|
|
|
redirect_to settings_project_path(@project, :tab => 'wiki')
|
2011-08-31 12:45:29 +04:00
|
|
|
end
|
2007-09-14 15:34:08 +04:00
|
|
|
end
|
|
|
|
end
|