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
@@ -0,0 +1,12 @@
1
+ <section class="summary">
2
+ <h1><%= t('my.index.index.heading') %></h1>
3
+
4
+ <figure>
5
+ <%= user_image_profile(current_user) %>
6
+ <figcaption><%= current_user.profile_name %></figcaption>
7
+ </figure>
8
+
9
+ <nav>
10
+
11
+ </nav>
12
+ </section>
@@ -0,0 +1,11 @@
1
+ <nav>
2
+ <ul>
3
+ <li><%= render 'my/profiles/nav_item' %></li>
4
+ <li><%= render 'my/tokens/nav_item' %></li>
5
+ <li><%= render 'my/login_attempts/nav_item' %></li>
6
+ <% if UserPrivilege.user_has_any_privilege?(current_user) %>
7
+ <li><%= link_to t('admin.index.index.heading'), admin_path %></li>
8
+ <% end %>
9
+ <li><%= link_to t(:logout), logout_path, method: :delete %></li>
10
+ </ul>
11
+ </nav>
@@ -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.login_attempts.nav_item.text') %></span>
5
5
  <% end %>
6
6
 
@@ -1,5 +1,5 @@
1
1
  <div>
2
- <%= link_to t('.text'), my_profile_path %>
2
+ <%= link_to t('.text'), user_profile_path(slug: current_user.screen_name) %>
3
3
  </div>
4
4
  <div class="description">
5
5
  <%= t('.description') %>
