billy_cms 0.0.18 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f987c96e0d13b400d49fa9f5056d5e15d899d940
4
- data.tar.gz: a6b1e0b07f002d25b0a1398b3fb40a2a1d587cd5
3
+ metadata.gz: 8ac003fcd657103097aa72393c7866948713dafb
4
+ data.tar.gz: c4d5897f877e027fa0fd9150364e41a63bd580f8
5
5
  SHA512:
6
- metadata.gz: 310fb4a40b442164c1a895d5d27a5a345a82765a93a6e6478d55e72683254d5b1472c1eb5707507a140497a81b1d77e8340f8e6994e91b556f3a3029ed85370e
7
- data.tar.gz: ac975b4e9087836bfc0c34fe1c22c3f8cca38a1481d97776bffdf296c19079dcdbf73f8a4cb95dccfc763dbcc6bad2d7c2290c739fdafbe6020ce8e68bfcd4dd
6
+ metadata.gz: beb64680c5941679e0cf7bbcb2708af749eb6ea468cf8d0268629f8393b4fc089c2bbc94ccde3de968adc592aa70374cf1538d53008077b58fe366368a146a78
7
+ data.tar.gz: b692f42bd5a42ecd41c61c054a7d2f51ead8f5bcdaf8397645eea7d10630dd7504fe16bf340e58ec2df5fe7773406a8f9e9b277dcd0a2ef42e4338a75d4ccf32
@@ -6,22 +6,23 @@ angular.module('BillyCmsBackend').controller('AttributesCtrl', ['$scope', '$http
6
6
  this.selectedTabIndex = 0;
7
7
 
8
8
  this.resetNewPageType = function() {
9
- this.newPageType = new AdditionalAttribute();
9
+ this.newAttribute = new AdditionalAttribute();
10
10
  };
11
11
  this.resetNewPageType();
12
12
 
13
13
  this.createAttribute = function() {
14
- $http.post('/billy_cms/api/attributes.json', this.newPageType)
14
+ $http.post('/billy_cms/api/attributes.json', this.newAttribute)
15
15
  .then(function(result) {
16
16
  var attribute = new AdditionalAttribute(result.data.attribute);
17
17
  $scope.app.allAdditionalAttributes.push(attribute);
18
18
 
19
19
  self.selectedTabIndex = 0;
20
20
  })
21
- .catch(function(err) {
21
+ .catch(function(response) {
22
+ var err = response.status + ': ' + response.data.error;
22
23
  alert(err);
23
- })
24
- }
24
+ });
25
+ };
25
26
 
26
27
  return this;
27
28
  }]);
@@ -15,7 +15,7 @@ BillyCms.Editing = {
15
15
  } else {
16
16
  editableFields = $('[contenteditable]');
17
17
  }
18
- var container = $('.container');
18
+ var container = $(document.body);
19
19
  if (state === true) {
20
20
  container.addClass('edit-mode-enabled');
21
21
  editableFields.attr('contenteditable', true);
@@ -35,7 +35,7 @@ module Api
35
35
  else
36
36
  render json: {
37
37
  success: false,
38
- error: attribute.error_messages,
38
+ error: attribute.errors.full_messages.join('. '),
39
39
  }, status: 500
40
40
  end
41
41
  end
@@ -4,5 +4,9 @@ module BillyCms
4
4
 
5
5
  has_many :additional_attributes_page_types, class_name: 'BillyCms::AdditionalAttributesPageTypes'
6
6
  has_many :page_types, through: :additional_attributes_page_types
7
+
8
+ validates_presence_of :title
9
+ validates_presence_of :name
10
+ validates_presence_of :attribute_type
7
11
  end
8
12
  end
@@ -1,3 +1,3 @@
1
1
  module BillyCms
2
- VERSION = "0.0.18"
2
+ VERSION = "0.0.19"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - unsdrei GbR
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-12 00:00:00.000000000 Z
11
+ date: 2016-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler