lanes 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +7 -0
  3. data/Gemfile +2 -2
  4. data/client/lanes/components/Base.coffee +12 -11
  5. data/client/lanes/components/enabled.js.erb +1 -1
  6. data/client/lanes/components/grid/Editor.coffee +2 -2
  7. data/client/lanes/components/grid/Grid.coffee +60 -58
  8. data/client/lanes/components/grid/PopOverEditor.coffee +3 -3
  9. data/client/lanes/components/grid/RowEditor.coffee +1 -1
  10. data/client/lanes/components/grid/{grid.scss → _index.scss} +0 -0
  11. data/client/lanes/components/grid/template.html +1 -1
  12. data/client/lanes/components/modal/ModalDialog.coffee +1 -1
  13. data/client/lanes/components/modal/{modal.scss → _index.scss} +1 -1
  14. data/client/lanes/components/modal/index.js +1 -1
  15. data/client/lanes/components/popover/PopOver.coffee +1 -1
  16. data/client/lanes/components/popover/_index.scss +1 -0
  17. data/client/lanes/components/popover/index.js +1 -1
  18. data/client/lanes/components/select_field/{select_field.scss → _index.scss} +0 -0
  19. data/client/lanes/extension/Extensions.coffee +3 -2
  20. data/client/lanes/lib/Templates.coffee +7 -0
  21. data/client/lanes/minimal.js +1 -1
  22. data/client/lanes/minimal.scss.erb +1 -1
  23. data/client/lanes/models/Base.coffee +16 -19
  24. data/client/lanes/models/Bootstrap.coffee +1 -2
  25. data/client/lanes/models/Collection.coffee +37 -25
  26. data/client/lanes/models/Screens.coffee +6 -18
  27. data/client/lanes/models/Sync.coffee +12 -5
  28. data/client/lanes/screens/Base.coffee +1 -2
  29. data/client/lanes/screens/Instance.coffee +2 -5
  30. data/client/lanes/screens/screen-definitions.js.erb +10 -2
  31. data/client/{styles → lanes/styles}/components/all.scss +0 -0
  32. data/client/{styles → lanes/styles}/components/changes-notification.scss +0 -0
  33. data/client/{styles → lanes/styles}/components/record-finder.scss +0 -0
  34. data/client/{styles → lanes/styles}/components/suggest.scss +0 -0
  35. data/client/{styles → lanes/styles}/fonts/icomoon.eot +0 -0
  36. data/client/{styles → lanes/styles}/fonts/icomoon.svg +0 -0
  37. data/client/{styles → lanes/styles}/fonts/icomoon.ttf +0 -0
  38. data/client/{styles → lanes/styles}/fonts/icomoon.woff +0 -0
  39. data/client/{styles → lanes/styles}/fonts/selection.json +0 -0
  40. data/client/{styles → lanes/styles}/fonts/style.scss +0 -0
  41. data/client/{styles → lanes/styles}/fonts.scss +5 -5
  42. data/client/{styles → lanes/styles}/forms.scss +0 -0
  43. data/client/{styles → lanes/styles}/index.css +0 -0
  44. data/client/{styles → lanes/styles}/keybindings.scss +0 -0
  45. data/client/{styles → lanes/styles}/layout.scss +0 -0
  46. data/client/{styles → lanes/styles}/plugins/all.scss +0 -0
  47. data/client/{styles → lanes/styles}/plugins/overlay.scss +0 -0
  48. data/client/{styles → lanes/styles}/plugins/resize-sensor.scss +0 -0
  49. data/client/{styles → lanes/styles}/screens.scss +0 -0
  50. data/client/{styles → lanes/styles}/tabs.scss +0 -0
  51. data/client/{styles → lanes/styles}/vendor/bootstrap/_alerts.scss +0 -0
  52. data/client/{styles → lanes/styles}/vendor/bootstrap/_badges.scss +0 -0
  53. data/client/{styles → lanes/styles}/vendor/bootstrap/_breadcrumbs.scss +0 -0
  54. data/client/{styles → lanes/styles}/vendor/bootstrap/_button-groups.scss +0 -0
  55. data/client/{styles → lanes/styles}/vendor/bootstrap/_buttons.scss +0 -0
  56. data/client/{styles → lanes/styles}/vendor/bootstrap/_carousel.scss +0 -0
  57. data/client/{styles → lanes/styles}/vendor/bootstrap/_close.scss +0 -0
  58. data/client/{styles → lanes/styles}/vendor/bootstrap/_code.scss +0 -0
  59. data/client/{styles → lanes/styles}/vendor/bootstrap/_component-animations.scss +0 -0
  60. data/client/{styles → lanes/styles}/vendor/bootstrap/_dropdowns.scss +0 -0
  61. data/client/{styles → lanes/styles}/vendor/bootstrap/_forms.scss +0 -0
  62. data/client/{styles → lanes/styles}/vendor/bootstrap/_glyphicons.scss +0 -0
  63. data/client/{styles → lanes/styles}/vendor/bootstrap/_grid.scss +0 -0
  64. data/client/{styles → lanes/styles}/vendor/bootstrap/_input-groups.scss +0 -0
  65. data/client/{styles → lanes/styles}/vendor/bootstrap/_jumbotron.scss +0 -0
  66. data/client/{styles → lanes/styles}/vendor/bootstrap/_labels.scss +0 -0
  67. data/client/{styles → lanes/styles}/vendor/bootstrap/_list-group.scss +0 -0
  68. data/client/{styles → lanes/styles}/vendor/bootstrap/_media.scss +0 -0
  69. data/client/{styles → lanes/styles}/vendor/bootstrap/_mixins.scss +0 -0
  70. data/client/{styles → lanes/styles}/vendor/bootstrap/_modals.scss +0 -0
  71. data/client/{styles → lanes/styles}/vendor/bootstrap/_navbar.scss +0 -0
  72. data/client/{styles → lanes/styles}/vendor/bootstrap/_navs.scss +0 -0
  73. data/client/{styles → lanes/styles}/vendor/bootstrap/_normalize.scss +0 -0
  74. data/client/{styles → lanes/styles}/vendor/bootstrap/_pager.scss +0 -0
  75. data/client/{styles → lanes/styles}/vendor/bootstrap/_pagination.scss +0 -0
  76. data/client/{styles → lanes/styles}/vendor/bootstrap/_panels.scss +0 -0
  77. data/client/{styles → lanes/styles}/vendor/bootstrap/_popovers.scss +0 -0
  78. data/client/{styles → lanes/styles}/vendor/bootstrap/_print.scss +0 -0
  79. data/client/{styles → lanes/styles}/vendor/bootstrap/_progress-bars.scss +0 -0
  80. data/client/{styles → lanes/styles}/vendor/bootstrap/_responsive-embed.scss +0 -0
  81. data/client/{styles → lanes/styles}/vendor/bootstrap/_responsive-utilities.scss +0 -0
  82. data/client/{styles → lanes/styles}/vendor/bootstrap/_scaffolding.scss +0 -0
  83. data/client/{styles → lanes/styles}/vendor/bootstrap/_tables.scss +0 -0
  84. data/client/{styles → lanes/styles}/vendor/bootstrap/_theme.scss +0 -0
  85. data/client/{styles → lanes/styles}/vendor/bootstrap/_thumbnails.scss +0 -0
  86. data/client/{styles → lanes/styles}/vendor/bootstrap/_tooltip.scss +0 -0
  87. data/client/{styles → lanes/styles}/vendor/bootstrap/_type.scss +0 -0
  88. data/client/{styles → lanes/styles}/vendor/bootstrap/_utilities.scss +0 -0
  89. data/client/{styles → lanes/styles}/vendor/bootstrap/_variables.scss +0 -0
  90. data/client/{styles → lanes/styles}/vendor/bootstrap/_wells.scss +0 -0
  91. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_alerts.scss +0 -0
  92. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_background-variant.scss +0 -0
  93. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_border-radius.scss +0 -0
  94. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_buttons.scss +0 -0
  95. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_center-block.scss +0 -0
  96. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_clearfix.scss +0 -0
  97. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_forms.scss +0 -0
  98. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_gradients.scss +0 -0
  99. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_grid-framework.scss +0 -0
  100. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_grid.scss +0 -0
  101. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_hide-text.scss +0 -0
  102. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_image.scss +0 -0
  103. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_labels.scss +0 -0
  104. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_list-group.scss +0 -0
  105. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_nav-divider.scss +0 -0
  106. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_nav-vertical-align.scss +0 -0
  107. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_opacity.scss +0 -0
  108. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_pagination.scss +0 -0
  109. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_panels.scss +0 -0
  110. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_progress-bar.scss +0 -0
  111. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_reset-filter.scss +0 -0
  112. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_resize.scss +0 -0
  113. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_responsive-visibility.scss +0 -0
  114. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_size.scss +0 -0
  115. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_tab-focus.scss +0 -0
  116. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_table-row.scss +0 -0
  117. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_text-emphasis.scss +0 -0
  118. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_text-overflow.scss +0 -0
  119. data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_vendor-prefixes.scss +0 -0
  120. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_alerts.scss +0 -0
  121. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_badges.scss +0 -0
  122. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_breadcrumbs.scss +0 -0
  123. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_button-groups.scss +0 -0
  124. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_buttons.scss +0 -0
  125. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_carousel.scss +0 -0
  126. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_close.scss +0 -0
  127. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_code.scss +0 -0
  128. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_component-animations.scss +0 -0
  129. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_dropdowns.scss +0 -0
  130. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_forms.scss +0 -0
  131. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_glyphicons.scss +0 -0
  132. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_grid.scss +0 -0
  133. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_input-groups.scss +0 -0
  134. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_jumbotron.scss +0 -0
  135. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_labels.scss +0 -0
  136. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_list-group.scss +0 -0
  137. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_media.scss +0 -0
  138. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_mixins.scss +0 -0
  139. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_modals.scss +0 -0
  140. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_navbar.scss +0 -0
  141. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_navs.scss +0 -0
  142. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_normalize.scss +0 -0
  143. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_pager.scss +0 -0
  144. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_pagination.scss +0 -0
  145. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_panels.scss +0 -0
  146. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_popovers.scss +0 -0
  147. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_print.scss +0 -0
  148. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_progress-bars.scss +0 -0
  149. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_responsive-embed.scss +0 -0
  150. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_responsive-utilities.scss +0 -0
  151. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_scaffolding.scss +0 -0
  152. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_tables.scss +0 -0
  153. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_theme.scss +0 -0
  154. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_thumbnails.scss +0 -0
  155. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_tooltip.scss +0 -0
  156. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_type.scss +0 -0
  157. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_utilities.scss +0 -0
  158. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_variables.scss +0 -0
  159. data/client/{styles → lanes/styles}/vendor/bootstrap/old/_wells.scss +0 -0
  160. data/client/{styles → lanes/styles}/vendor/bootstrap/old/bootstrap.scss +0 -0
  161. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_alerts.scss +0 -0
  162. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_background-variant.scss +0 -0
  163. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_border-radius.scss +0 -0
  164. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_buttons.scss +0 -0
  165. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_center-block.scss +0 -0
  166. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_clearfix.scss +0 -0
  167. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_forms.scss +0 -0
  168. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_gradients.scss +0 -0
  169. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_grid-framework.scss +0 -0
  170. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_grid.scss +0 -0
  171. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_hide-text.scss +0 -0
  172. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_image.scss +0 -0
  173. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_labels.scss +0 -0
  174. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_list-group.scss +0 -0
  175. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_nav-divider.scss +0 -0
  176. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_nav-vertical-align.scss +0 -0
  177. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_opacity.scss +0 -0
  178. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_pagination.scss +0 -0
  179. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_panels.scss +0 -0
  180. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_progress-bar.scss +0 -0
  181. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_reset-filter.scss +0 -0
  182. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_resize.scss +0 -0
  183. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_responsive-visibility.scss +0 -0
  184. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_size.scss +0 -0
  185. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_tab-focus.scss +0 -0
  186. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_table-row.scss +0 -0
  187. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_text-emphasis.scss +0 -0
  188. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_text-overflow.scss +0 -0
  189. data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_vendor-prefixes.scss +0 -0
  190. data/client/{styles → lanes/styles}/vendor/bootstrap-custom-grid.scss +0 -0
  191. data/client/{styles → lanes/styles}/vendor/bootstrap-custom-modals.scss +0 -0
  192. data/client/{styles → lanes/styles}/vendor/bootstrap.scss +2 -2
  193. data/client/{styles → lanes/styles}/vendor/dataTables.scss +0 -0
  194. data/client/lanes/views/Base.coffee +34 -49
  195. data/client/lanes/views/FormBindings.coffee +22 -20
  196. data/client/lanes/views/Helpers.coffee +1 -1
  197. data/client/lanes/views/empty-span.html +1 -0
  198. data/client/lanes/workspace/ActiveScreensSwitcher.coffee +8 -1
  199. data/client/lanes/workspace/Layout.coffee +7 -4
  200. data/client/lanes/workspace/Navbar.coffee +6 -2
  201. data/client/lanes/workspace/Pages.coffee +5 -1
  202. data/client/lanes/workspace/ScreensMenu.coffee +14 -2
  203. data/client/lanes/workspace/WorkspaceView.coffee +5 -0
  204. data/client/lanes/workspace/index.js +1 -0
  205. data/client/lanes/workspace.scss.erb +6 -1
  206. data/lanes.gemspec +1 -1
  207. data/lib/lanes/api/controller.rb +5 -7
  208. data/lib/lanes/api/helper_methods.rb +1 -1
  209. data/lib/lanes/api/javascript_processor.rb +3 -2
  210. data/lib/lanes/command/app.rb +8 -4
  211. data/lib/lanes/command/generate_model.rb +13 -11
  212. data/lib/lanes/command/generate_screen.rb +9 -2
  213. data/lib/lanes/command/generate_view.rb +15 -3
  214. data/lib/lanes/command/generate_view.usage +7 -7
  215. data/lib/lanes/command/named_command.rb +2 -2
  216. data/lib/lanes/command/templates/client/index.js +3 -0
  217. data/lib/lanes/command/templates/client/models/BaseModel.coffee +5 -0
  218. data/lib/lanes/command/templates/client/models/Model.coffee +1 -1
  219. data/lib/lanes/command/templates/client/views/BaseView.coffee +5 -0
  220. data/lib/lanes/command/templates/client/views/View.coffee +1 -1
  221. data/lib/lanes/command/templates/config/screen.rb +8 -0
  222. data/lib/lanes/command/templates/lib/namespace/base_model.rb +9 -0
  223. data/lib/lanes/command/templates/lib/namespace/model.rb +1 -1
  224. data/lib/lanes/command/templates/spec/client/models/ModelSpec.coffee +1 -1
  225. data/lib/lanes/command/templates/spec/client/views/ViewSpec.coffee +1 -1
  226. data/lib/lanes/command.rb +1 -2
  227. data/lib/lanes/components.rb +5 -4
  228. data/lib/lanes/concerns/all.rb +0 -5
  229. data/lib/lanes/concerns/attr_accessor_with_default.rb +5 -3
  230. data/lib/lanes/concerns/set_attribute_data.rb +6 -23
  231. data/lib/lanes/configuration.rb +1 -0
  232. data/lib/lanes/extension.rb +19 -10
  233. data/lib/lanes/guard_tasks.rb +1 -1
  234. data/lib/lanes/model.rb +1 -6
  235. data/lib/lanes/{screens.rb → screen.rb} +40 -23
  236. data/lib/lanes/spec_helper.rb +4 -2
  237. data/lib/lanes/version.rb +1 -1
  238. data/lib/lanes.rb +1 -1
  239. data/spec/api/javascript_processor_spec.rb +3 -3
  240. data/spec/command_spec.rb +49 -0
  241. data/spec/concerns/attr_accessor_with_default_spec.rb +7 -0
  242. data/spec/helpers/lanes-helpers.coffee +46 -22
  243. data/spec/helpers/minitest_assertions.rb +23 -0
  244. data/spec/lanes/models/BaseSpec.coffee +57 -56
  245. data/spec/lanes/models/CollectionSpec.coffee +14 -0
  246. data/spec/lanes/models/PubSubSpec.coffee +5 -5
  247. data/spec/lanes/views/BaseSpec.coffee +32 -31
  248. data/spec/lanes/views/FormBindingsSpec.coffee +32 -0
  249. metadata +183 -179
  250. data/client/lanes/components/popover/popover.scss +0 -1
  251. data/lib/lanes/command/templates/lib/namespace/screen.rb +0 -17
  252. data/lib/lanes/concerns/code_identifier.rb +0 -43
  253. data/lib/lanes/concerns/immutable_model.rb +0 -32
  254. data/lib/lanes/concerns/locked_fields.rb +0 -84
  255. data/lib/lanes/concerns/random_hash_code.rb +0 -40
  256. data/lib/lanes/concerns/visible_id_identifier.rb +0 -53
  257. data/spec/concerns/code_identifier_spec.rb +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b20837325a4feed75930d806fcc0ab5a8e914d3
