billy_cms 0.0.15 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/billy_cms/backend/controllers/attributes.controller.js +4 -4
- data/app/assets/javascripts/billy_cms/backend/controllers/page_types.controller.js +23 -1
- data/app/assets/javascripts/billy_cms/backend/factories/page_type.js +1 -0
- data/app/assets/javascripts/billy_cms/backend/jstree.js +735 -207
- data/app/assets/javascripts/billy_cms/frontend/editing.es6 +8 -3
- data/app/assets/stylesheets/billy_cms/backend/index.scss +4 -0
- data/app/assets/stylesheets/billy_cms/editmode.scss +6 -7
- data/app/controllers/api/page_types_controller.rb +21 -0
- data/app/controllers/api/pages_controller.rb +5 -4
- data/app/models/billy_cms/page.rb +1 -1
- data/app/views/billy_cms/backend/_page_types.html.erb +72 -48
- data/lib/billy_cms/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc0d73ca7fa60d20059fdae6eac48d43e9a2eedc
|
4
|
+
data.tar.gz: 6f57aa43b042cf96b1fe6e9bc0b6d1f1f5ee9797
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f2e2f83dda8d78dc19aa59325b4d7f4bd27e98c02c37c80e1222ffec9a8805c59e072d73efe36237c516772fddbb4ec3af5d2d589ad74eb8f471877e311394e
|
7
|
+
data.tar.gz: 6bb6213c04a9a30e542131c0e9b0dec191ebec900c544923b8b2cfb1c2f991f038b5ca9e2b38e8f70cd5f1d01d46c526493541ffb43b1647e801e029c557f3ba
|
@@ -5,13 +5,13 @@ angular.module('BillyCmsBackend').controller('AttributesCtrl', ['$scope', '$http
|
|
5
5
|
|
6
6
|
this.selectedTabIndex = 0;
|
7
7
|
|
8
|
-
this.
|
9
|
-
this.
|
8
|
+
this.resetNewPageType = function() {
|
9
|
+
this.newPageType = new AdditionalAttribute();
|
10
10
|
};
|
11
|
-
this.
|
11
|
+
this.resetNewPageType();
|
12
12
|
|
13
13
|
this.createAttribute = function() {
|
14
|
-
$http.post('/billy_cms/api/attributes.json', this.
|
14
|
+
$http.post('/billy_cms/api/attributes.json', this.newPageType)
|
15
15
|
.then(function(result) {
|
16
16
|
var attribute = new AdditionalAttribute(result.data.attribute);
|
17
17
|
$scope.app.allAdditionalAttributes.push(attribute);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
window.angular.module('BillyCmsBackend').controller('PageTypesCtrl', ['$scope', function($scope) {
|
3
|
+
window.angular.module('BillyCmsBackend').controller('PageTypesCtrl', ['$scope', '$http', 'PageType', function($scope, $http, PageType) {
|
4
4
|
var self = this;
|
5
5
|
$scope.$watch(
|
6
6
|
function() { return $scope.app.allPageTypes; },
|
@@ -35,6 +35,28 @@ window.angular.module('BillyCmsBackend').controller('PageTypesCtrl', ['$scope',
|
|
35
35
|
});
|
36
36
|
};
|
37
37
|
|
38
|
+
this.newPageType = new PageType({});
|
39
|
+
|
40
|
+
this.selectedTabIndex = 0;
|
41
|
+
|
42
|
+
this.resetNewPageType = function() {
|
43
|
+
this.newPageType = new PageType();
|
44
|
+
};
|
45
|
+
this.resetNewPageType();
|
46
|
+
|
47
|
+
this.createPageType = function() {
|
48
|
+
$http.post('/billy_cms/api/page_types.json', this.newPageType)
|
49
|
+
.then(function(result) {
|
50
|
+
var pageType = new PageType(result.data.page_type);
|
51
|
+
$scope.app.allPageTypes.push(pageType);
|
52
|
+
|
53
|
+
self.selectedTabIndex = 0;
|
54
|
+
})
|
55
|
+
.catch(function(err) {
|
56
|
+
alert(err);
|
57
|
+
})
|
58
|
+
};
|
59
|
+
|
38
60
|
this.removeAttribute = function(attribute) {
|
39
61
|
return this.selectedPageType.removeAdditionalAttribute(attribute).catch(function(err) {
|
40
62
|
alert(err);
|