wallaby 6.1.5 → 7.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/fonts/FontAwesome.otf +0 -0
  3. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  4. data/app/assets/fonts/fontawesome-webfont.svg +2671 -0
  5. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  6. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  7. data/app/assets/fonts/fontawesome-webfont.woff2 +0 -0
  8. data/app/assets/fonts/summernote.eot +0 -0
  9. data/app/assets/fonts/summernote.hash +1 -0
  10. data/app/assets/fonts/summernote.ttf +0 -0
  11. data/app/assets/fonts/summernote.woff +0 -0
  12. data/app/assets/fonts/summernote.woff2 +0 -0
  13. data/app/assets/javascripts/wallaby/base.js +1 -17
  14. data/app/assets/javascripts/wallaby/core.js +46172 -0
  15. data/app/assets/javascripts/wallaby/core.js.map +7 -0
  16. data/app/assets/javascripts/wallaby/{setup.js.erb → setup.js} +17 -5
  17. data/app/assets/stylesheets/wallaby/base/_fonts.scss +22 -0
  18. data/app/assets/stylesheets/wallaby/base/_functions.scss +15 -29
  19. data/app/assets/stylesheets/wallaby/base/_mixins.scss +7 -7
  20. data/app/assets/stylesheets/wallaby/base.scss +2 -8
  21. data/app/assets/stylesheets/wallaby/core.scss +12139 -0
  22. data/app/assets/stylesheets/wallaby/pages/_index.scss +1 -1
  23. data/app/javascript/wallaby/core.js +23 -0
  24. data/app/javascript/wallaby/globals.js +9 -0
  25. data/app/stylesheets/wallaby/core.scss +15 -0
  26. data/app/views/layouts/wallaby/resources.html.erb +1 -3
  27. data/app/views/wallaby/resources/_edit_page.html.erb +20 -0
  28. data/app/views/wallaby/resources/_form.html.erb +7 -1
  29. data/app/views/wallaby/resources/_frontend.html.erb +2 -3
  30. data/app/views/wallaby/resources/_home_page.html.erb +5 -0
  31. data/app/views/wallaby/resources/_index_page.html.erb +59 -0
  32. data/app/views/wallaby/resources/_index_query.html.erb +2 -2
  33. data/app/views/wallaby/resources/_new_page.html.erb +19 -0
  34. data/app/views/wallaby/resources/_show_page.html.erb +42 -0
  35. data/app/views/wallaby/resources/edit.html.erb +1 -18
  36. data/app/views/wallaby/resources/error.json.jbuilder +1 -0
  37. data/app/views/wallaby/resources/form/_belongs_to.html.erb +1 -1
  38. data/app/views/wallaby/resources/form/_citext.html.erb +1 -1
  39. data/app/views/wallaby/resources/form/_color.html.erb +1 -1
  40. data/app/views/wallaby/resources/form/_date.html.erb +1 -1
  41. data/app/views/wallaby/resources/form/_daterange.html.erb +1 -1
  42. data/app/views/wallaby/resources/form/_datetime.html.erb +1 -1
  43. data/app/views/wallaby/resources/form/_has_and_belongs_to_many.html.erb +1 -1
  44. data/app/views/wallaby/resources/form/_has_many.html.erb +1 -1
  45. data/app/views/wallaby/resources/form/_hstore.html.erb +1 -1
  46. data/app/views/wallaby/resources/form/_json.html.erb +1 -1
  47. data/app/views/wallaby/resources/form/_jsonb.html.erb +1 -1
  48. data/app/views/wallaby/resources/form/_longtext.html.erb +1 -1
  49. data/app/views/wallaby/resources/form/_markdown.html.erb +1 -1
  50. data/app/views/wallaby/resources/form/_mediumtext.html.erb +1 -1
  51. data/app/views/wallaby/resources/form/_text.html.erb +1 -1
  52. data/app/views/wallaby/resources/form/_time.html.erb +1 -1
  53. data/app/views/wallaby/resources/form/_tinytext.html.erb +1 -1
  54. data/app/views/wallaby/resources/form/_tsrange.html.erb +1 -1
  55. data/app/views/wallaby/resources/form/_tstzrange.html.erb +1 -1
  56. data/app/views/wallaby/resources/form/_xml.html.erb +1 -1
  57. data/app/views/wallaby/resources/home.html.erb +1 -5
  58. data/app/views/wallaby/resources/index/_box.html.erb +1 -1
  59. data/app/views/wallaby/resources/index/_circle.html.erb +1 -1
  60. data/app/views/wallaby/resources/index/_citext.html.erb +1 -1
  61. data/app/views/wallaby/resources/index/_dollar.html.erb +5 -0
  62. data/app/views/wallaby/resources/index/_hstore.html.erb +1 -1
  63. data/app/views/wallaby/resources/index/_json.html.erb +1 -1
  64. data/app/views/wallaby/resources/index/_jsonb.html.erb +1 -1
  65. data/app/views/wallaby/resources/index/_line.html.erb +1 -1
  66. data/app/views/wallaby/resources/index/_longtext.html.erb +1 -1
  67. data/app/views/wallaby/resources/index/_lseg.html.erb +1 -1
  68. data/app/views/wallaby/resources/index/_ltree.html.erb +1 -1
  69. data/app/views/wallaby/resources/index/_mediumtext.html.erb +1 -1
  70. data/app/views/wallaby/resources/index/_path.html.erb +1 -1
  71. data/app/views/wallaby/resources/index/_percent.html.erb +10 -0
  72. data/app/views/wallaby/resources/index/_polygon.html.erb +1 -1
  73. data/app/views/wallaby/resources/index/_sti.html.erb +1 -1
  74. data/app/views/wallaby/resources/index/_string.html.erb +1 -1
  75. data/app/views/wallaby/resources/index/_text.html.erb +1 -1
  76. data/app/views/wallaby/resources/index/_tinytext.html.erb +1 -1
  77. data/app/views/wallaby/resources/index/_tsvector.html.erb +1 -1
  78. data/app/views/wallaby/resources/index/_uuid.html.erb +1 -1
  79. data/app/views/wallaby/resources/index/_xml.html.erb +1 -1
  80. data/app/views/wallaby/resources/index.csv.erb +7 -1
  81. data/app/views/wallaby/resources/index.html.erb +1 -54
  82. data/app/views/wallaby/resources/new.html.erb +1 -18
  83. data/app/views/wallaby/resources/show/_active_storage.html.erb +5 -0
  84. data/app/views/wallaby/resources/show.html.erb +1 -35
  85. data/lib/generators/wallaby/engine/partials/USAGE +23 -0
  86. data/lib/generators/wallaby/engine/partials/partials_generator.rb +25 -0
  87. data/lib/generators/wallaby/install/install_generator.rb +1 -54
  88. data/lib/wallaby/ui_engine.rb +3 -2
  89. data/lib/wallaby/version.rb +1 -1
  90. data/lib/wallaby/views.rb +2 -11
  91. metadata +45 -122
  92. data/app/assets/stylesheets/wallaby/summernote.scss.erb +0 -7
  93. data/lib/generators/wallaby/install/templates/application_authorizer.rb.erb +0 -40
  94. data/lib/generators/wallaby/install/templates/application_controller.rb.erb +0 -148
  95. data/lib/generators/wallaby/install/templates/application_decorator.rb.erb +0 -10
  96. data/lib/generators/wallaby/install/templates/application_paginator.rb.erb +0 -30
  97. data/lib/generators/wallaby/install/templates/application_servicer.rb.erb +0 -50
  98. data/lib/generators/wallaby/install/templates/initializer.rb.erb +0 -58
  99. /data/app/views/wallaby/resources/{_active_storage.html.erb → index/_active_storage.html.erb} +0 -0
