fixed 'edit this form' button
This commit is contained in:
parent
71735f3bec
commit
4c21c176c2
|
@ -1,8 +1,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
angular.module('core').controller('HomeController', ['$rootScope', '$scope', 'User', 'Auth', '$state',
|
angular.module('core').controller('HomeController', ['$rootScope', '$scope', 'User', '$state',
|
||||||
function($rootScope, $scope, User, Auth, $state) {
|
function($rootScope, $scope, User, $state) {
|
||||||
$scope = $rootScope;
|
$scope = $rootScope;
|
||||||
}
|
}
|
||||||
]);
|
]);
|
|
@ -1,9 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// Forms controller
|
// Forms controller
|
||||||
angular.module('forms').controller('SubmitFormController', ['$scope', '$rootScope', '$stateParams', '$state', 'Forms', 'CurrentForm', 'Auth', 'myForm',
|
angular.module('forms').controller('SubmitFormController', ['$scope', '$rootScope', '$state', 'myForm',
|
||||||
function($scope, $rootScope, $stateParams, $state, Forms, CurrentForm, Auth, myForm) {
|
function($scope, $rootScope, $state, myForm) {
|
||||||
$scope.authentication = Auth;
|
$scope.authentication = $rootScope.authentication;
|
||||||
$scope.myform = myForm;
|
$scope.myform = myForm;
|
||||||
|
|
||||||
if(!$scope.myform.isLive){
|
if(!$scope.myform.isLive){
|
||||||
|
|
|
@ -9,6 +9,8 @@ angular.module('forms').directive('submitFormDirective', ['$http', '$timeout', '
|
||||||
myform:'='
|
myform:'='
|
||||||
},
|
},
|
||||||
controller: function($scope){
|
controller: function($scope){
|
||||||
|
$scope.authentication = $rootScope.authentication;
|
||||||
|
|
||||||
angular.element(document).ready(function() {
|
angular.element(document).ready(function() {
|
||||||
|
|
||||||
$scope.error = '';
|
$scope.error = '';
|
||||||
|
|
|
@ -61,7 +61,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="hidden-xs hidden-sm col-md-6 col-md-offset-3 row">
|
<div class="hidden-xs hidden-sm col-md-6 col-md-offset-3 row">
|
||||||
<div class="col-md-4 col-md-offset-2" ng-if="!authentication.isAuthenticated()">
|
<div class="col-md-4 col-md-offset-2" ng-if="!authentication.isAuthenticated()">
|
||||||
<a href="/#!/forms" class="btn btn-default">Create a NodeForm</a>
|
<a href="/#!/forms" class="btn btn-default">Create
|
||||||
|
a NodeForm</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-md-offset-2" ng-if="authentication.isAuthenticated()" class="hidden-sm hidden-xs">
|
<div class="col-md-4 col-md-offset-2" ng-if="authentication.isAuthenticated()" class="hidden-sm hidden-xs">
|
||||||
<a href="/#!/forms/{{myform._id}}/admin/create" class="btn btn-default">Edit this NodeForm</a>
|
<a href="/#!/forms/{{myform._id}}/admin/create" class="btn btn-default">Edit this NodeForm</a>
|
||||||
|
|
Loading…
Reference in a new issue