liquid_feedback_frontend
changeset 326:75ce92899049
Work on "config/example.lua" as complete example configuration; Removed config.absolute_base_url
author | jbe |
---|---|
date | Tue Feb 28 17:59:42 2012 +0100 (2012-02-28) |
parents | 07dc88da30cb |
children | 6a6ddf763054 |
files | app/main/_filter_view/34_stylesheet.lua app/main/index/_action/reset_password.lua app/main/initiative/_action/create.lua config/example.lua model/member.lua |
line diff
1.1 --- a/app/main/_filter_view/34_stylesheet.lua Tue Feb 28 16:38:54 2012 +0100 1.2 +++ b/app/main/_filter_view/34_stylesheet.lua Tue Feb 28 17:59:42 2012 +0100 1.3 @@ -8,11 +8,11 @@ 1.4 if value then 1.5 slot.put_into("stylesheet_url", value) 1.6 else 1.7 - slot.put_into("stylesheet_url", config.absolute_base_url .. "static/style.css") 1.8 + slot.put_into("stylesheet_url", request.get_relative_baseurl() .. "static/style.css") 1.9 end 1.10 1.11 execute.inner() 1.12 1.13 if config.footer_html then 1.14 slot.put_into("footer", config.footer_html) 1.15 -end 1.16 \ No newline at end of file 1.17 +end
2.1 --- a/app/main/index/_action/reset_password.lua Tue Feb 28 16:38:54 2012 +0100 2.2 +++ b/app/main/index/_action/reset_password.lua Tue Feb 28 17:59:42 2012 +0100 2.3 @@ -22,9 +22,9 @@ 2.4 local content = slot.use_temporary(function() 2.5 slot.put(_"Hello " .. member.name .. ",\n\n") 2.6 slot.put(_"to reset your password please click on the following link:\n\n") 2.7 - slot.put(config.absolute_base_url .. "index/reset_password.html?secret=" .. member.password_reset_secret .. "\n\n") 2.8 + slot.put(request.get_absolute_baseurl() .. "index/reset_password.html?secret=" .. member.password_reset_secret .. "\n\n") 2.9 slot.put(_"If this link is not working, please open following url in your web browser:\n\n") 2.10 - slot.put(config.absolute_base_url .. "index/reset_password.html\n\n") 2.11 + slot.put(request.get_absolute_baseurl() .. "index/reset_password.html\n\n") 2.12 slot.put(_"On that page please enter the reset code:\n\n") 2.13 slot.put(member.password_reset_secret .. "\n\n") 2.14 end) 2.15 @@ -73,4 +73,4 @@ 2.16 2.17 slot.put_into("notice", _"Password has been reset successfully") 2.18 2.19 -end 2.20 \ No newline at end of file 2.21 +end
3.1 --- a/app/main/initiative/_action/create.lua Tue Feb 28 16:38:54 2012 +0100 3.2 +++ b/app/main/initiative/_action/create.lua Tue Feb 28 17:59:42 2012 +0100 3.3 @@ -94,7 +94,7 @@ 3.4 .. "api/1/createGroupPad?apikey=" .. config.etherpad.api_key 3.5 .. "&groupID=" .. config.etherpad.group_id 3.6 .. "&padName=Issue" .. tostring(issue.id) 3.7 - .. "&text=" .. config.absolute_base_url .. "issue/show/" .. tostring(issue.id) .. ".html" 3.8 + .. "&text=" .. request.get_absolute_baseurl() .. "issue/show/" .. tostring(issue.id) .. ".html" 3.9 ) 3.10 end 3.11 end 3.12 @@ -129,4 +129,4 @@ 3.13 module = "initiative", 3.14 view = "show", 3.15 id = initiative.id 3.16 -} 3.17 \ No newline at end of file 3.18 +}
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/config/example.lua Tue Feb 28 17:59:42 2012 +0100 4.3 @@ -0,0 +1,127 @@ 4.4 +request.set_absolute_baseurl(request.get_relative_baseurl()) 4.5 +-- request.set_absolute_baseurl("http://www.example.com/lf/") 4.6 + 4.7 +config.app_name = "LiquidFeedback" 4.8 +config.app_version = "2.beta1" 4.9 + 4.10 +config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)" 4.11 + 4.12 +config.app_logo = nil 4.13 + 4.14 +config.app_service_provider = "Snake Oil<br/>10000 Berlin<br/>Germany" 4.15 + 4.16 +--config.footer_html = '<a href="somewhere">some link</a>' 4.17 + 4.18 +config.use_terms = "=== Terms of Use ===\nNothing is allowed." 4.19 +--config.use_terms_html = "" 4.20 + 4.21 +config.use_terms_checkboxes = { 4.22 + { 4.23 + name = "terms_of_use_v1", 4.24 + html = "I accept the terms of use.", 4.25 + not_accepted_error = "You have to accept the terms of use to be able to register." 4.26 + } 4.27 +} 4.28 + 4.29 +config.locked_profile_fields = { 4.30 + login = false, 4.31 + notify_email = false, 4.32 + name = false, 4.33 + organizational_unit = false, 4.34 + internal_posts = false, 4.35 + realname = false, 4.36 + birthday = false, 4.37 + address = false, 4.38 + email = false 4.39 +} 4.40 + 4.41 +config.member_image_content_type = "image/jpeg" 4.42 +config.member_image_convert_func = { 4.43 + avatar = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end, 4.44 + photo = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end 4.45 +} 4.46 + 4.47 +config.member_image_default_file = { 4.48 + avatar = "avatar.jpg", 4.49 + photo = nil 4.50 +} 4.51 + 4.52 +config.default_lang = "en" 4.53 + 4.54 +-- after how long is a user considered inactive and the trustee will see warning 4.55 +-- notation is according to postgresql intervals 4.56 +config.delegation_warning_time = '6 months' 4.57 + 4.58 +config.mail_subject_prefix = "[LiquidFeedback] " 4.59 + 4.60 +config.fastpath_url_func = nil 4.61 + 4.62 +config.download_dir = nil 4.63 + 4.64 +config.download_use_terms = "=== Nutzungsbedingungen ===\nAlles ist verboten" 4.65 + 4.66 +config.public_access = false -- Available options: "anonymous", "pseudonym" 4.67 + 4.68 +config.api_enabled = true 4.69 + 4.70 +config.feature_rss_enabled = false -- feature is broken 4.71 + 4.72 +config.single_unit_id = false 4.73 + 4.74 +-- OpenID authentication is not fully implemented yet, DO NOT USE BEFORE THIS NOTICE HAS BEEN REMOVED! 4.75 +config.auth_openid_enabled = false 4.76 +config.auth_openid_https_as_default = true 4.77 +config.auth_openid_identifier_check_func = function(uri) return false end 4.78 + 4.79 +request.set_allowed_json_request_slots{ "title", "actions", "support", "default", "trace", "system_error" } 4.80 + 4.81 +if request.get_json_request_slots() then 4.82 + request.force_absolute_baseurl() 4.83 +end 4.84 + 4.85 +request.set_404_route{ module = 'index', view = '404' } 4.86 + 4.87 +-- uncomment the following two lines to use C implementations of chosen 4.88 +-- functions and to disable garbage collection during the request, to 4.89 +-- increase speed: 4.90 +-- 4.91 +-- require 'webmcp_accelerator' 4.92 +-- collectgarbage("stop") 4.93 + 4.94 +-- open and set default database handle 4.95 +db = assert(mondelefant.connect{ 4.96 + engine='postgresql', 4.97 + dbname='liquid_feedback_p' 4.98 +}) 4.99 +at_exit(function() 4.100 + db:close() 4.101 +end) 4.102 +function mondelefant.class_prototype:get_db_conn() return db end 4.103 + 4.104 +-- enable output of SQL commands in trace system 4.105 +function db:sql_tracer(command) 4.106 + return function(error_info) 4.107 + local error_info = error_info or {} 4.108 + trace.sql{ command = command, error_position = error_info.position } 4.109 + end 4.110 +end 4.111 + 4.112 + 4.113 +-- TODO abstraction 4.114 +-- get record by id 4.115 +function mondelefant.class_prototype:by_id(id) 4.116 + local selector = self:new_selector() 4.117 + selector:add_where{ 'id = ?', id } 4.118 + selector:optional_object_mode() 4.119 + return selector:exec() 4.120 +end 4.121 + 4.122 +config.formatting_engine_executeables = { 4.123 + rocketwiki= "/opt/rocketwiki-lqfb/rocketwiki-lqfb", 4.124 + compat = "/opt/rocketwiki-lqfb/rocketwiki-lqfb-compat" 4.125 +} 4.126 + 4.127 +config.fastpath_url_func = function(member_id, image_type) 4.128 + return request.get_absolute_baseurl() .. "fastpath/getpic?" .. tostring(member_id) .. "+" .. tostring(image_type) 4.129 +end 4.130 +
5.1 --- a/model/member.lua Tue Feb 28 16:38:54 2012 +0100 5.2 +++ b/model/member.lua Tue Feb 28 17:59:42 2012 +0100 5.3 @@ -334,9 +334,9 @@ 5.4 local content = slot.use_temporary(function() 5.5 slot.put(_"Hello\n\n") 5.6 slot.put(_"You are invited to LiquidFeedback. To register please click the following link:\n\n") 5.7 - slot.put(config.absolute_base_url .. "index/register.html?invite_key=" .. self.invite_code .. "\n\n") 5.8 + slot.put(request.get_absolute_baseurl() .. "index/register.html?invite_key=" .. self.invite_code .. "\n\n") 5.9 slot.put(_"If this link is not working, please open following url in your web browser:\n\n") 5.10 - slot.put(config.absolute_base_url .. "index/register.html\n\n") 5.11 + slot.put(request.get_absolute_baseurl() .. "index/register.html\n\n") 5.12 slot.put(_"On that page please enter the invite key:\n\n") 5.13 slot.put(self.invite_code .. "\n\n") 5.14 end) 5.15 @@ -361,9 +361,9 @@ 5.16 local content = slot.use_temporary(function() 5.17 slot.put(_"Hello " .. self.name .. ",\n\n") 5.18 slot.put(_"Please confirm your email address by clicking the following link:\n\n") 5.19 - slot.put(config.absolute_base_url .. "index/confirm_notify_email.html?secret=" .. self.notify_email_secret .. "\n\n") 5.20 + slot.put(request.get_absolute_baseurl() .. "index/confirm_notify_email.html?secret=" .. self.notify_email_secret .. "\n\n") 5.21 slot.put(_"If this link is not working, please open following url in your web browser:\n\n") 5.22 - slot.put(config.absolute_base_url .. "index/confirm_notify_email.html\n\n") 5.23 + slot.put(request.get_absolute_baseurl() .. "index/confirm_notify_email.html\n\n") 5.24 slot.put(_"On that page please enter the confirmation code:\n\n") 5.25 slot.put(self.notify_email_secret .. "\n\n") 5.26 end) 5.27 @@ -479,4 +479,4 @@ 5.28 :optional_object_mode() 5.29 :for_share() 5.30 :exec()) and true or false 5.31 -end 5.32 \ No newline at end of file 5.33 +end