@@ -89,7 +89,7 @@
89
89
  border: none;
90
90
  border-bottom: 6px solid $background-color;
91
91
  font-weight: normal;
92
- height: 40px;
92
+ height: 41px;
93
93
  padding: 8px 12px;
94
94
  white-space: nowrap;
95
95
  }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * ----- NOTE -----
3
+ * file `app/assets/javascripts/wallaby/core.js` will be automatically generated by
4
+ * `yarn build:js` to bundle all the imports from `app/javascript/wallaby/core.js`
5
+ * Please DO NOT try to modify this generated file.
6
+ * ----------------
7
+ */
8
+
9
+ import './globals';
10
+ import 'jquery-ujs';
11
+ import 'moment-timezone';
12
+ import 'popper.js';
13
+ import 'bootstrap';
14
+ import 'tempusdominus-bootstrap-4';
15
+ import 'summernote/dist/summernote-bs4';
16
+ import 'codemirror/addon/mode/overlay';
17
+ import 'codemirror/mode/ruby/ruby';
18
+ import 'codemirror/mode/javascript/javascript';
19
+ import 'codemirror/mode/markdown/markdown';
20
+ import 'codemirror/mode/gfm/gfm';
21
+ import 'codemirror/mode/xml/xml';
22
+ import 'typeahead.js/dist/typeahead.bundle';
23
+ import 'jquery-minicolors';
@@ -0,0 +1,9 @@
1
+ import jquery from 'jquery';
2
+ import moment from 'moment';
3
+ import Bloodhound from 'typeahead.js/dist/bloodhound';
4
+ import CodeMirror from 'codemirror';
5
+
6
+ window.jQuery = window.$ = jquery
7
+ window.moment = moment
8
+ window.Bloodhound = Bloodhound
9
+ window.CodeMirror = CodeMirror
@@ -0,0 +1,15 @@
1
+ /*
2
+ * ----- NOTE -----
3
+ * file `app/assets/stylesheets/wallaby/core.scss` will be automatically generated by
4
+ * `yarn build:scss` to bundle all the imports from `app/stylesheets/wallaby/core.scss`
5
+ * Please DO NOT try to modify this generated file.
6
+ * ----------------
7
+ */
8
+
9
+ @import 'bootstrap/scss/bootstrap';
10
+ @import 'font-awesome/scss/font-awesome';
11
+ @import 'tempusdominus-bootstrap-4/src/sass/tempusdominus-bootstrap-4';
12
+ @import 'jquery-minicolors/jquery.minicolors.css';
13
+ @import 'summernote/src/styles/bs4/summernote-bs4';
14
+ @import 'codemirror/lib/codemirror.css';
15
+ @import 'codemirror/theme/mdn-like.css';
@@ -3,9 +3,7 @@
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <% if features.turbolinks_enabled %>
7
- <meta name="turbolinks-cache-control" content="no-cache">
8
- <% end %>
6
+ <meta name="turbolinks-cache-control" content="no-cache">
9
7
  <%= csrf_meta_tags %>
