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 +4 -4
- data/app/assets/javascripts/meta_model.js.coffee +11 -1
- data/app/assets/javascripts/templates/components/has-association-diagram.emblem +22 -0
- data/app/assets/javascripts/templates/has_associations/index.emblem +5 -23
- data/app/assets/javascripts/templates/has_associations/new.emblem +16 -4
- data/app/assets/javascripts/templates/models/edit.emblem +9 -11
- data/app/assets/javascripts/templates/models/hierarchy.emblem +7 -2
- data/app/assets/stylesheets/meta_model.css.scss +37 -1
- data/app/views/layouts/meta_model.html.slim +1 -1
- data/lib/neo4j/meta_model/version.rb +1 -1
- data/test/dummy/config/application.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50f85430a3cc7e2acc8074edf4a6c2e9f48c4405
|
4
|
+
data.tar.gz: 218c95ae1a5cfcc9c4d635224674093d98bdee1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
1
|
+
.row
|
2
|
+
link-to "has_associations.new" class="btn btn-primary" | New Association
|
2
3
|
|
3
|
-
|
4
|
+
.has-association-list
|
4
5
|
each has_association in model
|
5
|
-
|
6
|
-
|
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-
|
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
|
-
|
30
|
-
label
|
31
|
-
|
32
|
-
.
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
.
|
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
|
-
|
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
|
-
|
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
|
}
|
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.
|
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-
|
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
|