@@ -0,0 +1 @@
1
+ <%= render partial: 'shared/forms/list_of_errors', locals: { entity: current_user, form_id: 'my-profile-form' } %>
@@ -1,117 +1,131 @@
1
- <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
2
-
3
- <%= form_tag my_profile_path, method: :patch, multipart: true do %>
4
- <section>
5
- <h2><%= t('.common_parameters') %></h2>
6
-
7
- <dl>
8
- <dt>
9
- <%= t('activerecord.attributes.user.image') %>
10
- </dt>
11
- <dd>
12
- <figure id="user-image">
13
- <%= label_tag(:user_image, image_tag(entity.image.profile.url, alt: t(:current_image))) %>
14
- <figcaption><%= file_field_tag 'user[image]', accept: 'image/jpeg,image/png', data: { image: 'user-image' } %></figcaption>
15
- </figure>
16
- </dd>
17
-
18
- <dt>
19
- <%= label_tag :user_profile_name, t('activerecord.attributes.user_profile.name') %>
20
- </dt>
21
- <dd>
22
- <%= text_field_tag 'user_profile[name]', entity.user_profile.name, size: nil, maxlength: UserProfile::NAME_LIMIT %>
23
- </dd>
24
-
25
- <dt>
26
- <%= label_tag :user_profile_patronymic, t('activerecord.attributes.user_profile.patronymic') %>
27
- </dt>
28
- <dd>
29
- <%= text_field_tag 'user_profile[patronymic]', entity.user_profile.patronymic, size: nil, maxlength: UserProfile::NAME_LIMIT %>
30
- </dd>
31
-
32
- <dt>
33
- <%= label_tag :user_profile_surname, t('activerecord.attributes.user_profile.surname') %>
34
- </dt>
35
- <dd>
36
- <%= text_field_tag 'user_profile[surname]', entity.user_profile.surname, size: nil, maxlength: UserProfile::NAME_LIMIT %>
37
- </dd>
38
-
39
- <dt>
40
- <%= label_tag :user_profile_gender, t('activerecord.attributes.user_profile.gender') %>
41
- </dt>
42
- <dd>
43
- <%= select_tag 'user_profile[gender]', options_for_select(genders_for_select, selected: entity.user_profile.gender) %>
44
- </dd>
45
-
46
- <dt>
47
- <%= label_tag :user_profile_birthday, t('activerecord.attributes.user_profile.birthday') %>
48
- </dt>
49
- <dd>
50
- <%= date_field_tag 'user_profile[birthday]', entity.user_profile.birthday, size: 10 %>
51
- </dd>
52
-
53
- <dt>
54
- <%= t('.flags') %>
55
- </dt>
56
- <dd>
57
- <ul>
58
- <li>
59
- <%= hidden_field_tag 'user[allow_mail]', '0', id: 'user_allow_mail_0' %>
60
- <%= check_box_tag 'user[allow_mail]', '1', entity.allow_mail %>
61
- <%= label_tag :user_allow_mail, t('activerecord.attributes.user.allow_mail') %>
62
- </li>
63
- </ul>
64
- </dd>
65
- </dl>
66
- </section>
67
-
68
- <section>
69
- <h2><%= t('.sensitive_parameters') %></h2>
70
-
71
- <div class="guideline"><%= t('.sensitive_parameters_notice') %></div>
72
-
73
- <dl>
74
- <dt>
75
- <%= label_tag :password, t('.current_password') %>
76
- </dt>
77
- <dd>
78
- <%= password_field_tag 'password', '' %>
79
- </dd>
80
-
81
- <dt>
82
- <%= label_tag :user_email, t('activerecord.attributes.user.email') %>
83
- </dt>
84
- <dd>
85
- <%= email_field_tag 'user[email]', entity.email, size: nil, maxlength: User::EMAIL_LIMIT %>
86
- </dd>
87
-
88
- <dt>
89
- <%= label_tag :user_phone, t('activerecord.attributes.user.phone') %>
90
- </dt>
91
- <dd>
92
- <%= telephone_field_tag 'user[phone]', entity.phone, size: nil, maxlength: User::PHONE_LIMIT %>
93
- </dd>
94
- </dl>
95
-
96
- <div class="guideline"><%= t('.leave_blank_if_necessary') %></div>
97
- <dl>
98
- <dt>
99
- <%= label_tag :profile_password, t('.new_password') %>
100
- </dt>
101
- <dd>
102
- <%= password_field_tag 'user[password]', '', size: nil, maxlength: 70 %>
103
- </dd>
104
-
105
- <dt>
106
- <%= label_tag :profile_password_confirmation, t('activerecord.attributes.user.password_confirmation') %>
107
- </dt>
108
- <dd>
109
- <%= password_field_tag 'user[password_confirmation]', '', size: nil, maxlength: 70 %>
110
- </dd>
111
- </dl>
112
- </section>
113
-
114
- <div>
115
- <%= button_tag t('.update'), type: :submit %>
116
- </div>
1
+ <%=
2
+ form_with(
3
+ url: my_profile_path,
4
+ method: :patch,
5
+ multipart: true,
6
+ id: 'my-profile-form'
7
+ ) do
8
+ %>
9
+ <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
10
+ <section>
11
+ <h2><%= t('.common_parameters') %></h2>
12
+
13
+ <dl>
14
+ <dt>
15
+ <%= t('activerecord.attributes.user.image') %>
16
+ </dt>
17
+ <dd>
18
+ <figure id="user-image" role="group" class="preview">
19
+ <%=
20
+ label_tag(
21
+ :user_image,
22
+ image_tag(entity.image.profile.url, alt: t(:current_image))
23
+ )
24
+ %>
25
+ <figcaption>
26
+ <%=
27
+ file_field_tag(
28
+ 'user[image]',
29
+ accept: 'image/jpeg,image/png',
30
+ data: { image: 'user-image' }
31
+ )
32
+ %>
33
+ </figcaption>
34
+ </figure>
35
+ </dd>
36
+
37
+ <dt>
38
+ <%= label_tag :user_profile_birthday, t('activerecord.attributes.user.birthday') %>
39
+ </dt>
40
+ <dd>
41
+ <%=
42
+ date_field_tag(
43
+ 'user[birthday]',
44
+ entity.birthday,
45
+ size: 10
46
+ )
47
+ %>
48
+ </dd>
49
+
50
+ <%= render partial: 'my/profiles/edit/form/profile_data', locals: { data: entity.profile_data } %>
51
+
52
+ <dt>
53
+ <%= t('.flags') %>
54
+ </dt>
55
+ <dd>
56
+ <ul>
57
+ <li>
58
+ <%= hidden_field_tag 'user[allow_mail]', '0', id: 'user_allow_mail_0' %>
59
+ <%= check_box_tag 'user[allow_mail]', '1', entity.allow_mail %>
60
+ <%= label_tag :user_allow_mail, t('activerecord.attributes.user.allow_mail') %>
61
+ </li>
62
+ </ul>
63
+ </dd>
64
+ </dl>
65
+ </section>
66
+
67
+ <section>
68
+ <h2><%= t('.sensitive_parameters') %></h2>
69
+
70
+ <div class="guideline"><%= t('.sensitive_parameters_notice') %></div>
71
+
72
+ <dl>
73
+ <dt>
74
+ <%= label_tag :password, t('.current_password') %>
75
+ </dt>
76
+ <dd>
77
+ <%= password_field_tag 'password', '' %>
78
+ </dd>
79
+
80
+ <dt>
81
+ <%= label_tag :user_email, t('activerecord.attributes.user.email') %>
82
+ </dt>
83
+ <dd>
84
+ <%=
85
+ email_field_tag(
86
+ 'user[email]',
87
+ entity.email,
88
+ size: nil,
89
+ maxlength: User::EMAIL_LIMIT,
90
+ required: true
91
+ )
92
+ %>
93
+ </dd>
94
+
95
+ <dt>
96
+ <%= label_tag :user_phone, t('activerecord.attributes.user.phone') %>
97
+ </dt>
98
+ <dd>
99
+ <%=
100
+ telephone_field_tag(
101
+ 'user[phone]',
102
+ entity.phone,
103
+ size: nil,
104
+ maxlength: User::PHONE_LIMIT
105
+ )
106
+ %>
107
+ </dd>
108
+ </dl>
109
+
110
+ <div class="guideline"><%= t('.leave_blank_if_necessary') %></div>
111
+ <dl>
112
+ <dt>
113
+ <%= label_tag :profile_password, t('.new_password') %>
114
+ </dt>
115
+ <dd>
116
+ <%= password_field_tag 'user[password]', '', size: nil, maxlength: 70 %>
117
+ </dd>
118
+
119
+ <dt>
120
+ <%= label_tag :profile_password_confirmation, t('activerecord.attributes.user.password_confirmation') %>
121
+ </dt>
122
+ <dd>
123
+ <%= password_field_tag 'user[password_confirmation]', '', size: nil, maxlength: 70 %>
124
+ </dd>
125
+ </dl>
126
+ </section>
127
+
128
+ <div>
129
+ <%= button_tag t('.update'), type: :submit, class: 'button-save' %>
130
+ </div>
117
131
  <% 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, selected: data['gender'])