10
8
 
11
9
  <title><%= render 'title' %></title>
@@ -0,0 +1,20 @@
1
+ <%
2
+ # decorate first on every page or partial
3
+ decorated = decorate resource
4
+ %>
5
+ <article class="resource">
6
+ <div class="resource__header">
7
+ <h1><%= wt 'labels.edit', id: decorated.id %></h1>
8
+ <%= render 'resource_navs' %>
9
+ </div>
10
+ <%= render 'flash_messages' %>
11
+ <section>
12
+ <div class="resource__container">
13
+ <%= form_for decorated,
14
+ url: url_for(action: :show), method: :put,
15
+ html: { :multipart => true } do |form| %>
16
+ <%= render 'form', form: form, decorated: decorated %>
17
+ <% end %>
18
+ </div>
19
+ </section>
20
+ </article>
@@ -6,7 +6,13 @@
6
6
  <% end %>
7
7
  <% end %>
8
8
  <% decorated.form_field_names.each do |field_name| %>
9
- <%= type_render decorated.form_type_of(field_name), field_name: field_name, form: form %>
9
+ <%= render decorated.form_type_of(field_name),
10
+ form: form,
11
+ object: decorated,
12
+ field_name: field_name,
13
+ value: decorated.try(field_name),
14
+ metadata: decorated.form_metadata_of(field_name)
15
+ %>
10
16
  <% end %>
11
17
  <%= form.button wt('buttons.save'), class: 'btn btn-primary' %>
12
18
  <%= cancel_link html_options: { class: 'btn btn-default' } %>
@@ -1,4 +1,3 @@
1
1
  <% # can be overridden %>
