biovision-base 0.11.180127 → 0.14.180326

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -0
  3. data/app/assets/javascripts/biovision/base/biovision-sliders.js +12 -9
  4. data/app/assets/javascripts/biovision/base/biovision.js +187 -2
  5. data/app/assets/stylesheets/biovision/base/admin.scss +84 -40
  6. data/app/assets/stylesheets/biovision/base/biovision.scss +104 -44
  7. data/app/assets/stylesheets/biovision/base/buttons/buttons-common.scss +95 -0
  8. data/app/assets/stylesheets/biovision/base/buttons/buttons-rounded.scss +26 -0
  9. data/app/assets/stylesheets/biovision/base/default.scss +2 -2
  10. data/app/assets/stylesheets/biovision/base/default_admin.scss +1 -1
  11. data/app/assets/stylesheets/biovision/base/default_application.scss +1 -1
  12. data/app/assets/stylesheets/biovision/base/themes/simple-layout.scss +115 -0
  13. data/app/assets/stylesheets/biovision/base/users.scss +15 -0
  14. data/app/controllers/agents_controller.rb +3 -3
  15. data/app/controllers/authentication_controller.rb +4 -4
  16. data/app/controllers/browsers_controller.rb +3 -3
  17. data/app/controllers/codes_controller.rb +2 -2
  18. data/app/controllers/editable_pages_controller.rb +6 -5
  19. data/app/controllers/index_controller.rb +1 -1
  20. data/app/controllers/media_files_controller.rb +3 -3
  21. data/app/controllers/media_folders_controller.rb +3 -3
  22. data/app/controllers/metrics_controller.rb +1 -1
  23. data/app/controllers/my/index_controller.rb +2 -0
  24. data/app/controllers/my/profiles_controller.rb +15 -9
  25. data/app/controllers/privilege_groups_controller.rb +2 -2
  26. data/app/controllers/privileges_controller.rb +3 -3
  27. data/app/controllers/stored_values_controller.rb +2 -2
  28. data/app/controllers/tokens_controller.rb +2 -2
  29. data/app/controllers/users_controller.rb +26 -10
  30. data/app/helpers/biovision_helper.rb +13 -2
  31. data/app/helpers/biovision_users_helper.rb +20 -5
  32. data/app/helpers/codes_helper.rb +1 -1
  33. data/app/helpers/editable_pages_helper.rb +1 -1
  34. data/app/helpers/languages_helper.rb +18 -0
  35. data/app/helpers/media_helper.rb +2 -2
  36. data/app/helpers/privileges_helper.rb +2 -2
  37. data/app/helpers/stored_values_helper.rb +1 -1
  38. data/app/helpers/tracking_helper.rb +2 -2
  39. data/app/models/editable_page.rb +10 -1
  40. data/app/models/user.rb +17 -23
  41. data/app/services/user_manager.rb +15 -18
  42. data/app/services/user_profile_handler.rb +28 -0
  43. data/app/uploaders/avatar_uploader.rb +1 -5
  44. data/app/uploaders/editable_page_image_uploader.rb +1 -1
  45. data/app/views/admin/agents/entity/_in_list.html.erb +3 -3
  46. data/app/views/admin/agents/show.html.erb +10 -2
  47. data/app/views/admin/browsers/entity/_in_list.html.erb +3 -3
  48. data/app/views/admin/browsers/show.html.erb +2 -2
  49. data/app/views/admin/codes/entity/_in_list.html.erb +1 -1
  50. data/app/views/admin/codes/show.html.erb +1 -1
  51. data/app/views/admin/editable_pages/entity/_in_list.html.erb +7 -1
  52. data/app/views/admin/editable_pages/show.html.erb +26 -19
  53. data/app/views/admin/feedback_requests/entity/_in_list.html.erb +1 -1
  54. data/app/views/admin/index/_biovision_base.html.erb +1 -0
  55. data/app/views/admin/media_files/entity/_in_list.html.erb +1 -1
  56. data/app/views/admin/media_files/show.html.erb +2 -2
  57. data/app/views/admin/media_folders/entity/_in_list.html.erb +2 -2
  58. data/app/views/admin/media_folders/files.html.erb +1 -1
  59. data/app/views/admin/media_folders/show.html.erb +6 -4
  60. data/app/views/admin/metrics/_list.html.erb +2 -2
  61. data/app/views/admin/metrics/show.html.erb +2 -2
  62. data/app/views/admin/privilege_groups/entity/_in_list.html.erb +1 -1
  63. data/app/views/admin/privilege_groups/show.html.erb +1 -1
  64. data/app/views/admin/privileges/entity/_in_list.html.erb +4 -4
  65. data/app/views/admin/privileges/show.html.erb +4 -4
  66. data/app/views/admin/privileges/users.html.erb +1 -1
  67. data/app/views/admin/stored_values/entity/_in_list.html.erb +1 -1
  68. data/app/views/admin/stored_values/show.html.erb +1 -1
  69. data/app/views/admin/tokens/entity/_in_list.html.erb +2 -2
  70. data/app/views/admin/tokens/show.html.erb +2 -2
  71. data/app/views/admin/users/codes.html.erb +1 -1
  72. data/app/views/admin/users/entity/_in_list.html.erb +3 -2
  73. data/app/views/admin/users/entity/_privilege.html.erb +1 -1
  74. data/app/views/admin/users/entity/_profile.html.erb +17 -0
  75. data/app/views/admin/users/privileges.html.erb +1 -1
  76. data/app/views/admin/users/search.jbuilder +2 -2
  77. data/app/views/admin/users/show.html.erb +34 -49
  78. data/app/views/admin/users/tokens.html.erb +1 -1
  79. data/app/views/agents/_agent.jbuilder +1 -1
  80. data/app/views/agents/edit.html.erb +1 -1
  81. data/app/views/authentication/_form.html.erb +1 -1
  82. data/app/views/authentication/create.jbuilder +10 -0
  83. data/app/views/browsers/edit.html.erb +1 -1
  84. data/app/views/codes/edit.html.erb +1 -1
  85. data/app/views/editable_pages/_form.html.erb +116 -61
  86. data/app/views/editable_pages/edit.html.erb +1 -1
  87. data/app/views/index/index.html.erb +8 -6
  88. data/app/views/index/index/_custom_dashboard.html.erb +0 -0
  89. data/app/views/index/index/_default_dashboard.html.erb +2 -0
  90. data/app/views/index/index/_editable.html.erb +9 -0
  91. data/app/views/layouts/admin/_header.html.erb +1 -1
  92. data/app/views/layouts/application/_header.html.erb +1 -1
  93. data/app/views/layouts/application/header/authentication/_links.html.erb +3 -3
  94. data/app/views/layouts/application/header/authentication/_plate.html.erb +1 -1
  95. data/app/views/layouts/profile.html.erb +23 -0
  96. data/app/views/layouts/profile/_footer.html.erb +11 -0
  97. data/app/views/layouts/profile/_header.html.erb +9 -0
  98. data/app/views/layouts/profile/header/_navigation.html.erb +0 -0
  99. data/app/views/media_files/edit.html.erb +1 -1
  100. data/app/views/media_folders/_form.html.erb +0 -2
  101. data/app/views/media_folders/edit.html.erb +1 -1
  102. data/app/views/media_folders/new.html.erb +1 -1
  103. data/app/views/metrics/edit.html.erb +2 -2
  104. data/app/views/my/index/index.html.erb +9 -14
  105. data/app/views/my/index/index/_dashboard.html.erb +12 -0
  106. data/app/views/my/index/index/_sidebar.html.erb +11 -0
  107. data/app/views/my/login_attempts/index.html.erb +1 -1
  108. data/app/views/my/profiles/_nav_item.html.erb +1 -1
  109. data/app/views/my/profiles/edit.js.erb +1 -0
  110. data/app/views/my/profiles/edit/_form.html.erb +130 -116
  111. data/app/views/my/profiles/edit/form/_profile_data.html.erb +53 -0
  112. data/app/views/my/profiles/new.js.erb +1 -0
  113. data/app/views/my/profiles/new/_form.html.erb +100 -53
  114. data/app/views/my/tokens/_toggleable.html.erb +1 -1
  115. data/app/views/my/tokens/index.html.erb +1 -1
  116. data/app/views/privilege_groups/edit.html.erb +1 -1
  117. data/app/views/privileges/edit.html.erb +1 -1
  118. data/app/views/profiles/_profile.html.erb +5 -6
  119. data/app/views/shared/_pagination.jbuilder +4 -0
  120. data/app/views/shared/admin/_list_with_priority.html.erb +6 -1
  121. data/app/views/shared/forms/_list_of_errors.js.erb +2 -0
  122. data/app/views/shared/forms/_wysiwyg.html.erb +11 -0
  123. data/app/views/shared/forms/errors.js.erb +5 -0
  124. data/app/views/stored_values/edit.html.erb +1 -1
  125. data/app/views/tokens/edit.html.erb +1 -1
  126. data/app/views/users/_form.html.erb +141 -83
  127. data/app/views/users/check.jbuilder +4 -0
  128. data/app/views/users/edit.html.erb +1 -1
  129. data/app/views/users/form/_profile_data.html.erb +53 -0
  130. data/app/views/users/new.html.erb +1 -1
  131. data/config/locales/common-en.yml +2 -0
  132. data/config/locales/common-ru.yml +2 -0
  133. data/config/locales/editable-pages-en.yml +5 -4
  134. data/config/locales/editable-pages-ru.yml +5 -4
  135. data/config/locales/users-en.yml +388 -0
  136. data/config/locales/users-ru.yml +8 -3
  137. data/config/routes.rb +127 -103
  138. data/db/migrate/20170302000001_create_users.rb +2 -0
  139. data/db/migrate/20170320000000_create_editable_pages.rb +1 -1
  140. data/db/migrate/20180321000000_add_profile_data_to_users.rb +31 -0
  141. data/lib/biovision/base/base_methods.rb +37 -7
  142. data/lib/biovision/base/engine.rb +1 -1
  143. data/lib/biovision/base/privilege_methods.rb +1 -1
  144. data/lib/biovision/base/version.rb +1 -1
  145. metadata +27 -6
  146. data/app/assets/stylesheets/biovision/base/buttons.scss +0 -195
  147. data/app/assets/stylesheets/biovision/base/layout.scss +0 -193
  148. data/app/views/editable_pages/form/_ckeditor.html.erb +0 -11
  149. data/db/migrate/20170302000002_create_user_profiles.rb +0 -21