4
- data.tar.gz: 42515ab0003321f83e4946766645550b706deea5
3
+ metadata.gz: 3c48fe1ac2eaf85a9771acba612806120af0168b
4
+ data.tar.gz: 815755b8f6e731e8a85f6a02ed443a1ef676e9cf
5
5
  SHA512:
6
- metadata.gz: 70dc86cd4d7e8c44aa1536ad7301672ccb75e0b1b0525bb7f5bfc07fade7de185644190ea99358df5e6d01200e1b7605a5cad2c2b324270a7efc498f2c9f2e43
7
- data.tar.gz: 9fd2a37a119aaadfe4dda3f22fa2cd4882d2f79e19eed6e1a96469f8060ea77a579e3c38fd6dcf5dfc86552a34128bbc901f88a7dc94a3c8e15f01968646b69e
6
+ metadata.gz: 7d868609cfbac56dbd4e6ed6e4ca02284acd12c7e0cbea3145748b1a0726dd7e9bb8267eaa0c5ac436844297acc15a612fa6a07cb03e800f5e50d0a6f68c0e93
7
+ data.tar.gz: 844e24f045c8896fb405e20570edc981a7dcc04a3167316b9741090b42f2bc33767837b49a4d6589c60e747937d4f2410d989ce4c8891676ee757f3264ed53cd
data/.rubocop.yml ADDED
@@ -0,0 +1,7 @@
1
+
2
+ StringLiterals:
3
+ Enabled: false
4
+
5
+ Style/IndentationWidth:
6
+ # Number of spaces for each indentation level.
7
+ Width: 4
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem "yard-activerecord", github: 'nathanstitt/yard-activerecord', branch: 'develop'
4
- gem "active_record_mocks", github: 'envygeeks/active_record_mocks', branch: 'master'
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
- readTemplate: -> @renderTemplateMethod('template')
19
- writeTemplate: -> @renderTemplateMethod('template')
20
- emptyTemplate: -> '<span></span>'
16
+ emptyTemplateName: -> this.writeTemplate()
17
+ readTemplateName: -> this.writeTemplate()
18
+ writeTemplateName: -> 'lanes/views/empty-span'
21
19
 
