From 9f3e8c3db4285e3357b7f0de4597580c06b547bd Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Tue, 3 Jun 2014 15:22:55 -0300 Subject: [PATCH] signup: Allow environment admin to add an introduction or help text to the sign up form --- app/models/environment.rb | 3 +++ app/views/account/signup.html.erb | 5 +++++ app/views/admin_panel/_signup_intro.html.erb | 5 +++++ app/views/admin_panel/site_info.html.erb | 2 ++ 4 files changed, 15 insertions(+), 0 deletions(-) create mode 100644 app/views/admin_panel/_signup_intro.html.erb diff --git a/app/models/environment.rb b/app/models/environment.rb index 321551d..13912e7 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -248,6 +248,9 @@ class Environment < ActiveRecord::Base # store the Environment settings as YAML-serialized Hash. acts_as_having_settings :field => :settings + # introduce and explain to users something about the signup + settings_items :signup_intro, :type => String + # the environment's terms of use: every user must accept them before registering. settings_items :terms_of_use, :type => String diff --git a/app/views/account/signup.html.erb b/app/views/account/signup.html.erb index b1c388e..bd0b207 100644 --- a/app/views/account/signup.html.erb +++ b/app/views/account/signup.html.erb @@ -1,2 +1,7 @@

<%= _('Sign up for %s!') % environment.name %>

+ +
+ <%= environment.signup_intro %> +
+ <%= render :partial => 'signup_form' %> diff --git a/app/views/admin_panel/_signup_intro.html.erb b/app/views/admin_panel/_signup_intro.html.erb new file mode 100644 index 0000000..e60c905 --- /dev/null +++ b/app/views/admin_panel/_signup_intro.html.erb @@ -0,0 +1,5 @@ +
+ <%= _('This text will be shown to the user on the top of the sign up form.') %> +
+ +<%= labelled_form_field(_('Body'), text_area(:environment, :signup_intro, :cols => 40, :style => 'width: 100%', :class => 'mceEditor')) %> diff --git a/app/views/admin_panel/site_info.html.erb b/app/views/admin_panel/site_info.html.erb index 4de18ca..54d3ea8 100644 --- a/app/views/admin_panel/site_info.html.erb +++ b/app/views/admin_panel/site_info.html.erb @@ -17,6 +17,8 @@ :content => (render :partial => 'signup_welcome_text', :locals => {:f => f})} %> <% tabs << {:title => _('Signup welcome page'), :id => 'signup-welcome-message', :content => (render :partial => 'signup_welcome_screen', :locals => {:f => f}) }%> + <% tabs << {:title => _('Signup introduction text'), :id => 'signup-intro', + :content => (render :partial => 'signup_intro', :locals => {:f => f})} %> <%= render_tabs(tabs) %> <% button_bar do %> <%= submit_button(:save, _('Save'), :cancel => {:action => 'index'}) %> -- libgit2 0.21.2