@@ -1,4 +1,4 @@
1
- <div class="toggleable" data-url="<%= toggle_my_token_path(entity.id) %>">
1
+ <div class="toggleable" data-url="<%= toggle_my_token_path(id: entity.id) %>">
2
2
  <% Token.toggleable_attributes.each do |flag| %>
3
3
  <span class="<%= entity.attributes[flag.to_s] ? 'active' : 'inactive' %>" data-flag="<%= flag %>">
4
4
  <%= t("activerecord.attributes.token.#{flag}") %>
@@ -1,6 +1,6 @@
1
1
  <% content_for :meta_title, t('.title', page: current_page) %>
2
2
  <% content_for :breadcrumbs do %>
3
- <%= link_to(t('my.profiles.nav_item.text'), my_profile_path) %>
3
+ <%= link_to(t('my.profiles.nav_item.text'), my_path) %>
4
4
  <span><%= t('my.tokens.nav_item.text') %></span>
5
5
  <% end %>
6
6
 
@@ -9,7 +9,7 @@
9
9
  <h1><%= t('.heading') %></h1>
10
10
 
11
11
  <ul class="actions">
12
- <li><%= return_icon(admin_privilege_group_path(@entity.id)) %></li>
12
+ <li><%= return_icon(admin_privilege_group_path(id: @entity.id)) %></li>
13
13
  <li class="danger"><%= destroy_icon(@entity) %></li>
