alchemy-chimera 0.5.3 → 1.0.1
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.
- package/CHANGELOG.md +33 -0
- package/assets/scripts/chimera/chimera.js +13 -288
- package/assets/stylesheets/chimera/chimera.scss +273 -0
- package/bootstrap.js +6 -302
- package/config/routes.js +53 -5
- package/controller/00-chimera_controller.js +16 -0
- package/controller/chimera_editor_controller.js +161 -615
- package/controller/chimera_static_controller.js +102 -9
- package/lib/chimera_config.js +107 -163
- package/model/model.js +1 -1
- package/package.json +8 -12
- package/view/chimera/dashboard.hwk +8 -0
- package/view/chimera/editor/index.hwk +20 -0
- package/view/chimera/sidebar.hwk +4 -0
- package/view/chimera/widgets.hwk +8 -0
- package/view/layouts/chimera_base.hwk +15 -0
- package/view/layouts/chimera_basics.hwk +15 -0
- package/view/layouts/chimera_body.hwk +24 -0
- package/assets/scripts/chimera/assoc_field.js +0 -311
- package/assets/scripts/chimera/boolean_field.js +0 -53
- package/assets/scripts/chimera/chimera_field.js +0 -617
- package/assets/scripts/chimera/chimera_field_wrapper.js +0 -557
- package/assets/scripts/chimera/date_field.js +0 -170
- package/assets/scripts/chimera/geopoint_field.js +0 -147
- package/assets/scripts/chimera/medium-button.js +0 -6
- package/assets/scripts/chimera/object_field.js +0 -51
- package/assets/scripts/chimera/page-editor.js +0 -3
- package/assets/scripts/chimera/password_field.js +0 -54
- package/assets/scripts/chimera/schema_field.js +0 -300
- package/assets/scripts/chimera/text_field.js +0 -119
- package/assets/scripts/rome/rome.js +0 -4978
- package/assets/scripts/vex/vex.dialog.js +0 -151
- package/assets/scripts/vex/vex.js +0 -193
- package/assets/stylesheets/chimera/chimera.less +0 -1075
- package/assets/stylesheets/chimera_old/chimera.less +0 -351
- package/assets/stylesheets/chimera_old/core.less +0 -315
- package/assets/stylesheets/chimera_old/font.less +0 -38
- package/assets/stylesheets/chimera_old/mixins.less +0 -35
- package/assets/stylesheets/chimera_old/page-editor.less +0 -23
- package/assets/stylesheets/rome/rome.less +0 -130
- package/assets/stylesheets/vex/vex-theme-bottom-right-corner.less +0 -613
- package/assets/stylesheets/vex/vex.default.less +0 -501
- package/assets/stylesheets/vex/vex.flat.less +0 -443
- package/assets/stylesheets/vex/vex.less +0 -320
- package/controller/chimera_page_controller.js +0 -14
- package/controller/chimera_settings_controller.js +0 -129
- package/controller/tasks_chimera_controller.js +0 -106
- package/helper/chimera_helper.js +0 -202
- package/lib/chimera_action_fields.js +0 -292
- package/lib/chimera_field/belongsto_chimera_field.js +0 -155
- package/lib/chimera_field/boolean_chimera_field.js +0 -19
- package/lib/chimera_field/date_chimera_field.js +0 -20
- package/lib/chimera_field/datetime_chimera_field.js +0 -20
- package/lib/chimera_field/enum_chimera_field.js +0 -131
- package/lib/chimera_field/geopoint_chimera_field.js +0 -20
- package/lib/chimera_field/habtm_chimera_field.js +0 -55
- package/lib/chimera_field/hasoneparent_chimera_field.js +0 -18
- package/lib/chimera_field/html_chimera_field.js +0 -20
- package/lib/chimera_field/object_chimera_field.js +0 -18
- package/lib/chimera_field/password_chimera_field.js +0 -18
- package/lib/chimera_field/schema_chimera_field.js +0 -149
- package/lib/chimera_field/text_chimera_field.js +0 -20
- package/lib/chimera_field/time_chimera_field.js +0 -18
- package/lib/chimera_field.js +0 -208
- package/model/setting_model.js +0 -51
- package/public/chimera/codedor.svg +0 -28
- package/view/chimera/dashboard.ejs +0 -5
- package/view/chimera/editor/add.ejs +0 -32
- package/view/chimera/editor/edit.ejs +0 -33
- package/view/chimera/editor/index.ejs +0 -87
- package/view/chimera/editor/remove.ejs +0 -23
- package/view/chimera/editor/view.ejs +0 -54
- package/view/chimera/elements/editor_actions.ejs +0 -4
- package/view/chimera/elements/empty +0 -0
- package/view/chimera/field_wrappers/_entries.ejs +0 -91
- package/view/chimera/field_wrappers/_wrapper.ejs +0 -78
- package/view/chimera/field_wrappers/date_edit.ejs +0 -23
- package/view/chimera/field_wrappers/date_list.ejs +0 -3
- package/view/chimera/field_wrappers/date_view.ejs +0 -16
- package/view/chimera/field_wrappers/default_edit.ejs +0 -22
- package/view/chimera/field_wrappers/default_list.ejs +0 -3
- package/view/chimera/field_wrappers/default_peek.ejs +0 -3
- package/view/chimera/field_wrappers/default_view.ejs +0 -14
- package/view/chimera/field_wrappers/geopoint_edit.ejs +0 -25
- package/view/chimera/field_wrappers/geopoint_list.ejs +0 -5
- package/view/chimera/field_wrappers/geopoint_view.ejs +0 -18
- package/view/chimera/field_wrappers/schema_edit.ejs +0 -19
- package/view/chimera/field_wrappers/text_edit.ejs +0 -22
- package/view/chimera/field_wrappers/text_list.ejs +0 -1
- package/view/chimera/fields/belongsto_edit.ejs +0 -4
- package/view/chimera/fields/belongsto_list.ejs +0 -1
- package/view/chimera/fields/belongsto_peek.ejs +0 -1
- package/view/chimera/fields/boolean_edit.ejs +0 -17
- package/view/chimera/fields/boolean_list.ejs +0 -3
- package/view/chimera/fields/boolean_view.ejs +0 -3
- package/view/chimera/fields/date_edit.ejs +0 -14
- package/view/chimera/fields/date_list.ejs +0 -9
- package/view/chimera/fields/date_peek.ejs +0 -9
- package/view/chimera/fields/date_view.ejs +0 -9
- package/view/chimera/fields/datetime_edit.ejs +0 -24
- package/view/chimera/fields/datetime_list.ejs +0 -9
- package/view/chimera/fields/datetime_view.ejs +0 -10
- package/view/chimera/fields/default_edit.ejs +0 -10
- package/view/chimera/fields/default_list.ejs +0 -15
- package/view/chimera/fields/default_view.ejs +0 -1
- package/view/chimera/fields/enum_edit.ejs +0 -10
- package/view/chimera/fields/geopoint_edit.ejs +0 -10
- package/view/chimera/fields/geopoint_list.ejs +0 -9
- package/view/chimera/fields/geopoint_view.ejs +0 -9
- package/view/chimera/fields/habtm_edit.ejs +0 -5
- package/view/chimera/fields/hasoneparent_edit.ejs +0 -6
- package/view/chimera/fields/hasoneparent_list.ejs +0 -1
- package/view/chimera/fields/object_edit.ejs +0 -8
- package/view/chimera/fields/password_edit.ejs +0 -11
- package/view/chimera/fields/schema_edit.ejs +0 -14
- package/view/chimera/fields/text_edit.ejs +0 -5
- package/view/chimera/fields/text_list.ejs +0 -9
- package/view/chimera/fields/text_view.ejs +0 -3
- package/view/chimera/fields/time_edit.ejs +0 -15
- package/view/chimera/fields/time_list.ejs +0 -9
- package/view/chimera/fields/time_view.ejs +0 -9
- package/view/chimera/page/edit.ejs +0 -18
- package/view/chimera/page_editor.ejs +0 -5
- package/view/chimera/sidebar.ejs +0 -40
- package/view/chimera/tasks/index.ejs +0 -114
- package/view/layouts/chimera.ejs +0 -12
- package/view/layouts/chimera_base.ejs +0 -11
- package/view/layouts/chimera_body.ejs +0 -43
|
@@ -1,24 +1,117 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The Chimera Static Controller class
|
|
3
3
|
*
|
|
4
|
-
* @author
|
|
5
|
-
* @since
|
|
6
|
-
* @version
|
|
4
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
5
|
+
* @since 0.2.0
|
|
6
|
+
* @version 1.0.0
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
Static.super.call(this, conduit);
|
|
10
|
-
});
|
|
8
|
+
const ChimeraStatic = Function.inherits('Alchemy.Controller.Chimera', 'Static');
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* The dashboard action
|
|
14
12
|
*
|
|
15
|
-
* @
|
|
13
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
14
|
+
* @since 0.1.0
|
|
15
|
+
* @version 1.0.0
|
|
16
|
+
*
|
|
17
|
+
* @param {Conduit} conduit
|
|
16
18
|
*/
|
|
17
19
|
ChimeraStatic.setAction(function dashboard(conduit) {
|
|
18
20
|
this.set('pagetitle', 'Dashboard');
|
|
19
21
|
this.render('chimera/dashboard');
|
|
20
22
|
});
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The sidebar action
|
|
26
|
+
*
|
|
27
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
28
|
+
* @since 1.0.0
|
|
29
|
+
* @version 1.0.1
|
|
30
|
+
*
|
|
31
|
+
* @param {Conduit} conduit
|
|
32
|
+
*/
|
|
33
|
+
ChimeraStatic.setAction(function sidebar(conduit) {
|
|
34
|
+
|
|
35
|
+
let widgets = [],
|
|
36
|
+
config;
|
|
37
|
+
|
|
38
|
+
if (Array.isArray(alchemy.plugins.chimera.sidebar_menu)) {
|
|
39
|
+
|
|
40
|
+
for (let entry of alchemy.plugins.chimera.sidebar_menu) {
|
|
41
|
+
|
|
42
|
+
if (!entry.model && !entry.href) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let model,
|
|
47
|
+
title = entry.title;
|
|
48
|
+
|
|
49
|
+
if (entry.model) {
|
|
50
|
+
model = Model.get(entry.model);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!title) {
|
|
54
|
+
if (model) {
|
|
55
|
+
title = model.constructor.title;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!title && entry.href) {
|
|
59
|
+
title = entry.href;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (entry.href) {
|
|
64
|
+
widgets.push({
|
|
65
|
+
type : 'link',
|
|
66
|
+
config : {
|
|
67
|
+
href : entry.href,
|
|
68
|
+
content: title
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
|
|
73
|
+
widgets.push({
|
|
74
|
+
type : 'link',
|
|
75
|
+
config : {
|
|
76
|
+
route : 'Chimera.Editor#index',
|
|
77
|
+
parameters: [
|
|
78
|
+
{name: 'model', value: model.constructor.type_name},
|
|
79
|
+
],
|
|
80
|
+
content: title
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
} else {
|
|
87
|
+
|
|
88
|
+
let models = Model.getAllChildren();
|
|
89
|
+
models.sortByPath(1, 'model_name');
|
|
90
|
+
|
|
91
|
+
for (let model of models) {
|
|
92
|
+
widgets.push({
|
|
93
|
+
type : 'link',
|
|
94
|
+
config : {
|
|
95
|
+
route : 'Chimera.Editor#index',
|
|
96
|
+
parameters: [
|
|
97
|
+
{name: 'model', value: model.type_name},
|
|
98
|
+
],
|
|
99
|
+
content: model.title
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
config = [
|
|
106
|
+
{
|
|
107
|
+
"type": "navigation",
|
|
108
|
+
"config": {
|
|
109
|
+
"widgets": widgets
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
];
|
|
113
|
+
|
|
114
|
+
this.set('navigation_widgets', config);
|
|
115
|
+
|
|
116
|
+
this.renderSegment('chimera/sidebar');
|
|
24
117
|
});
|
package/lib/chimera_config.js
CHANGED
|
@@ -5,218 +5,162 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @constructor
|
|
7
7
|
*
|
|
8
|
-
* @author Jelle De Loecker <jelle@
|
|
8
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
9
9
|
* @since 0.2.0
|
|
10
|
-
* @version 0.
|
|
10
|
+
* @version 1.0.0
|
|
11
11
|
*
|
|
12
12
|
* @param {Model} ModelClass
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
const Config = Function.inherits('Alchemy.Base', 'Alchemy.Chimera', function Config(ModelClass) {
|
|
15
15
|
|
|
16
16
|
// The modal class constructor
|
|
17
17
|
this.ModelClass = ModelClass;
|
|
18
18
|
|
|
19
|
-
// The different
|
|
20
|
-
this.
|
|
19
|
+
// The different default field sets
|
|
20
|
+
this.field_sets = {};
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Get the fieldset for a specific action
|
|
25
25
|
*
|
|
26
|
-
* @
|
|
27
|
-
* @since 0.2.1
|
|
28
|
-
* @version 0.2.1
|
|
26
|
+
* @deprecated
|
|
29
27
|
*
|
|
30
|
-
* @
|
|
31
|
-
*/
|
|
32
|
-
ChimeraConfig.setProperty('show_index_filters', true);
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* See if this model's blueprint contains translation fields
|
|
36
|
-
*
|
|
37
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
28
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
38
29
|
* @since 0.2.0
|
|
39
|
-
* @version 0.
|
|
30
|
+
* @version 1.0.0
|
|
40
31
|
*
|
|
41
|
-
* @return {
|
|
32
|
+
* @return {FieldSet}
|
|
42
33
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
for (key in this.ModelClass.blueprint) {
|
|
46
|
-
if (this.ModelClass.blueprint[key].translatable) {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return false;
|
|
34
|
+
Config.setMethod(function getActionFields(name) {
|
|
35
|
+
return this.getFieldSet(name);
|
|
52
36
|
});
|
|
53
37
|
|
|
54
38
|
/**
|
|
55
|
-
* Get
|
|
39
|
+
* Get a named fieldset
|
|
56
40
|
*
|
|
57
|
-
* @author Jelle De Loecker <jelle@
|
|
41
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
58
42
|
* @since 0.2.0
|
|
59
|
-
* @version 0.
|
|
43
|
+
* @version 1.0.0
|
|
60
44
|
*
|
|
61
|
-
* @return {
|
|
45
|
+
* @return {FieldSet}
|
|
62
46
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var modelName,
|
|
66
|
-
fields = [],
|
|
67
|
-
key;
|
|
68
|
-
|
|
69
|
-
modelName = this.ModelClass.prototype.name;
|
|
70
|
-
|
|
71
|
-
return this.ModelClass.blueprint.getSorted();
|
|
72
|
-
|
|
73
|
-
for (key in this.ModelClass.blueprint) {
|
|
74
|
-
fields.push({field: modelName + '.' + key, config: this.ModelClass.blueprint[key]});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (this.containsTranslations()) {
|
|
78
|
-
fields.push({meta: 'translations'});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return fields;
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Get the fieldgroup for a specific action
|
|
86
|
-
*
|
|
87
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
88
|
-
* @since 0.2.0
|
|
89
|
-
* @version 0.3.0
|
|
90
|
-
*
|
|
91
|
-
* @return {Deck}
|
|
92
|
-
*/
|
|
93
|
-
ChimeraConfig.setMethod(function getActionFields(name) {
|
|
94
|
-
|
|
95
|
-
var group;
|
|
47
|
+
Config.setMethod(function getFieldSet(name) {
|
|
96
48
|
|
|
97
49
|
if (name == null) {
|
|
98
50
|
throw new Error('No action group name was given');
|
|
99
51
|
}
|
|
100
52
|
|
|
101
|
-
|
|
102
|
-
group = new Classes.Alchemy.ChimeraActionFields(this.ModelClass, name);
|
|
103
|
-
this.actionGroups[name] = group;
|
|
104
|
-
} else {
|
|
105
|
-
group = this.actionGroups[name];
|
|
106
|
-
}
|
|
53
|
+
let set = this.field_sets[name];
|
|
107
54
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
* Get the fields to show in the given type
|
|
113
|
-
*
|
|
114
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
115
|
-
* @since 0.2.0
|
|
116
|
-
* @version 0.2.0
|
|
117
|
-
*
|
|
118
|
-
* @return {Array}
|
|
119
|
-
*/
|
|
120
|
-
ChimeraConfig.setMethod(function getFields(type) {
|
|
121
|
-
|
|
122
|
-
var fields;
|
|
123
|
-
|
|
124
|
-
fields = this.ModelClass.blueprint.getSorted();
|
|
55
|
+
if (!set) {
|
|
56
|
+
set = new Classes.Alchemy.Criteria.FieldSet(name, this.ModelClass);
|
|
57
|
+
this.field_sets[name] = set;
|
|
58
|
+
}
|
|
125
59
|
|
|
126
|
-
return
|
|
60
|
+
return set;
|
|
127
61
|
});
|
|
128
62
|
|
|
129
63
|
/**
|
|
130
|
-
* Get
|
|
64
|
+
* Get the widget configuration for the given action
|
|
131
65
|
*
|
|
132
|
-
* @author Jelle De Loecker <jelle@
|
|
133
|
-
* @since 0.
|
|
134
|
-
* @version 0.
|
|
66
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
67
|
+
* @since 1.0.0
|
|
68
|
+
* @version 1.0.0
|
|
135
69
|
*
|
|
136
|
-
* @param {String}
|
|
137
|
-
* @param {
|
|
138
|
-
* @param {Object} record Optional record
|
|
70
|
+
* @param {String} action
|
|
71
|
+
* @param {Conduit} conduit
|
|
139
72
|
*
|
|
140
|
-
* @return {
|
|
73
|
+
* @return {Object}
|
|
141
74
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
var actionFields,
|
|
145
|
-
subschema,
|
|
146
|
-
subrecord,
|
|
147
|
-
next_name,
|
|
148
|
-
pieces,
|
|
149
|
-
field,
|
|
150
|
-
first,
|
|
151
|
-
temp;
|
|
152
|
-
|
|
153
|
-
if (fieldName == null || typeof fieldName == 'object') {
|
|
154
|
-
record = fieldName;
|
|
155
|
-
fieldName = actionName;
|
|
156
|
-
actionName = 'edit';
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
pieces = fieldName.split('.');
|
|
160
|
-
|
|
161
|
-
// Remove the first piece if it's just this model name
|
|
162
|
-
if (pieces[0] == this.ModelClass.model_name) {
|
|
163
|
-
pieces.shift();
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
first = pieces.shift();
|
|
167
|
-
next_name = first;
|
|
75
|
+
Config.setMethod(function getWidgetConfig(action, conduit) {
|
|
168
76
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (this.actionGroups[actionName] == null) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
77
|
+
let fieldset,
|
|
78
|
+
widgets;
|
|
174
79
|
|
|
175
|
-
|
|
80
|
+
// @TODO: get the possible user-modified widget config!
|
|
176
81
|
|
|
177
|
-
|
|
178
|
-
subrecord = record;
|
|
82
|
+
let result = {};
|
|
179
83
|
|
|
180
|
-
|
|
84
|
+
if (action == 'edit') {
|
|
85
|
+
fieldset = this.getFieldSet('edit');
|
|
181
86
|
|
|
182
|
-
|
|
183
|
-
subschema = field.fieldType.getSubschema(subrecord, next_name);
|
|
87
|
+
let field_widgets = [];
|
|
184
88
|
|
|
185
|
-
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
89
|
+
let field;
|
|
188
90
|
|
|
189
|
-
|
|
190
|
-
actionFields = new Classes.Alchemy.ChimeraActionFields(subschema, actionName);
|
|
91
|
+
for (field of fieldset) {
|
|
191
92
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
93
|
+
field_widgets.push({
|
|
94
|
+
type : 'alchemy_field',
|
|
95
|
+
config : {
|
|
96
|
+
field : field.name,
|
|
97
|
+
view : field.options.view,
|
|
98
|
+
widget_settings : field.options.widget_settings || {},
|
|
99
|
+
}
|
|
100
|
+
});
|
|
198
101
|
}
|
|
199
102
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
if (Array.isArray(subrecord)) {
|
|
206
|
-
subrecord = subrecord[next_name];
|
|
103
|
+
field_widgets.push({
|
|
104
|
+
type : 'html',
|
|
105
|
+
config : {
|
|
106
|
+
html : '<button class="btn btn-submit" type="submit">Save</button>'
|
|
207
107
|
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
widgets = [
|
|
111
|
+
{
|
|
112
|
+
"type": "column",
|
|
113
|
+
"config": {
|
|
114
|
+
"widgets": [
|
|
115
|
+
{
|
|
116
|
+
"type": "header",
|
|
117
|
+
"config": {
|
|
118
|
+
"level": 1,
|
|
119
|
+
"content": this.ModelClass.title + ' edit',
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
"type": "alchemy_form",
|
|
123
|
+
"config": {
|
|
124
|
+
model : this.ModelClass.type_name,
|
|
125
|
+
view_type : 'edit',
|
|
126
|
+
widgets : field_widgets
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
];
|
|
208
133
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
134
|
+
} else {
|
|
135
|
+
fieldset = this.getFieldSet('list');
|
|
136
|
+
|
|
137
|
+
widgets = [
|
|
138
|
+
{
|
|
139
|
+
"type": "column",
|
|
140
|
+
"config": {
|
|
141
|
+
"widgets": [
|
|
142
|
+
{
|
|
143
|
+
"type": "alchemy_table",
|
|
144
|
+
"config": {
|
|
145
|
+
fieldset : fieldset,
|
|
146
|
+
page_size : 50,
|
|
147
|
+
show_filters : true,
|
|
148
|
+
id : 'aft-' + this.ModelClass.type_name,
|
|
149
|
+
recordsource : {
|
|
150
|
+
route : 'Chimera.Editor#records',
|
|
151
|
+
parameters : {
|
|
152
|
+
model : this.ModelClass.type_name
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
];
|
|
219
161
|
}
|
|
220
162
|
|
|
221
|
-
|
|
163
|
+
result.widgets = widgets;
|
|
164
|
+
|
|
165
|
+
return result;
|
|
222
166
|
});
|
package/model/model.js
CHANGED
package/package.json
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alchemy-chimera",
|
|
3
3
|
"description": "Chimera plugin for Alchemy MVC",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"author": "Jelle De Loecker <jelle@
|
|
4
|
+
"version": "1.0.1",
|
|
5
|
+
"author": "Jelle De Loecker <jelle@elevenways.be>",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"alchemy",
|
|
8
8
|
"alchemymvc",
|
|
9
9
|
"plugin",
|
|
10
10
|
"cms"
|
|
11
11
|
],
|
|
12
|
-
"repository": "
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"alchemy-ajatar-theme" : "~1.1.3",
|
|
15
|
-
"excel-export" : "0.3.11",
|
|
16
|
-
"msexcel-builder" : "0.0.x"
|
|
17
|
-
},
|
|
12
|
+
"repository": "11ways/alchemy-chimera",
|
|
18
13
|
"peerDependencies": {
|
|
19
|
-
"
|
|
20
|
-
"alchemy-
|
|
21
|
-
"
|
|
14
|
+
"alchemy-acl" : "~0.7.0",
|
|
15
|
+
"alchemy-menu" : "~0.6.0",
|
|
16
|
+
"alchemymvc" : "~1.1.0",
|
|
17
|
+
"alchemy-widget": "~0.1.0"
|
|
22
18
|
},
|
|
23
19
|
"license": "MIT",
|
|
24
20
|
"engines": {
|
|
25
|
-
"node": ">=
|
|
21
|
+
"node" : ">=12.0.0"
|
|
26
22
|
}
|
|
27
23
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{% include "layouts/chimera_basics" %}
|
|
2
|
+
|
|
3
|
+
{% block "main" %}
|
|
4
|
+
<alchemy-widgets
|
|
5
|
+
class="main-widgets"
|
|
6
|
+
#context_variables={% context_variables %}
|
|
7
|
+
#value={% widget_config %}
|
|
8
|
+
></alchemy-widgets>
|
|
9
|
+
{% /block %}
|
|
10
|
+
|
|
11
|
+
{% block "page-actions" %}
|
|
12
|
+
<a
|
|
13
|
+
!Route="Chimera.Editor#add"
|
|
14
|
+
#model={% model_name %}
|
|
15
|
+
class="btn"
|
|
16
|
+
>
|
|
17
|
+
<al-ico type="plus"></al-ico>
|
|
18
|
+
{%t "new" model=model_name %}
|
|
19
|
+
</a>
|
|
20
|
+
{% /block %}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<!-- This puts in all the required styles, scripts, ... -->
|
|
5
|
+
<% this.foundation({protoblast: true}) %>
|
|
6
|
+
<% script('chimera/chimera') %>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<!-- This is a block you can assign content to -->
|
|
10
|
+
<he-block data-he-name="base"></he-block>
|
|
11
|
+
|
|
12
|
+
<!-- This is an internal element you should not worry about -->
|
|
13
|
+
<he-bottom></he-bottom>
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{% extend "layouts/chimera_body" %}
|
|
2
|
+
|
|
3
|
+
{% if page_title %}
|
|
4
|
+
{% block "page-title" %}{{ page_title }}{% /block %}
|
|
5
|
+
{% /if %}
|
|
6
|
+
|
|
7
|
+
{% if window_title %}
|
|
8
|
+
<% set_title(window_title) %>
|
|
9
|
+
{% elseif page_title %}
|
|
10
|
+
<% set_title(page_title) %>
|
|
11
|
+
{% /if %}
|
|
12
|
+
|
|
13
|
+
{% if message %}
|
|
14
|
+
{% block "page-notification" %}<span class="notification">{{ message }}</span>{% /block %}
|
|
15
|
+
{% /if %}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{% extend "layouts/chimera_base" %}
|
|
2
|
+
|
|
3
|
+
<% style('chimera/chimera') %>
|
|
4
|
+
|
|
5
|
+
{% block "base" %}
|
|
6
|
+
<div class="chimera-wrapper">
|
|
7
|
+
<div class="chimera-sidebar">
|
|
8
|
+
<div class="chimera-page-header">
|
|
9
|
+
|
|
10
|
+
</div>
|
|
11
|
+
<%= Alchemy.segment('Chimera.Static#sidebar') %>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="chimera-content">
|
|
14
|
+
<div class="chimera-page-header">
|
|
15
|
+
<div class="page-title" data-he-name="page-title"></div>
|
|
16
|
+
<div class="page-notification" data-he-name="page-notification"></div>
|
|
17
|
+
<div class="page-actions" data-he-name="page-actions"></div>
|
|
18
|
+
</div>
|
|
19
|
+
<div data-he-name="main" class="chimera-main">
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
{% /block %}
|