engine2 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/conf/message.yaml +7 -0
  3. data/conf/message_pl.yaml +7 -0
  4. data/engine2.gemspec +1 -1
  5. data/lib/engine2/action.rb +0 -5
  6. data/lib/engine2/core.rb +9 -8
  7. data/lib/engine2/handler.rb +2 -2
  8. data/lib/engine2/meta.rb +196 -33
  9. data/lib/engine2/meta/decode_meta.rb +2 -1
  10. data/lib/engine2/meta/form_meta.rb +3 -132
  11. data/lib/engine2/meta/infra_meta.rb +14 -9
  12. data/lib/engine2/meta/list_meta.rb +1 -4
  13. data/lib/engine2/meta/view_meta.rb +0 -14
  14. data/lib/engine2/models/UserInfo.rb +0 -4
  15. data/lib/engine2/scheme.rb +5 -5
  16. data/lib/engine2/type_info.rb +0 -1
  17. data/lib/engine2/version.rb +1 -1
  18. data/public/assets/javascripts.js +13 -13
  19. data/public/js/angular-animate.js +52 -20
  20. data/public/js/angular-cookies.js +2 -2
  21. data/public/js/angular-route.js +10 -7
  22. data/public/js/angular-sanitize.js +4 -4
  23. data/public/js/angular.js +322 -168
  24. data/public/js/lodash.custom.min.js +95 -93
  25. data/views/engine2.coffee +34 -29
  26. data/views/engine2actions.coffee +62 -60
  27. data/views/infra/index.slim +2 -2
  28. data/views/infra/inspect.slim +5 -1
  29. data/views/scaffold/confirm.slim +1 -1
  30. data/views/scaffold/list.slim +11 -23
  31. data/views/scaffold/message.slim +1 -1
  32. data/views/scaffold/search.slim +1 -2
  33. data/views/scaffold/view.slim +1 -1
  34. data/views/search_fields/checkbox2.slim +1 -1
  35. data/views/search_fields/checkbox_buttons.slim +3 -3
  36. data/views/search_fields/date_range.slim +4 -4
  37. data/views/search_fields/decimal_date_range.slim +4 -4
  38. data/views/search_fields/input_text.slim +2 -2
  39. data/views/search_fields/integer.slim +2 -2
  40. data/views/search_fields/integer_range.slim +2 -2
  41. data/views/search_fields/list_bsmselect.slim +2 -2
  42. data/views/search_fields/list_bsselect.slim +2 -2
  43. data/views/search_fields/list_buttons.slim +2 -2
  44. data/views/search_fields/list_select.slim +2 -2
  45. metadata +4 -4
@@ -1,5 +1,5 @@
1
1
  div
2
- span.badge.badge-primary ng-if="action.user"
3
- | Zalogowany: {{action.user.name}}
2
+ span.badge.badge-primary ng-if="action.user" ng-bind="::action.meta.loc.logged_on + ': ' + action.user.name"
3
+
4
4
  span< e2-button-set="action.meta.menus.menu"
5
5
 
@@ -78,4 +78,8 @@ e2-action action="'inspect'"
78
78
  br
79
79
  .row
80
80
  .col-lg-12
81
- pre ng-bind="action.activeAssoc | json"
81
+ pre ng-bind="action.activeAssoc | json"
82
+ div title="Globals" bs-pane=""
83
+ .panel.panel-default
84
+ .panel-body
85
+ pre ng-bind="action.globals() | json"
@@ -1,3 +1,3 @@
1
1
  span
2
- .alert.alert-warning ng-hide="action.alert" {{action.message}}
2
+ .alert.alert-warning ng-hide="action.alert" {{action.meta.message}}
3
3
  .alert.alert-danger ng-show="action.alert" {{action.alert}}
@@ -1,6 +1,5 @@
1
1
  div
2
2
  e2-include template="action.meta.panel.search_template" ng-if="action.ui_state.search_active"
3
- /.well.well-sm
4
3
  .panel.panel-default
5
4
  .panel-body
6
5
  table.table.table-striped.table-condensed.table-hover
@@ -11,32 +10,21 @@ div
11
10
  th ng-repeat="f in action.meta.fields"
12
11
  a> ng-if="action.meta.info[f].sort" ng-click="action.order(f)": strong ng-bind="::action.meta.info[f].loc"
13
12
  span ng-show="action.ui.order == f"