51
+ )
52
+ %>
53
+ </dd>
@@ -0,0 +1 @@
1
+ <%= render partial: 'shared/forms/list_of_errors', locals: { entity: @user, form_id: 'new-profile-form' } %>
@@ -1,60 +1,107 @@
1
- <section>
1
+ <%=
2
+ form_with(
3
+ model: entity,
4
+ scope: 'user',
5
+ url: my_profile_path,
6
+ class: 'new-my-profile',
7
+ id: 'new-profile-form',
8
+ data: { check_url: check_users_path }
9
+ ) do |f|
10
+ %>
2
11
  <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
12
+ <dl>
13
+ <dt>
14
+ <%= f.label :screen_name, t('activerecord.attributes.user.screen_name') %>
15
+ </dt>
16
+ <dd>
17
+ <%=
18
+ f.text_field(
19
+ :screen_name,
20
+ id: :user_screen_name,
21
+ required: true,
22
+ maxlength: User::SCREEN_NAME_LIMIT,
23
+ pattern: User::SCREEN_NAME_PATTERN_HTML,
24
+ title: t('.guidelines.screen_name'),
25
+ data: { check: :screen_name }
26
+ )
27
+ %>
28
+ <div class="check-result-error hidden" data-field="screen_name"></div>
29
+ <div class="guideline"><%= t('.guidelines.screen_name') %></div>
30
+ </dd>
3
31
 
4
- <%= form_tag my_profile_path, class: 'new-my-profile' do %>
5
- <dl>
6
- <dt>
7
- <%= label_tag :user_screen_name, t('activerecord.attributes.user.screen_name') %>
8
- </dt>
9
- <dd>
10
- <%= text_field_tag 'user[screen_name]', entity.screen_name, required: true, size: 30, maxlength: 30 %>
11
- <div class="guideline"><%= t('.guidelines.screen_name') %></div>
12
- </dd>
32
+ <dt>
33
+ <%= f.label :password, t('activerecord.attributes.user.password') %>
34
+ </dt>
35
+ <dd>
36
+ <%=
37
+ f.password_field(
38
+ :password,
39
+ id: :user_password,
40
+ required: true,
41
+ size: nil,
42
+ maxlength: 70,
43
+ data: { check: :password }
44
+ )
45
+ %>
46
+ <div class="check-result-error hidden" data-field="password"></div>
47
+ <div class="guideline"><%= t('.guidelines.password') %></div>
48
+ </dd>
13
49
 