14
14
  </ul>
15
15
 
@@ -11,7 +11,7 @@
11
11
  <article>
12
12
  <h1><%= t('.title') %></h1>
13
13
  <ul class="actions">
14
- <li><%= back_icon(admin_privilege_path(@entity.id)) %></li>
14
+ <li><%= back_icon(admin_privilege_path(id: @entity.id)) %></li>
15
15
  <% if @entity.can_be_deleted? %>
16
16
  <li class="danger"><%= destroy_icon(@entity) %></li>
17
17
  <% end %>
@@ -3,13 +3,13 @@
3
3
 
4
4
  <% if current_user_has_privilege?(:administrator) %>
5
5
  <ul class="actions">
6
- <li><%= gear_icon(admin_user_path(user)) %></li>
6
+ <li><%= gear_icon(admin_user_path(id: user.id)) %></li>
7
7
  </ul>
8
8
  <% end %>
9
9
 
10
10
  <% if current_user == user %>
11
11
  <nav>
12
- <%= link_to t(:edit), edit_my_profile_path %>
12
+ <%= link_to t(:edit), edit_my_profile_path, class: 'button-action' %>
13
13
  </nav>
14
14
  <% end %>
15
15
 
@@ -25,7 +25,7 @@
25
25
  <dt><%= t('activerecord.attributes.user.last_seen') %></dt>