2
- <%= stylesheet_link_tag 'wallaby/application', media: 'all' %>
3
- <%= javascript_include_tag 'turbolinks' if features.turbolinks_enabled %>
4
- <%= javascript_include_tag 'wallaby/application' %>
2
+ <%= stylesheet_link_tag 'wallaby/application', media: 'all', 'data-turbolinks-track' => true %>
3
+ <%= javascript_include_tag 'wallaby/application', 'data-turbolinks-track' => true, 'data-turbolinks-eval' => false %>
@@ -0,0 +1,5 @@
1
+ <h1>
2
+ Welcome
3
+ </h1>
4
+ <%# TODO: turn this page into intro maybe? %>
5
+ <%= render 'flash_messages' %>
@@ -0,0 +1,59 @@
1
+ <%
2
+ # decorate first on every page or partial
3
+ decorated_collection = decorate collection
4
+ %>
5
+ <article class="resources">
6
+ <div class="resources__header">
7
+ <h1><%= to_model_label(current_model_class) %></h1>
8
+ <%= render 'index_query' %>
9
+ <%= render 'index_filters' %>
10
+ <%= render 'index_pagination' %>
11
+ </div>
12
+ <%= render 'flash_messages' %>
13
+
14
+ <section>
15
+ <% # Data table %>
16
+ <% if decorated_collection.present? %>
17
+ <% field_names = current_model_decorator.index_field_names %>
18
+ <div class="resources__container">
19
+ <table class="resources__data">
20
+ <thead>
21
+ <tr>
22
+ <% field_names.each do |field_name| %>
23
+ <%= content_tag :th, class: sort_link_builder.current_sort[field_name] do %>
24
+ <%= sort_link_builder.build field_name %>
25
+ <% end %>
26
+ <% end %>
27
+ <th>&nbsp;</th>
28
+ </tr>
29
+ </thead>
30
+ <tbody>
31
+ <% decorated_collection.each do |decorated| %>
32
+ <tr>
33
+ <% field_names.each do |field_name| %>
34
+ <td>
35
+ <%= render decorated.index_type_of(field_name),
36
+ object: decorated,
37
+ field_name: field_name,
38
+ value: decorated.try(field_name),
39
+ metadata: decorated.index_metadata_of(field_name)
40
+ %>
41
+ </td>
42
+ <% end %>
43
+ <td class="resource__actions">
44
+ <%= render 'resource_actions', decorated: decorated %>
45
+ </td>
46
+ </tr>
47
+ <% end %>
48
+ </tbody>
49
+ </table>
50
+ </div>
51
+ <% else %>
52
+ <div class="resources__not-found">
53
+ <%= image_tag 'wallaby/not_found.png' %>
54
+ <%= wt 'errors.not_found.collection' %>
55
+ </div>
56
+ <% end %>
57
+ <% # /Data table %>
58
+ </section>
59
+ </article>
@@ -1,7 +1,7 @@
1
1
  <%= content_tag :div, class: request.query_parameters.present? ? %w(query query--filtered) : %w(query) do %>
2
2
  <nav class="query__actions">
3
- <%= index_link(current_model_class, html_classes('query__clear')) {} if request.query_parameters.present? %>
4
- <%= new_link(current_model_class, html_classes('query__create')) {} %>
3
+ <%= index_link(current_model_class, **html_classes('query__clear')) {} if request.query_parameters.present? %>
4
+ <%= new_link(current_model_class, **html_classes('query__create')) {} %>
5
5
  <a id="actions_list" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="query__more"></a>
6
6
  <%= render 'index_actions' %>
7
7
  </nav>