14
- span.glyphicon.glyphicon-chevron-up ng-show="action.ui.asc"
15
- span.glyphicon.glyphicon-chevron-down ng-show="!action.ui.asc"
13
+ span.glyphicon ng-class="action.ui.asc ? 'glyphicon-chevron-up' : 'glyphicon-chevron-down'"
16
14
  span ng-if="!action.meta.info[f].sort" ng-bind="::action.meta.info[f].loc"
17
15
  tbody e2-table-body=""
18
- / tr ng-repeat="e in action.entries track by action.id_for(e)" ng-class="action.selected_class($index)" ng-click="action.select($index, $event)"
19
- / td
20
- / div e2-button-set="item_menu" ng-if="action.meta.config.show_item_menu"
21
- / td ng-repeat="f in action.meta.fields track by ::f" ng-bind-html="action.list_cell(e, f)"
22
16
 
23
- span
24
- .pull-right
25
- .badge
26
- | Strona:
27
- span ng-bind="action.page_info()"
28
- |&nbsp;
29
- .badge ng-if="action.selection"
30
- | Zaznaczonych
31
- span ng-bind="action.selected_size()"
32
- ul.pagination
33
- li ng-if="action.prev_active()"
17
+ span ng-if="action.ui.pagination_active"
18
+ ul.pagination.pagination-md
19
+ li ng-class="!action.prev_active() && 'disabled'"
34
20
  a href="" ng-click="action.prev()": span.glyphicon.glyphicon-backward
35
- li.disabled ng-if="!action.prev_active()"
36
- a href="": span.glyphicon.glyphicon-backward
37
- li ng-if="action.next_active()"
21
+ li ng-class="!action.next_active() && 'disabled'"
38
22
  a href="" ng-click="action.next()": span.glyphicon.glyphicon-forward
39
- li.disabled ng-if="!action.next_active()"
40
- a href="": span.glyphicon.glyphicon-forward
23
+ |&nbsp;
24
+ .badge
25
+ span< ng-bind="action.page_info()"
26
+ |&nbsp;
27
+ .badge ng-if="action.selection"
28
+ span< ng-bind="action.selected_info()"
41
29
 
42
30
  span ng-if="action.alert": .alert.alert-danger ng-bind="action.alert"
@@ -1,3 +1,3 @@
1
1
  span
2
- .alert.alert-warning ng-hide="action.alert" {{action.message}}
2
+ .alert.alert-warning ng-hide="action.alert" {{action.meta.message}}
3
3
  .alert.alert-danger ng-show="action.alert" {{action.alert}}
@@ -1,5 +1,4 @@
1
1
  .panel.panel-default
2
- / | {{action.search}}
3
2
  .panel-body
4
3
  form
5
4
  span ng-if="::!action.meta.tabs"
@@ -14,7 +13,7 @@
14
13
 
15
14
  .btn-group.btn-group-sm.pull-right
16
15
  button.btn.btn-default ng-click="action.load_new()"
17
- | Szukaj
16
+ span ng-bind="::action.meta.loc.search"
18
17
  span.glyphicon.glyphicon-zoom-in<
19
18
  button.btn.btn-default ng-click="action.search_reset()"
20
19
  span.glyphicon.glyphicon-asterisk
@@ -15,4 +15,4 @@ div
15
15
  td
16
16
  div ng-bind-html="action.view_cell(action.record, f)"
17
17
 
18
- span ng-if="::action.alert": .alert.alert-danger[] {{::action.alert}}
18
+ span ng-if="::action.alert": .alert.alert-danger ng-bind="action.alert"
@@ -2,7 +2,7 @@
2
2
  .btn-group.btn-group-sm [
3
3
  ng-model="action.query.search[f]"
4
4
  bs-buttons-radio=""
5
- ng-change="action.search_live(f)"
5
+ ng-change="action.search_field_change(f)"
6
6
  ]
7
7
  button.btn.btn-default type="button" value="{{action.meta.info[f].render.true_value}}": span.glyphicon.glyphicon-ok
8
8
  button.btn.btn-default type="button" value="{{action.meta.info[f].render.false_value}}": span.glyphicon.glyphicon-remove
@@ -1,10 +1,10 @@
1
1
  .col-lg-3.col-md-3.col-sm-3
2
2
  .form-group
3
3
  .btn-group.btn-group-sm ng-init="info = action.meta.info[f]" xe2-search-field=""
