| 
									
										
										
										
											2011-08-31 08:45:29 +00:00
										 |  |  | # Redmine - project management software | 
					
						
							| 
									
										
										
										
											2016-03-13 10:30:10 +00:00
										 |  |  | # Copyright (C) 2006-2016  Jean-Philippe Lang | 
					
						
							| 
									
										
										
										
											2007-09-14 11:34:08 +00: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 08:45:29 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2007-09-14 11:34:08 +00: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 08:45:29 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2007-09-14 11:34:08 +00: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 11:53:43 +00:00
										 |  |  |   menu_item :settings | 
					
						
							| 
									
										
										
										
											2007-09-14 11:34:08 +00:00
										 |  |  |   before_filter :find_project, :authorize | 
					
						
							| 
									
										
										
										
											2011-08-31 08:45:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-14 11:34:08 +00:00
										 |  |  |   # Create or update a project's wiki | 
					
						
							|  |  |  |   def edit | 
					
						
							|  |  |  |     @wiki = @project.wiki || Wiki.new(:project => @project) | 
					
						
							| 
									
										
										
										
											2012-03-06 20:34:38 +00:00
										 |  |  |     @wiki.safe_attributes = params[:wiki] | 
					
						
							| 
									
										
										
										
											2007-12-14 22:00:03 +00:00
										 |  |  |     @wiki.save if request.post? | 
					
						
							| 
									
										
										
										
											2007-09-14 11:34:08 +00:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   # Delete a project's wiki | 
					
						
							|  |  |  |   def destroy | 
					
						
							|  |  |  |     if request.post? && params[:confirm] && @project.wiki | 
					
						
							|  |  |  |       @project.wiki.destroy | 
					
						
							| 
									
										
										
										
											2012-12-11 19:39:47 +00:00
										 |  |  |       redirect_to settings_project_path(@project, :tab => 'wiki') | 
					
						
							| 
									
										
										
										
											2011-08-31 08:45:29 +00:00
										 |  |  |     end | 
					
						
							| 
									
										
										
										
											2007-09-14 11:34:08 +00:00
										 |  |  |   end | 
					
						
							|  |  |  | end |