@@ -0,0 +1,19 @@
1
+ <% decorated = decorate resource %>
2
+ <article class="resource">
3
+ <div class="resource__header">
4
+ <h1><%= wt 'labels.create', model: to_model_label(current_model_class) %></h1>
5
+ <%= render 'resource_navs' %>
6
+ </div>
7
+ <%= render 'flash_messages' %>
8
+ <section>
9
+ <div class="resource__container">
10
+ <%= form_for(
11
+ decorated,
12
+ url: url_for(action: :index), method: :post,
13
+ html: { :multipart => true }
14
+ ) do |form| %>
15
+ <%= render 'form', form: form, decorated: decorated %>
16
+ <% end %>
17
+ </div>
18
+ </section>
19
+ </article>
@@ -0,0 +1,42 @@
1
+ <article class="resource">
2
+ <%
3
+ if resource
4
+ # decorate first on every page or partial
5
+ decorated = decorate resource
6
+ %>
7
+ <div class="resource__header">
8
+ <h1><%= show_title decorated %></h1>
9
+ <%= render 'resource_navs' %>
10
+ </div>
11
+ <%= render 'flash_messages' %>
12
+ <section>
13
+ <div class="resource__container">
14
+ <% decorated.show_field_names.each do |field_name| %>
15
+ <dl>
16
+ <dt><%= decorated.show_label_of field_name %></dt>
17
+ <dd>
18
+ <%= render decorated.show_type_of(field_name),
19
+ object: decorated,
20
+ field_name: field_name,
21
+ value: decorated.try(field_name),
22
+ metadata: decorated.show_metadata_of(field_name)
23
+ %>
24
+ </dd>
25
+ </dl>
26
+ <% end %>
27
+ </div>
28
+ </section>
29
+ <% else %>
30
+ <div class="resource__header">
31
+ <h1><%= to_model_label(current_model_class) %></h1>
32
+ <%= render 'resource_navs' %>
33
+ </div>
34
+ <%= render 'flash_messages' %>
35
+ <section>
36
+ <div class="resource__not-found">
37
+ <%= image_tag 'wallaby/not_found.png' %>
38
+ <%= wt 'errors.not_found.resource', resource: to_model_label(current_model_class) %>
39
+ </div>
40
+ </section>
41
+ <% end %>
42
+ </article>
@@ -1,18 +1 @@
1
- <%
2
- # decorate first on every page or partial
3
- decorated = decorate resource
4
- %>
5
- <article class="resource">
6
- <div class="resource__header">
7
- <h1><%= wt 'labels.edit', id: decorated.id %></h1>
8
- <%= render 'resource_navs' %>
9
- </div>
10
- <%= render 'flash_messages' %>
11
- <section>
12
- <div class="resource__container">
13
- <%= form_for decorated, url: url_for(action: :show), method: :put, html: { :multipart => true }, builder: Wallaby::FormBuilder do |form| %>
14
- <%= render 'form', form: form, decorated: decorated %>
15
- <% end %>
16
- </div>
17
- </section>
18
- </article>
1
+ <%= render 'edit_page' %>
@@ -2,6 +2,7 @@
2
2
 
3
3
  json.error do
4
4
  json.code @code
5
+
5
6
  if @code < 500 && @exception.present?
6
7
  json.message @exception.message
7
8
  else
@@ -63,7 +63,7 @@ unless @belongs_to_init
63
63
  @belongs_to_init = true
64
64
  content_for :custom_javascript do
65
65
  javascript_tag do %>
