Skip to content

Commit

Permalink
Merge pull request #348 from foodcoop1040/copy_order
Browse files Browse the repository at this point in the history
Add possibility to copy an order
  • Loading branch information
wvengen committed Feb 18, 2015
2 parents bd31092 + e57fd50 commit 1ac2478
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions app/controllers/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def show
# Page to create a new order.
def new
@order = Order.new(supplier_id: params[:supplier_id]).init_dates
@order.article_ids = Order.find(params[:order_id]).article_ids if params[:order_id]
end

# Save a new order.
Expand Down
2 changes: 1 addition & 1 deletion app/views/orders/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
= link_to t('.action_receive'), receive_order_path(order), class: 'btn btn-small btn-success'

%td
= link_to t('ui.edit'), '#', class: 'btn btn-small disabled', tabindex: -1
= link_to t('ui.copy'), new_order_path(order_id: order, supplier_id: order.supplier), class: 'btn btn-small'
= link_to t('ui.show'), order, class: 'btn btn-small'
= link_to t('ui.delete'), order, data: {confirm: t('.confirm_delete')}, method: :delete,
class: 'btn btn-small btn-danger'
Expand Down
14 changes: 7 additions & 7 deletions app/views/orders/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
- title t('.title')

= render 'form'

- content_for :javascript do
:javascript
// select all articles by default
$(function() {
$('#checkall').click();
});
- if @order.article_ids.empty?
- content_for :javascript do
:javascript
// select all articles by default
$(function() {
$('#checkall').click();
});
1 change: 1 addition & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1649,6 +1649,7 @@ de:
actions: Aktionen
cancel: Abbrechen
close: Schließen
copy: Kopieren
delete: Löschen
edit: Bearbeiten
marks:
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,7 @@ en:
actions: Actions
cancel: Cancel
close: Close
copy: Copy
delete: Delete
edit: Edit
marks:
Expand Down
1 change: 1 addition & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,7 @@ fr:
actions: Actions
cancel: Annuler
close: Fermer
copy: Copier
delete: Supprimer
edit: Modifier
marks:
Expand Down
1 change: 1 addition & 0 deletions config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,7 @@ nl:
actions: Acties
cancel: Annuleren
close: Sluiten
copy: Kopiëren
delete: Verwijder
edit: Bewerk
marks:
Expand Down

0 comments on commit 1ac2478

Please sign in to comment.