26
26
  <dd><%= time_tag user.last_seen %></dd>
27
27
  <% end %>
28
- <% unless user.profile&.name.blank? %>
28
+ <% unless user.profile_data['name'].blank? %>
29
29
  <dt><%= t('activerecord.attributes.user_profile.name') %></dt>
30
30
  <dd><%= user.full_name %></dd>
31
31
  <% end %>
@@ -33,10 +33,9 @@
33
33
  <dt><%= t('activerecord.attributes.user.email') %></dt>
34
34
  <dd><%= user.email %></dd>
35
35
  <% end %>
36
- <% unless user.profile&.gender.blank? %>
36
+ <% unless user.profile_data['gender'].blank? %>
37
37
  <dt><%= t('activerecord.attributes.user_profile.gender') %></dt>
38
- <dd><%= t("activerecord.attributes.user_profile.genders.#{user.user_profile.gender}") %></dd>
38
+ <dd><%= gender_name(user.profile_data['gender']) %></dd>
39
39
  <% end %>
40
40
  </dl>
41
-
42
41
  </article>
@@ -1,6 +1,10 @@
1
1
  if collection.respond_to?(:current_page)
2
2
  json.links do
3
3
  json.self url_for(page: collection.current_page, format: :json)
4
+ json.first url_for(page: 1, format: :json)
5
+ unless collection.prev_page.nil?
6
+ json.prev url_for(page: collection.prev_page, format: :json)
7
+ end
4
8
  unless collection.next_page.nil?
5
9
  json.next url_for(page: collection.next_page, format: :json)
6
10
  end
@@ -2,7 +2,12 @@
2
2
  <ol class="list-of-entities">
3
3
  <% collection.each do |entity| %>
4
4
  <li data-id="<%= entity.id %>" data-number="<%= entity.priority %>">
5
- <%= render partial: "admin/#{entity.class.table_name}/entity/in_list", locals: { entity: entity } %>
5
+ <%=
6
+ render(
7
+ partial: "admin/#{entity.class.table_name}/entity/in_list",
8
+ locals: { entity: entity }
9
+ )
10
+ %>
6
11
  </li>
7
12
  <% end %>
8
13
  </ol>
@@ -16,4 +16,6 @@
16
16
  errors.innerHTML = data;
17
17
 
18
18
  form.prepend(errors);
19
+
20
+ errors.scrollIntoView();
19
21
  }
@@ -0,0 +1,11 @@
1
+ <script src="//cdn.ckeditor.com/4.8.0/full/ckeditor.js"></script>
2
+ <script>
3
+ document.addEventListener('DOMContentLoaded', function () {
4
+ document.querySelectorAll('form [data-wysiwyg]').forEach(function(editor) {
5
+ CKEDITOR.replace(editor, {
6
+ filebrowserUploadUrl: '/media_files/ckeditor',
7
+ removePlugins: 'forms,save,preview,flash,bidi,language,print,templates,newpage,iframe,about,scayt,wsc',
8
+ });
9
+ });
10
+ });
11
+ </script>
@@ -0,0 +1,5 @@
1
+ <%
2
+ entity_name = @entity.class.to_s.underscore
3
+ list = @entity.errors.full_messages.map { |m| "'#{j(m)}'" }
4
+ %>
5
+ Biovision.show_list_of_errors('<%= entity_name %>', [<%= raw(list.join(',')) %>]);
@@ -9,7 +9,7 @@
9
9
  <h1><%= t('.heading') %></h1>
