"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/controllers/wiki_controller.rb" between
redmine-4.0.3.tar.gz and redmine-4.0.4.tar.gz

About: Redmine is a flexible project management and bug-tracking web application (using the Ruby on Rails framework). It supports also project wikis and forums, documents management, and multiple version control systems.

wiki_controller.rb  (redmine-4.0.3):wiki_controller.rb  (redmine-4.0.4)
skipping to change at line 35 skipping to change at line 35
# * edit - used to edit an existing or new page # * edit - used to edit an existing or new page
# * update - used to save a wiki page update to the database, including new page s # * update - used to save a wiki page update to the database, including new page s
# * destroy - normal # * destroy - normal
# #
# Other member and collection methods are also used # Other member and collection methods are also used
# #
# TODO: still being worked on # TODO: still being worked on
class WikiController < ApplicationController class WikiController < ApplicationController
default_search_scope :wiki_pages default_search_scope :wiki_pages
before_action :find_wiki, :authorize before_action :find_wiki, :authorize
before_action :find_existing_or_new_page, :only => [:show, :edit, :update] before_action :find_existing_or_new_page, :only => [:show, :edit]
before_action :find_existing_page, :only => [:rename, :protect, :history, :dif f, :annotate, :add_attachment, :destroy, :destroy_version] before_action :find_existing_page, :only => [:rename, :protect, :history, :dif f, :annotate, :add_attachment, :destroy, :destroy_version]
before_action :find_attachments, :only => [:preview] before_action :find_attachments, :only => [:preview]
accept_api_auth :index, :show, :update, :destroy accept_api_auth :index, :show, :update, :destroy
helper :attachments helper :attachments
include AttachmentsHelper include AttachmentsHelper
helper :watchers helper :watchers
include Redmine::Export::PDF include Redmine::Export::PDF
# List of pages, sorted alphabetically and by parent (hierarchy) # List of pages, sorted alphabetically and by parent (hierarchy)
skipping to change at line 153 skipping to change at line 153
@text = @content.text @text = @content.text
if params[:section].present? && Redmine::WikiFormatting.supports_section_edi t? if params[:section].present? && Redmine::WikiFormatting.supports_section_edi t?
@section = params[:section].to_i @section = params[:section].to_i
@text, @section_hash = Redmine::WikiFormatting.formatter.new(@text).get_se ction(@section) @text, @section_hash = Redmine::WikiFormatting.formatter.new(@text).get_se ction(@section)
render_404 if @text.blank? render_404 if @text.blank?
end end
end end
# Creates a new page or updates an existing one # Creates a new page or updates an existing one
def update def update
@page = @wiki.find_or_new_page(params[:id])
return render_403 unless editable? return render_403 unless editable?
was_new_page = @page.new_record? was_new_page = @page.new_record?
@page.safe_attributes = params[:wiki_page] @page.safe_attributes = params[:wiki_page]
@content = @page.content || WikiContent.new(:page => @page) @content = @page.content || WikiContent.new(:page => @page)
content_params = params[:content] content_params = params[:content]
if content_params.nil? && params[:wiki_page].present? if content_params.nil? && params[:wiki_page].present?
content_params = params[:wiki_page].slice(:text, :comments, :version) content_params = params[:wiki_page].slice(:text, :comments, :version)
end end
content_params ||= {} content_params ||= {}
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)