4
- a.btn.btn-default ng-class="action.query.search[f] == info.render.true_value && 'active'" ng-click="action.query.search[f] = info.render.true_value; action.search_live(f)"
4
+ a.btn.btn-default ng-class="action.query.search[f] == info.render.true_value && 'active'" ng-click="action.query.search[f] = info.render.true_value; action.search_field_change(f)"
5
5
  span.glyphicon.glyphicon-ok
6
- a.btn.btn-default ng-class="action.query.search[f] == info.render.false_value && 'active'" ng-click="action.query.search[f] = info.render.false_value; action.search_live(f)"
6
+ a.btn.btn-default ng-class="action.query.search[f] == info.render.false_value && 'active'" ng-click="action.query.search[f] = info.render.false_value; action.search_field_change(f)"
7
7
  span.glyphicon.glyphicon-remove
8
- a.btn.btn-default ng-disabled="action.query.search[f] == null" ng-click="action.query.search[f] = null; action.search_live(f)"
8
+ a.btn.btn-default ng-disabled="action.query.search[f] == null" ng-click="action.query.search[f] = null; action.search_field_change(f)"
9
9
  span ng-bind="::action.meta.info[f].loc"
10
10
  span.glyphicon.glyphicon-off<
@@ -8,7 +8,7 @@ span ng-init="action.query.search[f] = action.query.search[f] || {}; value = val
8
8
  class="form-control"
9
9
  placeholder="{{::info.loc}} <"
10
10
  ng-model="value.from"
11
- xng-change="action.search_live(f)"
11
+ xng-change="action.search_field_change(f)"
12
12
  data-max-date="{{value.to}}"
13
13
  data-date-format="{{::info.render.format}}"
14
14
  data-animation="{{::info.render.animation}}"
@@ -20,7 +20,7 @@ span ng-init="action.query.search[f] = action.query.search[f] || {}; value = val
20
20
  ]
21
21
  .input-group-btn
22
22
  a.btn.btn-default data-toggle="datepicker": span.glyphicon.glyphicon-calendar
23
- a.btn.btn-default ng-disabled="!action.query.search[f].from" ng-click="value.from = null; action.query.search[f].from = null; action.search_live(f)": span.glyphicon.glyphicon-off
23
+ a.btn.btn-default ng-disabled="!action.query.search[f].from" ng-click="value.from = null; action.query.search[f].from = null; action.search_field_change(f)": span.glyphicon.glyphicon-off
24
24
 
25
25
  .col-lg-3.col-md-4.col-sm-4
26
26
  .form-group
@@ -31,7 +31,7 @@ span ng-init="action.query.search[f] = action.query.search[f] || {}; value = val
31
31
  class="form-control"
32
32
  placeholder="{{::info.loc}} >"
33
33
  ng-model="value.to"
34
- xng-change="action.search_live(f)"
34
+ xng-change="action.search_field_change(f)"
35
35
  data-min-date="{{value.from}}"
36
36
  data-date-format="{{::info.render.format}}"
37
37
  data-animation="{{::info.render.animation}}"
@@ -43,4 +43,4 @@ span ng-init="action.query.search[f] = action.query.search[f] || {}; value = val
43
43
  ]
44
44
  .input-group-btn
45
45
  a.btn.btn-default data-toggle="datepicker": span.glyphicon.glyphicon-calendar
46
- a.btn.btn-default ng-disabled="!action.query.search[f].to" ng-click="value.to = null; action.query.search[f].to = null; action.search_live(f)": span.glyphicon.glyphicon-off
46
+ a.btn.btn-default ng-disabled="!action.query.search[f].to" ng-click="value.to = null; action.query.search[f].to = null; action.search_field_change(f)": span.glyphicon.glyphicon-off
@@ -8,7 +8,7 @@ span ng-init="action.query.search[f] = action.query.search[f] || {}"
8
8
  placeholder="{{::action.meta.info[f].loc}} <"
9
9
  xng-model="value"
10
10
  ng-model="action.query.search[f].from"
11
- ng-change="action.search_live(f)"
11
+ ng-change="action.search_field_change(f)"
12
12
  xe2-decimal-date-picker="" range="from"
13
13
  data-max-date="{{action.query.search[f].to}}"
14
14
  data-date-format="{{::action.meta.info[f].render.format}}"
@@ -20,7 +20,7 @@ span ng-init="action.query.search[f] = action.query.search[f] || {}"
20
20
  ]
21
21
  .input-group-btn
22
22
  a.btn.btn-default.disabled data-toggle="datepicker": span.glyphicon.glyphicon-calendar