22
- template: ->
23
- if this.writeAble
24
- this.writeTemplate()
20
+ renderContextFree: ->
21
+ tmpl = if this.writeAble
22
+ 'writeTemplate'
25
23
  else if this.readOnly
26
- this.readTemplate()
24
+ 'readTemplate'
27
25
  else
28
- this.emptyTemplate()
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)
@@ -1,3 +1,3 @@
1
1
  <% Lanes::Components.enabled_with_dependencies(self) do | component |
2
- require_asset "components/#{component}"
2
+ require_asset "lanes/components/#{component}"
3
3
  end %>
@@ -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.column_definitions, { field: name })
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.column_definitions[index] }
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
- sWrapper: "dataTables_wrapper form-inline"
5
- sFilterInput: "form-control input-sm"
6
- sLengthSelect: "form-control input-sm"
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
- template: 'grid/template'
21
- templateModels: ->
20
+ writeTemplateName: 'grid/template'
21
+
22
+ writeTemplateData: ->
22
23
  data = { grid: this, buttons: ['refresh'] }
23
- data['buttons'].push('create') if @add_records
24
- data['buttons'].push('delete') if @delete_records
24
+ data['buttons'].push('create') if @addRecords
25
+ data['buttons'].push('delete') if @deleteRecords
25
26
  data
