trestle 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/trestle/_confirmation.js +23 -0
  3. data/app/assets/javascripts/trestle/_datepicker.js +22 -0
  4. data/app/assets/javascripts/trestle/_errors.js +11 -0
  5. data/app/assets/javascripts/trestle/_form.js +6 -0
  6. data/app/assets/javascripts/trestle/_gallery.js +27 -0
  7. data/app/assets/javascripts/trestle/_select.js +11 -0
  8. data/app/assets/javascripts/trestle/_sidebar.js +52 -0
  9. data/app/assets/javascripts/trestle/_table.js +21 -0
  10. data/app/assets/javascripts/trestle/_tabs.js +13 -0
  11. data/app/assets/javascripts/trestle/_tooltips.js +3 -0
  12. data/app/assets/javascripts/trestle/admin.js +23 -0
  13. data/app/assets/javascripts/trestle/custom.js +4 -0
  14. data/app/assets/stylesheets/trestle/components/_table.scss +6 -0
  15. data/app/helpers/trestle/form_helper.rb +1 -1
  16. data/app/helpers/trestle/format_helper.rb +48 -0
  17. data/app/helpers/trestle/url_helper.rb +2 -8
  18. data/app/views/layouts/trestle/admin.html.erb +3 -3
  19. data/app/views/trestle/admin/index.html.erb +1 -1
  20. data/app/views/trestle/dashboard/index.html.erb +2 -2
  21. data/app/views/trestle/resource/_form.html.erb +1 -1
  22. data/app/views/trestle/resource/edit.html.erb +2 -2
  23. data/app/views/trestle/resource/index.html.erb +1 -1
  24. data/app/views/trestle/resource/new.html.erb +1 -1
  25. data/app/views/trestle/resource/show.html.erb +2 -2
  26. data/app/views/trestle/shared/_sidebar.html.erb +4 -2
  27. data/bower.json +1 -1
  28. data/config/locales/en.yml +16 -2
  29. data/lib/generators/trestle/install/install_generator.rb +3 -3
  30. data/lib/generators/trestle/install/templates/custom.js +7 -0
  31. data/lib/generators/trestle/install/templates/trestle.rb.erb +3 -2
  32. data/lib/trestle/adapters.rb +7 -64
  33. data/lib/trestle/adapters/active_record_adapter.rb +46 -20
  34. data/lib/trestle/adapters/adapter.rb +176 -0
  35. data/lib/trestle/adapters/sequel_adapter.rb +85 -0
  36. data/lib/trestle/admin.rb +1 -1
  37. data/lib/trestle/attribute.rb +14 -37
  38. data/lib/trestle/breadcrumb.rb +6 -0
  39. data/lib/trestle/configuration.rb +1 -1
  40. data/lib/trestle/form/automatic.rb +29 -21
  41. data/lib/trestle/form/builder.rb +4 -0
  42. data/lib/trestle/form/field.rb +2 -2
  43. data/lib/trestle/form/fields/check_box.rb +1 -1
  44. data/lib/trestle/form/fields/collection_select.rb +1 -1
  45. data/lib/trestle/form/fields/date_select.rb +1 -1
  46. data/lib/trestle/form/fields/datetime_select.rb +1 -1
  47. data/lib/trestle/form/fields/grouped_collection_select.rb +1 -1
  48. data/lib/trestle/form/fields/select.rb +2 -2
  49. data/lib/trestle/form/fields/tag_select.rb +1 -2
  50. data/lib/trestle/form/fields/time_select.rb +1 -1
  51. data/lib/trestle/form/fields/time_zone_select.rb +1 -1
  52. data/lib/trestle/resource.rb +11 -7
  53. data/lib/trestle/resource/builder.rb +2 -1
  54. data/lib/trestle/resource/controller.rb +61 -17
  55. data/lib/trestle/scope.rb +1 -1
  56. data/lib/trestle/table/automatic.rb +5 -11
  57. data/lib/trestle/table/builder.rb +1 -0
  58. data/lib/trestle/table/column.rb +24 -43
  59. data/lib/trestle/version.rb +1 -1
  60. data/trestle.gemspec +3 -4
  61. data/vendor/assets/bower_components/trestle/flatpickr/dist/flatpickr.css +51 -26
  62. data/vendor/assets/bower_components/trestle/flatpickr/dist/flatpickr.js +349 -299
  63. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/ar.js +5 -5
  64. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/bg.js +5 -5
  65. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/bn.js +5 -5
  66. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/cat.js +7 -7
  67. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/cs.js +7 -7
  68. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/cy.js +7 -7
  69. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/da.js +6 -6
  70. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/de.js +10 -10
  71. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/eo.js +11 -11
  72. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/es.js +7 -7
  73. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/et.js +11 -11
  74. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/fa.js +6 -6
  75. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/fi.js +7 -7
  76. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/fr.js +11 -11
  77. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/gr.js +13 -13
  78. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/he.js +5 -5
  79. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/hi.js +5 -5
  80. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/hr.js +6 -6
  81. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/hu.js +10 -10
  82. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/id.js +7 -7
  83. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/index.js +97 -0
  84. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/it.js +10 -10
  85. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/ja.js +5 -5
  86. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/ko.js +6 -6
  87. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/lt.js +10 -10
  88. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/lv.js +6 -6
  89. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/mk.js +8 -8
  90. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/ms.js +7 -7
  91. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/my.js +7 -7
  92. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/nl.js +11 -11
  93. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/no.js +11 -11
  94. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/pa.js +5 -5
  95. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/pl.js +6 -6
  96. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/pt.js +6 -8
  97. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/ro.js +7 -9
  98. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/ru.js +6 -8
  99. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/si.js +5 -7
  100. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/sk.js +8 -8
  101. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/sl.js +8 -10
  102. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/sq.js +5 -7
  103. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/sr.js +9 -10
  104. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/sv.js +8 -10
  105. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/th.js +10 -11
  106. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/tr.js +6 -8
  107. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/uk.js +6 -7
  108. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/vn.js +6 -8
  109. data/vendor/assets/bower_components/trestle/flatpickr/dist/l10n/zh.js +9 -11
  110. metadata +24 -34
  111. data/app/assets/javascripts/trestle/_confirmation.js.coffee +0 -18
  112. data/app/assets/javascripts/trestle/_datepicker.js.coffee +0 -18
  113. data/app/assets/javascripts/trestle/_errors.js.coffee +0 -8
  114. data/app/assets/javascripts/trestle/_form.js.coffee +0 -4
  115. data/app/assets/javascripts/trestle/_gallery.js.coffee +0 -21
  116. data/app/assets/javascripts/trestle/_select.js.coffee +0 -7
  117. data/app/assets/javascripts/trestle/_sidebar.js.coffee +0 -45
  118. data/app/assets/javascripts/trestle/_table.js.coffee +0 -16
  119. data/app/assets/javascripts/trestle/_tabs.js.coffee +0 -9
  120. data/app/assets/javascripts/trestle/_tooltips.js.coffee +0 -2
  121. data/app/assets/javascripts/trestle/admin.js.coffee +0 -22
  122. data/app/assets/javascripts/trestle/custom.js.coffee +0 -4
  123. data/lib/generators/trestle/install/templates/custom.js.coffee +0 -7
