Skip to content

Commit

Permalink
Close #757 view ticket details from the backend (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimsrung authored Oct 27, 2023
1 parent 606da77 commit d1fcbce
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 10 deletions.
11 changes: 11 additions & 0 deletions app/controllers/spree_cm_commissioner/orders_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class SpreeCmCommissioner::OrdersController < Spree::BaseController
layout 'spree_cm_commissioner/layouts/order_mailer'
helper 'spree/mail'

def show
@order = Spree::Order.search_by_qr_data(params[:id])
@product_type = @order.products.first&.product_type || 'accommodation'

render :template => 'spree/order_mailer/confirm_email'
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- insert_after "erb[silent]:contains('content_for :page_actions')" -->

<%= button_link_to Spree.t('print'),
main_app.url_for("/o/#{order.qr_data}"),
icon: 'printer.svg',
target: :_blank %>
2 changes: 1 addition & 1 deletion app/views/spree/order_mailer/confirm_email.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<%= render 'spree_cm_commissioner/order_mailer/your_booking', order: @order, show_booking_header: false%>
<% end %>
<%= render 'spree_cm_commissioner/order_mailer/customer_info', order: @order%>
<%= render 'spree_cm_commissioner/order_mailer/info_notice'%>
<%= render 'spree_cm_commissioner/order_mailer/info_notice', product_type: @product_type%>
<%= render 'spree_cm_commissioner/order_mailer/support_contact'%>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="container">
<h2>** <%= I18n.t('mail.order_mailer.info_notice')%></h2>
<div class="description">
<%= raw notice_info(current_store, @product_type)%>
<%= raw notice_info(current_store, product_type)%>
</div>
</div>
</div>
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ en:
invoice: 'Invoice'
option_text: 'Option Text'
none: 'none'
print: 'Print'
alert_request_to_vendor: 'Alert request to vendor'
alerted_to_vendor: 'Alerted to vendor Telegram'
accept_all: 'Accept all'
Expand Down
17 changes: 9 additions & 8 deletions config/locales/km.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
km:
account_checker:
verify:
already_exist: "%{login} already exist"
not_exist: "%{login} not exist"
already_exist: '%{login} already exist'
not_exist: '%{login} not exist'

sms:
to:
Expand All @@ -27,10 +27,10 @@ km:
hello: 'Hello world'

recaptcha:
request_failed: "Request failed"
invalid_code: "Invalid code"
score_not_qualify: "Score is not qualify"
action_not_matched: "Action is not matched"
request_failed: 'Request failed'
invalid_code: 'Invalid code'
score_not_qualify: 'Score is not qualify'
action_not_matched: 'Action is not matched'

taxon:
icon: Icon (Square)
Expand Down Expand Up @@ -133,6 +133,7 @@ km:
invoice: 'វិក្កយបត្រ'
option_text: ''
none: 'គ្មាន'
print: 'បោះពុម្ព'
alert_request_to_vendor: 'Alert request to vendor'
alerted_to_vendor: 'Alerted to vendor Telegram'
accept_all: 'Accept all'
Expand All @@ -155,8 +156,8 @@ km:
new_customer: 'អតិថិជនថ្មី'
listing_price: 'តម្លៃលក់'
length: 'ប្រវែង'
preference: "Preference"
notification: "Notification"
preference: 'Preference'
notification: 'Notification'
promotion_rule_types:
fixed_date:
name: 'ថ្ងៃជាក់លាក់'
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,5 @@

Rails.application.routes.draw do
get 'i/:id', to: 'spree_cm_commissioner/qr_images#show', as: 'qr_image'
get 'o/:id', to: 'spree_cm_commissioner/orders#show', as: 'order'
end

0 comments on commit d1fcbce

Please sign in to comment.