neo4j-meta_model 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e13d833527f3508fca4580d9172b9cff349b9a5f
4
- data.tar.gz: e8220743ccc9acc90787b66ef7170d57c7ea3791
3
+ metadata.gz: 50f85430a3cc7e2acc8074edf4a6c2e9f48c4405
4
+ data.tar.gz: 218c95ae1a5cfcc9c4d635224674093d98bdee1a
5
5
  SHA512:
6
- metadata.gz: 4ea0cfe86e0d79a5919b94a438719a064bc221120d8ebcf7a00bc07d68bf8f99f064391336ea008eb7ad12cc639a533bb94747e44b29b6fd3cabb7791f900286
7
- data.tar.gz: 8f54492ab911f8b4bca8ff62b92cb9a82bdf387ad2f9a08556a35791cdcf7280e7197675d7c59dfe5429b5c5ad5de6c09bd953a5d1f6a11bd0d0ff1b8022f134
6
+ metadata.gz: b0311c5159ed85369fd6e215f7781e23487fb3a422a8dc2b45a177b86f69a8beca91c9967d598d750f92cb664c5870de4553ac947154e02ee11530aaf15e9a4d
7
+ data.tar.gz: 937993749747a17a1347249cb80322bf474fe202268d27a93e007a38ad6933c47705f480467ddb8ef8f2e7d0b8a9a5dc1ee5d8ba6fac19ecce7db4f7746faba5
@@ -136,6 +136,17 @@ ready = ->
136
136
  ).property('from_model', 'to_model')
137
137
 
138
138
 
139
+ standardize_name: (->
140
+ @set 'name', @standardized_name @get('name')
141
+ ).observes('name')
142
+
143
+ standardize_opposite_name: (->
144
+ @set 'opposite_name', @standardized_name @get('opposite_name')
145
+ ).observes('opposite_name')
146
+
147
+ standardized_name: (name) ->
148
+ name.replace(/^[\s0-9]/, '').replace(/[^a-zA-Z0-9]+/g, '_').toLowerCase()
149
+
139
150
  standardize_relationship_type: (->
140
151
  @set 'relationship_type', @get('relationship_type').replace(/[^a-zA-Z0-9]+/g, '_')
141
152
  ).observes('relationship_type')
@@ -205,7 +216,6 @@ ready = ->
205
216
 
206
217
  actions:
207
218
  create: (has_association) ->
208
- console.log 'create!'
209
219
  has_association.save().then (record) =>
210
220
  @transitionToRoute 'has_associations.index'
211
221
 
@@ -0,0 +1,22 @@
1
+
2
+ .row.has-associations-row
3
+ = has_association.from_model.class_name
4
+ .relationship
5
+ span.source-join-type
6
+ = has_association.source_join_type
7
+ span.source-association-name
8
+ = has_association.name
9
+
10
+ | :
11
+
12
+ = has_association.relationship_type
13
+ span.destination-join-type
14
+ = has_association.destination_join_type
15
+ span.destination-association-name
16
+ = has_association.opposite_name
17
+
18
+ i.glyphicon.glyphicon-triangle-right
19
+ = has_association.to_model.class_name
20
+
21
+ = yield
22
+
@@ -1,25 +1,7 @@
1
- link-to "has_associations.new" | New Association
1
+ .row
2
+ link-to "has_associations.new" class="btn btn-primary" | New Association
2
3
 
3
- table#has-associations-table.table.table-striped.table-bordered
4
+ .has-association-list
4
5
  each has_association in model
5
- tr
6
- td
7
- = has_association.from_model.class_name
8
- .relationship
9
- span.source-join-type
10
- = has_association.source_join_type
11
- span.source-association-name
12
- = has_association.name
13
-
14
- | :
15
-
16
- = has_association.relationship_type
17
- span.destination-join-type
18
- = has_association.destination_join_type
19
- span.destination-association-name
20
- = has_association.opposite_name
21
-
22
- i.glyphicon.glyphicon-triangle-right
23
- = has_association.to_model.class_name
24
- td
25
- a.btn.btn-danger click="delete has_association" DELETE
6
+ has-association-diagram has_association=has_association
7
+ a.btn.btn-danger.pull-right click="delete has_association" DELETE
@@ -1,22 +1,34 @@
1
+ .well.well-sm
2
+ p Here you can define an association between two models.
3
+ p First choose the join type and the source and destination</strong>.
4
+ p Then give names to the associations. These should finish the sentence "SOURCE/DESTINATION MODEL has one/many..." (e.g. Person has many <strong>comments</strong> / Comment has one <strong>person</strong>)
5
+ p Lastly give a relationship type. This should complete the sentence "SOURCE MODEL ... DESTINATION MODEL" (e.g. Person <strong>wrote_comment</strong> Comment)
6
+ p Rules
7
+ ul
8
+ li For name, opposite name, and relationship type spaces will be converted to underscores (_)
9
+ li Name and opposite name cannot start with numbers and cannot be upper case
10
+
1
11
 
2
12
  form.form-horizontal
3
13
  .form-group
4
14
  label
5
15
  .col-sm-2.control-label Join Type
6
- .col-sm-10
7
- view "select" content=model.join_types selectionBinding="model.has_association.join_type" class="form-control"
16
+ .col-sm-4
17
+ view "select" content=model.join_types selectionBinding="model.has_association.join_type" class="form-control" prompt="Please Select"
18
+ .col-sm-6
19
+ has-association-diagram has_association=model.has_association
8
20
 
9
21
  .form-group
10
22
  label
11
23
  .col-sm-2.control-label Source Model
12
24
  .col-sm-10
