sharedlists/app/views/suppliers/_form.haml

49 lines
1.7 KiB
Text

= simple_form_for @supplier do |f|
= f.input :name, required: true
= f.input :address, required: true
= f.input :phone, required: true
= f.input :phone2
= f.input :fax
= f.input :email
= f.input :url
= f.input :delivery_days
/= f.input :order_howto, as: :text, input_html: {rows: 5}
= f.input :note, as: :text, input_html: {rows: 5, cols: 60}
/= f.input :min_order_quantity
/= f.input :article_info_url
= f.input :ftp_sync
%div#ftp_details{style: ('display: none' unless @supplier.ftp_sync?)}
= f.input :ftp_host
= f.input :ftp_user
= f.input :ftp_password
= f.input :ftp_type, collection: Supplier::FTP_TYPES, include_blank: false
= f.input :ftp_regexp, hint: t('.ftp_regexp_hint')
= f.input :mail_sync
%div#mail_details{style: ('display: none' unless @supplier.mail_sync?)}
.input
%label Send to
- if !ENV["MAILER_DOMAIN"].present?
%i (please set <tt>MAILER_DOMAIN</tt> to see address)
- elsif @supplier.articles_mail_address.present?
%tt= @supplier.articles_mail_address
- else
%i (save supplier to see address)
= f.input :mail_type, collection: ArticleImport.file_formats.map {|k,o| [o::NAME, k] }
= f.input :mail_from
= f.input :mail_subject
.form-actions
= f.submit class: 'btn'
= link_to t('ui.or_cancel'), (@supplier.new_record? ? suppliers_path : supplier_path(@supplier))
- content_for :javascript do
:javascript
$(document).on('change', '#supplier_ftp_sync', function() {
$('#ftp_details').toggle(this.checked);
});
$(document).on('change', '#supplier_mail_sync', function() {
$('#mail_details').toggle(this.checked);
});