Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

This commit is contained in:
Jacques Distler 2009-12-26 23:47:38 -06:00
commit dce19f6eda
4 changed files with 31 additions and 6 deletions

View file

@ -27,14 +27,28 @@ class Wiki
if not (web = Web.find_by_address(old_address))
raise Instiki::ValidationError.new("Web with address '#{old_address}' does not exist")
end
old_files_path = web.files_path
web.update_attributes(:address => new_address, :name => name, :markup => markup, :color => color,
:additional_style => additional_style, :safe_mode => safe_mode, :password => password, :published => published,
:brackets_only => brackets_only, :count_pages => count_pages, :allow_uploads => allow_uploads, :max_upload_size => max_upload_size)
@webs = nil
raise Instiki::ValidationError.new("There is already a web with address '#{new_address}'") unless web.errors.on(:address).nil?
web
move_files(old_files_path, web.files_path)
end
def move_files(old_path, new_path)
return if new_path == old_path
default_path = Rails.root.join("webs", "files")
FileUtils.rmdir(new_path)
if [old_path, new_path].include? default_path
File.rename(old_path, new_path)
FileUtils.rmdir(old_path.parent) unless old_path == default_path
else
File.rename(old_path.parent, new_path.parent)
end
end
def read_page(web_address, page_name)
ApplicationController.logger.debug "Reading page '#{page_name}' from web '#{web_address}'"

View file

@ -71,7 +71,8 @@
Stylesheet tweaks &gt;&gt;</a>
<em>
- add or change styles used by this web; styles defined here take precedence over
instiki.css. Hint: View HTML source of a page you want to style to find ID names on individual
instiki.css.<br/>
Hint: View HTML source of a page you want to style to find ID names on individual
tags.</em>
<br/>
<textarea id="additionalStyle" class="disableAutoComplete" cols="50" rows="20"
@ -96,7 +97,7 @@
<div class="help">
You can turn on a read-only version of this web that's accessible even when the regular web
is password protected.
The published version is accessible through URLs like /wiki/published/HomePage.
The published version is accessible through URLs like /<%= @web.address %>/published/HomePage.
</div>
<div class="inputBox">
<input type="checkbox" id="published" name="published" class="disableAutoComplete" <%= 'checked="checked"' if @web.published? %> />