allow login required screen to be customized

This commit is contained in:
Sam
2013-07-16 20:49:04 +10:00
parent dc3079db37
commit 06bd9e3234
5 changed files with 9 additions and 1 deletions

View File

@@ -27,6 +27,10 @@ class StaticController < ApplicationController
file = "static/#{page}.en"
end
if not lookup_context.find_all("#{file}.html").any?
file = "static/#{page}"
end
if lookup_context.find_all("#{file}.html").any?
render file, layout: !request.xhr?, formats: [:html]
return

View File

@@ -20,6 +20,7 @@ class SiteContent < ActiveRecord::Base
add_content_type :login_required_welcome_message, default_18n_key: 'login_required.welcome_message'
add_content_type :privacy_policy, allow_blank: true
add_content_type :faq, allow_blank: true
add_content_type :login_required, default_18n_key: 'login_required.welcome_message'
def site_content_type
@site_content_type ||= SiteContent.content_types.find {|t| t.content_type == content_type.to_sym}

View File

@@ -1 +0,0 @@
<%= markdown_content(:login_required_welcome_message) %>

View File

@@ -0,0 +1 @@
<%= PrettyText.cook(SiteContent.content_for(:login_required)).html_safe %>