mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Make OC edit page steps clickable when editing an OC
This commit is contained in:
@@ -2,8 +2,6 @@ angular.module('admin.orderCycles')
|
||||
.controller 'AdminCreateOrderCycleCtrl', ($scope, $controller, $filter, $window, OrderCycle, Enterprise, EnterpriseFee, Schedules, RequestMonitor, ocInstance, StatusMessage) ->
|
||||
$controller('AdminOrderCycleBasicCtrl', {$scope: $scope, ocInstance: ocInstance})
|
||||
|
||||
$scope.view = 'general_settings'
|
||||
|
||||
$scope.order_cycle = OrderCycle.new({ coordinator_id: ocInstance.coordinator_id})
|
||||
$scope.enterprises = Enterprise.index(coordinator_id: ocInstance.coordinator_id)
|
||||
$scope.enterprise_fees = EnterpriseFee.index(coordinator_id: ocInstance.coordinator_id)
|
||||
|
||||
@@ -2,8 +2,6 @@ angular.module('admin.orderCycles')
|
||||
.controller 'AdminEditOrderCycleCtrl', ($scope, $controller, $filter, $location, $window, OrderCycle, Enterprise, EnterpriseFee, StatusMessage, Schedules, RequestMonitor, ocInstance) ->
|
||||
$controller('AdminOrderCycleBasicCtrl', {$scope: $scope, ocInstance: ocInstance})
|
||||
|
||||
$scope.view = 'general_settings'
|
||||
|
||||
order_cycle_id = $location.absUrl().match(/\/admin\/order_cycles\/(\d+)/)[1]
|
||||
$scope.order_cycle = OrderCycle.load(order_cycle_id)
|
||||
$scope.enterprises = Enterprise.index(order_cycle_id: order_cycle_id)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
angular.module('admin.orderCycles').controller 'AdminOrderCycleIncomingCtrl', ($scope, $controller, $location, Enterprise, ocInstance) ->
|
||||
$controller('AdminOrderCycleExchangesCtrl', {$scope: $scope, ocInstance: ocInstance, $location: $location})
|
||||
|
||||
$scope.view = 'incoming'
|
||||
|
||||
$scope.enterpriseTotalVariants = (enterprise) ->
|
||||
Enterprise.totalVariants(enterprise)
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
angular.module('admin.orderCycles').controller 'AdminOrderCycleOutgoingCtrl', ($scope, $controller, $filter, $location, OrderCycle, ocInstance, StatusMessage) ->
|
||||
$controller('AdminOrderCycleExchangesCtrl', {$scope: $scope, ocInstance: ocInstance, $location: $location})
|
||||
|
||||
$scope.view = 'outgoing'
|
||||
|
||||
$scope.productSuppliedToOrderCycle = (product) ->
|
||||
OrderCycle.productSuppliedToOrderCycle(product)
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@ ul.wizard-progress {
|
||||
line-height: 30px;
|
||||
padding: 0 25px 0 40px;
|
||||
position: relative;
|
||||
a {
|
||||
color: #494949;
|
||||
}
|
||||
&:first-child {
|
||||
padding-left: 25px;
|
||||
border-top-left-radius: 3px;
|
||||
@@ -62,6 +65,9 @@ ul.wizard-progress {
|
||||
&.current {
|
||||
background-color: $color_selected;
|
||||
color: #fff;
|
||||
a {
|
||||
color: #fff;
|
||||
}
|
||||
&:after {
|
||||
background-color: $color_selected;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
= render 'wizard_progress'
|
||||
|
||||
%fieldset.no-border-bottom
|
||||
%legend{ align: 'center'}= t('spree.general_settings')
|
||||
%legend{ align: 'center'}= t('.general_settings')
|
||||
|
||||
= render 'name_and_timing_form', f: f
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
%ul.wizard-progress
|
||||
%li{ ng: { repeat: "step in ['general_settings','incoming','outgoing']", class: '{current: view==step}' } }
|
||||
{{ "admin.order_cycles.wizard_progress."+ step | t }}
|
||||
- if action_name == 'new'
|
||||
%li{ class: "current" }
|
||||
= t("admin.order_cycles.wizard_progress.edit")
|
||||
%li
|
||||
= t("admin.order_cycles.wizard_progress.incoming")
|
||||
%li
|
||||
= t("admin.order_cycles.wizard_progress.outgoing")
|
||||
- else
|
||||
%li{ class: "#{'current' if action_name == 'edit'}" }
|
||||
%a{href: "#{main_app.edit_admin_order_cycle_path(@order_cycle)}"}
|
||||
= t("admin.order_cycles.wizard_progress.edit")
|
||||
%li{ class: "#{'current' if action_name == 'incoming'}" }
|
||||
%a{href: "#{main_app.admin_order_cycle_incoming_path(@order_cycle)}"}
|
||||
= t("admin.order_cycles.wizard_progress.incoming")
|
||||
%li{ class: "#{'current' if action_name == 'outgoing'}" }
|
||||
%a{href: "#{main_app.admin_order_cycle_outgoing_path(@order_cycle)}"}
|
||||
= t("admin.order_cycles.wizard_progress.outgoing")
|
||||
|
||||
@@ -915,7 +915,7 @@ en:
|
||||
cancel: "Cancel"
|
||||
back_to_list: "Back To List"
|
||||
wizard_progress:
|
||||
general_settings: "1. General Settings"
|
||||
edit: "1. General Settings"
|
||||
incoming: "2. Incoming Products"
|
||||
outgoing: "3. Outgoing Products"
|
||||
exchange_form:
|
||||
@@ -944,6 +944,7 @@ en:
|
||||
any_enterprise: "Any Enterprise"
|
||||
any_schedule: "Any Schedule"
|
||||
form:
|
||||
general_settings: "General Settings"
|
||||
incoming: Incoming
|
||||
supplier: Supplier
|
||||
products: Products
|
||||
|
||||
Reference in New Issue
Block a user