biovision-base 0.19.180703.1 → 0.20.180731.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/biovision/base/biovision.js +47 -3
  3. data/app/assets/stylesheets/biovision/base/biovision.scss +1 -1
  4. data/app/assets/stylesheets/biovision/base/default.scss +16 -0
  5. data/app/controllers/codes_controller.rb +5 -4
  6. data/app/controllers/index_controller.rb +14 -1
  7. data/app/controllers/media_files_controller.rb +1 -1
  8. data/app/controllers/my/profiles_controller.rb +9 -2
  9. data/app/helpers/languages_helper.rb +1 -1
  10. data/app/models/language.rb +1 -0
  11. data/app/models/user.rb +1 -0
  12. data/app/services/canonizer.rb +1 -0
  13. data/app/views/admin/users/entity/_in_list.html.erb +16 -10
  14. data/app/views/admin/users/show.html.erb +11 -3
  15. data/app/views/authentication/_form.html.erb +1 -1
  16. data/app/views/codes/_form.html.erb +42 -9
  17. data/app/views/editable_blocks/_form.html.erb +28 -24
  18. data/app/views/feedback_mailer/new_feedback_request.html.erb +17 -6
  19. data/app/views/feedback_mailer/new_feedback_request.text.erb +19 -3
  20. data/app/views/feedback_requests/_form.html.erb +1 -1
  21. data/app/views/layouts/application/_footer.html.erb +1 -0
  22. data/app/views/link_block_items/_form.html.erb +6 -5
  23. data/app/views/link_blocks/_form.html.erb +18 -16
  24. data/app/views/shared/forms/errors.js.erb +2 -2
  25. data/config/locales/common-en.yml +4 -1
  26. data/config/locales/common-ru.yml +3 -0
  27. data/config/locales/common-sv.yml +168 -0
  28. data/config/locales/editable-pages-en.yml +48 -2
  29. data/config/locales/editable-pages-ru.yml +2 -6
  30. data/config/locales/editable-pages-sv.yml +123 -0
  31. data/config/locales/feedback-en.yml +3 -2
  32. data/config/locales/feedback-sv.yml +37 -0
  33. data/config/locales/links-en.yml +95 -0
  34. data/config/locales/links-sv.yml +95 -0
  35. data/config/locales/media-sv.yml +92 -0
  36. data/config/locales/track-en.yml +102 -0
  37. data/config/locales/track-sv.yml +102 -0
  38. data/config/locales/users-en.yml +10 -6
  39. data/config/locales/users-ru.yml +5 -1
  40. data/config/locales/users-sv.yml +395 -0
  41. data/config/routes.rb +47 -47
  42. data/db/migrate/20170228000000_create_languages.rb +1 -0
  43. data/db/migrate/20170302000001_create_users.rb +1 -0
  44. data/db/migrate/20170320000000_create_editable_pages.rb +1 -1
  45. data/db/migrate/20180722222222_add_active_to_languages.rb +11 -0
  46. data/db/migrate/20180725111111_add_referral_link_to_users.rb +22 -0
  47. data/lib/biovision/base/base_methods.rb +10 -1
  48. data/lib/biovision/base/version.rb +1 -1
  49. metadata +13 -4
  50. data/app/views/shared/forms/_default_ajax_handler.html.erb +0 -15
  51. data/app/views/shared/forms/_list_of_errors.js.erb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf92e00f9a0ab7e0f652c415e72aafc3366b9fc3bf66dfe3ffe53cc28ec4ed52
4
- data.tar.gz: da76fa84f6d156b168cc9a00ef1a8ffaeca82a6bd88259039e91b5cea400e486
3
+ metadata.gz: 878d3c84e3d6e08ba4fa008b488ed44edd05a0da401a1845782c7f31a3fab464
4
+ data.tar.gz: f4e73e086c4fe87bf11f2c68e7ceb26daaeb0507e0699990cb0729a38758338a
5
5
  SHA512:
