From 25a2732253e16d9bbb3f91e937eec579d2902be4 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Sun, 2 Dec 2012 15:14:31 +1100 Subject: [PATCH] Add basic styling to order cycle edit page --- app/assets/stylesheets/admin/openfoodweb.css.scss | 12 ++++++++++++ app/views/admin/order_cycles/_form.html.haml | 11 +++++++---- app/views/admin/order_cycles/edit.html.haml | 2 +- app/views/admin/order_cycles/new.html.haml | 2 +- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/admin/openfoodweb.css.scss b/app/assets/stylesheets/admin/openfoodweb.css.scss index dafc21a80a..53f28694a7 100644 --- a/app/assets/stylesheets/admin/openfoodweb.css.scss +++ b/app/assets/stylesheets/admin/openfoodweb.css.scss @@ -22,3 +22,15 @@ .ng .ng-invalid.ng-dirty { background-color: #fa787e; } + + +form.order_cycle { + h2 { + margin-top: 2em; + } + table.exchanges { + tr td.active { + width: 20px; + } + } +} diff --git a/app/views/admin/order_cycles/_form.html.haml b/app/views/admin/order_cycles/_form.html.haml index 1992ae7959..1c64ba61cb 100644 --- a/app/views/admin/order_cycles/_form.html.haml +++ b/app/views/admin/order_cycles/_form.html.haml @@ -10,9 +10,9 @@ %h2 Incoming -%table +%table.exchanges %tr{'ng-repeat' => 'exchange in order_cycle.incoming_exchanges'} - %td= check_box_tag 'order_cycle_exchange_{{ $index }}_active', 1, 1, 'ng-model' => 'exchange.active', 'id' => 'order_cycle_exchange_{{ $index }}_active' + %td.active= check_box_tag 'order_cycle_exchange_{{ $index }}_active', 1, 1, 'ng-model' => 'exchange.active', 'id' => 'order_cycle_exchange_{{ $index }}_active' %td {{ enterprises[exchange.enterprise_id].name }} = select_tag :new_supplier_id, options_from_collection_for_select(Enterprise.is_primary_producer, :id, :name), {'ng-model' => 'new_supplier_id'} @@ -30,5 +30,8 @@ or = link_to 'Cancel', main_app.admin_order_cycles_path -%pre {{ order_cycle | json }} -%pre {{ enterprises | json }} + +

Debug information

+ +%pre order_cycle = {{ order_cycle | json }} +%pre enterprises = {{ enterprises | json }} diff --git a/app/views/admin/order_cycles/edit.html.haml b/app/views/admin/order_cycles/edit.html.haml index 9168d68f92..9bf0a8ca31 100644 --- a/app/views/admin/order_cycles/edit.html.haml +++ b/app/views/admin/order_cycles/edit.html.haml @@ -1,4 +1,4 @@ %h1 Edit Order Cycle -= form_for [main_app, :admin, @order_cycle], :url => '', :html => {:class => 'ng', 'ng-app' => 'order_cycle', 'ng-controller' => 'AdminEditOrderCycleCtrl', 'ng-submit' => 'submit()'} do |f| += form_for [main_app, :admin, @order_cycle], :url => '', :html => {:class => 'ng order_cycle', 'ng-app' => 'order_cycle', 'ng-controller' => 'AdminEditOrderCycleCtrl', 'ng-submit' => 'submit()'} do |f| = render 'form', :f => f diff --git a/app/views/admin/order_cycles/new.html.haml b/app/views/admin/order_cycles/new.html.haml index 82c19db25d..c2e9c924f2 100644 --- a/app/views/admin/order_cycles/new.html.haml +++ b/app/views/admin/order_cycles/new.html.haml @@ -1,4 +1,4 @@ %h1 New Order Cycle -= form_for [main_app, :admin, @order_cycle], :url => '', :html => {:class => 'ng', 'ng-app' => 'order_cycle', 'ng-controller' => 'AdminCreateOrderCycleCtrl', 'ng-submit' => 'submit()'} do |f| += form_for [main_app, :admin, @order_cycle], :url => '', :html => {:class => 'ng order_cycle', 'ng-app' => 'order_cycle', 'ng-controller' => 'AdminCreateOrderCycleCtrl', 'ng-submit' => 'submit()'} do |f| = render 'form', :f => f