mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-15 23:57:48 +00:00
Add upload timestamp to TCs upload form in enterprise business details
This commit is contained in:
@@ -6,7 +6,8 @@ class Api::Admin::EnterpriseSerializer < ActiveModel::Serializer
|
||||
:preferred_product_selection_from_inventory_only,
|
||||
:preferred_show_customer_names_to_suppliers, :owner, :contact, :users, :tag_groups,
|
||||
:default_tag_group, :require_login, :allow_guest_orders, :allow_order_changes,
|
||||
:logo, :promo_image, :terms_and_conditions, :terms_and_conditions_file_name
|
||||
:logo, :promo_image, :terms_and_conditions,
|
||||
:terms_and_conditions_file_name, :terms_and_conditions_updated_at
|
||||
|
||||
has_one :owner, serializer: Api::Admin::UserSerializer
|
||||
has_many :users, serializer: Api::Admin::UserSerializer
|
||||
@@ -21,9 +22,13 @@ class Api::Admin::EnterpriseSerializer < ActiveModel::Serializer
|
||||
end
|
||||
|
||||
def terms_and_conditions
|
||||
return unless @object.terms_and_conditions.file?
|
||||
return unless object.terms_and_conditions.file?
|
||||
|
||||
@object.terms_and_conditions.url
|
||||
object.terms_and_conditions.url
|
||||
end
|
||||
|
||||
def terms_and_conditions_updated_at
|
||||
object.terms_and_conditions_updated_at&.to_s
|
||||
end
|
||||
|
||||
def tag_groups
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
= f.label :terms_and_conditions, t('.terms_and_conditions')
|
||||
|
||||
.omega.eight.columns
|
||||
%a{ href: '{{ Enterprise.terms_and_conditions }}', target: "_blank", ng: { if: 'Enterprise.terms_and_conditions' } }
|
||||
= '{{ Enterprise.terms_and_conditions_file_name }}'
|
||||
%a{ href: '{{ Enterprise.terms_and_conditions }}', target: '_blank', ng: { if: 'Enterprise.terms_and_conditions' } }
|
||||
= '{{ Enterprise.terms_and_conditions_file_name }}' " uploaded on " '{{ Enterprise.terms_and_conditions_updated_at }}'
|
||||
.pad-top
|
||||
= f.file_field :terms_and_conditions
|
||||
.pad-top
|
||||
|
||||
Reference in New Issue
Block a user