14
- <dt>
15
- <%= label_tag :user_password, t('activerecord.attributes.user.password') %>
16
- </dt>
17
- <dd>
18
- <%= password_field_tag 'user[password]', '', required: true, size: nil, maxlength: 70 %>
19
- <div class="guideline"><%= t('.guidelines.password') %></div>
20
- </dd>
50
+ <dt>
51
+ <%= f.label :password_confirmation, t('activerecord.attributes.user.password_confirmation') %>
52
+ </dt>
53
+ <dd>
54
+ <%=
55
+ f.password_field(
56
+ :password_confirmation,
57
+ id: :user_password_confirmation,
58
+ required: true,
59
+ size: nil,
60
+ maxlength: 70,
61
+ data: { check: :password_confirmation }
62
+ )
63
+ %>
64
+ <div class="check-result-error hidden" data-field="password_confirmation"></div>
65
+ <div class="guideline"><%= t('.guidelines.password_confirmation') %></div>
66
+ </dd>
21
67
 
22
- <dt>
23
- <%= label_tag :user_password_confirmation, t('activerecord.attributes.user.password_confirmation') %>
24
- </dt>
25
- <dd>
26
- <%= password_field_tag 'user[password_confirmation]', '', required: true, size: nil, maxlength: 70 %>
27
- <div class="guideline"><%= t('.guidelines.password_confirmation') %></div>
28
- </dd>
68
+ <dt>
69
+ <%= f.label :email, t('activerecord.attributes.user.email') %>
70
+ </dt>
71
+ <dd>
72
+ <%=
73
+ f.email_field(
74
+ :email,
75
+ id: :user_email,
76
+ size: nil,
77
+ maxlength: User::EMAIL_LIMIT,
78
+ required: true,
79
+ data: { check: :email }
80
+ )
81
+ %>
82
+ <div class="check-result-error hidden" data-field="email"></div>
83
+ <div class="guideline"><%= t('.guidelines.email') %></div>
84
+ </dd>
85
+ </dl>
29
86
 
30
- <dt>
31
- <%= label_tag :user_email, t('activerecord.attributes.user.email') %>
32
- </dt>
33
- <dd>
34
- <%= email_field_tag 'user[email]', entity.email, size: nil, maxlength: User::EMAIL_LIMIT, required: true %>
35
- <div class="guideline"><%= t('.guidelines.email') %></div>
36
- </dd>
37
- </dl>
87
+ <ul class="flags">
88
+ <li>
89
+ <%= check_box_tag 'user[consent]', '1', false, required: true %>
90
+ <%= label_tag :user_consent, t('.consent') %>
91
+ </li>
92
+ <li>
93
+ <%= f.check_box :allow_mail, id: :user_allow_mail %>
94
+ <%= f.label :allow_mail, t('activerecord.attributes.user.allow_mail') %>
95
+ </li>
96
+ </ul>
38
97
 
39
- <ul class="flags">
40
- <li>
41
- <%= check_box_tag 'user[consent]', '1', false, required: true %>
42
- <%= label_tag :user_consent, t('.consent') %>
43
- </li>
44
- <li>
45
- <%= check_box_tag 'user[allow_mail]', '1', entity.allow_mail %>
46
- <%= label_tag :user_allow_mail, t('activerecord.attributes.user.allow_mail') %>
47
- </li>
48
- </ul>
98
+ <div class="trap">
99
+ <%= check_box_tag :agree, '1', false, tabindex: '-1' %>
100
+ <%= label_tag :agree, t('.i_am_bot') %>
101
+ </div>
49
102
 
50
- <div class="trap">
51
- <%= check_box_tag :agree, '1', false, tabindex: '-1' %>
52
- <%= label_tag :agree, t('.i_am_bot') %>
53
- </div>
54
-
55
- <div class="actions">
56
- <%= button_tag t('.join'), type: :submit, name: 'button' %>
57
- <%= link_to t('authentication.nav_item.log_in'), login_path, class: 'button-nav' %>
58
- </div>
59
- <% end %>
60
- </section>
103
+ <div class="actions">
104
+ <%= button_tag t('.join'), type: :submit, class: 'button-action' %>
105
+ <%= link_to t('authentication.nav_item.log_in'), login_path, class: 'button-nav' %>
106
+ </div>
107
+ <% end %>