alchemy-chimera 0.5.4 → 1.0.2
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 +39 -4
- package/assets/scripts/chimera/chimera.js +13 -288
- package/assets/stylesheets/chimera/chimera.scss +451 -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 +159 -614
- package/controller/chimera_static_controller.js +102 -9
- package/lib/chimera_config.js +138 -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 -622
- package/assets/scripts/chimera/chimera_field_wrapper.js +0 -558
- 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 -73
- 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 -160
- 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 -82
- 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 -12
- 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
package/model/setting_model.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Setting model
|
|
3
|
-
*
|
|
4
|
-
* @constructor
|
|
5
|
-
*
|
|
6
|
-
* @author Kjell Keisse <kjell@codedor.be>
|
|
7
|
-
* @since 0.2.0
|
|
8
|
-
* @version 0.2.0
|
|
9
|
-
*/
|
|
10
|
-
var Setting = Model.extend(function SettingModel(options) {
|
|
11
|
-
SettingModel.super.call(this, options);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Constitute the class wide schema
|
|
16
|
-
*
|
|
17
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
18
|
-
* @since 0.2.0
|
|
19
|
-
* @version 0.2.0
|
|
20
|
-
*/
|
|
21
|
-
Setting.constitute(function addFields() {
|
|
22
|
-
this.addField('email', 'String');
|
|
23
|
-
this.addField('google_analytics', 'String', {default: 'UA-XXXXX-Y'});
|
|
24
|
-
this.addField('site_name', 'String');
|
|
25
|
-
this.addField('cookie_warn_enable', 'Boolean');
|
|
26
|
-
this.addField('cookie_warn_page', 'String');
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Configure chimera for this model
|
|
31
|
-
*
|
|
32
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
33
|
-
* @since 0.2.0
|
|
34
|
-
* @version 0.2.0
|
|
35
|
-
*/
|
|
36
|
-
Setting.constitute(function chimeraConfig() {
|
|
37
|
-
|
|
38
|
-
var edit;
|
|
39
|
-
|
|
40
|
-
if (!this.chimera) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Get the edit group
|
|
45
|
-
edit = this.chimera.getActionFields('edit');
|
|
46
|
-
edit.addField('email');
|
|
47
|
-
edit.addField('google_analytics');
|
|
48
|
-
edit.addField('site_name');
|
|
49
|
-
edit.addField('cookie_warn_enable');
|
|
50
|
-
edit.addField('cookie_warn_page');
|
|
51
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
-
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
5
|
-
width="160px" height="85px" viewBox="0 0 160 85" enable-background="new 0 0 160 85" xml:space="preserve">
|
|
6
|
-
<polygon fill="#28F0C8" points="-76.355,239.387 273.492,-110.462 272.129,-110.462 -77.72,239.387 "/>
|
|
7
|
-
<g>
|
|
8
|
-
<g>
|
|
9
|
-
<path fill="#FFFFFF" d="M27.105,67.529l2.323-2.322c-0.787-0.859-1.247-2.051-1.247-3.354V61.81c0-2.565,1.817-4.661,4.343-4.661
|
|
10
|
-
c1.368,0,2.47,0.537,3.531,1.431l2.272-2.272c-1.368-1.307-3.04-2.195-5.783-2.195c-4.599,0-7.807,3.485-7.807,7.741v0.043
|
|
11
|
-
C24.738,64.137,25.628,66.132,27.105,67.529z"/>
|
|
12
|
-
</g>
|
|
13
|
-
<path fill="#FFFFFF" d="M50.162,54.367h5.839c4.705,0,7.956,3.229,7.956,7.442v0.043c0,4.214-3.251,7.485-7.956,7.485h-5.839
|
|
14
|
-
V54.367z M53.456,57.34v9.025h2.545c2.694,0,4.513-1.818,4.513-4.47v-0.043c0-2.651-1.819-4.513-4.513-4.513H53.456z"/>
|
|
15
|
-
<path fill="#FFFFFF" d="M65.762,54.367h11.292v2.93h-8.02v3.037h7.058v2.93h-7.058v3.145h8.127v2.93H65.762V54.367z"/>
|
|
16
|
-
<path fill="#FFFFFF" d="M110.383,54.285l-3.033,3.031c0.391-0.106,0.805-0.168,1.242-0.168c2.65,0,4.533,2.139,4.533,4.704v0.043
|
|
17
|
-
c0,2.565-1.838,4.663-4.49,4.663s-4.535-2.141-4.535-4.706V61.81c0-0.507,0.074-0.995,0.211-1.454l-3.428,3.428
|
|
18
|
-
c0.82,3.342,3.797,5.811,7.709,5.811c4.619,0,7.977-3.484,7.977-7.741V61.81C116.568,58.113,114.068,55.031,110.383,54.285z"/>
|
|
19
|
-
<path fill="#FFFFFF" d="M118.375,54.367h6.844c1.904,0,3.379,0.535,4.363,1.518c0.834,0.835,1.283,2.012,1.283,3.423v0.043
|
|
20
|
-
c0,2.417-1.305,3.935-3.209,4.641l3.658,5.347h-3.85l-3.209-4.791h-2.586v4.791h-3.295V54.367z M125.004,61.639
|
|
21
|
-
c1.605,0,2.525-0.855,2.525-2.117v-0.043c0-1.412-0.984-2.139-2.59-2.139h-3.27v4.299H125.004z"/>
|
|
22
|
-
<path fill="#FFFFFF" d="M93.629,66.21c-0.4,0.099-0.828,0.155-1.281,0.155h-2.547V57.34h2.547c2.693,0,4.512,1.861,4.512,4.513
|
|
23
|
-
v0.043c0,0.437-0.054,0.847-0.147,1.232l3.327-3.327c-0.859-3.188-3.77-5.434-7.691-5.434h-5.84v14.971h3.994L93.629,66.21z"/>
|
|
24
|
-
<path fill="#FFFFFF" d="M42.171,54.285l-3.033,3.031c0.39-0.106,0.803-0.168,1.241-0.168c2.652,0,4.535,2.139,4.535,4.704v0.043
|
|
25
|
-
c0,2.565-1.839,4.663-4.492,4.663c-2.652,0-4.534-2.141-4.534-4.706V61.81c0-0.507,0.074-0.995,0.21-1.454l-3.427,3.428
|
|
26
|
-
c0.819,3.342,3.796,5.811,7.708,5.811c4.62,0,7.978-3.484,7.978-7.741V61.81C48.357,58.113,45.855,55.031,42.171,54.285z"/>
|
|
27
|
-
</g>
|
|
28
|
-
</svg>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<% expands('layouts/chimera');
|
|
2
|
-
|
|
3
|
-
Router.setBreadcrumb([
|
|
4
|
-
{title: __('chimera', 'Dashboard'), route: 'chimera@Dashboard'},
|
|
5
|
-
{title: modelName.titleize(), route: 'chimera@ModelAction', parameters: {action: 'index'}},
|
|
6
|
-
{title: display_field_value, route: 'chimera@RecordAction'}
|
|
7
|
-
]);
|
|
8
|
-
|
|
9
|
-
start('chimera-cage') %>
|
|
10
|
-
<main>
|
|
11
|
-
<x-panel class="chimera-editor" tabs>
|
|
12
|
-
<x-panel-tabs>
|
|
13
|
-
<% for (name in groups) { %>
|
|
14
|
-
<a href="#<%= name.slug() %>"><%= name.titleize() %></a>
|
|
15
|
-
<% } %>
|
|
16
|
-
</x-panel-tabs>
|
|
17
|
-
<x-panel-action>
|
|
18
|
-
<% Chimera.printActions('record-draft', {className: 'btn-top'}, record) %>
|
|
19
|
-
</x-panel-action>
|
|
20
|
-
<% for (name in groups) { %>
|
|
21
|
-
<x-panel-body id="<%= name.slug() %>">
|
|
22
|
-
<%
|
|
23
|
-
fields = groups[name][0].fields;
|
|
24
|
-
for (i = 0; i < fields.length; i++) {
|
|
25
|
-
Chimera.printField(fields[i]);
|
|
26
|
-
}
|
|
27
|
-
%>
|
|
28
|
-
</x-panel-body>
|
|
29
|
-
<% } %>
|
|
30
|
-
</x-panel>
|
|
31
|
-
</main>
|
|
32
|
-
<% end('chimera-cage') %>
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<% expands('layouts/chimera');
|
|
2
|
-
|
|
3
|
-
Router.setBreadcrumb([
|
|
4
|
-
{title: __('chimera', 'Dashboard'), route: 'chimera@Dashboard'},
|
|
5
|
-
{title: modelName.titleize(), route: 'chimera@ModelAction', parameters: {action: 'index'}},
|
|
6
|
-
{title: display_field_value, route: 'chimera@RecordAction'}
|
|
7
|
-
]);
|
|
8
|
-
|
|
9
|
-
start('chimera-cage') %>
|
|
10
|
-
<main>
|
|
11
|
-
<x-panel class="chimera-editor" tabs>
|
|
12
|
-
<x-panel-tabs>
|
|
13
|
-
<% for (name in groups) { %>
|
|
14
|
-
<a href="#<%= name.slug() %>"><%= name.titleize() %></a>
|
|
15
|
-
<% } %>
|
|
16
|
-
</x-panel-tabs>
|
|
17
|
-
<x-panel-action>
|
|
18
|
-
<% Chimera.printActions('model', {className: 'btn-top'}, record) %>
|
|
19
|
-
<% Chimera.printActions('draft', {className: 'btn-top'}, record) %>
|
|
20
|
-
</x-panel-action>
|
|
21
|
-
<% for (name in groups) { %>
|
|
22
|
-
<x-panel-body id="<%= name.slug() %>">
|
|
23
|
-
<%
|
|
24
|
-
fields = groups[name][0].fields;
|
|
25
|
-
for (i = 0; i < fields.length; i++) {
|
|
26
|
-
Chimera.printField(fields[i]);
|
|
27
|
-
}
|
|
28
|
-
%>
|
|
29
|
-
</x-panel-body>
|
|
30
|
-
<% } %>
|
|
31
|
-
</x-panel>
|
|
32
|
-
</main>
|
|
33
|
-
<% end('chimera-cage') %>
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
<% expands('layouts/chimera');
|
|
2
|
-
|
|
3
|
-
Router.setBreadcrumb([
|
|
4
|
-
{title: __('chimera', 'Dashboard'), route: 'chimera@Dashboard'},
|
|
5
|
-
{title: pageTitle, route: 'chimera@ModelAction'}
|
|
6
|
-
]);
|
|
7
|
-
|
|
8
|
-
start('chimera-cage') %>
|
|
9
|
-
<x-panel class="table-panel model-list-panel" role="main">
|
|
10
|
-
<x-panel-title></x-panel-title>
|
|
11
|
-
<x-panel-action>
|
|
12
|
-
<% Chimera.printActions('model', {className: 'btn-top'}) %>
|
|
13
|
-
</x-panel-action>
|
|
14
|
-
<x-panel-body>
|
|
15
|
-
<table class="table table-bordered table-hover model-list">
|
|
16
|
-
<thead>
|
|
17
|
-
<tr>
|
|
18
|
-
<th class="model-list-checkbox">
|
|
19
|
-
<label class="cbx-label cbx-label-primary">
|
|
20
|
-
<input type="checkbox" class="check-all">
|
|
21
|
-
<span></span>
|
|
22
|
-
</label>
|
|
23
|
-
</th>
|
|
24
|
-
<%
|
|
25
|
-
while (fields.hasNext()) {
|
|
26
|
-
field = fields.next().value;
|
|
27
|
-
|
|
28
|
-
print('<th>');
|
|
29
|
-
print(Pagination.sort({field: field.path, content: field.fieldType.title}));
|
|
30
|
-
print('</th>');
|
|
31
|
-
}
|
|
32
|
-
%>
|
|
33
|
-
<th class="record-actions">Actions</th>
|
|
34
|
-
</tr>
|
|
35
|
-
<% if (show_index_filters) { %>
|
|
36
|
-
<tr class="filters">
|
|
37
|
-
<th></th>
|
|
38
|
-
<%
|
|
39
|
-
fields.reset();
|
|
40
|
-
while (fields.hasNext()) {
|
|
41
|
-
field = fields.next().value;
|
|
42
|
-
|
|
43
|
-
print('<th>');
|
|
44
|
-
filter_element = Pagination.filter({field: field.path, content: field.fieldType.title});
|
|
45
|
-
filter_element.classList.add('chimeraField-string');
|
|
46
|
-
|
|
47
|
-
print(filter_element);
|
|
48
|
-
print('</th>');
|
|
49
|
-
}
|
|
50
|
-
%>
|
|
51
|
-
</tr>
|
|
52
|
-
<% } %>
|
|
53
|
-
</thead>
|
|
54
|
-
<tbody>
|
|
55
|
-
<%
|
|
56
|
-
iterator = records.createIterator();
|
|
57
|
-
while (iterator.hasNext()) {
|
|
58
|
-
item = iterator.next();
|
|
59
|
-
record = item.value;
|
|
60
|
-
fields = record.fields;
|
|
61
|
-
|
|
62
|
-
print('<tr class="model-list-record">');
|
|
63
|
-
|
|
64
|
-
print('<td class="model-list-checkbox"><label class="cbx-label cbx-label-primary">');
|
|
65
|
-
print('<input type="checkbox" value="' + record.id + '"><span></span>');
|
|
66
|
-
print('</label></td>');
|
|
67
|
-
|
|
68
|
-
for (i = 0; i < fields.length; i++) {
|
|
69
|
-
print('<td>');
|
|
70
|
-
Chimera.printField(fields[i]);
|
|
71
|
-
print('</td>');
|
|
72
|
-
}
|
|
73
|
-
print('<td class="record-actions">');
|
|
74
|
-
Chimera.printActions('record', {className: 'btn-inline'}, record);
|
|
75
|
-
print('</td>');
|
|
76
|
-
print('</tr>');
|
|
77
|
-
}
|
|
78
|
-
%>
|
|
79
|
-
</tbody>
|
|
80
|
-
</table>
|
|
81
|
-
</x-panel-body>
|
|
82
|
-
<x-panel-footer class="chimeraEditor-footer u-stretch">
|
|
83
|
-
<%= Pagination.getInfo() %>
|
|
84
|
-
<% Pagination.show() %>
|
|
85
|
-
</x-panel-footer>
|
|
86
|
-
</x-panel>
|
|
87
|
-
<% end('chimera-cage') %>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<% expands('layouts/chimera') %>
|
|
2
|
-
|
|
3
|
-
<% start('chimera-cage') %>
|
|
4
|
-
<main>
|
|
5
|
-
<article class="chimeraEditor">
|
|
6
|
-
<header class="chimeraEditor-header u-stretch">
|
|
7
|
-
<h1 class="pageTitle u-child"><%= pageTitle %>:</h1>
|
|
8
|
-
<nav class="u-child">
|
|
9
|
-
<% Chimera.printActions('model', {className: 'btn-top'}, record) %>
|
|
10
|
-
<% Chimera.printActions('record', {className: 'btn-top'}, record) %>
|
|
11
|
-
</nav>
|
|
12
|
-
</header>
|
|
13
|
-
<% model = modelName.singularize().camelize() %>
|
|
14
|
-
|
|
15
|
-
<div class="chimera-remove">
|
|
16
|
-
<% console.log(item) %>
|
|
17
|
-
<p>Are you sure you want to delete <% if(item[model].title){ %><%= item[model].title %><% } else { %><%= item[model]._id %><% } %></p>
|
|
18
|
-
<% Router.printRoute('RecordAction', {controller: 'editor', subject: modelName, action: 'remove', id: item[model]._id}, {title: 'Yes', className: 'btn remove-btn btn-red'}) %>
|
|
19
|
-
<% Router.printRoute('ModelAction', {controller: 'editor', subject: modelName, action: 'index'}, {title: 'No', className: 'btn'}) %>
|
|
20
|
-
</div>
|
|
21
|
-
</article>
|
|
22
|
-
</main>
|
|
23
|
-
<% end('chimera-cage') %>
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<% expands('layouts/chimera') %>
|
|
2
|
-
|
|
3
|
-
<% start('chimera-cage') %>
|
|
4
|
-
<main>
|
|
5
|
-
<article class="chimeraEditor">
|
|
6
|
-
<header class="chimeraEditor-header u-stretch">
|
|
7
|
-
<h1 class="pageTitle u-child"><%= pageTitle %>:</h1>
|
|
8
|
-
<nav class="u-child">
|
|
9
|
-
<% Chimera.printActions('model', {className: 'btn-top'}, record) %>
|
|
10
|
-
<% Chimera.printActions('record', {className: 'btn-top'}, record) %>
|
|
11
|
-
</nav>
|
|
12
|
-
</header>
|
|
13
|
-
|
|
14
|
-
<div class="radioTabs">
|
|
15
|
-
|
|
16
|
-
<%
|
|
17
|
-
counter = 0;
|
|
18
|
-
|
|
19
|
-
for (name in groups) {
|
|
20
|
-
record = groups[name][0];
|
|
21
|
-
fields = record.fields;
|
|
22
|
-
id = record.id;
|
|
23
|
-
|
|
24
|
-
print('<input class="radioTabs-input" name="etab" type="radio" id="r' + counter + '"');
|
|
25
|
-
if (counter === 0) print(' checked');
|
|
26
|
-
print('>');
|
|
27
|
-
print('<label class="radioTabs-label" for="r' + counter + '"><section>');
|
|
28
|
-
print('<h1 class="radioTabs-title">');
|
|
29
|
-
print(name);
|
|
30
|
-
print('</h1>');
|
|
31
|
-
print('<div class="radioTabs-content">');
|
|
32
|
-
|
|
33
|
-
for (i = 0; i < fields.length; i++) {
|
|
34
|
-
Chimera.printField(fields[i]);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
print('</div>');
|
|
38
|
-
print('</section></label>');
|
|
39
|
-
|
|
40
|
-
counter++;
|
|
41
|
-
}
|
|
42
|
-
%>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
<footer class="chimeraEditor-footer u-stretch">
|
|
46
|
-
<div class="u-child"></div>
|
|
47
|
-
<nav class="u-child">
|
|
48
|
-
<% Chimera.printActions('model', {className: 'btn-top'}, record) %>
|
|
49
|
-
<% Chimera.printActions('record', {className: 'btn-top'}, record) %>
|
|
50
|
-
</nav>
|
|
51
|
-
</footer>
|
|
52
|
-
</article>
|
|
53
|
-
</main>
|
|
54
|
-
<% end('chimera-cage') %>
|
|
File without changes
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
|
|
3
|
-
// Create a new entries id
|
|
4
|
-
entries_id = getId();
|
|
5
|
-
|
|
6
|
-
// This function will print out the actual entry
|
|
7
|
-
printEntries = function printEntries(values) {
|
|
8
|
-
|
|
9
|
-
// Make sure there is at least 1 entry
|
|
10
|
-
if (!values.length) {
|
|
11
|
-
values.push(null);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
for (i = 0; i < values.length; i++) {
|
|
15
|
-
value = values[i];
|
|
16
|
-
|
|
17
|
-
// The field element expects a single value to be in `data.value`
|
|
18
|
-
newData = {
|
|
19
|
-
data: Object.assign({}, data, {value: value}),
|
|
20
|
-
parent_entries_id: entries_id
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
className = 'chimeraField-entry action-' + template.action + ' cfe-' + entries_id;
|
|
24
|
-
|
|
25
|
-
// Print the actual field element
|
|
26
|
-
print('\n');
|
|
27
|
-
placeholder = print_element(fieldElement, newData, {className: className});
|
|
28
|
-
print('\n');
|
|
29
|
-
|
|
30
|
-
// Set the element id for creating client-side chimera fields
|
|
31
|
-
placeholder.element.setAttribute('data-oid', i);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// Start creating the entries block
|
|
36
|
-
start('entries', {attributes: {'data-entries-id': entries_id}});
|
|
37
|
-
|
|
38
|
-
if (data.field.fieldType.isTranslatable) {
|
|
39
|
-
prefixes = {};
|
|
40
|
-
first_prefix = true;
|
|
41
|
-
|
|
42
|
-
exposed_prefixes = expose('prefixes');
|
|
43
|
-
|
|
44
|
-
for (prefix in exposed_prefixes) {
|
|
45
|
-
prefixes[prefix] = true;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
for (prefix in data.value) {
|
|
49
|
-
prefixes[prefix] = true;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
for (prefix in prefixes) {
|
|
53
|
-
print('\n<div class="chimeraField-prefix-intake" data-prefix="' + prefix + '"');
|
|
54
|
-
|
|
55
|
-
if (first_prefix) {
|
|
56
|
-
first_prefix = false;
|
|
57
|
-
} else {
|
|
58
|
-
print(' style="display:none;"');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
print('>\n');
|
|
62
|
-
|
|
63
|
-
if (data.value) {
|
|
64
|
-
values = Array.cast(data.value[prefix]);
|
|
65
|
-
} else {
|
|
66
|
-
values = [];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
printEntries(values);
|
|
70
|
-
print('\n</div>\n');
|
|
71
|
-
}
|
|
72
|
-
} else {
|
|
73
|
-
if (data.field.fieldType.options && data.field.fieldType.options.nested_array) {
|
|
74
|
-
if (Array.isArray(data.value)) {
|
|
75
|
-
if (Array.isArray(data.value[0])) {
|
|
76
|
-
values = data.value;
|
|
77
|
-
} else {
|
|
78
|
-
values = [data.value];
|
|
79
|
-
}
|
|
80
|
-
} else {
|
|
81
|
-
values = [data.value];
|
|
82
|
-
}
|
|
83
|
-
} else {
|
|
84
|
-
values = Array.cast(data.value);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
printEntries(values);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
end('entries');
|
|
91
|
-
%>
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
|
|
3
|
-
fieldWrapper = [
|
|
4
|
-
|
|
5
|
-
// The expected wrapper to use
|
|
6
|
-
'chimera/field_wrappers/' + template.wrapper + '_' + template.action,
|
|
7
|
-
|
|
8
|
-
// The fallback wrapper
|
|
9
|
-
'chimera/field_wrappers/default_' + template.action,
|
|
10
|
-
|
|
11
|
-
// If it still doesn't exist, try the list view
|
|
12
|
-
'chimera/field_wrappers/default_list'
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
fieldElement = [
|
|
16
|
-
|
|
17
|
-
// The expected element to use
|
|
18
|
-
'chimera/fields/' + template.field + '_' + template.action,
|
|
19
|
-
|
|
20
|
-
// The fallback element
|
|
21
|
-
'chimera/fields/default_' + template.action,
|
|
22
|
-
|
|
23
|
-
// If it still doesn't exist, try the list view
|
|
24
|
-
'chimera/fields/default_list'
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
fieldEntries = 'chimera/field_wrappers/_entries';
|
|
28
|
-
|
|
29
|
-
// Render the wrapper
|
|
30
|
-
if (print_wrapper !== false) {
|
|
31
|
-
|
|
32
|
-
if (data.field.options && data.field.options.title) {
|
|
33
|
-
field_title = data.field.options.title;
|
|
34
|
-
} else {
|
|
35
|
-
field_title = data.field.fieldType.title;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (data.field.options && data.field.options.description) {
|
|
39
|
-
field_description = data.field.options.description;
|
|
40
|
-
} else if (data.field.fieldType.options) {
|
|
41
|
-
field_description = data.field.fieldType.options.description;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (!field_title && data.field.fieldType.name) {
|
|
45
|
-
field_title = data.field.fieldType.name.titleize();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
wrapper_variables = {
|
|
49
|
-
field_title : field_title,
|
|
50
|
-
field_description : field_description
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
implement(fieldWrapper, {changeMain: true, wrapper: false}, wrapper_variables);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (data.field) {
|
|
57
|
-
field_scripts = [
|
|
58
|
-
'chimera/chimera',
|
|
59
|
-
'chimera/chimera_field_wrapper',
|
|
60
|
-
'chimera/chimera_field'
|
|
61
|
-
];
|
|
62
|
-
|
|
63
|
-
if (data.field.script_file) {
|
|
64
|
-
field_scripts = field_scripts.concat(data.field.script_file);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
script(field_scripts);
|
|
68
|
-
|
|
69
|
-
if (data.field.style_file) {
|
|
70
|
-
style(data.field.style_file);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (print_entries !== false) {
|
|
75
|
-
if (print_wrapper === false) {
|
|
76
|
-
assign('entries');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
implement(fieldEntries, null, {fieldElement: fieldElement});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
%>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
// This currently breaks rendering
|
|
3
|
-
//expands('chimera/field_wrappers/default_edit');
|
|
4
|
-
script('rome/rome');
|
|
5
|
-
style('rome/rome');
|
|
6
|
-
%>
|
|
7
|
-
<div class="chimeraEditor-fieldGroup">
|
|
8
|
-
<label
|
|
9
|
-
class="chimeraEditor-fieldLabel"
|
|
10
|
-
for="field-<%= data.field.path %>"
|
|
11
|
-
>
|
|
12
|
-
<% assign('title') %>
|
|
13
|
-
<span class="field-title"><% print(field_title) %></span>
|
|
14
|
-
|
|
15
|
-
<% if (field_description) { %>
|
|
16
|
-
<small class="field-description"><%= field_description %></small>
|
|
17
|
-
<% } %>
|
|
18
|
-
<% assign_end('title') %>
|
|
19
|
-
</label>
|
|
20
|
-
<div class="chimeraEditor-fieldWrap">
|
|
21
|
-
<% assign('entries') %>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<div class="chimeraEditor-fieldGroup">
|
|
2
|
-
<div class="chimeraField-left">
|
|
3
|
-
<label class="chimeraEditor-fieldLabel">
|
|
4
|
-
<% assign('title') %>
|
|
5
|
-
<span class="field-title"><% print(field_title) %></span>
|
|
6
|
-
|
|
7
|
-
<% if (field_description) { %>
|
|
8
|
-
<small class="field-description"><%= field_description %></small>
|
|
9
|
-
<% } %>
|
|
10
|
-
<% assign_end('title') %>
|
|
11
|
-
</label>
|
|
12
|
-
</div>
|
|
13
|
-
<div class="chimeraEditor-fieldWrap">
|
|
14
|
-
<% assign('entries') %>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<div class="chimeraField-row">
|
|
2
|
-
<div class="chimeraField-left">
|
|
3
|
-
<label
|
|
4
|
-
class="chimeraField-label"
|
|
5
|
-
for="field-<%= data.field.path %>"
|
|
6
|
-
>
|
|
7
|
-
<% assign('title') %>
|
|
8
|
-
<span class="field-title"><% print(field_title) %></span>
|
|
9
|
-
|
|
10
|
-
<% if (field_description) { %>
|
|
11
|
-
<small class="field-description"><%= field_description %></small>
|
|
12
|
-
<% } %>
|
|
13
|
-
<% assign_end('title') %>
|
|
14
|
-
</label>
|
|
15
|
-
<% if (data.field.fieldType.isArray) { %>
|
|
16
|
-
<button class="btn chimeraField-add-entry">
|
|
17
|
-
<%= __('chimera', 'Add new entry') %>
|
|
18
|
-
</button>
|
|
19
|
-
<% } %>
|
|
20
|
-
</div>
|
|
21
|
-
<% assign('entries') %>
|
|
22
|
-
</div>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<div class="chimeraEditor-fieldGroup">
|
|
2
|
-
<label class="chimeraEditor-fieldLabel">
|
|
3
|
-
<% assign('title') %>
|
|
4
|
-
<span class="field-title"><% print(field_title) %></span>
|
|
5
|
-
|
|
6
|
-
<% if (field_description) { %>
|
|
7
|
-
<small class="field-description"><%= field_description %></small>
|
|
8
|
-
<% } %>
|
|
9
|
-
<% assign_end('title') %>
|
|
10
|
-
</label>
|
|
11
|
-
<div class="chimeraEditor-fieldWrap">
|
|
12
|
-
<% assign('entries') %>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
// This currently breaks rendering
|
|
3
|
-
//expands('chimera/field_wrappers/default_edit');
|
|
4
|
-
style('//cdn.leafletjs.com/leaflet-0.7.3/leaflet.css');
|
|
5
|
-
script('//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js');
|
|
6
|
-
%>
|
|
7
|
-
<div class="chimeraEditor-fieldGroup">
|
|
8
|
-
<div class="chimeraField-left">
|
|
9
|
-
<label
|
|
10
|
-
class="chimeraEditor-fieldLabel"
|
|
11
|
-
for="map-<%= data.field.path %>"
|
|
12
|
-
>
|
|
13
|
-
<% assign('title') %>
|
|
14
|
-
<span class="field-title"><% print(field_title) %></span>
|
|
15
|
-
|
|
16
|
-
<% if (field_description) { %>
|
|
17
|
-
<small class="field-description"><%= field_description %></small>
|
|
18
|
-
<% } %>
|
|
19
|
-
<% assign_end('title') %>
|
|
20
|
-
</label>
|
|
21
|
-
</div>
|
|
22
|
-
<div class="chimeraEditor-fieldWrap">
|
|
23
|
-
<% assign('entries') %>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
// This currently breaks rendering
|
|
3
|
-
//expands('chimera/field_wrappers/default_edit');
|
|
4
|
-
style('//cdn.leafletjs.com/leaflet-0.7.3/leaflet.css');
|
|
5
|
-
script('//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js');
|
|
6
|
-
%>
|
|
7
|
-
<div class="chimeraField-row">
|
|
8
|
-
<label class="chimeraField-label">
|
|
9
|
-
<% assign('title') %>
|
|
10
|
-
<span class="field-title"><% print(field_title) %></span>
|
|
11
|
-
|
|
12
|
-
<% if (field_description) { %>
|
|
13
|
-
<small class="field-description"><%= field_description %></small>
|
|
14
|
-
<% } %>
|
|
15
|
-
<% assign_end('title') %>
|
|
16
|
-
</label>
|
|
17
|
-
<% assign('entries') %>
|
|
18
|
-
</div>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<div class="chimeraEditor-subschema">
|
|
2
|
-
<h2>
|
|
3
|
-
<% assign('title') %>
|
|
4
|
-
<span class="field-title"><% print(field_title) %></span>
|
|
5
|
-
|
|
6
|
-
<% if (field_description) { %>
|
|
7
|
-
<small class="field-description"><%= field_description %></small>
|
|
8
|
-
<% } %>
|
|
9
|
-
<% assign_end('title') %>
|
|
10
|
-
</h2>
|
|
11
|
-
<% if (data.field.fieldType.isArray) { %>
|
|
12
|
-
<button class="btn chimeraField-add-entry">
|
|
13
|
-
<%= __('chimera', 'Add new entry') %>
|
|
14
|
-
</button>
|
|
15
|
-
<% } %>
|
|
16
|
-
<div class="chimeraEditor-subschema-wrap">
|
|
17
|
-
<% assign('entries') %>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|