"user interface" to allow or prohibit file uploads (not working, just the UI element)
This commit is contained in:
parent
a99e492f05
commit
8d8deb8e76
5 changed files with 35 additions and 11 deletions
|
@ -148,7 +148,8 @@ class WikiController < ApplicationController
|
|||
@params['password'].empty? ? nil : @params['password'],
|
||||
@params['published'] ? true : false,
|
||||
@params['brackets_only'] ? true : false,
|
||||
@params['count_pages'] ? true : false
|
||||
@params['count_pages'] ? true : false,
|
||||
@params['allow_uploads'] ? true : false
|
||||
)
|
||||
redirect_show('HomePage', @params['address'])
|
||||
else
|
||||
|
|
|
@ -6,8 +6,8 @@ require "zip/zip"
|
|||
|
||||
class Web
|
||||
attr_accessor :name, :address, :password, :markup, :color, :safe_mode, :pages
|
||||
attr_accessor :additional_style, :published, :brackets_only, :count_pages
|
||||
|
||||
attr_accessor :additional_style, :published, :brackets_only, :count_pages, :allow_uploads
|
||||
|
||||
def initialize(parent_wiki, name, address, password = nil)
|
||||
@name, @address, @password, @safe_mode = name, address, password, false
|
||||
@pages = {}
|
||||
|
|
|
@ -75,21 +75,22 @@ module AbstractWikiService
|
|||
end
|
||||
|
||||
def update_web(old_address, new_address, name, markup, color, additional_style, safe_mode = false,
|
||||
password = nil, published = false, brackets_only = false, count_pages = false)
|
||||
password = nil, published = false, brackets_only = false, count_pages = false,
|
||||
allow_uploads = true)
|
||||
if old_address != new_address
|
||||
@webs[new_address] = @webs[old_address]
|
||||
@webs.delete(old_address)
|
||||
@webs[new_address].address = new_address
|
||||
end
|
||||
|
||||
|
||||
web = @webs[new_address]
|
||||
web.refresh_revisions if settings_changed?(web, markup, safe_mode, brackets_only)
|
||||
|
||||
|
||||
web.name, web.markup, web.color, web.additional_style, web.safe_mode =
|
||||
name, markup, color, additional_style, safe_mode
|
||||
|
||||
web.password, web.published, web.brackets_only, web.count_pages =
|
||||
password, published, brackets_only, count_pages
|
||||
|
||||
web.password, web.published, web.brackets_only, web.count_pages, web.allow_uploads =
|
||||
password, published, brackets_only, count_pages, allow_uploads
|
||||
end
|
||||
|
||||
def write_page(web_address, page_name, content, written_on, author)
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
Turning safe mode on will strip HTML tags and stylesheet options from the content of all pages.
|
||||
Turning on "brackets only" will require all wiki words to be as [[wiki word]] and WikiWord
|
||||
won't work.
|
||||
Turning "allow uploads" on will let wiki users to upload pictures and other files to the wiki
|
||||
and include them on wiki pages.
|
||||
Additions to the stylesheet take precedence over the existing styles.
|
||||
<i>Hint:</i> View source on a page you want to style to find ID names on individual tags.
|
||||
<a href="#" onClick="document.getElementById('additionalStyle').style.display='block';return false;">
|
||||
|
@ -51,6 +53,8 @@
|
|||
Brackets only
|
||||
|
||||
<input type="checkbox" name="count_pages"<%= " CHECKED" if @web.count_pages %> /> Count pages
|
||||
|
||||
<input type="checkbox" name="allow_uploads"<%= " CHECKED" if @web.allow_uploads %> /> Allow uploads
|
||||
</small>
|
||||
|
||||
<textarea id="additionalStyle"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue