replace skeleton files by previous version; apply obvious fixes
This commit is contained in:
parent
1f5cbcd6d1
commit
2133be2436
35 changed files with 1086 additions and 39 deletions
49
app/views/suppliers/_form.haml
Normal file
49
app/views/suppliers/_form.haml
Normal file
|
@ -0,0 +1,49 @@
|
|||
= 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);
|
||||
});
|
2
app/views/suppliers/edit.haml
Normal file
2
app/views/suppliers/edit.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
%h1 Lieferantin bearbeiten
|
||||
= render 'form'
|
23
app/views/suppliers/index.haml
Normal file
23
app/views/suppliers/index.haml
Normal file
|
@ -0,0 +1,23 @@
|
|||
%h1 Lieferanten
|
||||
%table
|
||||
%tr
|
||||
%th Name
|
||||
%th Adresse
|
||||
%th Telefon
|
||||
%th Liefertage
|
||||
%th Notiz
|
||||
%th Zuletzt aktualisiert
|
||||
%th
|
||||
- for supplier in @suppliers
|
||||
%tr
|
||||
%td= link_to supplier.name, supplier_path(supplier)
|
||||
%td= supplier.address
|
||||
%td= supplier.phone
|
||||
%td= supplier.delivery_days
|
||||
%td= supplier.note
|
||||
%td= I18n.l supplier.articles_updated_at rescue nil
|
||||
%td= link_to supplier.articles.size.to_s + ' Artikel', supplier_articles_url(supplier)
|
||||
|
||||
%br/
|
||||
= link_to 'Neuer Lieferant', new_supplier_url
|
||||
|
2
app/views/suppliers/new.haml
Normal file
2
app/views/suppliers/new.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
%h1 Neue Lieferantin
|
||||
= render 'form'
|
43
app/views/suppliers/show.haml
Normal file
43
app/views/suppliers/show.haml
Normal file
|
@ -0,0 +1,43 @@
|
|||
%h1 Lieferantin anzeigen
|
||||
%p
|
||||
Name:
|
||||
%br/
|
||||
%strong= @supplier.name
|
||||
%p
|
||||
Adresse:
|
||||
%br/
|
||||
%strong= @supplier.address
|
||||
%p
|
||||
Telefon 1:
|
||||
%br/
|
||||
%strong= @supplier.phone
|
||||
%p
|
||||
Telefon 2:
|
||||
%br/
|
||||
%strong= @supplier.phone2
|
||||
%p
|
||||
Fax:
|
||||
%br/
|
||||
%strong= @supplier.fax
|
||||
%p
|
||||
E-Mail:
|
||||
%br/
|
||||
%strong= @supplier.email
|
||||
%p
|
||||
Webseite:
|
||||
%br/
|
||||
%strong= @supplier.url
|
||||
%p
|
||||
Liefertage:
|
||||
%br/
|
||||
%strong= @supplier.delivery_days
|
||||
%p
|
||||
Notiz:
|
||||
%br/
|
||||
%strong= @supplier.note
|
||||
|
||||
= link_to 'Bearbeiten', edit_supplier_path(@supplier)
|
||||
|
|
||||
= link_to 'Löschen', supplier_path(@supplier), :confirm => 'Bist du sicher?', :method => :delete
|
||||
|
|
||||
= link_to 'Zurück', suppliers_path
|
Loading…
Add table
Add a link
Reference in a new issue