Files
openfoodnetwork/app/views/admin/order_cycles/_row.html.haml
2024-02-22 15:01:13 +11:00

40 lines
3.5 KiB
Plaintext

%tr{ "class" => "order-cycle-{{orderCycle.id}} {{orderCycle.status}}", "ng-repeat" => 'orderCycle in orderCycles | schedule:scheduleFilter | involving:involvingFilter | filter:{name: query} track by orderCycle.id' }
%td.name{ "ng-show" => 'columns.name.visible' }
%input{ "id" => 'oc{{::orderCycle.id}}_name', "name" => 'oc{{::orderCycle.id}}[name]', "type" => 'text', "ng-model" => 'orderCycle.name', "ng-disabled" => '!orderCycle.viewing_as_coordinator' }
%td.schedules{ "ng-show" => 'columns.schedules.visible' }
%span{ "ng-repeat" => 'schedule in orderCycle.schedules' }
%a{ 'schedule-dialog' => true, 'schedule-id' => '{{schedule.id}}' }
{{ schedule.name + ($last ? '' : ',') }}
%span{ "ng-show" => 'orderCycle.schedules.length == 0' } None
%td.orders_open_at{ "ng-show" => 'columns.open.visible' }
%input.datetimepicker{ "id" => 'oc{{::orderCycle.id}}_orders_open_at', "name" => 'oc{{::orderCycle.id}}[orders_open_at]', "type" => 'text', "change-warning" => 'orderCycle', "ng-if" => 'orderCycle.viewing_as_coordinator', "ng-model" => 'orderCycle.orders_open_at', "data-controller" => "flatpickr", "data-flatpickr-enable-time-value" => true }
%input{ "id" => 'oc{{::orderCycle.id}}_orders_open_at', "name" => 'oc{{::orderCycle.id}}[orders_open_at]', "type" => 'text', "disabled" => true, "ng-if" => '!orderCycle.viewing_as_coordinator', "ng-model" => 'orderCycle.orders_open_at' }
%td.orders_close_at{ "ng-show" => 'columns.close.visible' }
%input.datetimepicker{ "id" => 'oc{{::orderCycle.id}}_orders_close_at', "name" => 'oc{{::orderCycle.id}}[orders_close_at]', "type" => 'text', "change-warning" => 'orderCycle', "ng-if" => 'orderCycle.viewing_as_coordinator', "ng-model" => 'orderCycle.orders_close_at', "data-controller" => "flatpickr", "data-flatpickr-enable-time-value" => true }
%input{ "id" => 'oc{{::orderCycle.id}}_orders_close_at', "name" => 'oc{{::orderCycle.id}}[orders_close_at]', "type" => 'text', "disabled" => true, "ng-if" => '!orderCycle.viewing_as_coordinator', "ng-model" => 'orderCycle.orders_close_at' }
- unless simple_index
%td.producers{ "ng-show" => 'columns.producers.visible' }
%span{ "ofn-with-tip" => '{{ orderCycle.producerNames }}', "ng-show" => 'orderCycle.producers.length > 3' }
{{ orderCycle.producers.length }}
= t('.suppliers')
%span{ "ng-hide" => 'orderCycle.producers.length > 3', "ng-bind" => 'orderCycle.producerNames' }
%td.coordinator{ "ng-show" => 'columns.coordinator.visible', "ng-bind-html" => 'orderCycle.coordinator.name' }
%td.shops{ "ng-show" => 'columns.shops.visible' }
%span{ "ofn-with-tip" => '{{ orderCycle.shopNames }}', "ng-show" => 'orderCycle.shops.length > 3' }
{{ orderCycle.shops.length }}
= t('.distributors')
%span{ "ng-hide" => 'orderCycle.shops.length > 3', "ng-bind" => 'orderCycle.shopNames' }
%td.products{ "ng-show" => 'columns.products.visible' }
%span
{{orderCycle.variant_count}}
= t('.variants')
%td.actions
%a.edit-order-cycle.icon-edit.no-text{ "ofn-with-tip" => t(:edit), "ng-href" => '{{orderCycle.edit_path}}' }
%td.actions{ "ng-if" => 'orderCycle.viewing_as_coordinator' }
%a.clone-order-cycle.icon-copy.no-text{ "ofn-with-tip" => t(:clone), "ng-href" => '{{orderCycle.clone_path}}' }
%td.actions{ "ng-if" => 'orderCycle.deletable && orderCycle.viewing_as_coordinator' }
%a.delete-order-cycle.icon-trash.no-text{ "ofn-with-tip" => t(:remove), "ng-href" => '{{orderCycle.delete_path}}', "data-method" => 'delete', "data-confirm" => t(:are_you_sure), "data-ujs-navigate" => "false" }