@@ -1,19 +1,17 @@
1
1
  /* Vietnamese locals for flatpickr */
2
- var Flatpickr = Flatpickr || { l10ns: {} };
3
- Flatpickr.l10ns.vn = {};
2
+ var flatpickr = flatpickr || { l10ns: {} };
3
+ flatpickr.l10ns.vn = {};
4
4
 
5
- Flatpickr.l10ns.vn.weekdays = {
5
+ flatpickr.l10ns.vn.weekdays = {
6
6
  shorthand: ["CN", "T2", "T3", "T4", "T5", "T6", "T7"],
7
7
  longhand: ["Chủ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy"]
8
8
  };
9
9
 
10
- Flatpickr.l10ns.vn.months = {
10
+ flatpickr.l10ns.vn.months = {
11
11
  shorthand: ["Th1", "Th2", "Th3", "Th4", "Th5", "Th6", "Th7", "Th8", "Th9", "Th10", "Th11", "Th12"],
12
12
  longhand: ["Tháng một", "Tháng hai", "Tháng ba", "Tháng tư", "Tháng năm", "Tháng sáu", "Tháng bảy", "Tháng tám", "Tháng chín", "Tháng mười", "Tháng 11", "Tháng 12"]
13
13
  };
14
14
 
15
- Flatpickr.l10ns.vn.firstDayOfWeek = 1;
16
-
17
- if (typeof module !== "undefined")
18
- module.exports = Flatpickr.l10ns;
15
+ flatpickr.l10ns.vn.firstDayOfWeek = 1;
19
16
 
17
+ if (typeof module !== "undefined") module.exports = flatpickr.l10ns;
@@ -1,22 +1,20 @@
1
1
  /* Mandarin locals for flatpickr */
2
- var Flatpickr = Flatpickr || {l10ns: {}};
3
- Flatpickr.l10ns.zh = {};
2
+ var flatpickr = flatpickr || { l10ns: {} };
3
+ flatpickr.l10ns.zh = {};
4
4
 
5
- Flatpickr.l10ns.zh.weekdays = {
5
+ flatpickr.l10ns.zh.weekdays = {
6
6
  shorthand: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
7
7
  longhand: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
8
8
  };
9
9
 
10
- Flatpickr.l10ns.zh.months = {
10
+ flatpickr.l10ns.zh.months = {
11
11
  shorthand: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
12
12
  longhand: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
13
13
  };
14
14
 
15
- Flatpickr.l10ns.zh.rangeSeparator = " 至 ";
16
- Flatpickr.l10ns.zh.weekAbbreviation = "周";
17
- Flatpickr.l10ns.zh.scrollTitle = "滚动切换";
18
- Flatpickr.l10ns.zh.toggleTitle = "点击切换 12/24 小时时制";
19
-
20
- if (typeof module !== "undefined")
21
- module.exports = Flatpickr.l10ns;
15
+ flatpickr.l10ns.zh.rangeSeparator = " 至 ";
16
+ flatpickr.l10ns.zh.weekAbbreviation = "周";
17
+ flatpickr.l10ns.zh.scrollTitle = "滚动切换";
18
+ flatpickr.l10ns.zh.toggleTitle = "点击切换 12/24 小时时制";
22
19
 
20
+ if (typeof module !== "undefined") module.exports = flatpickr.l10ns;
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trestle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Pohlenz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-08 00:00:00.000000000 Z
11
+ date: 2017-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: railties
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -38,48 +38,34 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 5.0.6
41
- - !ruby/object:Gem::Dependency
42
- name: coffee-rails
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 4.2.1
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 4.2.1
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: autoprefixer-rails
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
45
  - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: 6.4.0
47
+ version: 7.1.2
62
48
  type: :runtime
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: 6.4.0
54
+ version: 7.1.2
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: kaminari
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: 0.17.0
61
+ version: 1.0.1
76
62
  type: :runtime
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
66
  - - "~>"
81
67
  - !ruby/object:Gem::Version
82
- version: 0.17.0
68
+ version: 1.0.1
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: bundler
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -181,18 +167,18 @@ files:
181
167
  - Rakefile
182
168
  - app/assets/images/trestle/textures/billie-holiday.png
183
169
  - app/assets/images/trestle/textures/bright-squares.png
184
- - app/assets/javascripts/trestle/_confirmation.js.coffee
185
- - app/assets/javascripts/trestle/_datepicker.js.coffee
186
- - app/assets/javascripts/trestle/_errors.js.coffee
187
- - app/assets/javascripts/trestle/_form.js.coffee
188
- - app/assets/javascripts/trestle/_gallery.js.coffee
189
- - app/assets/javascripts/trestle/_select.js.coffee
190
- - app/assets/javascripts/trestle/_sidebar.js.coffee
191
- - app/assets/javascripts/trestle/_table.js.coffee
192
- - app/assets/javascripts/trestle/_tabs.js.coffee
193
- - app/assets/javascripts/trestle/_tooltips.js.coffee
194
- - app/assets/javascripts/trestle/admin.js.coffee
195
- - app/assets/javascripts/trestle/custom.js.coffee
170
+ - app/assets/javascripts/trestle/_confirmation.js
171
+ - app/assets/javascripts/trestle/_datepicker.js
172
+ - app/assets/javascripts/trestle/_errors.js
173
+ - app/assets/javascripts/trestle/_form.js
174
+ - app/assets/javascripts/trestle/_gallery.js
175
+ - app/assets/javascripts/trestle/_select.js
176
+ - app/assets/javascripts/trestle/_sidebar.js
177
+ - app/assets/javascripts/trestle/_table.js
178
+ - app/assets/javascripts/trestle/_tabs.js
179
+ - app/assets/javascripts/trestle/_tooltips.js
180
+ - app/assets/javascripts/trestle/admin.js
181
+ - app/assets/javascripts/trestle/custom.js
196
182
  - app/assets/stylesheets/trestle/_custom.scss
197
183
  - app/assets/stylesheets/trestle/_support.scss
198
184
  - app/assets/stylesheets/trestle/_variables.scss
@@ -233,6 +219,7 @@ files:
233
219
  - app/helpers/trestle/container_helper.rb
234
220
  - app/helpers/trestle/display_helper.rb
235
221
  - app/helpers/trestle/form_helper.rb
222
+ - app/helpers/trestle/format_helper.rb
236
223
  - app/helpers/trestle/grid_helper.rb
237
224
  - app/helpers/trestle/hook_helper.rb
238
225
  - app/helpers/trestle/icon_helper.rb
@@ -284,14 +271,16 @@ files:
284
271
  - lib/generators/trestle/install/install_generator.rb
285
272
  - lib/generators/trestle/install/templates/_custom.scss
286
273
  - lib/generators/trestle/install/templates/_variables.scss
287
- - lib/generators/trestle/install/templates/custom.js.coffee
274
+ - lib/generators/trestle/install/templates/custom.js
288
275
  - lib/generators/trestle/install/templates/trestle.rb.erb
289
276
  - lib/generators/trestle/resource/resource_generator.rb
290
277
  - lib/generators/trestle/resource/templates/admin.rb.erb
291
278
  - lib/trestle.rb
292
279
  - lib/trestle/adapters.rb
293
280
  - lib/trestle/adapters/active_record_adapter.rb
281
+ - lib/trestle/adapters/adapter.rb
294
282
  - lib/trestle/adapters/draper_adapter.rb
283
+ - lib/trestle/adapters/sequel_adapter.rb
295
284
  - lib/trestle/admin.rb
296
285
  - lib/trestle/admin/builder.rb
297
286
  - lib/trestle/admin/controller.rb
@@ -476,6 +465,7 @@ files:
476
465
  - vendor/assets/bower_components/trestle/flatpickr/dist/l10n/hr.js
477
466
  - vendor/assets/bower_components/trestle/flatpickr/dist/l10n/hu.js
478
467
  - vendor/assets/bower_components/trestle/flatpickr/dist/l10n/id.js
468
+ - vendor/assets/bower_components/trestle/flatpickr/dist/l10n/index.js
479
469
  - vendor/assets/bower_components/trestle/flatpickr/dist/l10n/it.js
480
470
  - vendor/assets/bower_components/trestle/flatpickr/dist/l10n/ja.js
481
471
  - vendor/assets/bower_components/trestle/flatpickr/dist/l10n/ko.js
@@ -1,18 +0,0 @@
1
- Trestle.ready ->
2
- # This must be bound to an element beneath document so
3
- # that it is fired before any jquery_ujs events.
4
- root = $('body')
5
-
6
- root.confirmation
7
- rootSelector: 'body'
8
- selector: '[data-toggle="confirm-delete"]'
9
- singleton: true
10
- popout: true
11
- title: Trestle.i18n['admin.confirmation.title']
12
- btnOkIcon: ''
13
- btnOkClass: 'btn-danger'
14
- btnOkLabel: Trestle.i18n['admin.confirmation.delete'] || 'Delete'
15
- btnCancelIcon: ''
16
- btnCancelClass: 'btn-default'
17
- btnCancelLabel: Trestle.i18n['admin.confirmation.cancel'] || 'Cancel'
18
- copyAttributes: ''
@@ -1,18 +0,0 @@
1
- Trestle.ready ->
2
- $('input[type="date"][data-picker="true"]').flatpickr
3
- allowInput: true
4
- altInput: true
5
- altFormat: "m/d/Y"
6
-
7
- $('input[type="datetime"][data-picker="true"], input[type="datetime-local"][data-picker="true"]').flatpickr
8
- enableTime: true
9
- allowInput: true
10
- altInput: true
11
- altFormat: "m/d/Y h:i K"
12
-
13
- $('input[type="time"][data-picker="true"]').flatpickr
14
- enableTime: true
15
- noCalendar: true
16
- allowInput: true
17
- altInput: true
18
- altFormat: "h:i K"
@@ -1,8 +0,0 @@
1
- # Add error indicators to tabs
2
- Trestle.ready ->
3
- $('.tab-pane').each ->
4
- errorCount = $(this).find('.has-error').length
5
-
6
- if errorCount > 0
7
- indicator = $("<span>").addClass('label label-danger label-pill').text(errorCount)
8
- $(".nav-tabs a[href='##{$(this).attr('id')}']").append(indicator)
@@ -1,4 +0,0 @@
1
- # Prevent enter key from submitting the form
2
- $(document).on 'keypress', '.app-main form :input:not(textarea):not([type=submit])', (e) ->
3
- if e.keyCode == 13
4
- e.preventDefault()
@@ -1,21 +0,0 @@
1
- Trestle.ready ->
2
- $('[data-behavior~="zoom"]').magnificPopup
3
- type: 'image'
4
- closeOnContentClick: false
5
- closeBtnInside: false
6
- mainClass: 'mfp-with-zoom mfp-img-mobile'
7
- zoom:
8
- enabled: true
9
- duration: 150
10
-
11
- $('[data-behavior~="gallery"]').magnificPopup
12
- delegate: 'a'
13
- type: 'image'
14
- closeOnContentClick: false
15
- closeBtnInside: false
16
- mainClass: 'mfp-with-zoom mfp-img-mobile'
17
- gallery:
18
- enabled: true
19
- zoom:
20
- enabled: true
21
- duration: 150
@@ -1,7 +0,0 @@
1
- Trestle.ready ->
2
- $('select').each ->
3
- $(this).select2
4
- theme: 'bootstrap'
5
- containerCssClass: ':all:'
6
- dropdownCssClass: (el) ->
7
- el[0].className.replace(/\s*form-control\s*/, '')
@@ -1,45 +0,0 @@
1
- Trestle.ready ->
2
- sidebar = $('.app-sidebar')
3
-
4
- # Toggle mobile navigation using menu button
5
-
6
- sidebar.find('.navbar-toggle').on 'click', (e) ->
7
- e.preventDefault()
8
-
9
- $('.app-wrapper').addClass('animate')
10
- $('body').toggleClass('mobile-nav-expanded')
11
-
12
- $('.app-wrapper').on 'transitionend webkitTransitionEnd', ->
13
- $(this).removeClass('animate')
14
-
15
-
16
- # Interacting outside of the sidebar closes the navigation
17
-
18
- $('.app-wrapper').on 'click touchstart', (e) ->
19
- navExpanded = $('body').hasClass('mobile-nav-expanded')
20
-
21
- clickInHeader = $(e.target).closest('.app-header').length
22
- clickInSidebar = $(e.target).closest('.app-sidebar').length
23
-
24
- if navExpanded and !clickInHeader and !clickInSidebar
25
- e.stopPropagation()
26
- e.preventDefault()
27
-
28
- $('.app-wrapper').addClass('animate')
29
- $('body').removeClass('mobile-nav-expanded')
30
-
31
-
32
- # Toggle sidebar expand/collapse
33
-
34
- sidebar.find('.toggle-sidebar').on 'click', (e) ->
35
- e.preventDefault()
36
-
37
- if sidebar.hasClass('expanded') or sidebar.hasClass('collapsed')
38
- sidebar.removeClass('expanded').removeClass('collapsed')
39
- document.cookie = "trestle:sidebar=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT"
40
- else if $(document).width() >= 1200
41
- sidebar.addClass('collapsed')
42
- document.cookie = "trestle:sidebar=collapsed; path=/"
43
- else if $(document).width() >= 768
44
- sidebar.addClass('expanded')
45
- document.cookie = "trestle:sidebar=expanded; path=/"
@@ -1,16 +0,0 @@
1
- $(document).on 'click', 'tr[data-url]', (e) ->
2
- row = $(e.currentTarget)
3
-
4
- if row.data('url') == 'auto'
5
- url = row.find('td:not(.actions) a:first').attr('href')
6
- else
7
- url = row.data('url')
8
-
9
- if url
10
- if e.metaKey or e.ctrlKey
11
- window.open(url, '_blank')
12
- else
13
- Trestle.visit(url)
14
-
15
- $(document).on 'click', 'tr[data-url] a', (e) ->
16
- e.stopPropagation()
@@ -1,9 +0,0 @@
1
- Trestle.ready ->
2
- $("a[data-toggle='tab']").on 'shown.bs.tab', (e) ->
3
- hash = $(this).attr("href")
4
-
5
- if hash.substr(0, 1) == "#"
6
- history.replaceState({ turbolinks: {} }, "", "#!#{hash.substr(1)}")
7
-
8
- if location.hash.substr(0, 2) == "#!"
9
- $("a[data-toggle='tab'][href='##{location.hash.substr(2)}']").tab("show")
@@ -1,2 +0,0 @@
1
- Trestle.ready ->
2
- $('[data-toggle="tooltip"]').tooltip()
@@ -1,22 +0,0 @@
1
- #= require trestle/jquery
2
- #= require trestle/jquery_ujs
3
- #= require trestle/bootstrap
4
- #= require trestle/bootstrap-confirmation
5
- #= require trestle/magnific-popup
6
- #= require trestle/flatpickr
7
- #= require trestle/select2
8
- #
9
- #= require_self
10
- #= require trestle/custom
11
- #= require_tree .
12
-
13
- window.Trestle = Trestle = {}
14
-
15
- Trestle.i18n = {}
16
-
17
- if Turbolinks?.supported
18
- Trestle.ready = (callback) -> $(document).on 'turbolinks:load', callback
19
- Trestle.visit = (url) -> Turbolinks.visit(url)
20
- else
21
- Trestle.ready = (callback) -> $(callback)
22
- Trestle.visit = (url) -> document.location = url
@@ -1,4 +0,0 @@
1
- # This file is left as an extension point for user customization.
2
- #
3
- # It will be overridden by the similarly named file within
4
- # the app/assets folder of the Rails application.
@@ -1,7 +0,0 @@
1
- # This file may be used for providing additional customizations to the Trestle
2
- # admin. It will be automatically included within all admin pages.
3
- #
4
- # For organizational purposes, you may wish to define your customizations
5
- # within individual partials and `require` them here.
6
- #
7
- # e.g. #= require "trestle/custom/my_custom_js"