def has_content?(name)
(@has_content && @has_content[name]) || false
end
+
+ def email_delivery_enabled?
+ !!ActionMailer::Base.perform_deliveries
+ end
# Returns the avatar image tag for the given +user+ if avatars are enabled
# +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
<% labelled_tabular_form_for :user, @user, :url => { :controller => 'users', :action => "update", :tab => nil }, :html => { :method => :put, :class => nil } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
- <% if @user.active? -%>
+ <% if @user.active? && email_delivery_enabled? -%>
<p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p>
<% end -%>
<p><%= submit_tag l(:button_save) %></p>
<% labelled_tabular_form_for :user, @user, :url => { :action => "create" }, :html => { :class => nil } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
+ <% if email_delivery_enabled? %>
<p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p>
+ <% end %>
<p>
<%= submit_tag l(:button_create) %>
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>