mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
SO Index: Adding begins_on and ends_on columns
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class Api::Admin::IndexStandingOrderSerializer < ActiveModel::Serializer
|
||||
attributes :id, :begins_at, :ends_at
|
||||
attributes :id, :begins_on, :ends_on
|
||||
|
||||
has_one :shop, serializer: Api::Admin::IdNameSerializer
|
||||
has_one :customer, serializer: Api::Admin::IdEmailSerializer # Remove IdEmailSerializer if no longer user here
|
||||
@@ -7,11 +7,11 @@ class Api::Admin::IndexStandingOrderSerializer < ActiveModel::Serializer
|
||||
has_one :payment_method, serializer: Api::Admin::IdNameSerializer
|
||||
has_one :shipping_method, serializer: Api::Admin::IdNameSerializer
|
||||
|
||||
def begins_at
|
||||
object.begins_at.andand.strftime('%F')
|
||||
def begins_on
|
||||
object.begins_at.strftime('%b %d, %Y')
|
||||
end
|
||||
|
||||
def ends_at
|
||||
object.ends_at.andand.strftime('%F')
|
||||
def ends_on
|
||||
object.ends_at.andand.strftime('%b %d, %Y') || I18n.t(:ongoing)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
%table.index#standing_orders
|
||||
%col.customer{ width: "20%", 'ng-show' => 'columns.customer.visible' }
|
||||
%col.schedule{ width: "20%", 'ng-show' => 'columns.name.visible' }
|
||||
%col.schedule{ width: "15%", 'ng-show' => 'columns.schedule.visible' }
|
||||
%col.begins_on{ width: "15%", 'ng-show' => 'columns.begins_on.visible' }
|
||||
%col.ends_on{ width: "15%", 'ng-show' => 'columns.ends_on.visible' }
|
||||
%col.payment_method{ width: "20%", 'ng-show' => 'columns.payment_method.visible' }
|
||||
%col.shipping_method{ width: "20%", 'ng-show' => 'columns.shipping_method.visible' }
|
||||
-# %col.actions
|
||||
%thead
|
||||
%tr
|
||||
@@ -10,6 +14,10 @@
|
||||
= t('admin.customer')
|
||||
%th.schedule{ ng: { show: 'columns.schedule.visible', } }
|
||||
= t('admin.schedule')
|
||||
%th.begins_on{ ng: { show: 'columns.begins_on.visible', } }
|
||||
= t('admin.begins_on')
|
||||
%th.ends_on{ ng: { show: 'columns.ends_on.visible', } }
|
||||
= t('admin.ends_on')
|
||||
%th.payment_method{ ng: { show: 'columns.payment_method.visible', } }
|
||||
= t('admin.payment_method')
|
||||
%th.shipping_method{ ng: { show: 'columns.shipping_method.visible', } }
|
||||
@@ -19,6 +27,8 @@
|
||||
%tr.standing_order{ :id => "so_{{standingOrder.id}}", ng: { repeat: "standingOrder in standingOrders | filter:query", class: { even: "'even'", odd: "'odd'" } } }
|
||||
%td.customer{ ng: { show: 'columns.customer.visible', bind: '::standingOrder.customer.email' } }
|
||||
%td.schedule{ ng: { show: 'columns.schedule.visible', bind: '::standingOrder.schedule.name' } }
|
||||
%td.begins_on{ ng: { show: 'columns.begins_on.visible', bind: '::standingOrder.begins_on' } }
|
||||
%td.ends_on{ ng: { show: 'columns.ends_on.visible', bind: '::standingOrder.ends_on' } }
|
||||
%td.payment_method{ ng: { show: 'columns.payment_method.visible', bind: '::standingOrder.payment_method.name' } }
|
||||
%td.shipping_method{ ng: { show: 'columns.shipping_method.visible', bind: '::standingOrder.shipping_method.name' } }
|
||||
-# %td.actions
|
||||
|
||||
@@ -128,6 +128,7 @@ en:
|
||||
say_no: "No"
|
||||
say_yes: "Yes"
|
||||
then: then
|
||||
ongoing: Ongoing
|
||||
sort_order_cycles_on_shopfront_by: "Sort Order Cycles On Shopfront By"
|
||||
required_fields: Required fields are denoted with an asterisk
|
||||
select_continue: Select and Continue
|
||||
@@ -189,10 +190,12 @@ en:
|
||||
admin:
|
||||
# Common properties / models
|
||||
begins_at: Begins At
|
||||
begins_on: Begins On
|
||||
customer: Customer
|
||||
date: Date
|
||||
email: Email
|
||||
ends_at: Ends At
|
||||
ends_on: Ends On
|
||||
name: Name
|
||||
on_hand: On Hand
|
||||
on_demand: On Demand
|
||||
|
||||
@@ -102,6 +102,8 @@ module OpenFoodNetwork
|
||||
{
|
||||
customer: { name: I18n.t("admin.customer"), visible: true },
|
||||
schedule: { name: I18n.t("admin.schedule"), visible: true },
|
||||
begins_on: { name: I18n.t("admin.begins_on"), visible: true },
|
||||
ends_on: { name: I18n.t("admin.ends_on"), visible: true },
|
||||
payment_method: { name: I18n.t("admin.payment_method"), visible: false },
|
||||
shipping_method: { name: I18n.t("admin.shipping_method"), visible: false }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user