diff --git a/app/views/admin/dhls/_method_details_form.html.erb b/app/views/admin/dhls/_method_details_form.html.erb new file mode 100644 index 0000000..3958ce4 --- /dev/null +++ b/app/views/admin/dhls/_method_details_form.html.erb @@ -0,0 +1,6 @@ + <%= f.field_container :details do %> + <%= f.label :details, t("details") %>
+ <%= f.text_area :method_details %> + <%= error_message_on :shipping_method, :method_details %> + <% end %> + diff --git a/app/views/shipment_mailer/dhls/_tracking_description.text.erb b/app/views/shipment_mailer/dhls/_tracking_description.text.erb new file mode 100644 index 0000000..d124ace --- /dev/null +++ b/app/views/shipment_mailer/dhls/_tracking_description.text.erb @@ -0,0 +1 @@ +<%= @shipment.shipping_method.method_details %> diff --git a/db/migrate/20120801104503_dhl_shipping_details.rb b/db/migrate/20120801104503_dhl_shipping_details.rb new file mode 100644 index 0000000..69d9aa0 --- /dev/null +++ b/db/migrate/20120801104503_dhl_shipping_details.rb @@ -0,0 +1,9 @@ +class DhlShippingDetails < ActiveRecord::Migration + def self.up + add_column :shipping_methods, :method_details, :string + end + + def self.down + remove_column :shipping_methods, :method_details + end +end diff --git a/lib/sysmocom_dhl_hooks.rb b/lib/sysmocom_dhl_hooks.rb index 1327fab..cb4429a 100644 --- a/lib/sysmocom_dhl_hooks.rb +++ b/lib/sysmocom_dhl_hooks.rb @@ -6,4 +6,8 @@ class SysmocomDhlHooks < Spree::ThemeSupport::HookListener # Add the DHL label download insert_after :admin_shipment_edit_buttons, 'admin/dhls/address_label' + + # Add shipment identification.. + insert_after :shipment_mailer_shipped_email_tracking, 'shipment_mailer/dhls/tracking_description' + insert_after :admin_shipping_method_form_fields, 'admin/dhls/method_details_form' end