Commit 43548e507b1013a7a9f4365862670a6e90dce4af

Authored by Rodrigo Souto
1 parent 3cec04fc

Display default welcome page on administration

When the administrator filled the welcome_message the default welcome
message displayed below was displaying the message written by the user
instead of the default welcome message.
app/views/admin_panel/_signup_welcome_screen.html.erb
... ... @@ -8,4 +8,4 @@
8 8 <%= _('If this content is left blank, the following page will be displayed to the user:') %><br/><br/>
9 9 </div>
10 10 <p>
11   -<%= render :file => 'home/welcome' %>
  11 +<%= render :file => 'home/welcome', :locals => {:default_message => true} %>
... ...
app/views/home/welcome.html.erb
  1 +<% default_message = defined?(default_message) ? default_message : false %>
  2 +
1 3 <div id='thanks-for-signing'>
2 4 <h1><%= _("Welcome to %s!") % environment.name %></h1>
3   - <% if environment.has_custom_welcome_screen? %>
  5 + <% if environment.has_custom_welcome_screen? && !default_message %>
4 6 <%= environment.settings[:signup_welcome_screen_body].html_safe %>
5 7 <% else %>
6 8 <h3><%= _("Thanks for signing up, we're thrilled to have you on our social network!") %></h3>
... ...