26
27
 
27
28
  derived:
28
- column_definitions:
29
- deps:['record_query'], fn: ->
30
- @record_query.fields.map(this._make_field, this)
29
+ columnDefinitions:
30
+ deps:['recordRuery'], fn: ->
31
+ @recordQuery.fields.map(this._makeField, this)
31
32
 
32
- model_class:
33
- deps:['record_query'], fn:-> @record_query.model_class
33
+ modelClass:
34
+ deps:['recordQuery'], fn:-> @recordQuery.model_class
34
35
 
35
- single_select_mode:
36
- deps:['selection_mode'], fn:-> @selection_mode == 'single'
36
+ singleSelectMode:
37
+ deps:['selectionMode'], fn:-> @selectionMode == 'single'
37
38
 
38
39
  session:
39
- edit_records: ['boolean',true,false]
40
- add_records: ['boolean',true,false]
41
- delete_records: ['boolean',true,false]
42
- record_query: 'state'
43
- editor: 'state'
44
- selection_mode: ['string', true, 'single']
45
- editor_config: { type: 'object' }
46
- editing_controller: 'any' # either string or constructor fn
47
-
48
- initialize: (options)->
49
- this.listenTo(this.viewport,'change:screen_menu_size', this.delayedWidthReset)
50
-
51
- unless Lanes.current_user.canWrite(this.model_class)
52
- this.edit_records = false
53
- this.add_records = false
54
- unless Lanes.current_user.canDelete(this.model_class)
55
- this.delete_records = false
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.editor_config)
88
- @editor = switch this.editing_controller
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.editing_controller(config)
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 = new this.model_class() if !record || record.type == "click"
104
+ record = this.createNewRecord() if !record || record.type == "click"
100
105
  row = this.dt_api.row.add( this._dataFromModel(record) )
