mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Side menu for enterprise group page
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
//= require ../shared/ng-infinite-scroll.min.js
|
||||
//= require ./admin
|
||||
//= require ./enterprises/enterprises
|
||||
//= require ./enterprise_groups/enterprise_groups
|
||||
//= require ./payment_methods/payment_methods
|
||||
//= require ./products/products
|
||||
//= require ./shipping_methods/shipping_methods
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
angular.module("admin.enterprise_groups")
|
||||
.controller "enterpriseGroupCtrl", ($scope, SideMenu) ->
|
||||
$scope.menu = SideMenu
|
||||
@@ -0,0 +1,13 @@
|
||||
angular.module("admin.enterprise_groups")
|
||||
.controller "sideMenuCtrl", ($scope, SideMenu) ->
|
||||
$scope.menu = SideMenu
|
||||
$scope.select = SideMenu.select
|
||||
|
||||
$scope.menu.setItems [
|
||||
{ name: 'Primary Details', icon_class: "icon-user" }
|
||||
{ name: 'About', icon_class: "icon-pencil" }
|
||||
{ name: 'Images', icon_class: "icon-picture" }
|
||||
{ name: 'Contact', icon_class: "icon-phone" }
|
||||
]
|
||||
|
||||
$scope.select(0)
|
||||
@@ -0,0 +1 @@
|
||||
angular.module("admin.enterprise_groups", ["admin.side_menu"])
|
||||
@@ -1,43 +1,11 @@
|
||||
= f.field_container :name do
|
||||
= f.label :name
|
||||
%br/
|
||||
= f.text_field :name
|
||||
= render :partial => 'spree/shared/error_messages', :locals => { :target => @enterprise }
|
||||
|
||||
= f.field_container :description do
|
||||
= f.label :description
|
||||
%br/
|
||||
= f.text_field :description
|
||||
|
||||
= f.field_container :long_description do
|
||||
= f.label :long_description
|
||||
%br/
|
||||
= f.text_area :long_description
|
||||
|
||||
= f.field_container :on_front_page do
|
||||
= f.label :on_front_page, 'On front page?'
|
||||
%br/
|
||||
= f.check_box :on_front_page
|
||||
|
||||
= f.field_container :enterprise_ids do
|
||||
= f.label :enterprise_ids, 'Enterprises'
|
||||
%br/
|
||||
= f.collection_select :enterprise_ids, Enterprise.all, :id, :name, {}, {class: "select2 fullwidth", multiple: true}
|
||||
|
||||
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :logo, class: 'with-tip', 'data-powertip' => 'This is the logo'
|
||||
.with-tip{'data-powertip' => 'This is the logo'}
|
||||
%a What's this?
|
||||
.omega.eight.columns
|
||||
= image_tag @object.logo.url if @object.logo.present?
|
||||
= f.file_field :logo
|
||||
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :promo_image, class: 'with-tip', 'data-powertip' => 'This image is displayed at the top of the Group profile'
|
||||
.with-tip{'data-powertip' => 'This image is displayed at the top of the Group profile'}
|
||||
%a What's this?
|
||||
.omega.eight.columns
|
||||
= image_tag @object.promo_image.url if @object.promo_image.present?
|
||||
= f.file_field :promo_image
|
||||
= form_for [main_app, :admin, @enterprise_group] do |f|
|
||||
.row{ ng: {app: 'admin.enterprise_groups', controller: 'enterpriseGroupCtrl'} }
|
||||
.sixteen.columns.alpha
|
||||
.four.columns.alpha
|
||||
= render 'admin/shared/side_menu'
|
||||
.one.column
|
||||
.eleven.columns.omega.fullwidth_inputs
|
||||
= render :partial => 'inputs', :locals => { :f => f }
|
||||
= render partial: "spree/admin/shared/#{action}_resource_links"
|
||||
|
||||
52
app/views/admin/enterprise_groups/_inputs.html.haml
Normal file
52
app/views/admin/enterprise_groups/_inputs.html.haml
Normal file
@@ -0,0 +1,52 @@
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Primary Details'" } }
|
||||
%legend Primary Details
|
||||
= f.field_container :name do
|
||||
= f.label :name
|
||||
%br/
|
||||
= f.text_field :name
|
||||
|
||||
= f.field_container :description do
|
||||
= f.label :description
|
||||
%br/
|
||||
= f.text_field :description
|
||||
|
||||
= f.field_container :on_front_page do
|
||||
= f.label :on_front_page, 'On front page?'
|
||||
%br/
|
||||
= f.check_box :on_front_page
|
||||
|
||||
= f.field_container :enterprise_ids do
|
||||
= f.label :enterprise_ids, 'Enterprises'
|
||||
%br/
|
||||
= f.collection_select :enterprise_ids, Enterprise.all, :id, :name, {}, {class: "select2 fullwidth", multiple: true}
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='About'" } }
|
||||
%legend About
|
||||
= f.field_container :long_description do
|
||||
= f.label :long_description
|
||||
%br/
|
||||
= f.text_area :long_description
|
||||
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Images'" } }
|
||||
%legend Images
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :logo, class: 'with-tip', 'data-powertip' => 'This is the logo'
|
||||
.with-tip{'data-powertip' => 'This is the logo'}
|
||||
%a What's this?
|
||||
.omega.eight.columns
|
||||
= image_tag @object.logo.url if @object.logo.present?
|
||||
= f.file_field :logo
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :promo_image, class: 'with-tip', 'data-powertip' => 'This image is displayed at the top of the Group profile'
|
||||
.with-tip{'data-powertip' => 'This image is displayed at the top of the Group profile'}
|
||||
%a What's this?
|
||||
.omega.eight.columns
|
||||
= image_tag @object.promo_image.url if @object.promo_image.present?
|
||||
= f.file_field :promo_image
|
||||
|
||||
%fieldset.alpha.no-border-bottom{ ng: { show: "menu.selected.name=='Contact'" } }
|
||||
%legend Contact
|
||||
TODO
|
||||
@@ -1,5 +1,3 @@
|
||||
= render :partial => 'spree/shared/error_messages', :locals => { :target => @enterprise }
|
||||
|
||||
= form_for [main_app, :admin, @enterprise_group] do |f|
|
||||
= render :partial => 'form', :locals => { :f => f }
|
||||
= render :partial => 'spree/admin/shared/edit_resource_links'
|
||||
= render 'admin/enterprise_groups/form', action: 'edit'
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
= render :partial => 'spree/shared/error_messages', :locals => { :target => @enterprise }
|
||||
|
||||
= form_for [main_app, :admin, @enterprise_group] do |f|
|
||||
= render :partial => 'form', :locals => { :f => f }
|
||||
= render :partial => 'spree/admin/shared/new_resource_links'
|
||||
= render 'admin/enterprise_groups/form', action: 'new'
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
.row
|
||||
.sixteen.columns.alpha
|
||||
.four.columns.alpha
|
||||
= render 'side_menu'
|
||||
= render 'admin/shared/side_menu'
|
||||
.one.column
|
||||
.eleven.columns.omega.fullwidth_inputs
|
||||
= render 'form', f: f
|
||||
|
||||
Reference in New Issue
Block a user