10
10
 
11
11
  <ul class="actions">
12
- <li><%= return_icon(admin_stored_value_path(@entity.id)) %></li>
12
+ <li><%= return_icon(admin_stored_value_path(id: @entity.id)) %></li>
13
13
  <li class="danger"><%= destroy_icon(@entity) %></li>
14
14
  </ul>
15
15
 
@@ -9,7 +9,7 @@
9
9
  <h1><%= t('.title') %></h1>
10
10
 
11
11
  <ul class="actions">
12
- <li><%= return_icon(admin_token_path(@entity.id)) %></li>
12
+ <li><%= return_icon(admin_token_path(id: @entity.id)) %></li>
13
13
  <li class="danger"><%= destroy_icon @entity %></li>
14
14
  </ul>
15
15
 
@@ -1,89 +1,147 @@
1
- <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
2
-
3
- <%= form_for entity do |f| %>
4
-
5
-
6
- <dl>
7
- <dt><%= f.label :image %></dt>
8
- <dd>
9
- <figure id="user-image">
10
- <%= f.label(:image, image_tag(entity.image.profile.url, alt: t(:current_image))) %>
11
- <figcaption>
12
- <%= f.file_field :image, accept: 'image/jpeg,image/png', data: { image: 'user-image' } %>
13
- </figcaption>
14
- </figure>
15
- </dd>
16
-
17
- <dt><%= f.label :screen_name %></dt>
18
- <dd>
19
- <%= f.text_field :screen_name, size: 30, maxlength: User::SLUG_LIMIT %>
20
- </dd>
21
-
22
- <dt><%= f.label :email %></dt>
23
- <dd>
24
- <%= f.email_field :email, size: 30, maxlength: User::EMAIL_LIMIT %>
25
- </dd>
26
-
27
- <dt><%= f.label :phone %></dt>
28
- <dd>
29
- <%= f.phone_field :phone, size: 15, maxlength: User::PHONE_LIMIT %>
30
- </dd>
31
-
32
- <% if entity.id.blank? %>
33
- <dt><%= f.label :password %></dt>
34
- <dd>
35
- <%= f.text_field :password, size: nil, maxlength: 70 %>
36
- </dd>
37
-
38
- <dt><%= f.label :password_confirmation %></dt>
39
- <dd>
40
- <%= f.text_field :password_confirmation, size: nil, maxlength: 70 %>
41
- </dd>
42
- <% end %>
43
-
44
- <dt><%= label_tag :user_profile_name, t('activerecord.attributes.user_profile.name') %></dt>
1
+ <% entity_type = entity.class.to_s.underscore %>
2
+ <%= form_with(model: entity, html: { id: "#{entity_type}-form" }) do |f| %>
3
+ <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
4
+
5
+ <dl>
6
+ <dt><%= f.label :image %></dt>
7
+ <dd>
8
+ <figure id="<%= entity_type %>-image" role="group" class="preview">
9
+ <%= f.label(:image, image_tag(entity.image.profile.url)) %>
10
+ <figcaption>
11
+ <%=
12
+ f.file_field(
13
+ :image,
14
+ id: :user_image,
15
+ accept: 'image/jpeg,image/png',
16
+ data: { image: "#{entity_type}-image" }
17
+ )
18
+ %>
19
+ </figcaption>
20
+ </figure>
21
+ </dd>
22
+
23
+ <dt><%= f.label :screen_name %></dt>
24
+ <dd>
25
+ <%=
26
+ f.text_field(
27
+ :screen_name,
28
+ maxlength: User::SCREEN_NAME_LIMIT,
29
+ pattern: User::SCREEN_NAME_PATTERN_HTML,
30
+ title: t('.guidelines.screen_name'),
31
+ required: true
32
+ )
33
+ %>
34
+ <div class="guideline"><%= t('.guidelines.screen_name') %></div>
35
+ </dd>
36
+
37
+ <dt><%= f.label :email %></dt>
38
+ <dd>
39
+ <%=
40
+ f.email_field(
41
+ :email,
42
+ id: :user_email,
43
+ size: nil,
44
+ maxlength: User::EMAIL_LIMIT,
45
+ readonly: entity.super_user?
46
+ )
47
+ %>
48
+ </dd>
49
+
50
+ <dt><%= f.label :phone %></dt>
51
+ <dd>
52
+ <%=
53
+ f.phone_field(
54
+ :phone,
55
+ id: :user_phone,
56
+ size: 15,
57
+ maxlength: User::PHONE_LIMIT,
58
+ readonly: entity.super_user?
59
+ )
60
+ %>
61
+ </dd>
62
+
63
+ <dt><%= f.label :birthday %></dt>
64
+ <dd>
65
+ <%=
66
+ f.date_field(
67
+ :birthday,
68
+ id: :user_birthday,
69
+ size: 10
70
+ )
71
+ %>
72
+ </dd>
73
+
74
+ <% if entity.id.blank? || !entity.super_user? %>
75
+ <dt><%= f.label :password %></dt>
45
76
  <dd>
