Skip to content

Commit

Permalink
Adds 'create and continue' button on parcels, sales, and purchases
Browse files Browse the repository at this point in the history
  • Loading branch information
Brice TEXIER committed Nov 14, 2016
1 parent 6506b8a commit 7adde6c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/controllers/backend/parcels_controller.rb
Expand Up @@ -18,7 +18,8 @@

module Backend
class ParcelsController < Backend::BaseController
manage_restfully t3e: { nature: 'RECORD.nature.text'.c }, except: :new
manage_restfully t3e: { nature: 'RECORD.nature.text'.c }, except: :new,
continue: [:nature]

respond_to :csv, :ods, :xlsx, :pdf, :odt, :docx, :html, :xml, :json

Expand Down Expand Up @@ -196,6 +197,7 @@ def new
end
end
t3e(@parcel.attributes.merge(nature: @parcel.nature.text))
render locals: { with_continue: true }
end

# Converts parcel to trade
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/backend/purchases_controller.rb
Expand Up @@ -18,7 +18,8 @@

module Backend
class PurchasesController < Backend::BaseController
manage_restfully planned_at: 'Time.zone.today+2'.c, redirect_to: '{action: :show, id: "id".c}'.c, except: :new
manage_restfully planned_at: 'Time.zone.today+2'.c, redirect_to: '{action: :show, id: "id".c}'.c,
except: :new, continue: [:nature_id]

respond_to :csv, :ods, :xlsx, :pdf, :odt, :docx, :html, :xml, :json

Expand Down Expand Up @@ -147,6 +148,7 @@ def new
if address = Entity.of_company.default_mail_address
@purchase.delivery_address = address
end
render locals: { with_continue: true }
end

def abort
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/backend/sales_controller.rb
Expand Up @@ -18,7 +18,7 @@

module Backend
class SalesController < Backend::BaseController
manage_restfully except: [:index, :show, :new], redirect_to: '{action: :show, id: "id".c}'.c
manage_restfully except: [:index, :show, :new], redirect_to: '{action: :show, id: "id".c}'.c, continue: [:nature_id]

respond_to :csv, :ods, :xlsx, :pdf, :odt, :docx, :html, :xml, :json

Expand Down Expand Up @@ -192,6 +192,7 @@ def new
@sale.function_title = :default_letter_function_title.tl
@sale.introduction = :default_letter_introduction.tl
@sale.conclusion = :default_letter_conclusion.tl
render locals: { with_continue: true }
end

def duplicate
Expand Down

0 comments on commit 7adde6c

Please sign in to comment.