23
- a.btn.btn-default ng-disabled="!action.query.search[f].from" ng-click="action.query.search[f].from = null; action.search_live(f)": span.glyphicon.glyphicon-off
23
+ a.btn.btn-default ng-disabled="!action.query.search[f].from" ng-click="action.query.search[f].from = null; action.search_field_change(f)": span.glyphicon.glyphicon-off
24
24
 
25
25
  .col-lg-3.col-md-4.col-sm-4
26
26
  .form-group
@@ -31,7 +31,7 @@ span ng-init="action.query.search[f] = action.query.search[f] || {}"
31
31
  placeholder="{{::action.meta.info[f].loc}} >"
32
32
  xng-model="value"
33
33
  ng-model="action.query.search[f].to"
34
- ng-change="action.search_live(f)"
34
+ ng-change="action.search_field_change(f)"
35
35
  xe2-decimal-date-picker="" range="to"
36
36
  data-min-date="{{action.query.search[f].from}}"
37
37
  data-date-format="{{::action.meta.info[f].render.format}}"
@@ -44,4 +44,4 @@ span ng-init="action.query.search[f] = action.query.search[f] || {}"
44
44
  ]
45
45
  .input-group-btn
46
46
  a.btn.btn-default.disabled data-toggle="datepicker": span.glyphicon.glyphicon-calendar
47
- a.btn.btn-default ng-disabled="!action.query.search[f].to" ng-click="action.query.search[f].to = null; action.search_live(f)": span.glyphicon.glyphicon-off
47
+ a.btn.btn-default ng-disabled="!action.query.search[f].to" ng-click="action.query.search[f].to = null; action.search_field_change(f)": span.glyphicon.glyphicon-off
@@ -6,13 +6,13 @@
6
6
  ng-model="action.query.search[f]"
7
7
  ng-model-options="{debounce: 200}"
8
8
  maxlength="15"
9
- ng-change="action.search_live(f)"
9
+ ng-change="action.search_field_change(f)"
10
10
  ng-class="action.meta.info[f].render.class"
11
11
  class="form-control"
12
12
  placeholder="{{::action.meta.info[f].loc}}"
13
13
  e2-search-field=""
14
14
  ]
15
15
  .input-group-btn
16
- a.btn.btn-default ng-disabled="!action.query.search[f]" ng-click="action.query.search[f] = null; action.search_live(f)"
16
+ a.btn.btn-default ng-disabled="!action.query.search[f]" ng-click="action.query.search[f] = null; action.search_field_change(f)"
17
17
  span.glyphicon.glyphicon-off
18
18
 
@@ -5,14 +5,14 @@
5
5
  type="text"
6
6
  ng-model="action.query.search[f]"
7
7
  ng-model-options="{debounce: 200}"
8
- ng-change="action.search_live(f)"
8
+ ng-change="action.search_field_change(f)"
9
9
  class="form-control"
10
10
  placeholder="{{::action.meta.info[f].loc}}"
11
11
  e2-search-field=""
12
12
  e2-integer=""
13
13
  ]
14
14
  .input-group-btn
15
- a.btn.btn-default ng-disabled="!action.query.search[f]" ng-click="action.query.search[f] = null; action.search_live(f)"
15
+ a.btn.btn-default ng-disabled="!action.query.search[f]" ng-click="action.query.search[f] = null; action.search_field_change(f)"
16
16
  span.glyphicon.glyphicon-off
17
17
 
18
18
  /button.btn ng-click="action.query.search[f] = null": i.icon-remove
@@ -11,7 +11,7 @@ span ng-init="action.query.search[f] = action.query.search[f] || {}"
11
11
  e2-integer=""
12
12
  ]
13
13
  .input-group-btn
14
- a.btn.btn-default ng-disabled="!action.query.search[f].from" ng-click="action.query.search[f].from = null; action.search_live(f)": span.glyphicon.glyphicon-off
14
+ a.btn.btn-default ng-disabled="!action.query.search[f].from" ng-click="action.query.search[f].from = null; action.search_field_change(f)": span.glyphicon.glyphicon-off
15
15
  .col-lg-2.col-md-3.col-sm-4
16
16
  .form-group
17
17
  .input-group.input-group-sm
@@ -24,4 +24,4 @@ span ng-init="action.query.search[f] = action.query.search[f] || {}"
24
24
  e2-integer=""
25
25
  ]
26
26
  .input-group-btn