101
- this.api_settings().oFeatures.bServerSide=false
106
+ this.apiSettings().oFeatures.bServerSide=false
102
107
  row.draw(false)
103
- this.api_settings().oFeatures.bServerSide=true
104
- this.$( row.nodes() ).click()
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.edit_records
117
+ if this.editRecords
113
118
  this.beginEdit(row,ev)
114
- else if @single_select_mode
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 @column_definitions
137
+ for field,i in @columnDefinitions
134
138
  attrs[field.field] = data[i]
135
- data.model = new @record_query.model_class(attrs,ignoreUnsaved:true)
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: @record_query.url + ".json"
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: @column_definitions
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 = { o: {}, s: d.start, l: d.length||100, df:'array', f: ['id'].concat(_.pluck(@column_definitions, 'field')) }
181
- if ! _.isEmpty( query = @record_query.asParams() )
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 = @record_query.fields.at(order.column)
186
+ column = @recordQuery.fields.at(order.column)
185
187
  params['o'][column.field] = order.dir
186
188
  params
187
189
 
188
190
 
189
- _make_field: (query_field,index)->
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 @column_definitions
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.column_definitions }
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.calculated_title()
19
+ title: this.title || this.calculatedTitle()
20
20
  content: this.el
21
21
  autoShow: true