6
- metadata.gz: f20c9f734d53640a9c4e7c34f28b439a273a9c1aa7ec61bab3b97182c6247783efad7a44db47de9bc2059e6d3b8e5adba325d31c5ea0873ac51178d328dd559b
7
- data.tar.gz: e42080ee36e46275a170f0c75d082bc0e5da83df1604cd99d44148d9b8b0bcdc6dcf2ac2d354ae6c2542a38dc2103b17ca2ec48b375936a4e57b5967673b9e6e
6
+ metadata.gz: 2a1c30cb8db14f7831172840f86d9a05a4352e7d833e0c2b1e9e5d7c68515afe90aa499f9a9675478a46e572261a01e76f19ff4f9da6cf023d7155135f458781
7
+ data.tar.gz: 71512a52954db3ceb82eaa5fc64fa9b773b2388c8117940194e972106c973b67b9a2fb59714c1e5ff20eb6bf8da3df38255af27b5b1d7f64b8415eea08003d7a
@@ -151,7 +151,8 @@ const Biovision = {
151
151
  'о': 'o', 'п': 'p', 'р': 'r', 'с': 's', 'т': 't',
152
152
  'у': 'u', 'ф': 'f', 'х': 'kh', 'ц': 'c', 'ч': 'ch',
153
153
  'ш': 'sh', 'щ': 'shh', 'ъ': '', 'ы': 'y', 'ь': '',
154
- 'э': 'e', 'ю': 'yu', 'я': 'ya'
154
+ 'э': 'e', 'ю': 'yu', 'я': 'ya',
155
+ 'å': 'ao', 'ä': 'ae', 'ö': 'oe', 'é': 'e'
155
156
  };
156
157
  let string = input.toLowerCase();
157
158
 
@@ -255,8 +256,16 @@ const Biovision = {
255
256
  });
256
257
  }
257
258
  },
258
- show_list_of_errors: function (entity_name, list) {
259
- const form = document.getElementById(entity_name + '-form');
259
+ /**
260
+ * Показать список ошибок после обработки формы
261
+ *
262
+ * Используется в контроллерах при отправке форм через remote: true
263
+ *
264
+ * @param {string} model_name название модели
265
+ * @param {Array<string>} list список ошибок
266
+ */
267
+ showListOfErrors: function (model_name, list) {
268
+ const form = document.getElementById(model_name + '-form');
260
269
  if (form) {
261
270
  let errors = form.querySelector('ol.errors');
262
271
  let data = '';
@@ -302,12 +311,42 @@ const Biovision = {
302
311
  request.send();
303
312
  }
304
313
  }
314
+ },
315
+ autoExpand: function () {
316
+ if (!this.hasOwnProperty('baseScrollHeight')) {
317
+ let savedValue = this.value;
318
+ this.value = '';
319
+ this.baseScrollHeight = this.scrollHeight;
320
+ this.value = savedValue;
321
+ }
322
+ const styles = getComputedStyle(this);
323
+ const ratio = styles.getPropertyValue('line-height').replace('px', '');
324
+ const minRows = this.getAttribute('data-min-rows') | 0;
325
+ const maxRows = this.hasAttribute('data-max-rows') ? parseInt(this.getAttribute('data-max-rows')) : 25;
326
+ const rows = Math.ceil((this.scrollHeight - this.baseScrollHeight) / ratio);
327
+
328
+ this.rows = minRows;
329
+ this.rows = minRows + rows;
330
+ if (this.rows > maxRows) {
331
+ this.rows = maxRows;
332
+ }
305
333
  }
306
334
  };
307
335
 