66
- jQuery(document).off(readyPrefix('.belongs_to')).on(readyPrefix('.belongs_to'), function () {
66
+ documentReady('.belongs_to', function () {
67
67
  jQuery('[data-init="belongs_to"]').each(function () {
68
68
  var $container = jQuery(this);
69
69
  var $select = $container.find('select');
@@ -18,7 +18,7 @@ The following params are the variables that can be used in this partial.
18
18
  <% @summernote_init = true %>
19
19
  <% content_for :custom_javascript do %>
20
20
  <% javascript_tag do %>
21
- jQuery(document).off(readyPrefix('.citext')).on(readyPrefix('.citext'), function () {
21
+ documentReady('.citext', function () {
22
22
  $('textarea[data-init="summernote"]').summernote({
23
23
  height: 150,
24
24
  codemirror: { // codemirror options
@@ -22,7 +22,7 @@ The following params are the variables that can be used in this partial.
22
22
  <% @colorpicker_init = true %>
23
23
  <% content_for :custom_javascript do %>
24
24
  <% javascript_tag do %>
25
- jQuery(document).off(readyPrefix('.color')).on(readyPrefix('.color'), function () {
25
+ documentReady('.color', function () {
26
26
  $('[data-init="colorpicker"]').minicolors({ theme: 'bootstrap' })
27
27
  })
28
28
  <% end %>
@@ -26,7 +26,7 @@ The following params are the variables that can be used in this partial.
26
26
  <% @datepicker_init = true %>
27
27
  <% content_for :custom_javascript do %>
28
28
  <% javascript_tag do %>
29
- jQuery(document).off(readyPrefix('.date')).on(readyPrefix('.date'), function () {
29
+ documentReady('.date', function () {
30
30
  $('[data-init="datepicker"]').each(function() {
31
31
  var $input = $('input', this),
32
32
  val = ($input.attr('value') || '').split(' ').slice(0,1).join(' ');
@@ -35,7 +35,7 @@ The following params are the variables that can be used in this partial.
35
35
  <% @datepicker_init = true %>
36
36
  <% content_for :custom_javascript do %>
37
37
  <% javascript_tag do %>
38
- jQuery(document).off(readyPrefix('.daterange')).on(readyPrefix('.daterange'), function () {
38
+ documentReady('.daterange', function () {
39
39
  $('[data-init="datepicker"]').each(function() {
40
40
  var $input = $('input', this),
41
41
  val = ($input.attr('value') || '').split(' ').slice(0,1).join(' ');
@@ -26,7 +26,7 @@ The following params are the variables that can be used in this partial.
26
26
  <% @datetimepicker_init = true %>
27
27
  <% content_for :custom_javascript do %>
28
28
  <% javascript_tag do %>
29
- jQuery(document).off(readyPrefix('.datetime')).on(readyPrefix('.datetime'), function () {
29
+ documentReady('.datetime', function () {
30
30
  $('[data-init="datetimepicker"]').each(function() {
31
31
  var $input = $('input', this),
32
32
  val = ($input.attr('value') || '').split(' ').slice(0,2).join(' ');
@@ -52,7 +52,7 @@ unless @has_and_belongs_to_many_init
52
52
  @has_and_belongs_to_many_init = true
53
53
  content_for :custom_javascript do
54
54
  javascript_tag do %>
55
- jQuery(document).off(readyPrefix('.has_and_belongs_to_many')).on(readyPrefix('.has_and_belongs_to_many'), function () {
55
+ documentReady('.has_and_belongs_to_many', function () {
56
56
  $('[data-init="has_and_belongs_to_many"]').auto_select();
57
57
  });
58
58
  <% end
@@ -51,7 +51,7 @@ unless @has_many_init
51
51
  @has_many_init = true
52
52
  content_for :custom_javascript do
53
53
  javascript_tag do %>
54
- jQuery(document).off(readyPrefix('.has_many')).on(readyPrefix('.has_many'), function () {
54
+ documentReady('.has_many', function () {
55
55
  $('[data-init="has_many"]').auto_select();
56
56
  });
57
57
  <% end
@@ -18,7 +18,7 @@ The following params are the variables that can be used in this partial.
18
18
  <% @codemirror_init = true %>
19
19
  <% content_for :custom_javascript do %>
20
20
  <% javascript_tag do %>
21
- jQuery(document).off(readyPrefix('.codemirror_init')).on(readyPrefix('.codemirror_init'), function () {
21
+ documentReady('.codemirror_init', function () {
22
22
  $('textarea[data-init="codemirror"]').each(function (index, element) {
23
23
  CodeMirror.fromTextArea(element, {
24
24
  mode: $(element).data('mode')
@@ -19,7 +19,7 @@ The following params are the variables that can be used in this partial.
19
19
  <% @codemirror_init = true %>
20
20
  <% content_for :custom_javascript do %>
21
21
  <% javascript_tag do %>
22
- jQuery(document).off(readyPrefix('.codemirror_init')).on(readyPrefix('.codemirror_init'), function () {
22
+ documentReady('.codemirror_init', function () {
23
23
  $('textarea[data-init="codemirror"]').each(function (index, element) {
24
24
  CodeMirror.fromTextArea(element, {
25
25
  mode: $(element).data('mode')
@@ -19,7 +19,7 @@ The following params are the variables that can be used in this partial.
19
19
  <% @codemirror_init = true %>
20
20
  <% content_for :custom_javascript do %>
21
21
  <% javascript_tag do %>
22
- jQuery(document).off(readyPrefix('.codemirror_init')).on(readyPrefix('.codemirror_init'), function () {
22
+ documentReady('.codemirror_init', function () {
23
23
  $('textarea[data-init="codemirror"]').each(function (index, element) {
24
24
  CodeMirror.fromTextArea(element, {
25
25
  mode: $(element).data('mode')
@@ -18,7 +18,7 @@ The following params are the variables that can be used in this partial.
18
18
  <% @summernote_init = true %>
19
19
  <% content_for :custom_javascript do %>
20
20
  <% javascript_tag do %>
21
- jQuery(document).off(readyPrefix('.summernote')).on(readyPrefix('.summernote'), function () {
21
+ documentReady('.summernote', function () {
22
22
  $('textarea[data-init="summernote"]').summernote({
23
23
  height: 150,
24
24
  codemirror: { // codemirror options
@@ -18,7 +18,7 @@ The following params are the variables that can be used in this partial.
18
18
  <% @codemirror_init = true %>
19
19
  <% content_for :custom_javascript do %>
20
20
  <% javascript_tag do %>
21
- jQuery(document).off(readyPrefix('.codemirror_init')).on(readyPrefix('.codemirror_init'), function () {
21
+ documentReady('.codemirror_init', function () {
22
22
  $('textarea[data-init="codemirror"]').each(function (index, element) {
23
23
  CodeMirror.fromTextArea(element, {
24
24
  mode: $(element).data('mode')
@@ -18,7 +18,7 @@ The following params are the variables that can be used in this partial.
18
18
  <% @summernote_init = true %>
19
19
  <% content_for :custom_javascript do %>
20
20
  <% javascript_tag do %>
21
- jQuery(document).off(readyPrefix('.summernote')).on(readyPrefix('.summernote'), function () {
21
+ documentReady('.summernote', function () {
22
22
  $('textarea[data-init="summernote"]').summernote({
23
23
  height: 150,
24
24
  codemirror: { // codemirror options
@@ -18,7 +18,7 @@ The following params are the variables that can be used in this partial.
18
18
  <% @summernote_init = true %>
19
19
  <% content_for :custom_javascript do %>
20
20
  <% javascript_tag do %>
21
- jQuery(document).off(readyPrefix('.summernote')).on(readyPrefix('.summernote'), function () {
21
+ documentReady('.summernote', function () {
22
22
  $('textarea[data-init="summernote"]').summernote({
23
23
  height: 150,
24
24
  codemirror: { // codemirror options
@@ -26,7 +26,7 @@ The following params are the variables that can be used in this partial.
26
26
  <% @timepicker_init = true %>
27
27
  <% content_for :custom_javascript do %>
28
28
  <% javascript_tag do %>
29
- jQuery(document).off(readyPrefix('.time')).on(readyPrefix('.time'), function () {
29
+ documentReady('.time', function () {
30
30
  $('[data-init="timepicker"]').each(function() {
31
31
  var $input = $('input', this),
32
32
  val = ($input.attr('value') || '').split(' ').slice(0,2).join(' ');
@@ -18,7 +18,7 @@ The following params are the variables that can be used in this partial.
18
18
  <% @summernote_init = true %>
19
19
  <% content_for :custom_javascript do %>
20
20
  <% javascript_tag do %>
21
- jQuery(document).off(readyPrefix('.summernote')).on(readyPrefix('.summernote'), function () {
21
+ documentReady('.summernote', function () {
22
22
  $('textarea[data-init="summernote"]').summernote({
23
23
  height: 150,
24
24
  codemirror: { // codemirror options
@@ -35,7 +35,7 @@ The following params are the variables that can be used in this partial.
35
35
  <% @datetimepicker_init = true %>
36
36
  <% content_for :custom_javascript do %>
37
37
  <% javascript_tag do %>
38
- jQuery(document).off(readyPrefix('.tsrange')).on(readyPrefix('.tsrange'), function () {
38
+ documentReady('.tsrange', function () {
39
39
  $('[data-init="datetimepicker"]').each(function() {
40
40
  var $input = $('input', this),
41
41
  val = ($input.attr('value') || '').split(' ').slice(0,2).join(' ');
@@ -35,7 +35,7 @@ The following params are the variables that can be used in this partial.
35
35
  <% @datetimepicker_init = true %>
36
36
  <% content_for :custom_javascript do %>
37
37
  <% javascript_tag do %>
38
- jQuery(document).off(readyPrefix('.tstzrange')).on(readyPrefix('.tstzrange'), function () {
38
+ documentReady('.tstzrange', function () {
39
39
  $('[data-init="datetimepicker"]').each(function() {
40
40
  var $input = $('input', this),
41
41
  val = ($input.attr('value') || '').split(' ').slice(0,2).join(' ');
@@ -18,7 +18,7 @@ The following params are the variables that can be used in this partial.
18
18
  <% @codemirror_init = true %>
19
19
  <% content_for :custom_javascript do %>
20
20
  <% javascript_tag do %>
21
- jQuery(document).off(readyPrefix('.codemirror_init')).on(readyPrefix('.codemirror_init'), function () {
21
+ documentReady('.codemirror_init', function () {
22
22
  $('textarea[data-init="codemirror"]').each(function (index, element) {
23
23
  CodeMirror.fromTextArea(element, {
24
24
  mode: $(element).data('mode')
@@ -1,5 +1 @@
1
- <h1>
2
- Welcome
3
- </h1>
4
- <%# TODO: turn this page into intro maybe? %>
5
- <%= render 'flash_messages' %>
1
+ <%= render 'home_page' %>
@@ -5,7 +5,7 @@
5
5
  <%= if value.nil?
6
6
  null
7
7
  else
8
- max = metadata[:max] || default_metadata.max
8
+ max = metadata[:max] || max_text_length
9
9
  value = value.to_s
10
10
  if value.length > max
11
11
  concat content_tag(:code, value.truncate(max))
@@ -5,7 +5,7 @@
5
5
  <%= if value.nil?
6
6
  null
7
7
  else
8
- max = metadata[:max] || default_metadata.max
8
+ max = metadata[:max] || max_text_length
9
9
  value = value.to_s
10
10
  if value.length > max
11
11
  concat content_tag(:code, value.truncate(max))
@@ -5,7 +5,7 @@
5
5
  <%= if value.nil?
6
6
  null
7
7
  else
8
- max = metadata[:max] || default_metadata.max
8
+ max = metadata[:max] || max_text_length
9
9
  value = value.to_s
10
10
  if value.length > max
11
11
  concat content_tag(:span, value.truncate(max))
@@ -0,0 +1,5 @@
1
+ <%# @param object [model] model instance %>
2
+ <%# @param field_name [String] name of the field %>
3
+ <%# @param value [Object] value of the field %>
4
+ <%# @param metadata [Hash] metadata of the field %>
5
+ <%= value.try { |v| number_to_currency(v, metadata[:dollar] || {}) } || null %>
@@ -5,7 +5,7 @@
5
5
  <%= if value.nil?
6
6
  null
7
7
  else
8
- max = metadata[:max] || default_metadata.max
8
+ max = metadata[:max] || max_text_length
9
9
  value = value.to_s
10
10
  if value.length > max
11
11
  concat content_tag(:code, value.truncate(max))
@@ -5,7 +5,7 @@
5
5
  <%= if value.nil?
6
6
  null
7
7
  else
8
- max = metadata[:max] || default_metadata.max
8
+ max = metadata[:max] || max_text_length
9
9
  value = value.to_s
10
10
  if value.length > max
11
11
  concat content_tag(:code, value.truncate(max))
@@ -5,7 +5,7 @@
5
5
  <%= if value.nil?
6
6
  null
7
7
  else
8
- max = metadata[:max] || default_metadata.max
8
+ max = metadata[:max] || max_text_length
9
9
  value = value.to_s
10
10
  if value.length > max
11
11
  concat content_tag(:code, value.truncate(max))
@@ -5,7 +5,7 @@
5
5
  <%= if value.nil?
6
6
  null
7
7
  else
8
- max = metadata[:max] || default_metadata.max
8
+ max = metadata[:max] || max_text_length
9
9
  value = value.to_s
10
10
  if value.length > max
11
11
  concat content_tag(:code, value.truncate(max))
@@ -5,7 +5,7 @@
5
5
  <%= if value.nil?
6
6
  null
7
7
  else
8
- max = metadata[:max] || default_metadata.max
8
+ max = metadata[:max] || max_text_length
9
9
  value = value.to_s
10
10
  if value.length > max
11
11
  concat content_tag(:span, value.truncate(max))
@@ -5,7 +5,7 @@
5
5
  <%= if value.nil?
6
6
  null
7
7
  else
8
- max = metadata[:max] || default_metadata.max
8
+ max = metadata[:max] || max_text_length
9
9
  value = value.to_s
10
10
  if value.length > max
11
11
  concat content_tag(:code, value.truncate(max))
@@ -5,7 +5,7 @@
5
5
  <%= if value.nil?
6
6
  null
7
7
  else
8
- max = metadata[:max] || default_metadata.max
8
+ max = metadata[:max] || max_text_length
9
9
  value = value.to_s
10
10
  if value.length > max
11
11
  concat content_tag(:span, value.truncate(max))
@@ -5,7 +5,7 @@
5
5
  <%= if value.nil?
6
6
  null
7
7
  else
8
- max = metadata[:max] || default_metadata.max
8
+ max = metadata[:max] || max_text_length
9
9
  value = value.to_s
10
10
  if value.length > max
11
11
  concat content_tag(:span, value.truncate(max))
@@ -5,7 +5,7 @@
5
5
  <%= if value.nil?
6
6
  null
7
7
  else
8
- max = metadata[:max] || default_metadata.max
8
+ max = metadata[:max] || max_text_length
9
9
  value = value.to_s
10
10
  if value.length > max
11
11
  concat content_tag(:code, value.truncate(max))