46
- <%= text_field_tag 'user_profile[name]', entity.user_profile&.name, size: 30, maxlength: UserProfile::NAME_LIMIT %>
77
+ <%=
78
+ f.text_field(
79
+ :password,
80
+ id: :user_password,
81
+ size: nil,
82
+ maxlength: 70,
83
+ required: entity.id.nil?
84
+ )
85
+ %>
47
86
  </dd>
48
87
 
49
- <dt><%= label_tag :user_profile_patronymic, t('activerecord.attributes.user_profile.patronymic') %></dt>
88
+ <dt><%= f.label :password_confirmation %></dt>
50
89
  <dd>
51
- <%= text_field_tag 'user_profile[patronymic]', entity.user_profile&.patronymic, size: 30, maxlength: UserProfile::NAME_LIMIT %>
90
+ <%=
91
+ f.text_field(
92
+ :password_confirmation,
93
+ id: :user_password_confirmation,
94
+ size: nil,
95
+ maxlength: 70,
96
+ required: entity.id.nil?
97
+ )
98
+ %>
52
99
  </dd>
53
-
54
- <dt><%= label_tag :user_profile_surname, t('activerecord.attributes.user_profile.surname') %></dt>
55
- <dd>
56
- <%= text_field_tag 'user_profile[surname]', entity.user_profile&.surname, size: 30, maxlength: UserProfile::NAME_LIMIT %>
57
- </dd>
58
-
59
- <dt><%= label_tag :user_profile_gender, t('activerecord.attributes.user_profile.gender') %></dt>
60
- <dd>
61
- <%= select_tag 'user_profile[gender]', options_for_select(genders_for_select, entity.user_profile&.gender) %>
62
- </dd>
63
-
64
- <dt><%= label_tag :user_profile_birthday, t('activerecord.attributes.user_profile.birthday') %></dt>
65
- <dd>
66
- <%= date_field_tag 'user_profile[birthday]', entity.user_profile&.birthday, size: 10 %>
67
- </dd>
68
-
69
- <dt><%= f.label :notice %></dt>
70
- <dd>
71
- <%= f.text_field :notice, size: nil, maxlength: User::NOTICE_LIMIT %>
72
- </dd>
73
-
74
- <dt><%= t(:flags) %></dt>
75
- <dd>
76
- <ul>
77
- <li><%= f.check_box :bot %><%= f.label :bot %></li>
78
- <li><%= f.check_box :allow_login %><%= f.label :allow_login %></li>
79
- <li><%= f.check_box :email_confirmed %><%= f.label :email_confirmed %></li>
80
- <li><%= f.check_box :phone_confirmed %><%= f.label :phone_confirmed %></li>
81
- <li><%= f.check_box :allow_mail %><%= f.label :allow_mail %></li>
82
- </ul>
83
- </dd>
84
- </dl>
85
-
86
- <div class="buttons">
87
- <%= f.button t(:save), type: :submit %>
88
- </div>
100
+ <% end %>
101
+
102
+ <%= render partial: 'users/form/profile_data', locals: { data: entity.profile_data } %>
103
+
104
+ <dt><%= f.label :notice %></dt>
105
+ <dd>
106
+ <%=
107
+ f.text_field(
108
+ :notice,
109
+ id: :user_notice,
110
+ size: nil,
111
+ maxlength: User::NOTICE_LIMIT
112
+ )
113
+ %>
114
+ <div class="guideline"><%= t('.guidelines.notice') %></div>
115
+ </dd>
116
+
117
+ <dt><%= t(:flags) %></dt>
118
+ <dd>
119
+ <ul>
120
+ <li>
121
+ <%= f.check_box :bot, id: :user_bot %>
122
+ <%= f.label :bot %>
123
+ </li>
124
+ <li>
125
+ <%= f.check_box :allow_login, id: :user_allow_login %>
126
+ <%= f.label :allow_login %>
127
+ </li>
128
+ <li>
129
+ <%= f.check_box :email_confirmed, id: :user_email_confirmed %>
130
+ <%= f.label :email_confirmed %>
131
+ </li>
132
+ <li>
133
+ <%= f.check_box :phone_confirmed, id: :user_phone_confirmed %>
134
+ <%= f.label :phone_confirmed %>
135
+ </li>
136
+ <li>
137
+ <%= f.check_box :allow_mail, id: :user_allow_mail %>
138
+ <%= f.label :allow_mail %>
139
+ </li>
140
+ </ul>
141
+ </dd>
142
+ </dl>
143
+
144
+ <div class="buttons">
145
+ <%= f.button t(:save), type: :submit, class: 'button-save' %>
146
+ </div>
89
147
  <% end %>
