OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/views/settings/_notifications.html.erb

85 lines
4.1 KiB

<%#-- copyright
OpenProject is a project management system.
Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2013 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<% if @deliveries %>
<%= styled_form_tag({action: 'edit', tab: 'notifications'}) do %>
<section class="form--section">
<div class="form--field"><%= setting_text_field :mail_from, size: 60 %></div>
<div class="form--field"><%= setting_check_box :bcc_recipients %></div>
<div class="form--field"><%= setting_check_box :plain_text_mail %></div>
<div class="form--field"><%= setting_select(:default_notification_option, User.valid_notification_options.collect {|o| [l(o.last), o.first.to_s]}) %></div>
</section>
<fieldset id="notified_events" class="form--fieldset"><legend class="form--fieldset-legend"><%=l(:text_select_mail_notifications)%></legend>
<%= hidden_field_tag 'settings[notified_events][]', '' %>
<div class="form--field">
<div class="form--field-container -vertical">
<% @notifiables.each do |notifiable| %>
<%= notification_field notifiable %>
<% end %>
</div>
</div>
<div class="form--field"><%= check_all_links('notified_events') %></div>
</fieldset>
<fieldset id="emails_decorators" class="form--fieldset"><legend class="form--fieldset-legend"><%= l(:setting_emails_header) %> & <%= l(:setting_emails_footer) %></legend>
<div class="form--field -vertical">
<div class="form--field-container">
<%= styled_select_tag 'lang', options_for_select(lang_options_for_select(false), current_language.to_s), id: 'emails_decorators_switch', onchange: "toggleEmailDecoratorFields()" %>
</div>
</div>
<% Setting.available_languages.each do |lang| %>
<div id="emails_decorators_<%= lang %>" style="display:none" class="emails_decorators">
<div class="form--field -vertical">
<%= styled_label_tag "settings[emails_header][#{lang}]", l(:setting_emails_header) %>
<div class="form--field-container">
<%= styled_text_area_tag("settings[emails_header][#{lang}]", Setting.emails_header[lang], label: false, class: 'wiki-edit', rows: 5) %>
</div>
</div>
<div class="form--field -vertical">
<%= styled_label_tag "settings[emails_footer][#{lang}]", l(:setting_emails_footer) %>
<div class="form--field-container">
<%= styled_text_area_tag("settings[emails_footer][#{lang}]", Setting.emails_footer[lang], label: false, class: 'wiki-edit', rows: 5) %>
</div>
</div>
</div>
<% end %>
</fieldset>
<%= javascript_tag do -%>
jQuery(document).ready(function () {
toggleEmailDecoratorFields();
});
<% end -%>
<div style="float:right;">
<%= link_to l(:label_send_test_email), controller: '/admin', action: 'test_email' %>
</div>
<%= styled_button_tag l(:button_save), class: '-highlight -with-icon icon-yes' %>
<% end %>
<% else %>
<div class="nodata">
<%= simple_format(l(:text_email_delivery_not_configured)) %>
</div>
<% end %>