27
- a.btn.btn-default ng-disabled="!action.query.search[f].to" ng-click="action.query.search[f].to = null; action.search_live(f)": span.glyphicon.glyphicon-off
27
+ a.btn.btn-default ng-disabled="!action.query.search[f].to" ng-click="action.query.search[f].to = null; action.search_field_change(f)": span.glyphicon.glyphicon-off
@@ -7,7 +7,7 @@
7
7
  ng-model="action.query.search[f]"
8
8
  bs-options="v[0] as v[1] for v in info.render.list"
9
9
  data-html="true"
10
- ng-change="action.search_live(f)"
10
+ ng-change="action.search_field_change(f)"
11
11
  ng-class="info.render.class"
12
12
  class="form-control"
13
13
 
@@ -20,5 +20,5 @@
20
20
  ]
21
21
 
22
22
  .input-group-btn
23
- a.btn.btn-default ng-disabled="action.query.search[f].length == 0" ng-click="action.query.search[f] = []; action.search_live(f)"
23
+ a.btn.btn-default ng-disabled="action.query.search[f].length == 0" ng-click="action.query.search[f] = []; action.search_field_change(f)"
24
24
  span.glyphicon.glyphicon-off
@@ -7,7 +7,7 @@
7
7
  ng-model="action.query.search[f]"
8
8
  bs-options="v[0] as v[1] for v in info.render.list"
9
9
  data-html="true"
10
- ng-change="action.search_live(f)"
10
+ ng-change="action.search_field_change(f)"
11
11
  ng-class="info.render.class"
12
12
  class="form-control"
13
13
 
@@ -18,5 +18,5 @@
18
18
  ]
19
19
 
20
20
  .input-group-btn
21
- a.btn.btn-default ng-disabled="action.query.search[f] == null" ng-click="action.query.search[f] = null; action.search_live(f)"
21
+ a.btn.btn-default ng-disabled="action.query.search[f] == null" ng-click="action.query.search[f] = null; action.search_field_change(f)"
22
22
  span.glyphicon.glyphicon-off
@@ -2,7 +2,7 @@
2
2
  /.container
3
3
  .form-group
4
4
  .btn-group.btn-group-sm ng-init="info = action.meta.info[f]" ng-model="action.query.search[f]" e2-search-field=""
5
- a.btn.btn-default ng-class="action.query.search[f] == v[0] && 'active'" ng-click="action.query.search[f] = v[0]; action.search_live(f)" ng-repeat="v in info.render.list" ng-bind-html="v[1]"
6
- a.btn.btn-default ng-disabled="action.query.search[f] == null" ng-click="action.query.search[f] = null; action.search_live(f)"
5
+ a.btn.btn-default ng-class="action.query.search[f] == v[0] && 'active'" ng-click="action.query.search[f] = v[0]; action.search_field_change(f)" ng-repeat="v in info.render.list" ng-bind-html="v[1]"
6
+ a.btn.btn-default ng-disabled="action.query.search[f] == null" ng-click="action.query.search[f] = null; action.search_field_change(f)"
7
7
  span ng-bind="::action.meta.info[f].loc"
8
8
  span.glyphicon.glyphicon-off<
@@ -5,7 +5,7 @@
5
5
  ng-init="info = action.meta.info[f]"
6
6
  ng-model="action.query.search[f]"
7
7
  ng-options="v[0] as v[1] for v in info.render.list"
8
- ng-change="action.search_live(f)"
8
+ ng-change="action.search_field_change(f)"
9
9
  ng-class="info.render.class"
10
10
  class="form-control"
11
11
  e2-search-field=""
@@ -13,5 +13,5 @@
13
13
  option value="" ng-bind="::action.meta.info[f].loc"
14
14
 
15
15
  .input-group-btn
16
- a.btn.btn-default ng-disabled="action.query.search[f] == null" ng-click="action.query.search[f] = null; action.search_live(f)"
16
+ a.btn.btn-default ng-disabled="action.query.search[f] == null" ng-click="action.query.search[f] = null; action.search_field_change(f)"
17
17
  span.glyphicon.glyphicon-off
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engine2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - lopex
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-08 00:00:00.000000000 Z
11
+ date: 2016-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -113,7 +113,7 @@ dependencies:
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '10.0'
116
+ version: '11.1'
117
117
  name: rake
118
118
  prerelease: false
119
119
  type: :development
@@ -121,7 +121,7 @@ dependencies:
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '10.0'
124
+ version: '11.1'
125
125
  - !ruby/object:Gem::Dependency
126
126
  requirement: !ruby/object:Gem::Requirement
127
127
  requirements: