diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 3f956cd1..585c74be 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -194,4 +194,19 @@ tr.unavailable { input, select { border-color: red; } -} \ No newline at end of file +} + + +// ********* Tweaks & fixes + +// https://github.com/twitter/bootstrap/issues/4062 +.dl-horizontal { + dd { .clearfix(); } +} + +// need more space for supplier information (in German, at least) +.dl-horizontal { + dt { width: 150px; } + dd { margin-left: 160px; } +} + diff --git a/app/views/ordergroups/edit.html.haml b/app/views/ordergroups/edit.html.haml index e81314a2..7c0424a6 100644 --- a/app/views/ordergroups/edit.html.haml +++ b/app/views/ordergroups/edit.html.haml @@ -1,4 +1,4 @@ -- title "Edit Ordergroup" +- title t('.title') - form_for @ordergroup do |f| = f.error_messages %p @@ -81,4 +81,4 @@ = f.label :contact_address %br/ = f.text_field :contact_address - %p= f.submit "Submit" + %p= f.submit t('.submit') diff --git a/app/views/suppliers/_form.haml b/app/views/suppliers/_form.haml index 32bfc8c8..dde823b9 100644 --- a/app/views/suppliers/_form.haml +++ b/app/views/suppliers/_form.haml @@ -1,6 +1,7 @@ = simple_form_for @supplier do |f| - if @supplier.shared_supplier - .alert.alert-success Lieferantin ist mit externer Datenbank verknüpft. + .alert.alert-success + = t 'suppliers.shared_supplier_note' = f.hidden_field :shared_supplier_id = f.input :name = f.input :address @@ -17,4 +18,4 @@ = f.input :min_order_quantity .form-actions = f.submit class: 'btn' - = link_to 'oder abbrechen', suppliers_path \ No newline at end of file + = link_to t('.cancel'), suppliers_path diff --git a/app/views/suppliers/edit.haml b/app/views/suppliers/edit.haml index 24a35c12..ea1ec870 100644 --- a/app/views/suppliers/edit.haml +++ b/app/views/suppliers/edit.haml @@ -1,3 +1,3 @@ -- title "Lieferantin bearbeiten" +- title t('.title') -= render "form" \ No newline at end of file += render "form" diff --git a/app/views/suppliers/index.haml b/app/views/suppliers/index.haml index 4697f573..81c2d607 100644 --- a/app/views/suppliers/index.haml +++ b/app/views/suppliers/index.haml @@ -1,14 +1,14 @@ -- title "Lieferanten" +- title t('.title') - content_for :actionbar do - = link_to 'Neue Lieferantin anlegen', new_supplier_path, class: 'btn btn-primary' - = link_to 'Lieferantin aus externer Datenbank importieren', shared_suppliers_suppliers_path, class: 'btn' + = link_to t('.action_new'), new_supplier_path, class: 'btn btn-primary' + = link_to t('.action_import'), shared_suppliers_suppliers_path, class: 'btn' %table.table.table-striped %thead %tr - %th Name - %th Telefon - %th Kunden-Nr + %th= t 'simple_form.labels.supplier.name' + %th= t 'simple_form.labels.supplier.phone' + %th= t 'simple_form.labels.supplier.customer_number' %th %th %th @@ -18,10 +18,10 @@ %td= link_to h(supplier.name) , supplier %td= supplier.phone %td= supplier.customer_number - %td= link_to "Artikel (#{supplier.articles.count})", supplier_articles_path(supplier) - %td= link_to "im Lager (#{supplier.stock_articles.count})", stock_articles_path - %td= link_to "Lieferungen (#{supplier.deliveries.count})", supplier_deliveries_path(supplier) + %td= link_to t('.articles', count: supplier.articles.count), supplier_articles_path(supplier) + %td= link_to t('.stock', count: supplier.stock_articles.count), stock_articles_path + %td= link_to t('.deliveries', count: supplier.deliveries.count), supplier_deliveries_path(supplier) %td - = link_to "Bearbeiten", edit_supplier_path(supplier), class: 'btn btn-mini' - = link_to "Löschen", supplier_path(supplier), method: :delete, - confirm: "Achtung, willst Du wirklich den Lieferanten #{supplier.name} löschen?", class: 'btn btn-mini btn-danger' \ No newline at end of file + = link_to t('ui.edit'), edit_supplier_path(supplier), class: 'btn btn-mini' + = link_to t('ui.delete'), supplier_path(supplier), method: :delete, + confirm: t('.confirm_del', name: supplier.name), class: 'btn btn-mini btn-danger' diff --git a/app/views/suppliers/new.haml b/app/views/suppliers/new.haml index 07fdb6ef..ea1ec870 100644 --- a/app/views/suppliers/new.haml +++ b/app/views/suppliers/new.haml @@ -1,3 +1,3 @@ -- title "Neue Lieferantin" +- title t('.title') -= render "form" \ No newline at end of file += render "form" diff --git a/app/views/suppliers/shared_suppliers.haml b/app/views/suppliers/shared_suppliers.haml index 2de9234d..6d36149c 100644 --- a/app/views/suppliers/shared_suppliers.haml +++ b/app/views/suppliers/shared_suppliers.haml @@ -1,19 +1,14 @@ -- title "Externe Listen" -%p - Hier werden die Lieferantinnen der externen Datenbank angezeigt. - %br/ - Ihr könnt externe Lieferantinnen importieren, indem ihr sie einfach abonniert. (siehe unten) - %br/ - Damit wird eine neue Lieferantin angelegt und mit der externen Datenbank verknüpft. +- title t('.title') += t('.body').html_safe %table.table.table-striped %thead %tr - %th Lieferantin - %th Adresse - %th Notiz - %th Liefertag - %th abonniert? + %th= t 'simple_form.labels.supplier.name' + %th= t 'simple_form.labels.supplier.address' + %th= t 'simple_form.labels.supplier.note' + %th= t 'simple_form.labels.supplier.delivery_days' + %th= t 'simple_form.labels.supplier.is_subscribed' %tbody - for shared_supplier in @shared_suppliers %tr @@ -25,4 +20,4 @@ - if shared_supplier.supplier %i.icon-ok - else - = link_to "abonnieren", new_supplier_path(:shared_supplier_id => shared_supplier), class: 'btn' \ No newline at end of file + = link_to t('.subscribe'), new_supplier_path(:shared_supplier_id => shared_supplier), class: 'btn' diff --git a/app/views/suppliers/show.haml b/app/views/suppliers/show.haml index 47694d97..0a9417fe 100644 --- a/app/views/suppliers/show.haml +++ b/app/views/suppliers/show.haml @@ -4,54 +4,52 @@ .span6 - if shared_supplier = @supplier.shared_supplier .alert.alert-info - Die Lieferantin ist mit der externen Artikledatenbank verknüpft. + = t 'suppliers.shared_supplier_note' %dl.dl-horizontal - %dt Adresse: + %dt= t('simple_form.labels.supplier.address') + ':' %dd= @supplier.address - %dt Telefon: + %dt= t('simple_form.labels.supplier.phone') + ':' %dd= @supplier.phone - %dt Telefon2: + %dt= t('simple_form.labels.supplier.phone2') + ':' %dd= @supplier.phone2 - %dt FAX: + %dt= t('simple_form.labels.supplier.fax') + ':' %dd= @supplier.fax - %dt Email: + %dt= t('simple_form.labels.supplier.email') + ':' %dd= @supplier.email - %dt Hompage: - %dd= @supplier.url - %dt Kontakt-Person: + %dt= t('simple_form.labels.supplier.url') + ':' + %dd= link_to @supplier.url, @supplier.url + %dt= t('simple_form.labels.supplier.contact_person') + ':' %dd= @supplier.contact_person - %dt Kundennummer: + %dt= t('simple_form.labels.supplier.customer_number') + ':' %dd= @supplier.customer_number - %dt Liefertage: + %dt= t('simple_form.labels.supplier.delivery_days') + ':' %dd= @supplier.delivery_days - %dt BestellHowTo: + %dt= t('simple_form.labels.supplier.order_howto') + ':' %dd= @supplier.order_howto - %dt Notiz: + %dt= t('simple_form.labels.supplier.note') + ':' %dd= @supplier.note - %dt Liefertage: - %dd= @supplier.delivery_days - %dt Mindestbestellmenge: + %dt= t('simple_form.labels.supplier.min_order_quantity') + ':' %dd= @supplier.min_order_quantity .clearfix - if @current_user.role_suppliers? .form-actions - = link_to 'Bearbeiten', edit_supplier_path(@supplier), class: 'btn' - = link_to 'Löschen', @supplier, :confirm => 'Bist Du sicher?', :method => :delete, class: 'btn btn-danger' + = link_to t('ui.edit'), edit_supplier_path(@supplier), class: 'btn' + = link_to t('ui.delete'), @supplier, :confirm => t('.confirm_delete'), :method => :delete, class: 'btn btn-danger' .span6 - %h2 Letzte Lieferungen + %h2= t '.last_deliveries' %table.table.table-horizontal %thead %tr - %th Datum - %th Betrag + %th= t 'simple_form.labels.defaults.date' + %th= t 'simple_form.labels.defaults.amount' %tbody - for delivery in @deliveries %tr %td= link_to delivery.delivered_on, [@supplier, delivery] %td= link_to_invoice(delivery) .form-actions - = link_to "Neue Lieferung anlegen", new_supplier_delivery_path(@supplier), class: 'btn' - = link_to "Zeige alle Lieferungen", supplier_deliveries_path(@supplier) \ No newline at end of file + = link_to t('.new_delivery'), new_supplier_delivery_path(@supplier), class: 'btn' + = link_to t('.show_deliveries'), supplier_deliveries_path(@supplier) diff --git a/config/locales/de/de.defaults.yml b/config/locales/de/de.defaults.yml index 9da33386..17390db2 100644 --- a/config/locales/de/de.defaults.yml +++ b/config/locales/de/de.defaults.yml @@ -269,6 +269,8 @@ de: # general user-interface ui: close: 'Schließen' + edit: 'Bearbeiten' + delete: 'Löschen' marks: close: 'x' diff --git a/config/locales/de/de.simple_form.yml b/config/locales/de/de.simple_form.yml index 5ef3150c..b7a602b5 100644 --- a/config/locales/de/de.simple_form.yml +++ b/config/locales/de/de.simple_form.yml @@ -66,10 +66,12 @@ de: body: 'Inhalt' parent_id: Oberseite supplier: + name: 'Name' address: 'Adresse' phone: 'Telefon' phone2: 'Telefon 2' fax: 'FAX' + email: 'Email' url: 'Homepage' contact_person: 'Ansprechparter_in' customer_number: 'Kundennummer' @@ -77,6 +79,7 @@ de: order_howto: 'Howto Bestellen' note: 'Notiz' min_order_quantity: 'Mindestbestellmenge' + is_subscribed: 'abonniert?' article: availability: 'Artikel ist verfügbar?' origin: 'Herkunft' diff --git a/config/locales/de/de.suppliers.yml b/config/locales/de/de.suppliers.yml new file mode 100644 index 00000000..55e0117e --- /dev/null +++ b/config/locales/de/de.suppliers.yml @@ -0,0 +1,30 @@ +de: + suppliers: + shared_supplier_note: 'Lieferantin ist mit externer Datenbank verknüpft.' + index: + title: 'Lieferanten' + action_new: 'Neue Lieferantin anlegen' + action_import: 'Lieferantin aus externer Datenbank importieren' + articles: 'Artikel (%{count})' + stock: 'im Lager (%{count})' + deliveries: 'Lieferungen (%{count})' + confirm_del: 'Achtung, willst Du wirklich den Lieferanten %{name} löschen?' + edit: + title: 'Lieferantin bearbeiten' + form: + cancel: 'oder abbrechen' + new: + title: 'Neue Lieferantin' + show: + confirm_delete: 'Bist Du sicher?' + last_deliveries: 'Letzte Lieferungen' + new_delivery: 'Neue Lieferung anlegen' + show_deliveries: 'Zeige alle Lieferungen' + shared_suppliers: + title: 'Externe Listen' + body: +
Hier werden die Lieferantinnen der externen Datenbank angezeigt.
+Ihr könnt externe Lieferantinnen importieren, indem ihr sie einfach abonniert. (siehe unten)
+Damit wird eine neue Lieferantin angelegt und mit der externen Datenbank verknüpft.
+ supplier: 'Lieferantin' + subscribe: 'abonnieren'