308
336
  document.addEventListener('DOMContentLoaded', function () {
309
337
  Biovision.csrf_token = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
310
338
 
339
+ const topLinker = document.getElementById('go-to-top');
340
+ if (topLinker) {
341
+ window.addEventListener('scroll', function () {
342
+ if (window.pageYOffset > 500) {
343
+ topLinker.classList.remove('inactive');
344
+ } else {
345
+ topLinker.classList.add('inactive');
346
+ }
347
+ });
348
+ }
349
+
311
350
  // Предварительный просмотр картинки при выборе файла
312
351
  document.addEventListener('change', function (event) {
313
352
  const input = event.target;
@@ -543,6 +582,11 @@ document.addEventListener('DOMContentLoaded', function () {
543
582
  button.addEventListener('click', Biovision.removeEntityImage);
544
583
  });
545
584
 
585
+ document.querySelectorAll('textarea.auto-expand').forEach(function (textarea) {
586
+ textarea.addEventListener('focus', Biovision.autoExpand);
587
+ textarea.addEventListener('input', Biovision.autoExpand);
588
+ });
589
+
546
590
  if (typeof jQuery !== 'undefined') {
547
591
  jQuery.ajaxSetup({
548
592
  headers: {
@@ -19,7 +19,7 @@ h4,
19
19
  h5,
20
20
  h6 {
21
21
  font-family: $font-family-heading;
22
- font-weight: 500;
22
+ //font-weight: 500;
23
23
  margin: 0;
24
24
  }
25
25
 
@@ -33,10 +33,26 @@ $link-color: rgb(20, 127, 255) !default;
33
33
  $link-color-visited: rgb(20, 77, 250) !default;
34
34
  $link-color-hover: rgb(255, 77, 20) !default;
35
35
 
36
+ $spacer-xxs: .4rem;
37
+ $spacer-xs: .8rem;
38
+ $spacer-s: 1.6rem;
39
+ $spacer-m: 3.2rem;
40
+ $spacer-l: 4.8rem;
41
+ $spacer-xl: 6.4rem;
42
+ $spacer-xxl: 9.6rem;
43
+
36
44
  :root {
37
45
  --font-size-large: #{$font-size-large};
38
46
  --font-size-increased: #{$font-size-increased};
39
47
  --font-size-normal: #{$font-size-normal};
40
48
  --font-size-decreased: #{$font-size-decreased};
41
49
  --font-size-small: #{$font-size-small};
50
+
51
+ --spacer-xxs: #{$spacer-xxs};
52
+ --spacer-xs: #{$spacer-xs};
53
+ --spacer-s: #{$spacer-s};
54
+ --spacer-m: #{$spacer-m};
55
+ --spacer-l: #{$spacer-l};
56
+ --spacer-xl: #{$spacer-xl};
57
+ --spacer-xxl: #{$spacer-xxl};
42
58
  }
@@ -10,9 +10,9 @@ class CodesController < AdminController
10
10
  def create
11
11
  @entity = Code.new(creation_parameters)
12
12
  if @entity.save
13
- redirect_to admin_code_path(id: @entity.id)
13
+ form_processed_ok(admin_code_path(id: @entity.id))
14
14
  else
15
- render :new, status: :bad_request
15
+ form_processed_with_error(:new)
16
16
  end
17
17
  end
18
18
 
@@ -23,9 +23,10 @@ class CodesController < AdminController
23
23
  # patch /codes/:id
24
24
  def update
25
25
  if @entity.update(entity_parameters)
26
- redirect_to admin_code_path(id: @entity.id), notice: t('codes.update.success')
26
+ flash[:notice] = t('codes.update.success')
27
+ form_processed_ok(admin_code_path(id: @entity.id))
27
28
  else
28
- render :edit, status: :bad_request
29
+ form_processed_with_error(:edit)
29
30
  end
30
31
  end
31
32
 
@@ -1,6 +1,19 @@
1
1
  class IndexController < ApplicationController
2
2
  # get /
3
3
  def index
4
- @editable_page = EditablePage.find_localized('index', locale)
4
+ @editable_page = EditablePage.localized_page('index', locale)
5
+ check_referral_link if params.key?(:rl)
6
+ end
7
+
8
+ private
9
+
10
+ def check_referral_link
11
+ return if cookies['r']
12
+ cookies['r'] = {
13
+ value: param_from_request(:rl),
14
+ expires: 1.year.from_now,
15
+ domain: :all,
16
+ httponly: true
17
+ }
5
18
  end
6
19
  end
@@ -68,7 +68,7 @@ class MediaFilesController < ApplicationController
68
68
  render json: {
69
69
  uploaded: 1,
70
70
  fileName: File.basename(@entity.name),
71
- url: @entity.file.medium.url
71
+ url: @entity.file.medium_2x.url
72
72
  }
73
73
  end
74
74
  end
@@ -51,10 +51,11 @@ class My::ProfilesController < ApplicationController
51
51
  end
52
52
 
53
53
  def create_user
54
- @entity = User.new creation_parameters
54
+ @entity = User.new(creation_parameters)
55
55
  if @entity.save
56
56
  Metric.register(User::METRIC_REGISTRATION)
57
57
  create_token_for_user(@entity)
58
+ cookies.delete('r', domain: :all)
58
59
  redirect_after_creation
59
60
  else
60
61
  form_processed_with_error(:new)
@@ -63,7 +64,13 @@ class My::ProfilesController < ApplicationController
63
64
 
64
65
  def creation_parameters
65
66
  parameters = params.require(:user).permit(User.new_profile_parameters)
66
- parameters.merge(tracking_for_entity).merge({ super_user: User.count < 1 })
67
+ parameters.merge!(tracking_for_entity)
68
+ parameters.merge!({ super_user: User.count < 1 })
69
+ if cookies['r']
70
+ parameters[:inviter] = User.find_by(referral_link: cookies['r'])
71
+ end
72
+
73
+ parameters
67
74
  end
68
75
 
69
76
  def user_parameters
@@ -10,7 +10,7 @@ module LanguagesHelper
10
10
  def languages_for_select(include_blank = true)
11
11
  options = []
12
12
  options << [t(:not_set), ''] if include_blank
13
- Language.ordered_by_priority.each do |language|
13
+ Language.active.ordered_by_priority.each do |language|
14
14
  options << ["#{language.code}: #{language_name(language)}", language.id]
15
15
  end
16
16
  options
@@ -21,6 +21,7 @@ class Language < ApplicationRecord
21
21
  validates_uniqueness_of :slug
22
22
 
23
23
  scope :ordered_by_priority, -> { order('priority asc') }
24
+ scope :active, -> { where(active: true) }
24
25
 
25
26
  # @param [Integer] delta
26
27
  def change_priority(delta)
@@ -38,6 +38,7 @@ class User < ApplicationRecord
38
38
 
39
39
  before_save :normalize_slug
40
40
  before_save :prepare_search_string
41
+ before_save { self.referral_link = SecureRandom.alphanumeric(12) if referral_link.blank? }
41
42
 
42
43
  before_validation { self.email = nil if email.blank? }
43
44
 
@@ -6,6 +6,7 @@ class Canonizer
6
6
  'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'kh', 'ц' => 'c',
7
7
  'ч' => 'ch', 'ш' => 'sh', 'щ' => 'shh', 'ъ' => '', 'ы' => 'y', 'ь' => '',
8
8
  'э' => 'e', 'ю' => 'yu', 'я' => 'ya',
9
+ 'å' => 'ao', 'ä' => 'ae', 'ö' => 'oe', 'é' => 'e'
9
10
  }
10
11
 
11
12
  # @param [String] text
@@ -4,15 +4,15 @@
4
4
  <div class="data">
5
5
  <div><%= admin_user_link(entity) %></div>
6
6
  <% unless entity.notice.blank? %>
7
- <div><%= entity.notice %></div>
7
+ <div><%= entity.notice %></div>
8
8
  <% end %>
9
9
  <div class="info">
10
10
  <%= entity.screen_name %>
11
11
  </div>
12
12
  <% unless entity.email.blank? %>
13
- <div class="info">
14
- <%= t('activerecord.attributes.user.email') %>: <%= entity.email %>
15
- </div>
13
+ <div class="info">
14
+ <%= t('activerecord.attributes.user.email') %>: <%= entity.email %>
15
+ </div>
16
16
  <% end %>
17
17
  <div class="info">
18
18
  <%= t('activerecord.attributes.user.balance') %>:
@@ -21,19 +21,25 @@
21
21
  <div class="secondary info">
22
22
  <div><%= t(:created_at) %>: <%= time_tag entity.created_at %></div>
23
23
  <% unless entity.last_seen.nil? %>
24
- <div>
25
- <%= t('activerecord.attributes.user.last_seen') %>:
26
- <%= time_tag entity.last_seen %>
27
- </div>
24
+ <div>
25
+ <%= t('activerecord.attributes.user.last_seen') %>:
26
+ <%= time_tag entity.last_seen %>
27
+ </div>
28
28
  <% end %>
29
29
  </div>
30
+ <% unless entity.inviter_id.nil? %>
31
+ <div class="secondary info">
32
+ <%= t('activerecord.attributes.user.inviter') %>:
33
+ <%= admin_user_link(entity.inviter) %>
34
+ </div>
35
+ <% end %>
30
36
 
31
37
  <%=
32
38
  render(
33
39
  partial: 'shared/admin/toggleable',
34
- locals: {
40
+ locals: {
35
41
  entity: entity,
36
- url: toggle_admin_user_path(id: entity.id)
42
+ url: toggle_admin_user_path(id: entity.id)
37
43
  }
38
44
  )
39
45
  %>
@@ -28,7 +28,7 @@
28
28
  t('.authenticate'),
29
29
  authenticate_admin_user_path(id: @entity.id),
30
30
  method: :post,
31
- class: 'button-action'
31
+ class: 'button-action'
32
32
  )
33
33
  %>
34
34
  <% end %>
@@ -37,7 +37,7 @@
37
37
  <figure role="group" class="preview">
38
38
  <%= profile_avatar @entity %>
39
39
  <figcaption>
40
- <%= @entity.slug %>
40
+ <%= user_link(@entity) %>
41
41
  </figcaption>
42
42
  </figure>
43
43
 
@@ -48,7 +48,12 @@
48
48
  <% end %>
49
49
 
50
50
  <dt><%= t('activerecord.attributes.user.screen_name') %></dt>
51
- <dd><%= user_link @entity %></dd>
51
+ <dd><%= @entity.screen_name %></dd>
52
+
53
+ <% unless @entity.inviter_id.nil? %>
54
+ <dt><%= t('activerecord.attributes.user.inviter') %></dt>
55
+ <dd><%= admin_user_link(@entity.inviter) %></dd>
56
+ <% end %>
52
57
 
53
58
  <% unless @entity.email.blank? %>
54
59
  <dt><%= t('activerecord.attributes.user.email') %></dt>
@@ -76,6 +81,9 @@
76
81
  <dt><%= t(:updated_at) %></dt>
77
82
  <dd><%= time_tag @entity.updated_at %></dd>
78
83
 
84
+ <dt><%= t('activerecord.attributes.user.referral_link') %></dt>
85
+ <dd><%= root_url(rl: @entity.referral_link) %></dd>
86
+
79
87
  <% unless @entity.last_seen.blank? %>
80
88
  <dt><%= t('activerecord.attributes.user.last_seen') %></dt>
81
89
  <dd><%= time_tag @entity.last_seen %></dd>
@@ -1,7 +1,7 @@
1
1
  <%= form_tag login_path, class: 'login' do %>
2
2
  <div class="fields">
3
3
  <div>
4
- <%= label_tag :login, t('activerecord.attributes.user.screen_name') %>
4
+ <%= label_tag :login, t('.login') %>
5
5
  <%= text_field_tag :login, '', required: true, size: 18 %>
6
6
  </div>
7
7
  <div>
@@ -1,8 +1,9 @@
1
- <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
1
+ <% model_name = entity.class.to_s.underscore %>
2
+ <%= form_with(model: entity, html: { id: "#{model_name}-form" }) do |f| %>
3
+ <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
2
4
 
3
- <%= form_for entity do |f| %>
4
- <dl>
5
- <% if entity.id.blank? %>
5
+ <dl>
6
+ <% if entity.id.nil? %>
6
7
  <dt><%= f.label :code_type_id %></dt>
7
8
  <dd>
8
9
  <%= f.select :code_type_id, code_types_for_select, required: true %>
@@ -10,8 +11,19 @@
10
11
 
11
12
  <dt><%= f.label :user_id %></dt>
12
13
  <dd>
13
- <%= f.number_field :user_id, in: User.ids_range %>
14
- <%= render partial: 'admin/users/search', locals: { target_id: :code_user_id } %>
14
+ <%=
15
+ f.number_field(
16
+ :user_id,
17
+ id: "#{model_name}_user_id",
18
+ in: User.ids_range
19
+ )
20
+ %>
21
+ <%=
22
+ render(
23
+ partial: 'admin/users/search',
24
+ locals: { target_id: "#{model_name}_user_id" }
25
+ )
26
+ %>
15
27
  </dd>
16
28
  <% else %>
17
29
  <dt><%= t('activerecord.attributes.code.code_type') %></dt>
@@ -27,19 +39,40 @@
27
39
 
28
40
  <dt><%= f.label :body %></dt>
29
41
  <dd>
30
- <%= f.text_field :body, size: 25, maxlength: Code::BODY_LIMIT, required: true %>
42
+ <%=
43
+ f.text_field(
44
+ :body,
45
+ id: "#{model_name}_body",
46
+ size: 25,
47
+ maxlength: Code::BODY_LIMIT,
48
+ required: true
49
+ )
50
+ %>
31
51
  <div class="guideline"><%= t('.guidelines.body') %></div>
32
52
  </dd>
33
53
 
34
54
  <dt><%= f.label :payload %></dt>
35
55
  <dd>
36
- <%= f.text_field :payload, size: 25, maxlength: Code::PAYLOAD_LIMIT %>
56
+ <%=
57
+ f.text_field(
58
+ :payload,
59
+ id: "#{model_name}_payload",
60
+ size: 25,
61
+ maxlength: Code::PAYLOAD_LIMIT
62
+ )
63
+ %>
37
64
  <div class="guideline"><%= t('.guidelines.payload') %></div>
38
65
  </dd>
39
66
 
40
67
  <dt><%= f.label :quantity %></dt>
41
68
  <dd>
42
- <%= f.number_field :quantity, in: Code::QUANTITY_RANGE %>
69
+ <%=
70
+ f.number_field(
71
+ :quantity,
72
+ id: "#{model_name}_quantity",
73
+ in: Code::QUANTITY_RANGE
74
+ )
75
+ %>
43
76
  </dd>
44
77
  </dl>
45
78
 
@@ -2,8 +2,8 @@
2
2
  <%=
3
3
  form_with(
4
4
  model: entity,
5
- html: {
6
- id: "#{model_name}-form",
5
+ html: {
6
+ id: "#{model_name}-form",
7
7
  data: { check_url: check_editable_blocks_path }
8
8
  }
9
9
  ) do |f|
@@ -22,10 +22,10 @@
22
22
  id: "#{model_name}_slug",
23
23
  size: nil,
24
24
  maxlength: EditableBlock::SLUG_LIMIT,
25
- pattern: EditableBlock::SLUG_PATTERN_HTML,
26
- title: t('.guidelines.slug'),
25
+ pattern: EditableBlock::SLUG_PATTERN_HTML,
26
+ title: t('.guidelines.slug'),
27
27
  required: true,
28
- data: {
28
+ data: {
29
29
  check: :slug
30
30
  }
31
31
  )
@@ -42,8 +42,8 @@
42
42
  id: "#{model_name}_name",
43
43
  size: nil,
44
44
  maxlength: EditableBlock::TITLE_LIMIT,
45
- required: true,
46
- data: {
45
+ required: true,
46
+ data: {
47
47
  check: :name
48
48
  }
49
49
  )
@@ -60,7 +60,7 @@
60
60
  id: "#{model_name}_description",
61
61
  size: nil,
62
62
  maxlength: EditableBlock::DESCRIPTION_LIMIT,
63
- data: {
63
+ data: {
64
64
  check: :description
65
65
  }
66
66
  )
@@ -99,7 +99,7 @@
99
99
  id: "#{model_name}_title",
100
100
  size: nil,
101
101
  maxlength: EditableBlock::TITLE_LIMIT,
102
- data: {
102
+ data: {
103
103
  check: :title
104
104
  }
105
105
  )
@@ -113,11 +113,12 @@
113
113
  <%=
114
114
  f.text_area(
115
115
  :lead,
116
- id: "#{model_name}_lead",
117
- cols: 80,
118
- rows: 5,
119
- max_length: EditableBlock::TEXT_LIMIT,
120
- data: {
116
+ id: "#{model_name}_lead",
117
+ cols: 80,
118
+ rows: 5,
119
+ maxlength: EditableBlock::TEXT_LIMIT,
120
+ class: 'auto-expand',
121
+ data: {
121
122
  check: :lead
122
123
  }
123
124
  )
@@ -131,11 +132,12 @@
131
132
  <%=
132
133
  f.text_area(
133
134
  :body,
134
- id: "#{model_name}_body",
135
- cols: 80,
136
- rows: 5,
137
- max_length: EditableBlock::TEXT_LIMIT,
138
- data: {
135
+ id: "#{model_name}_body",
136
+ cols: 80,
137
+ rows: 5,
138
+ maxlength: EditableBlock::TEXT_LIMIT,
139
+ class: 'auto-expand',
140
+ data: {
139
141
  check: :body
140
142
  }
141
143
  )
@@ -149,11 +151,12 @@
149
151
  <%=
150
152
  f.text_area(
151
153
  :footer,
152
- id: "#{model_name}_footer",
153
- cols: 80,
154
- rows: 5,
155
- max_length: EditableBlock::TEXT_LIMIT,
156
- data: {
154
+ id: "#{model_name}_footer",
155
+ cols: 80,
156
+ rows: 5,
157
+ maxlength: EditableBlock::TEXT_LIMIT,
158
+ class: 'auto-expand',
159
+ data: {
157
160
  check: :footer
158
161
  }
159
162
  )
@@ -166,6 +169,7 @@
166
169
  </dl>
167
170
 
168
171
  <div class="buttons">
172
+ <%= hidden_field_tag :entity_id, entity.id %>
169
173
  <%= f.button t(:save), type: :submit, class: 'button-save' %>
170
174
  </div>
171
175
  <% end %>