lanes 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -0
- data/Gemfile +2 -2
- data/client/lanes/components/Base.coffee +12 -11
- data/client/lanes/components/enabled.js.erb +1 -1
- data/client/lanes/components/grid/Editor.coffee +2 -2
- data/client/lanes/components/grid/Grid.coffee +60 -58
- data/client/lanes/components/grid/PopOverEditor.coffee +3 -3
- data/client/lanes/components/grid/RowEditor.coffee +1 -1
- data/client/lanes/components/grid/{grid.scss → _index.scss} +0 -0
- data/client/lanes/components/grid/template.html +1 -1
- data/client/lanes/components/modal/ModalDialog.coffee +1 -1
- data/client/lanes/components/modal/{modal.scss → _index.scss} +1 -1
- data/client/lanes/components/modal/index.js +1 -1
- data/client/lanes/components/popover/PopOver.coffee +1 -1
- data/client/lanes/components/popover/_index.scss +1 -0
- data/client/lanes/components/popover/index.js +1 -1
- data/client/lanes/components/select_field/{select_field.scss → _index.scss} +0 -0
- data/client/lanes/extension/Extensions.coffee +3 -2
- data/client/lanes/lib/Templates.coffee +7 -0
- data/client/lanes/minimal.js +1 -1
- data/client/lanes/minimal.scss.erb +1 -1
- data/client/lanes/models/Base.coffee +16 -19
- data/client/lanes/models/Bootstrap.coffee +1 -2
- data/client/lanes/models/Collection.coffee +37 -25
- data/client/lanes/models/Screens.coffee +6 -18
- data/client/lanes/models/Sync.coffee +12 -5
- data/client/lanes/screens/Base.coffee +1 -2
- data/client/lanes/screens/Instance.coffee +2 -5
- data/client/lanes/screens/screen-definitions.js.erb +10 -2
- data/client/{styles → lanes/styles}/components/all.scss +0 -0
- data/client/{styles → lanes/styles}/components/changes-notification.scss +0 -0
- data/client/{styles → lanes/styles}/components/record-finder.scss +0 -0
- data/client/{styles → lanes/styles}/components/suggest.scss +0 -0
- data/client/{styles → lanes/styles}/fonts/icomoon.eot +0 -0
- data/client/{styles → lanes/styles}/fonts/icomoon.svg +0 -0
- data/client/{styles → lanes/styles}/fonts/icomoon.ttf +0 -0
- data/client/{styles → lanes/styles}/fonts/icomoon.woff +0 -0
- data/client/{styles → lanes/styles}/fonts/selection.json +0 -0
- data/client/{styles → lanes/styles}/fonts/style.scss +0 -0
- data/client/{styles → lanes/styles}/fonts.scss +5 -5
- data/client/{styles → lanes/styles}/forms.scss +0 -0
- data/client/{styles → lanes/styles}/index.css +0 -0
- data/client/{styles → lanes/styles}/keybindings.scss +0 -0
- data/client/{styles → lanes/styles}/layout.scss +0 -0
- data/client/{styles → lanes/styles}/plugins/all.scss +0 -0
- data/client/{styles → lanes/styles}/plugins/overlay.scss +0 -0
- data/client/{styles → lanes/styles}/plugins/resize-sensor.scss +0 -0
- data/client/{styles → lanes/styles}/screens.scss +0 -0
- data/client/{styles → lanes/styles}/tabs.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_alerts.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_badges.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_breadcrumbs.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_button-groups.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_buttons.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_carousel.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_close.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_code.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_component-animations.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_dropdowns.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_forms.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_glyphicons.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_grid.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_input-groups.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_jumbotron.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_labels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_list-group.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_media.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_mixins.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_modals.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_navbar.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_navs.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_normalize.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_pager.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_pagination.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_panels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_popovers.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_print.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_progress-bars.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_responsive-embed.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_responsive-utilities.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_scaffolding.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_tables.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_theme.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_thumbnails.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_tooltip.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_type.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_utilities.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_variables.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_wells.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_alerts.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_background-variant.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_border-radius.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_buttons.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_center-block.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_clearfix.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_forms.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_gradients.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_grid-framework.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_grid.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_hide-text.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_image.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_labels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_list-group.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_nav-divider.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_nav-vertical-align.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_opacity.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_pagination.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_panels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_progress-bar.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_reset-filter.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_resize.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_responsive-visibility.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_size.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_tab-focus.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_table-row.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_text-emphasis.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_text-overflow.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_vendor-prefixes.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_alerts.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_badges.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_breadcrumbs.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_button-groups.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_buttons.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_carousel.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_close.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_code.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_component-animations.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_dropdowns.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_forms.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_glyphicons.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_grid.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_input-groups.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_jumbotron.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_labels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_list-group.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_media.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_mixins.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_modals.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_navbar.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_navs.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_normalize.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_pager.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_pagination.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_panels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_popovers.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_print.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_progress-bars.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_responsive-embed.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_responsive-utilities.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_scaffolding.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_tables.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_theme.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_thumbnails.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_tooltip.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_type.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_utilities.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_variables.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_wells.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/bootstrap.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_alerts.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_background-variant.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_border-radius.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_buttons.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_center-block.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_clearfix.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_forms.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_gradients.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_grid-framework.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_grid.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_hide-text.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_image.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_labels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_list-group.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_nav-divider.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_nav-vertical-align.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_opacity.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_pagination.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_panels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_progress-bar.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_reset-filter.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_resize.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_responsive-visibility.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_size.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_tab-focus.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_table-row.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_text-emphasis.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_text-overflow.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_vendor-prefixes.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap-custom-grid.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap-custom-modals.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap.scss +2 -2
- data/client/{styles → lanes/styles}/vendor/dataTables.scss +0 -0
- data/client/lanes/views/Base.coffee +34 -49
- data/client/lanes/views/FormBindings.coffee +22 -20
- data/client/lanes/views/Helpers.coffee +1 -1
- data/client/lanes/views/empty-span.html +1 -0
- data/client/lanes/workspace/ActiveScreensSwitcher.coffee +8 -1
- data/client/lanes/workspace/Layout.coffee +7 -4
- data/client/lanes/workspace/Navbar.coffee +6 -2
- data/client/lanes/workspace/Pages.coffee +5 -1
- data/client/lanes/workspace/ScreensMenu.coffee +14 -2
- data/client/lanes/workspace/WorkspaceView.coffee +5 -0
- data/client/lanes/workspace/index.js +1 -0
- data/client/lanes/workspace.scss.erb +6 -1
- data/lanes.gemspec +1 -1
- data/lib/lanes/api/controller.rb +5 -7
- data/lib/lanes/api/helper_methods.rb +1 -1
- data/lib/lanes/api/javascript_processor.rb +3 -2
- data/lib/lanes/command/app.rb +8 -4
- data/lib/lanes/command/generate_model.rb +13 -11
- data/lib/lanes/command/generate_screen.rb +9 -2
- data/lib/lanes/command/generate_view.rb +15 -3
- data/lib/lanes/command/generate_view.usage +7 -7
- data/lib/lanes/command/named_command.rb +2 -2
- data/lib/lanes/command/templates/client/index.js +3 -0
- data/lib/lanes/command/templates/client/models/BaseModel.coffee +5 -0
- data/lib/lanes/command/templates/client/models/Model.coffee +1 -1
- data/lib/lanes/command/templates/client/views/BaseView.coffee +5 -0
- data/lib/lanes/command/templates/client/views/View.coffee +1 -1
- data/lib/lanes/command/templates/config/screen.rb +8 -0
- data/lib/lanes/command/templates/lib/namespace/base_model.rb +9 -0
- data/lib/lanes/command/templates/lib/namespace/model.rb +1 -1
- data/lib/lanes/command/templates/spec/client/models/ModelSpec.coffee +1 -1
- data/lib/lanes/command/templates/spec/client/views/ViewSpec.coffee +1 -1
- data/lib/lanes/command.rb +1 -2
- data/lib/lanes/components.rb +5 -4
- data/lib/lanes/concerns/all.rb +0 -5
- data/lib/lanes/concerns/attr_accessor_with_default.rb +5 -3
- data/lib/lanes/concerns/set_attribute_data.rb +6 -23
- data/lib/lanes/configuration.rb +1 -0
- data/lib/lanes/extension.rb +19 -10
- data/lib/lanes/guard_tasks.rb +1 -1
- data/lib/lanes/model.rb +1 -6
- data/lib/lanes/{screens.rb → screen.rb} +40 -23
- data/lib/lanes/spec_helper.rb +4 -2
- data/lib/lanes/version.rb +1 -1
- data/lib/lanes.rb +1 -1
- data/spec/api/javascript_processor_spec.rb +3 -3
- data/spec/command_spec.rb +49 -0
- data/spec/concerns/attr_accessor_with_default_spec.rb +7 -0
- data/spec/helpers/lanes-helpers.coffee +46 -22
- data/spec/helpers/minitest_assertions.rb +23 -0
- data/spec/lanes/models/BaseSpec.coffee +57 -56
- data/spec/lanes/models/CollectionSpec.coffee +14 -0
- data/spec/lanes/models/PubSubSpec.coffee +5 -5
- data/spec/lanes/views/BaseSpec.coffee +32 -31
- data/spec/lanes/views/FormBindingsSpec.coffee +32 -0
- metadata +183 -179
- data/client/lanes/components/popover/popover.scss +0 -1
- data/lib/lanes/command/templates/lib/namespace/screen.rb +0 -17
- data/lib/lanes/concerns/code_identifier.rb +0 -43
- data/lib/lanes/concerns/immutable_model.rb +0 -32
- data/lib/lanes/concerns/locked_fields.rb +0 -84
- data/lib/lanes/concerns/random_hash_code.rb +0 -40
- data/lib/lanes/concerns/visible_id_identifier.rb +0 -53
- data/spec/concerns/code_identifier_spec.rb +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c48fe1ac2eaf85a9771acba612806120af0168b
|
4
|
+
data.tar.gz: 815755b8f6e731e8a85f6a02ed443a1ef676e9cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d868609cfbac56dbd4e6ed6e4ca02284acd12c7e0cbea3145748b1a0726dd7e9bb8267eaa0c5ac436844297acc15a612fa6a07cb03e800f5e50d0a6f68c0e93
|
7
|
+
data.tar.gz: 844e24f045c8896fb405e20570edc981a7dcc04a3167316b9741090b42f2bc33767837b49a4d6589c60e747937d4f2410d989ce4c8891676ee757f3264ed53cd
|
data/.rubocop.yml
ADDED
data/Gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem "yard-activerecord", github: 'nathanstitt/yard-activerecord',
|
4
|
-
gem "active_record_mocks", github: '
|
3
|
+
gem "yard-activerecord", github: 'nathanstitt/yard-activerecord', branch: 'develop'
|
4
|
+
gem "active_record_mocks", github: 'nathanstitt/active_record_mocks', branch: 'develop'
|
5
5
|
|
6
6
|
gem 'puma'
|
7
7
|
|
@@ -4,8 +4,6 @@ class BaseComponent
|
|
4
4
|
super
|
5
5
|
@access ||= this.calculate_access()
|
6
6
|
|
7
|
-
namespace: "Components"
|
8
|
-
|
9
7
|
session:
|
10
8
|
access:
|
11
9
|
type: 'string',
|
@@ -15,17 +13,21 @@ class BaseComponent
|
|
15
13
|
readOnly: { deps: ['access'], fn:-> @access=='read' }
|
16
14
|
writeAble: { deps: ['access'], fn:-> @access=='write' }
|
17
15
|
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
emptyTemplateName: -> this.writeTemplate()
|
17
|
+
readTemplateName: -> this.writeTemplate()
|
18
|
+
writeTemplateName: -> 'lanes/views/empty-span'
|
21
19
|
|
22
|
-
|
23
|
-
if this.writeAble
|
24
|
-
|
20
|
+
renderContextFree: ->
|
21
|
+
tmpl = if this.writeAble
|
22
|
+
'writeTemplate'
|
25
23
|
else if this.readOnly
|
26
|
-
|
24
|
+
'readTemplate'
|
27
25
|
else
|
28
|
-
|
26
|
+
'emptyTemplate'
|
27
|
+
|
28
|
+
this.replaceEl( this.renderTemplateMethod(tmpl) );
|
29
|
+
|
30
|
+
templatePrefix: -> this.FILE.extensionName.toLowerCase() + "/components/"
|
29
31
|
|
30
32
|
calculate_access:->
|
31
33
|
if ! @field_name || Lanes.Views.RenderContext.canWrite(@field_name)
|
@@ -35,5 +37,4 @@ class BaseComponent
|
|
35
37
|
else
|
36
38
|
'none'
|
37
39
|
|
38
|
-
|
39
40
|
Lanes.Components.Base = Lanes.Views.Base.extend(BaseComponent)
|
@@ -35,7 +35,7 @@ class Lanes.Components.Grid.Editor extends Lanes.Components.Base
|
|
35
35
|
@model.set( definition.field, Lanes.dom.getAttribute(input,'value') )
|
36
36
|
|
37
37
|
getColumn: (name)->
|
38
|
-
_.findWhere(this.grid.
|
38
|
+
_.findWhere(this.grid.columnDefinitions, { field: name })
|
39
39
|
|
40
40
|
saveChanges: ->
|
41
41
|
this.persistFields()
|
@@ -58,5 +58,5 @@ class Lanes.Components.Grid.Editor extends Lanes.Components.Base
|
|
58
58
|
|
59
59
|
fields: ->
|
60
60
|
_.map(this.ui.form.children(), (input,index)->
|
61
|
-
{ index: index, input: Lanes.$(input), column: this.grid.
|
61
|
+
{ index: index, input: Lanes.$(input), column: this.grid.columnDefinitions[index] }
|
62
62
|
,this)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# ModelsTables class modifications
|
2
2
|
_.extend( Lanes.$.fn.dataTableExt.oStdClasses,{
|
3
3
|
sTable: "table table-striped"
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
sWrapper: "dataTables_wrapper form-inline"
|
5
|
+
sFilterInput: "form-control input-sm"
|
6
|
+
sLengthSelect: "form-control input-sm"
|
7
7
|
})
|
8
8
|
|
9
9
|
|
@@ -17,42 +17,43 @@ class Lanes.Components.Grid extends Lanes.Components.Base
|
|
17
17
|
'cancel-edit': 'onCancelEdit'
|
18
18
|
'order.dt table': 'onSort'
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
writeTemplateName: 'grid/template'
|
21
|
+
|
22
|
+
writeTemplateData: ->
|
22
23
|
data = { grid: this, buttons: ['refresh'] }
|
23
|
-
data['buttons'].push('create') if @
|
24
|
-
data['buttons'].push('delete') if @
|
24
|
+
data['buttons'].push('create') if @addRecords
|
25
|
+
data['buttons'].push('delete') if @deleteRecords
|
25
26
|
data
|
26
27
|
|
27
28
|
derived:
|
28
|
-
|
29
|
-
deps:['
|
30
|
-
@
|
29
|
+
columnDefinitions:
|
30
|
+
deps:['recordRuery'], fn: ->
|
31
|
+
@recordQuery.fields.map(this._makeField, this)
|
31
32
|
|
32
|
-
|
33
|
-
deps:['
|
33
|
+
modelClass:
|
34
|
+
deps:['recordQuery'], fn:-> @recordQuery.model_class
|
34
35
|
|
35
|
-
|
36
|
-
deps:['
|
36
|
+
singleSelectMode:
|
37
|
+
deps:['selectionMode'], fn:-> @selectionMode == 'single'
|
37
38
|
|
38
39
|
session:
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
unless Lanes.current_user.canWrite(this.
|
52
|
-
this.
|
53
|
-
this.
|
54
|
-
unless Lanes.current_user.canDelete(this.
|
55
|
-
this.
|
40
|
+
editRecords: ['boolean',true,false]
|
41
|
+
addRecords: ['boolean',true,false]
|
42
|
+
deleteRecords: ['boolean',true,false]
|
43
|
+
createRecordFn: 'function'
|
44
|
+
recordQuery: 'state'
|
45
|
+
editor: 'state'
|
46
|
+
selectionMode: ['string', true, 'single']
|
47
|
+
editorConfig: { type: 'object' }
|
48
|
+
editingController: 'any' # either string or constructor fn
|
49
|
+
|
50
|
+
initialize: ->
|
51
|
+
this.listenTo(this.viewport,'change:screen_enu_size', this.delayedWidthReset)
|
52
|
+
unless Lanes.current_user.canWrite(this.modelClass)
|
53
|
+
this.editRecords = false
|
54
|
+
this.addRecords = false
|
55
|
+
unless Lanes.current_user.canDelete(this.modelClass)
|
56
|
+
this.deleteRecords = false
|
56
57
|
|
57
58
|
onSort: ->
|
58
59
|
return unless @editor
|
@@ -82,36 +83,40 @@ class Lanes.Components.Grid extends Lanes.Components.Base
|
|
82
83
|
this.createEditor(row) unless @editor
|
83
84
|
@editor.move(row,ev)
|
84
85
|
|
85
|
-
|
86
86
|
createEditor: (row)->
|
87
|
-
config = _.extend({ parent: this }, this.
|
88
|
-
@editor = switch this.
|
87
|
+
config = _.extend({ parent: this }, this.editorConfig)
|
88
|
+
@editor = switch this.editingController
|
89
89
|
when 'row' then new Grid.RowEditor(config)
|
90
90
|
when 'popover' then new Grid.PopOverEditor(config)
|
91
|
-
else new this.
|
91
|
+
else new this.editingController(config)
|
92
92
|
|
93
93
|
deleteRow: ->
|
94
94
|
@editor.deleteCurrent()
|
95
95
|
|
96
|
+
createNewRecord: ->
|
97
|
+
if @createRecordFn
|
98
|
+
@createRecordFn(this)
|
99
|
+
else
|
100
|
+
new this.modelClass()
|
96
101
|
|
97
102
|
addRow: (record)->
|
98
103
|
# create a record if record argument wasn't given or it's an event
|
99
|
-
record =
|
104
|
+
record = this.createNewRecord() if !record || record.type == "click"
|
100
105
|
row = this.dt_api.row.add( this._dataFromModel(record) )
|
101
|
-
this.
|
106
|
+
this.apiSettings().oFeatures.bServerSide=false
|
102
107
|
row.draw(false)
|
103
|
-
this.
|
104
|
-
|
108
|
+
this.apiSettings().oFeatures.bServerSide=true
|
109
|
+
tr = row.nodes()[0]
|
110
|
+
this.$( tr.cells[ tr.cells.length/2 ] ).click()
|
105
111
|
|
106
|
-
|
107
|
-
api_settings: ->
|
112
|
+
apiSettings: ->
|
108
113
|
this.dt_api.settings()[0]
|
109
114
|
|
110
115
|
onRowClick: (ev)->
|
111
116
|
row = this.$(ev.target).closest('tr')
|
112
|
-
if this.
|
117
|
+
if this.editRecords
|
113
118
|
this.beginEdit(row,ev)
|
114
|
-
else if @
|
119
|
+
else if @singleSelectMode
|
115
120
|
this.unselect(row) for row in this.$('tr .active')
|
116
121
|
else
|
117
122
|
if row.hasClass('active')
|
@@ -124,23 +129,20 @@ class Lanes.Components.Grid extends Lanes.Components.Base
|
|
124
129
|
row.attr('id', model.id)
|
125
130
|
this.dt_api.row(row).data(this._dataFromModel(model)).draw()
|
126
131
|
|
127
|
-
|
128
132
|
modelForRow: (row)->
|
129
133
|
data = this.dt_api.row(row).data()
|
130
134
|
return null unless data
|
131
135
|
return data.model if data.model?.isModel
|
132
136
|
attrs = if row.attr('id') then { id: parseInt(row.attr('id')) } else {}
|
133
|
-
for field,i in @
|
137
|
+
for field,i in @columnDefinitions
|
134
138
|
attrs[field.field] = data[i]
|
135
|
-
data.model = new @
|
136
|
-
|
139
|
+
data.model = new @modelClass(attrs,ignoreUnsaved:true)
|
137
140
|
|
138
141
|
delayedGridConfiguration: ->
|
139
142
|
_.delay( =>
|
140
143
|
@dt_api.columns.adjust()
|
141
144
|
,500 )
|
142
145
|
|
143
|
-
|
144
146
|
render: ->
|
145
147
|
super
|
146
148
|
responsiveHelper = undefined;
|
@@ -148,7 +150,6 @@ class Lanes.Components.Grid extends Lanes.Components.Base
|
|
148
150
|
tablet: 1024,
|
149
151
|
phone : 480
|
150
152
|
};
|
151
|
-
|
152
153
|
this.dataTable=this.$('table').dataTable(
|
153
154
|
deferRender: true
|
154
155
|
scrollY: "300px"
|
@@ -158,9 +159,8 @@ class Lanes.Components.Grid extends Lanes.Components.Base
|
|
158
159
|
bProcessing: true
|
159
160
|
bDeferRender: true
|
160
161
|
oScroller: { loadingIndicator: true }
|
161
|
-
# columnDefs: @column_definitions
|
162
162
|
ajax:
|
163
|
-
url: @
|
163
|
+
url: @recordQuery.url + ".json"
|
164
164
|
data: (d)=>@buildModels(d)
|
165
165
|
dataSrc: (d)->
|
166
166
|
d.recordsFiltered = d.recordsTotal = d.total
|
@@ -169,24 +169,26 @@ class Lanes.Components.Grid extends Lanes.Components.Base
|
|
169
169
|
dom: "rtiS"
|
170
170
|
oScroller:
|
171
171
|
rowHeight: 40
|
172
|
-
columns: @
|
172
|
+
columns: @columnDefinitions
|
173
173
|
)
|
174
174
|
this.dt_api = this.dataTable.api()
|
175
|
-
|
176
175
|
this.delayedGridConfiguration()
|
177
176
|
this
|
178
177
|
|
179
178
|
buildModels: (d)->
|
180
|
-
params = {
|
181
|
-
|
179
|
+
params = {
|
180
|
+
o: {}, s: d.start, l: d.length||100, df:'array',
|
181
|
+
f: ['id'].concat(_.pluck(@columnDefinitions, 'field'))
|
182
|
+
}
|
183
|
+
if ! _.isEmpty( query = @recordQuery.asParams() )
|
182
184
|
params['q']=query
|
183
185
|
for order in d.order
|
184
|
-
column = @
|
186
|
+
column = @recordQuery.fields.at(order.column)
|
185
187
|
params['o'][column.field] = order.dir
|
186
188
|
params
|
187
189
|
|
188
190
|
|
189
|
-
|
191
|
+
_makeField: (query_field,index)->
|
190
192
|
align = switch query_field.type
|
191
193
|
when 'integer','bigdec' then 'r'
|
192
194
|
else 'l'
|
@@ -194,6 +196,6 @@ class Lanes.Components.Grid extends Lanes.Components.Base
|
|
194
196
|
|
195
197
|
_dataFromModel: (model)->
|
196
198
|
data = []
|
197
|
-
for field,i in @
|
199
|
+
for field,i in @columnDefinitions
|
198
200
|
data.push( model.get(field.field) || '' )
|
199
201
|
data
|
@@ -2,7 +2,7 @@ class Lanes.Components.Grid.PopOverEditor extends Lanes.Components.Grid.Editor
|
|
2
2
|
|
3
3
|
template: 'grid/popover-editor'
|
4
4
|
templateModels: ->
|
5
|
-
{ columns: this.grid.
|
5
|
+
{ columns: this.grid.columnDefinitions }
|
6
6
|
|
7
7
|
session:
|
8
8
|
view: 'object'
|
@@ -16,12 +16,12 @@ class Lanes.Components.Grid.PopOverEditor extends Lanes.Components.Grid.Editor
|
|
16
16
|
parent: this
|
17
17
|
className: 'grid-popover-editor'
|
18
18
|
target: Lanes.$(ev.target)
|
19
|
-
title: this.title || this.
|
19
|
+
title: this.title || this.calculatedTitle()
|
20
20
|
content: this.el
|
21
21
|
autoShow: true
|
22
22
|
})
|
23
23
|
|
24
|
-
|
24
|
+
calculatedTitle: ->
|
25
25
|
(if this.model.isNew() then "Create: " else "Edit: ") + this.model.constructor.name
|
26
26
|
|
27
27
|
cancelEditing: ->
|
@@ -14,7 +14,7 @@ class Lanes.Components.Grid.RowEditor extends Lanes.Components.Grid.Editor
|
|
14
14
|
inputs = this.form.children()
|
15
15
|
for input, index in inputs
|
16
16
|
column = Lanes.$(this.row[0].cells[index])
|
17
|
-
definition = this.grid.
|
17
|
+
definition = this.grid.columnDefinitions[index]
|
18
18
|
Lanes.$(input)
|
19
19
|
.width(column.width())
|
20
20
|
.css("left", column.position().left)
|
File without changes
|
@@ -17,7 +17,7 @@ class Lanes.Components.ModalDialog extends Lanes.Components.Base
|
|
17
17
|
if show then this.show() else this.hide()
|
18
18
|
|
19
19
|
template: ->
|
20
|
-
tmpl = Lanes.Templates.find('modal/template'
|
20
|
+
tmpl = Lanes.Templates.find('lanes/components/modal/template')
|
21
21
|
tmpl({
|
22
22
|
size : @size || 'lg'
|
23
23
|
title : @title || context.dialog_title
|
@@ -1,2 +1,2 @@
|
|
1
|
-
//= require vendor/bootstrap/modal
|
1
|
+
//= require lanes/vendor/bootstrap/modal
|
2
2
|
//= require_tree .
|
@@ -26,7 +26,7 @@ class Lanes.Components.PopOver extends Lanes.Components.Base
|
|
26
26
|
Lanes.warn "PopOver Template #{this.template} was not found"
|
27
27
|
|
28
28
|
initialize: (options)->
|
29
|
-
template = Lanes.Templates.find('components/popover/template')({ className: options.className||'' })
|
29
|
+
template = Lanes.Templates.find('lanes/components/popover/template')({ className: options.className||'' })
|
30
30
|
_.extend(options, this.options, {template: template, container: this.viewport?.root})
|
31
31
|
this.target.popover(options).on("hide.bs.popover", _.bind(this._onHide, this) )
|
32
32
|
this.show() if options.autoShow
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "lanes/styles/vendor/bootstrap/popovers";
|
@@ -1,2 +1,2 @@
|
|
1
|
-
//= require vendor/bootstrap/popover
|
1
|
+
//= require lanes/vendor/bootstrap/popover
|
2
2
|
//= require_tree .
|
File without changes
|
@@ -10,9 +10,10 @@ Lanes.Extensions = {
|
|
10
10
|
fireOnAvailable: (application)->
|
11
11
|
instance.onAvailable?(application) for identifier, instance of @instances
|
12
12
|
|
13
|
-
|
13
|
+
setBootstrapData: (bootstrap_data)->
|
14
14
|
for identifier,data of bootstrap_data
|
15
|
-
instance
|
15
|
+
instance = this.instances[identifier]
|
16
|
+
instance?.setBootstrapData?(data)
|
16
17
|
|
17
18
|
makeNamespace: (identifier)->
|
18
19
|
for ns in ['Models','Views','Controllers','Screens']
|
@@ -8,6 +8,13 @@ Lanes.Templates.find = (name, namespace) ->
|
|
8
8
|
else
|
9
9
|
null
|
10
10
|
|
11
|
+
Lanes.Templates.render = (view, name, data)->
|
12
|
+
template_fn = Lanes.Templates.find(name, view.FILE.extensionName)
|
13
|
+
if template_fn
|
14
|
+
template_fn( data )
|
15
|
+
else
|
16
|
+
null
|
17
|
+
|
11
18
|
# scribbed from eco's compiler.coffee
|
12
19
|
# we include the functions here rather than on every single template
|
13
20
|
Lanes.Templates.Wrapper = {
|
data/client/lanes/minimal.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# ------------------------------------------------------------------ #
|
3
2
|
# The ModelChangeMonitor watches for changes on the #
|
4
3
|
# Model and remembers which attributes have been changed #
|
@@ -58,7 +57,7 @@ class AssocationMap
|
|
58
57
|
target_klass ||= findAssociationClass() # it might not have been present previously
|
59
58
|
record = target_klass.findOrCreate(args)
|
60
59
|
record.parent = this
|
61
|
-
record
|
60
|
+
record
|
62
61
|
{ deps: [definition.fk], fn: createAssocation }
|
63
62
|
|
64
63
|
# Sets the assocations for "model"
|
@@ -157,7 +156,7 @@ class BaseModel
|
|
157
156
|
base += "/"
|
158
157
|
return base + encodeURIComponent(this.getId())
|
159
158
|
|
160
|
-
|
159
|
+
|
161
160
|
# A record is considered loaded if it has the id set and some attributes set
|
162
161
|
isLoaded: ->
|
163
162
|
!this.isNew() && !_.isEmpty( _.omit(this.attributes,this.idAttribute) )
|
@@ -184,30 +183,28 @@ class BaseModel
|
|
184
183
|
# Searches the PubSub idenity map for a record of the same type and matching id
|
185
184
|
# If one is found, it will update it with the given attributes and return it
|
186
185
|
# When not found, it will create a new record and return it.
|
187
|
-
# The newly created record will not be stored
|
186
|
+
# The newly created record will not be stored in the PubSub map,
|
187
|
+
# as only records bound to a view are stored there
|
188
188
|
@findOrCreate: (attrs, options={})->
|
189
189
|
if attrs.id && ( record = Lanes.Models.PubSub.instanceFor(this, attrs.id) )
|
190
190
|
record.set(attrs)
|
191
191
|
else
|
192
192
|
new this(attrs,options)
|
193
193
|
|
194
|
-
# Fetch a single record using an ID and the query options
|
195
|
-
@fetch: (id, options={})->
|
196
|
-
record = new this()
|
197
|
-
if _.isNumber(id)
|
198
|
-
record.id = id
|
199
|
-
record.fetch(options)
|
200
|
-
|
201
194
|
# Calls Ampersand State's set method, then sets any associations that are present as well
|
202
195
|
set: (attrs,options)->
|
203
196
|
super
|
204
197
|
this.associations.set(this,attrs) if this.associations
|
205
198
|
this
|
206
199
|
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
200
|
+
# Loads records from the server that match query, returns a collection
|
201
|
+
@where: (query, options)->
|
202
|
+
this.Collection.fetch( _.extend({query: query}, options) )
|
203
|
+
|
204
|
+
# Load a single record using an ID and the query options
|
205
|
+
@fetchById: (id, options={})->
|
206
|
+
record = new this(id: id)
|
207
|
+
record.fetch(options)
|
211
208
|
|
212
209
|
# Sets the attribute data from a server respose
|
213
210
|
setFromServer: (data,options)->
|
@@ -227,7 +224,7 @@ class BaseModel
|
|
227
224
|
'create'
|
228
225
|
else
|
229
226
|
if options.saveAll then 'update' else 'patch'
|
230
|
-
|
227
|
+
|
231
228
|
sync = this.sync(method, this, options);
|
232
229
|
|
233
230
|
handlers.promise
|
@@ -260,7 +257,7 @@ class BaseModel
|
|
260
257
|
handlers.promise
|
261
258
|
|
262
259
|
# returns any attributes that have been set and not saved
|
263
|
-
|
260
|
+
unsavedAttributes: ->
|
264
261
|
attrs = if this.isNew() then {} else { id: this.getId() }
|
265
262
|
_.extend(attrs, _.pick( this.getAttributes(props:true, true),
|
266
263
|
@changeMonitor.changedAttributes() ) )
|
@@ -272,7 +269,7 @@ class BaseModel
|
|
272
269
|
if options.saveAll
|
273
270
|
data = this.getAttributes(props:true, true)
|
274
271
|
else
|
275
|
-
data = this.
|
272
|
+
data = this.unsavedAttributes()
|
276
273
|
_.extend(data, this.associations.dataForSave(this, options)) if this.associations
|
277
274
|
data
|
278
275
|
|
@@ -307,7 +304,7 @@ class BaseModel
|
|
307
304
|
klass::session['updated_at'] ||= 'date'
|
308
305
|
|
309
306
|
if klass::associations
|
310
|
-
klass::associations = new AssocationMap(klass)
|
307
|
+
klass::associations = new AssocationMap(klass)
|
311
308
|
|
312
309
|
unless klass.Collection
|
313
310
|
class DefaultCollection
|