13
- view "select" content=model.models optionValuePath="content.id" optionLabelPath="content.class_name" selectionBinding="model.has_association.from_model" class="form-control"
25
+ view "select" content=model.models optionValuePath="content.id" optionLabelPath="content.class_name" selectionBinding="model.has_association.from_model" class="form-control" prompt="Please Select"
14
26
 
15
27
  .form-group
16
28
  label
17
29
  .col-sm-2.control-label Destination Model
18
30
  .col-sm-10
19
- view "select" content=model.models optionValuePath="content.id" optionLabelPath="content.class_name" selectionBinding="model.has_association.to_model" class="form-control"
31
+ view "select" content=model.models optionValuePath="content.id" optionLabelPath="content.class_name" selectionBinding="model.has_association.to_model" class="form-control" prompt="Please Select"
20
32
 
21
33
  .form-group
22
34
  label
@@ -26,17 +26,15 @@
26
26
  .well.property.col-sm-6 class=property.isDirty:has-warning:
27
27
  i.glyphicon.glyphicon-remove-circle.close.pull-right click="delete_property property"
28
28
 
29
- .form-group
30
- label
31
- .col-sm-2.control-label Name
32
- .col-sm-10
33
- = focus-input valueBinding="property.name" class="form-control"
34
-
35
- .form-group
36
- label
37
- .col-sm-2.control-label Type
38
- .col-sm-10
39
- view "select" content=property_types valueBinding="property.type" class="form-control"
29
+ label
30
+ .col-sm-2.control-label Name
31
+ .col-sm-10
32
+ = focus-input valueBinding="property.name" class="form-control"
33
+
34
+ label
35
+ .col-sm-2.control-label Type
36
+ .col-sm-10
37
+ view "select" content=property_types valueBinding="property.type" class="form-control"
40
38
 
41
39
  .form-group
42
40
  button.btn.btn-danger.pull-right click="delete model.model" DELETE!
@@ -1,8 +1,13 @@
1
+ .well.well-sm
2
+ p Here you can create new models and edit existing models.
3
+ p To create a model, enter the model name in the box below and click the button
4
+ p To edit a model, simply click on a model from the list
5
+
1
6
  .row
2
7
  div.col-sm-11
3
8
  = input valueBinding="new_model_name" class="form-control" placeholder="Model Name" class="form-control"
4
- a.btn.col-sm-1 click='add add_model_name'
5
- i.glyphicon.glyphicon-plus
9
+ a.btn.add-model-btn.col-sm-1 click='add add_model_name'
10
+ | +
6
11
 
7
12
 
8
13
  model-list node=model class="nested-list-group" id="model-list"
@@ -4,6 +4,19 @@
4
4
  *= require_self
5
5
  */
6
6
 
7
+ /* Gotten from: https://github.com/twbs/bootstrap-sass/blob/7d30630bc8d490239b15dce754dfba298a7d5bc2/assets/stylesheets/_bootstrap-sprockets.scss */
8
+ @function twbs-font-path($path) {
9
+ @return font-path($path);
10
+ }
11
+
12
+ @function twbs-image-path($path) {
13
+ @return image-path($path);
14
+ }
15
+
16
+ $bootstrap-sass-asset-helper: true;
17
+ /* end */
18
+
19
+
7
20
  #accordion .glyphicon { margin-right:10px; }
8
21
 
9
22
  #model-list {
@@ -59,9 +72,21 @@ label {
59
72
  }
60
73
  }
61
74
 
75
+ .add-model-btn {
76
+ font-size: 2em;
77
+ font-weight: bold;
78
+ margin: 0;
79
+ padding: 0;
80
+ line-height: 1em;
81
+ }
82
+
62
83
  $relationship-arrow-length: 60px;
63
84
 
64
- #has-associations-table {
85
+ .has-association-list .has-associations-row {
86
+ margin: 3em 0;
87
+ }
88
+
89
+ .has-associations-row {
65
90
  td {
66
91
  line-height: 4em;
67
92
  }
@@ -110,4 +135,15 @@ $relationship-arrow-length: 60px;
110
135
  position: absolute;
111
136
  transform: translate(5px,14px);
112
137
  }
138
+
139
+ .glyphicon-triangle-right {
140
+ top: -1px;
141
+ left: -5px;
142
+
143
+ &:before {
144
+ content: '>';
145
+ font-weight: bold;
146
+ font-size: 1.4em;
147
+ }
148
+ }
113
149
  }
@@ -19,7 +19,7 @@ body
19
19
  = link_to 'Models', root_path
20
20
 
21
21
  li
22
- = link_to 'Admin', meta_path
22
+ = link_to 'Admin', meta_path + '#/'
23
23
 
24
24
  .container
25
25
  = yield
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module MetaModel
3
- VERSION = "0.2.2"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -22,7 +22,7 @@ module MetaModel
22
22
  # Do not swallow errors in after_commit/after_rollback callbacks.
23
23
  config.active_record.raise_in_transactional_callbacks = true
24
24
 
25
-
25
+ config.assets.precompile << /\.(?:svg|eot|woff|ttf)\z/
26
26
 
27
27
  end
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-meta_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-27 00:00:00.000000000 Z
11
+ date: 2015-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -123,6 +123,7 @@ files:
123
123
  - app/assets/javascripts/router.js.coffee
124
124
  - app/assets/javascripts/store.js.coffee
125
125
  - app/assets/javascripts/templates/application.emblem
126
+ - app/assets/javascripts/templates/components/has-association-diagram.emblem
126
127
  - app/assets/javascripts/templates/components/model-list-item.emblem
127
128
  - app/assets/javascripts/templates/components/model-list.emblem
128
129
  - app/assets/javascripts/templates/has_associations/index.emblem