22
22
  })
23
23
 
24
- calculated_title: ->
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.column_definitions[index]
17
+ definition = this.grid.columnDefinitions[index]
18
18
  Lanes.$(input)
19
19
  .width(column.width())
20
20
  .css("left", column.position().left)
@@ -1,4 +1,4 @@
1
1
  <div class="lanes-grid">
2
- <% if @grid.edit_records: %><%= h.toolbar( buttons: @buttons ) %><% end %>
2
+ <% if @grid.editRecords: %><%= h.toolbar( buttons: @buttons ) %><% end %>
3
3
  <table cellspacing="0" width="100%"></table>
4
4
  </div>
@@ -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', this.namespace)
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,4 +1,4 @@
1
- @import "styles/vendor/bootstrap/modals";
1
+
2
2
 
3
3
  .modal-backdrop{
4
4
  position: absolute;
@@ -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 .
@@ -10,9 +10,10 @@ Lanes.Extensions = {
10
10
  fireOnAvailable: (application)->
11
11
  instance.onAvailable?(application) for identifier, instance of @instances
12
12
 
13
- setBootstrapModels: (bootstrap_data)->
13
+ setBootstrapData: (bootstrap_data)->
14
14
  for identifier,data of bootstrap_data
15
- instance?.setBootstrapModels?(data)
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 = {
@@ -5,7 +5,7 @@
5
5
  //= require ./models
6
6
  //= require ./plugins
7
7
  //= require ./views
8
- //= require ./screens
9
8
  //= require ./components/Base
10
9
  //= require ./components/enabled
11
10
  //= require ./extension/LateLoaded
11
+ //= require ./screens
@@ -6,7 +6,7 @@
6
6
  <% end %>
7
7
 
8
8
  <% Lanes::Components.enabled_with_dependencies(self) do | component | %>
9
- @import "components/<%= component %>/<%= component %>";
9
+ @import "lanes/components/<%= component %>/index";
10
10
  <% end %>
11
11
 
12
12
  }
@@ -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, in PubSub map, only records bound to a view are 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
- where: (query,options)->
208
- collection = new @constructor.Collection
209
- collection.fetch( _.extend({query: query}, options) )
210
- collection
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
- unsavedModels: ->
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.unsavedModels()
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
@@ -3,6 +3,5 @@ Lanes.Models.Bootstrap = {
3
3
  initialize: (options)->
4
4
  Lanes.Models.Config.csrf_token = options.csrf
5
5
  Lanes.Models.Config.api_path = options.api_path
6
- Lanes.Extensions.setBootstrapModels(options);
7
-
6
+ Lanes.Extensions.setBootstrapData(options);
8
7
  }