Moving welcomeCrtl to enterprise module as sellsCtrl

This commit is contained in:
Rob Harrington
2014-10-24 09:10:45 +11:00
parent d2efd25e8d
commit 46ab424655
5 changed files with 5 additions and 6 deletions

View File

@@ -23,7 +23,6 @@
//= require ./products/products
//= require ./shipping_methods/shipping_methods
//= require ./users/users
//= require ./welcome/welcome
//= require textAngular.min.js
//= require textAngular-sanitize.min.js

View File

@@ -1,5 +1,5 @@
angular.module("admin.welcome")
.controller "welcomeCtrl", ($scope) ->
angular.module("admin.enterprises")
.controller "sellsCtrl", ($scope) ->
$scope.sells = "unspecified"
$scope.producer_profile_only = true
$scope.submitted = false

View File

@@ -1 +0,0 @@
angular.module("admin.welcome", [])

View File

@@ -1,4 +1,5 @@
= form_for @enterprise, url: main_app.set_sells_admin_enterprise_path(@enterprise), html: { name: "enterprise", novalidate: true } do |enterprise_form|
= form_for @enterprise, url: main_app.set_sells_admin_enterprise_path(@enterprise),
html: { name: "enterprise", novalidate: true, "ng-app" => "admin.enterprises", "ng-controller"=> 'sellsCtrl' } do |enterprise_form|
-# Have to use hidden:'true' on this input rather than type:'hidden' as the latter seems to break ngPattern and therefore validation
%input{ hidden: "true", name: "sells", ng: { required: true, pattern: "/^(none|own)$/", model: 'sells', value: "sells"} }
.options.sixteen.columns.alpha

View File

@@ -1,4 +1,4 @@
#welcome_page.sixteen.columns.alpha{ ng: { app: "admin.welcome", controller: 'welcomeCtrl' } }
#welcome_page.sixteen.columns.alpha
%header
%h1 Welcome to the Open Food Network!
%p