@@ -0,0 +1,4 @@
1
+ json.meta do
2
+ json.valid @entity.valid?
3
+ json.errors @entity.errors
4
+ end
@@ -8,7 +8,7 @@
8
8
  <article>
9
9
  <h1><%= t('.heading') %></h1>
10
10
  <ul class="actions">
11
- <li><%= back_icon(admin_user_path(@entity.id)) %></li>
11
+ <li><%= back_icon(admin_user_path(id: @entity.id)) %></li>
12
12
  <% unless @entity.deleted? %>
13
13
  <li class="danger"><%= destroy_icon @entity %></li>
14
14
  <% end %>
@@ -0,0 +1,53 @@
1
+ <dt>
2
+ <%= label_tag :user_profile_name, t('activerecord.attributes.user_profile.name') %>
3
+ </dt>
4
+ <dd>
5
+ <%=
6
+ text_field_tag(
7
+ 'user_profile[name]',
8
+ data['name'],
9
+ size: nil,
10
+ maxlength: 50
11
+ )
12
+ %>
13
+ </dd>
14
+
15
+ <dt>
16
+ <%= label_tag :user_profile_patronymic, t('activerecord.attributes.user_profile.patronymic') %>
17
+ </dt>
18
+ <dd>
19
+ <%=
20
+ text_field_tag(
21
+ 'user_profile[patronymic]',
22
+ data['patronymic'],
23
+ size: nil,
24
+ maxlength: 50
25
+ )
26
+ %>
27
+ </dd>
28
+
29
+ <dt>
30
+ <%= label_tag :user_profile_surname, t('activerecord.attributes.user_profile.surname') %>
31
+ </dt>
32
+ <dd>
33
+ <%=
34
+ text_field_tag(
35
+ 'user_profile[surname]',
36
+ data['surname'],
37
+ size: nil,
38
+ maxlength: 50
39
+ )
40
+ %>
41
+ </dd>
42
+
43
+ <dt>
44
+ <%= label_tag :user_profile_gender, t('activerecord.attributes.user_profile.gender') %>
45
+ </dt>
46
+ <dd>
47
+ <%=
48
+ select_tag(
49
+ 'user_profile[gender]',
50
+ options_for_select(genders_for_select, data['gender'])
51
+ )
52
+ %>
53
+ </dd>