biovision-base 0.7.170709 → 0.8.170916

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -13
  3. data/app/assets/javascripts/biovision/base/biovision.js +128 -45
  4. data/app/assets/stylesheets/biovision/base/admin.scss +64 -104
  5. data/app/assets/stylesheets/biovision/base/biovision.scss +2 -11
  6. data/app/assets/stylesheets/biovision/base/buttons.scss +156 -52
  7. data/app/assets/stylesheets/biovision/base/default.scss +2 -37
  8. data/app/assets/stylesheets/biovision/base/default_admin.scss +1 -0
  9. data/app/assets/stylesheets/biovision/base/default_application.scss +1 -0
  10. data/app/assets/stylesheets/biovision/base/layout.scss +64 -2
  11. data/app/assets/stylesheets/biovision/base/toggleable.scss +71 -0
  12. data/app/assets/stylesheets/biovision/base/users.scss +77 -13
  13. data/app/controllers/about_controller.rb +15 -0
  14. data/app/controllers/admin/stored_values_controller.rb +25 -0
  15. data/app/controllers/concerns/toggleable_entity.rb +17 -1
  16. data/app/controllers/index_controller.rb +1 -0
  17. data/app/controllers/my/profiles_controller.rb +6 -1
  18. data/app/controllers/stored_values_controller.rb +56 -0
  19. data/app/controllers/users_controller.rb +6 -0
  20. data/app/helpers/biovision_users_helper.rb +3 -3
  21. data/app/helpers/stored_values_helper.rb +6 -0
  22. data/app/models/central_region.rb +4 -0
  23. data/app/models/region.rb +5 -0
  24. data/app/models/stored_value.rb +28 -0
  25. data/app/models/user.rb +33 -13
  26. data/app/models/user_profile.rb +21 -0
  27. data/app/services/user_manager.rb +32 -0
  28. data/app/views/about/editable.html.erb +11 -0
  29. data/app/views/admin/index/index.html.erb +1 -0
  30. data/app/views/admin/login_attempts/entity/_in_list.html.erb +1 -1
  31. data/app/views/admin/stored_values/_nav_item.html.erb +6 -0
  32. data/app/views/admin/stored_values/entity/_in_list.html.erb +15 -0
  33. data/app/views/admin/stored_values/index.html.erb +14 -0
  34. data/app/views/admin/stored_values/show.html.erb +37 -0
  35. data/app/views/admin/users/_filter.html.erb +2 -0
  36. data/app/views/admin/users/codes.html.erb +1 -1
  37. data/app/views/admin/users/search.jbuilder +4 -2
  38. data/app/views/admin/users/show.html.erb +11 -11
  39. data/app/views/authentication/_form.html.erb +2 -2
  40. data/app/views/authentication/new.html.erb +1 -1
  41. data/app/views/editable_pages/_editable_page.html.erb +8 -0
  42. data/app/views/index/index.html.erb +7 -3
  43. data/app/views/layouts/application/_footer.html.erb +9 -0
  44. data/app/views/my/confirmations/show.html.erb +21 -15
  45. data/app/views/my/login_attempts/index.html.erb +1 -1
  46. data/app/views/my/profiles/edit/_form.html.erb +112 -65
  47. data/app/views/my/profiles/edit.html.erb +5 -4
  48. data/app/views/my/profiles/new/_form.html.erb +5 -5
  49. data/app/views/my/recoveries/show.html.erb +28 -17
  50. data/app/views/my/tokens/index.html.erb +1 -1
  51. data/app/views/profiles/_profile.html.erb +34 -40
  52. data/app/views/shared/admin/_list_with_priority.html.erb +11 -0
  53. data/app/views/stored_values/_form.html.erb +33 -0
  54. data/app/views/stored_values/edit.html.erb +17 -0
  55. data/app/views/stored_values/new.html.erb +15 -0
  56. data/app/views/users/_form.html.erb +42 -31
  57. data/app/views/users/new.html.erb +1 -1
  58. data/config/locales/common-ru.yml +10 -0
  59. data/config/locales/editable-pages-ru.yml +34 -2
  60. data/config/locales/users-ru.yml +19 -12
  61. data/config/routes.rb +7 -0
  62. data/db/migrate/20170302000001_create_users.rb +1 -5
  63. data/db/migrate/20170302000002_create_user_profiles.rb +21 -0
  64. data/db/migrate/{20170302000002_create_tokens.rb → 20170302000003_create_tokens.rb} +0 -0
  65. data/db/migrate/{20170302000003_create_code_types.rb → 20170302000004_create_code_types.rb} +0 -0
  66. data/db/migrate/{20170302000004_create_codes.rb → 20170302000005_create_codes.rb} +0 -0
  67. data/db/migrate/20170320000000_create_editable_pages.rb +4 -0
  68. data/db/migrate/20170823000001_create_stored_values.rb +19 -0
  69. data/lib/biovision/base/engine.rb +1 -0
  70. data/lib/biovision/base/version.rb +1 -1
  71. data/lib/tasks/regions.rake +37 -2
  72. metadata +32 -12
@@ -1,70 +1,117 @@
1
1
  <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
2
2
 
3
3
  <%= form_tag my_profile_path, method: :patch, multipart: true do %>
4
- <table>
5
- <caption><%= t('my.profiles.edit.title') %></caption>
6
- <tbody>
7
- <tr>
8
- <th colspan="2"><%= t('.common_parameters') %></th>
9
- </tr>
10
- <tr>
11
- <td colspan="2">
12
- <figure class="preview" id="user-image">
13
- <%= image_tag entity.image.profile.url, alt: t(:current_image) %>
14
- <figcaption>
15
- <%= label_tag :user_image, t('.update_image') %>
16
- <%= file_field_tag 'user[image]', accept: 'image/jpeg,image/png', data: { image: 'user-image' } %>
17
- </figcaption>
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>
18
15
  </figure>
19
- </td>
20
- </tr>
21
- <tr>
22
- <th><%= label_tag :user_name, t('activerecord.attributes.user.name') %></th>
23
- <td><%= text_field_tag 'user[name]', entity.name, size: 30, maxlength: User::NAME_LIMIT %></td>
24
- </tr>
25
- <tr>
26
- <th><%= label_tag :user_gender, t('activerecord.attributes.user.gender') %></th>
27
- <td>
28
- <%= select_tag 'user[gender]', options_for_select(genders_for_select, selected: entity.gender) %>
29
- </td>
30
- </tr>
31
- <tr>
32
- <td colspan="2">
33
- <%= hidden_field_tag 'user[allow_mail]', '0' %>
34
- <%= check_box_tag 'user[allow_mail]', '1', entity.allow_mail %>
35
- <%= label_tag :user_allow_mail, t('activerecord.attributes.user.allow_mail') %>
36
- </td>
37
- </tr>
38
- <tr>
39
- <th colspan="2"><%= t('.sensitive_parameters') %></th>
40
- </tr>
41
- <tr>
42
- <td colspan="2"><p class="notice"><%= t('.sensitive_parameters_notice') %></p></td>
43
- </tr>
44
- <tr>
45
- <th><%= label_tag :password, t('.current_password') %></th>
46
- <td><%= password_field_tag 'password', '', size: 30 %></td>
47
- </tr>
48
- <tr>
49
- <th><%= label_tag :user_email, t('activerecord.attributes.user.email') %></th>
50
- <td><%= email_field_tag 'user[email]', entity.email, size: 30, maxlength: User::EMAIL_LIMIT %></td>
51
- </tr>
52
- <tr>
53
- <td colspan="2"><p class="notice"><%= t('.leave_blank_if_necessary') %></p></td>
54
- </tr>
55
- <tr>
56
- <th><%= label_tag :profile_password, t('.new_password') %></th>
57
- <td><%= password_field_tag 'user[password]', '', size: 30, maxlength: 70 %></td>
58
- </tr>
59
- <tr>
60
- <th><%= label_tag :profile_password_confirmation, t('activerecord.attributes.user.password_confirmation') %></th>
61
- <td><%= password_field_tag 'user[password_confirmation]', '', size: 30, maxlength: 70 %></td>
62
- </tr>
63
- </tbody>
64
- <tfoot>
65
- <tr>
66
- <td colspan="2"><%= button_tag t('.update'), type: :submit %></td>
67
- </tr>
68
- </tfoot>
69
- </table>
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>
70
117
  <% end %>
@@ -1,10 +1,11 @@
1
1
  <% content_for :meta_title, t('.title') %>
2
2
 
3
- <article class="profile">
3
+ <article class="user">
4
4
  <h1><%= current_user.profile_name %></h1>
5
- <div>
6
- <p><%= link_to t(:view), my_profile_path %></p>
7
- </div>
5
+
6
+ <ul class="actions">
7
+ <li><%= world_icon(my_profile_path, t(:view)) %></li>
8
+ </ul>
8
9
 
9
10
  <%= render partial: 'my/profiles/edit/form', locals: { entity: current_user } %>
10
11
  </article>
@@ -1,7 +1,7 @@
1
1
  <section>
2
2
  <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
3
3
 
4
- <%= form_tag my_profile_path do %>
4
+ <%= form_tag my_profile_path, class: 'new-my-profile' do %>
5
5
  <dl>
6
6
  <dt>
7
7
  <%= label_tag :user_screen_name, t('activerecord.attributes.user.screen_name') %>
@@ -48,13 +48,13 @@
48
48
  </ul>
49
49
 
50
50
  <div class="trap">
51
- <%= check_box_tag :agree %>
51
+ <%= check_box_tag :agree, '1', false, tabindex: '-1' %>
52
52
  <%= label_tag :agree, t('.i_am_bot') %>
53
53
  </div>
54
54
 
55
- <div>
56
- <%= button_tag t('my.profiles.new.title'), type: :submit, name: 'button' %>
57
- <%= link_to t('authentication.nav_item.log_in'), login_path, class: 'nav-button' %>
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
58
  </div>
59
59
  <% end %>
60
60
  </section>
@@ -1,23 +1,34 @@
1
1
  <% content_for :meta_title, t('.title') %>
2
2
 
3
- <article class="recovery">
3
+ <article class="my-recovery">
4
4
  <h1><%= t('.title') %></h1>
5
5
 
6
6
  <section>
7
7
  <h2><%= t('.got_code') %></h2>
8
8
  <%= form_tag my_recovery_path, method: :patch do %>
9
- <div>
10
- <%= label_tag :code, t('activerecord.attributes.code.body') %>
11
- <%= text_field_tag :code, param_from_request(:code), required: true, size: 25 %>
12
- </div>
13
- <div>
14
- <%= label_tag :user_password, t('activerecord.attributes.user.password') %>
15
- <%= password_field_tag 'user[password]', '', required: true, size: 25 %>
16
- </div>
17
- <div>
18
- <%= label_tag :user_password_confirmation, t('activerecord.attributes.user.password_confirmation') %>
19
- <%= password_field_tag 'user[password_confirmation]', '', required: true, size: 25 %>
20
- </div>
9
+ <dl>
10
+ <dt>
11
+ <%= label_tag :code, t('activerecord.attributes.code.body') %>
12
+ </dt>
13
+ <dd>
14
+ <%= text_field_tag :code, param_from_request(:code), required: true, size: 25 %>
15
+ </dd>
16
+
17
+ <dt>
18
+ <%= label_tag :user_password, t('activerecord.attributes.user.password') %>
19
+ </dt>
20
+ <dd>
21
+ <%= password_field_tag 'user[password]', '', required: true, size: 25 %>
22
+ </dd>
23
+
24
+ <dt>
25
+ <%= label_tag :user_password_confirmation, t('activerecord.attributes.user.password_confirmation') %>
26
+ </dt>
27
+ <dd>
28
+ <%= password_field_tag 'user[password_confirmation]', '', required: true, size: 25 %>
29
+ </dd>
30
+ </dl>
31
+
21
32
  <div>
22
33
  <%= button_tag t('.update_password'), type: :submit %>
23
34
  </div>
@@ -27,10 +38,10 @@
27
38
  <section>
28
39
  <h2><%= t('.no_code') %></h2>
29
40
  <%= form_tag my_recovery_path, method: :post do %>
30
- <div>
31
- <%= label_tag :email, t('activerecord.attributes.user.email') %>
32
- <%= text_field_tag :email, param_from_request(:email), required: true, size: 40 %>
33
- </div>
41
+ <dl>
42
+ <dt><%= label_tag :email, t('activerecord.attributes.user.email') %></dt>
43
+ <dd><%= email_field_tag :email, param_from_request(:email), required: true %></dd>
44
+ </dl>
34
45
  <div>
35
46
  <%= button_tag t('.send_code'), type: :submit %>
36
47
  </div>
@@ -4,7 +4,7 @@
4
4
  <span><%= t('my.tokens.nav_item.text') %></span>
5
5
  <% end %>
6
6
 
7
- <article class="entity-page">
7
+ <article>
8
8
  <h1><%= t('.heading') %></h1>
9
9
 
10
10
  <%= paginate @collection %>
@@ -1,48 +1,42 @@
1
1
  <article class="user">
2
- <h1><%= user.profile_name %></h1>
3
- <table>
4
- <caption><%= t('.user_info') %></caption>
5
- <tbody>
6
- <tr>
7
- <td colspan="2">
8
- <figure><%= profile_avatar(user) %></figure>
9
- </td>
10
- </tr>
11
- <tr>
12
- <th><%= t('.registration_date') %></th>
13
- <td><%= time_tag user.created_at %></td>
14
- </tr>
2
+ <h1><%= user.screen_name %></h1>
3
+
4
+ <% if current_user_has_privilege?(:administrator) %>
5
+ <ul class="actions">
6
+ <li><%= gear_icon(admin_user_path(user)) %></li>
7
+ </ul>
8
+ <% end %>
9
+
10
+ <% if current_user == user %>
11
+ <nav>
12
+ <%= link_to t(:edit), edit_my_profile_path %>
13
+ </nav>
14
+ <% end %>
15
+
16
+ <figure>
17
+ <%= profile_avatar(user) %>
18
+ <figcaption><%= user.profile_name %></figcaption>
19
+ </figure>
20
+
21
+ <dl>
22
+ <dt><%= t('.registration_date') %></dt>
23
+ <dd><%= time_tag user.created_at %></dd>
15
24
  <% unless user.last_seen.blank? %>
16
- <tr>
17
- <th><%= t('activerecord.attributes.user.last_seen') %></th>
18
- <td><%= time_tag user.last_seen %></td>
19
- </tr>
25
+ <dt><%= t('activerecord.attributes.user.last_seen') %></dt>
26
+ <dd><%= time_tag user.last_seen %></dd>
20
27
  <% end %>
21
- <% unless user.name.blank? %>
22
- <tr>
23
- <th><%= t('activerecord.attributes.user.name') %></th>
24
- <td><%= user.name %></td>
25
- </tr>
28
+ <% unless user.profile&.name.blank? %>
29
+ <dt><%= t('activerecord.attributes.user_profile.name') %></dt>
30
+ <dd><%= user.full_name %></dd>
26
31
  <% end %>
27
32
  <% if current_user == user && !user.email.blank? %>
28
- <tr>
29
- <th><%= t('activerecord.attributes.user.email') %></th>
30
- <td><%= user.email %></td>
31
- </tr>
33
+ <dt><%= t('activerecord.attributes.user.email') %></dt>
34
+ <dd><%= user.email %></dd>
32
35
  <% end %>
33
- <% unless user.gender.blank? %>
34
- <tr>
35
- <th><%= t('activerecord.attributes.user.gender') %></th>
36
- <td><%= t("activerecord.attributes.user.genders.#{user.gender}") %></td>
37
- </tr>
36
+ <% unless user.profile&.gender.blank? %>
37
+ <dt><%= t('activerecord.attributes.user_profile.gender') %></dt>
38
+ <dd><%= t("activerecord.attributes.user_profile.genders.#{user.user_profile.gender}") %></dd>
38
39
  <% end %>
39
- </tbody>
40
- <% if current_user == user %>
41
- <tfoot>
42
- <tr>
43
- <td colspan="2"><%= link_to t(:edit), edit_my_profile_path %></td>
44
- </tr>
45
- </tfoot>
46
- <% end %>
47
- </table>
40
+ </dl>
41
+
48
42
  </article>
@@ -0,0 +1,11 @@
1
+ <% if collection.any? %>
2
+ <ol class="list-of-entities">
3
+ <% collection.each do |entity| %>
4
+ <li data-id="<%= entity.id %>" data-number="<%= entity.priority %>">
5
+ <%= render partial: "admin/#{entity.class.table_name}/entity/in_list", locals: { entity: entity } %>
6
+ </li>
7
+ <% end %>
8
+ </ol>
9
+ <% else %>
10
+ <%= render 'shared/nothing_found' %>
11
+ <% end %>
@@ -0,0 +1,33 @@
1
+ <%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
2
+
3
+ <%= form_for entity do |f| %>
4
+ <dl>
5
+ <dt><%= f.label :slug %></dt>
6
+ <dd>
7
+ <%= f.text_field :slug, required: true, size: nil, maxlength: StoredValue::SLUG_LIMIT %>
8
+ <div class="guideline"><%= t('.guidelines.slug') %></div>
9
+ </dd>
10
+
11
+ <dt><%= f.label :value %></dt>
12
+ <dd>
13
+ <%= f.text_field :value, size: nil, maxlength: StoredValue::VALUE_LIMIT %>
14
+ <div class="guideline"><%= t('.guidelines.value') %></div>
15
+ </dd>
16
+
17
+ <dt><%= f.label :name %></dt>
18
+ <dd>
19
+ <%= f.text_field :name, size: nil, maxlength: StoredValue::NAME_LIMIT %>
20
+ <div class="guideline"><%= t('.guidelines.name') %></div>
21
+ </dd>
22
+
23
+ <dt><%= f.label :description %></dt>
24
+ <dd>
25
+ <%= f.text_field :description, size: nil, maxlength: StoredValue::DESCRIPTION_LIMIT %>
26
+ <div class="guideline"><%= t('.guidelines.description') %></div>
27
+ </dd>
28
+ </dl>
29
+
30
+ <div class="buttons">
31
+ <%= f.button t(:save), type: :submit %>
32
+ </div>
33
+ <% end %>
@@ -0,0 +1,17 @@
1
+ <% content_for :meta_title, t('.title') %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.stored_values.nav_item.text'), admin_stored_values_path) %>
4
+ <%= admin_stored_value_link(@entity) %>
5
+ <span><%= t(:edit) %></span>
6
+ <% end %>
7
+
8
+ <article class="entity-page">
9
+ <h1><%= t('.heading') %></h1>
10
+
11
+ <ul class="actions">
12
+ <li><%= return_icon(admin_stored_value_path(@entity.id)) %></li>
13
+ <li class="danger"><%= destroy_icon(@entity) %></li>
14
+ </ul>
15
+
16
+ <%= render partial: 'form', locals: { entity: @entity } %>
17
+ </article>
@@ -0,0 +1,15 @@
1
+ <% content_for :meta_title, t('.title') %>
2
+ <% content_for :breadcrumbs do %>
3
+ <%= link_to(t('admin.stored_values.nav_item.text'), admin_stored_values_path) %>
4
+ <span><%= t(:create) %></span>
5
+ <% end %>
6
+
7
+ <article class="entity-page">
8
+ <h1><%= t('.title') %></h1>
9
+
10
+ <ul class="actions">
11
+ <li><%= back_icon(admin_stored_values_path) %></li>
12
+ </ul>
13
+
14
+ <%= render partial: 'form', locals: { entity: @entity } %>
15
+ </article>
@@ -2,33 +2,21 @@
2
2
 
3
3
  <%= form_for entity do |f| %>
4
4
 
5
- <figure class="preview" id="user-image">
6
- <%= label_tag(:user_image, image_tag(entity.image.profile.url, alt: t(:current_image))) %>
7
- <figcaption>
8
- <%= f.label :image %>
9
- <%= f.file_field :image, accept: 'image/jpeg,image/png', data: { image: 'user-image' } %>
10
- </figcaption>
11
- </figure>
12
5
 
13
6
  <dl>
14
- <dt><%= f.label :screen_name %></dt>
7
+ <dt><%= f.label :image %></dt>
15
8
  <dd>
16
- <%= f.text_field :screen_name, size: 30, maxlength: User::SLUG_LIMIT %>
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>
17
15
  </dd>
18
16
 
19
- <dt><%= f.label :name %></dt>
20
- <dd>
21
- <%= f.text_field :name, size: 30, maxlength: User::NAME_LIMIT %>
22
- </dd>
23
-
24
- <dt><%= f.label :patronymic %></dt>
25
- <dd>
26
- <%= f.text_field :patronymic, size: 30, maxlength: User::NAME_LIMIT %>
27
- </dd>
28
-
29
- <dt><%= f.label :surname %></dt>
17
+ <dt><%= f.label :screen_name %></dt>
30
18
  <dd>
31
- <%= f.text_field :surname, size: 30, maxlength: User::NAME_LIMIT %>
19
+ <%= f.text_field :screen_name, size: 30, maxlength: User::SLUG_LIMIT %>
32
20
  </dd>
33
21
 
34
22
  <dt><%= f.label :email %></dt>
@@ -53,24 +41,47 @@
53
41
  </dd>
54
42
  <% end %>
55
43
 
56
- <dt><%= f.label :gender %></dt>
44
+ <dt><%= label_tag :user_profile_name, t('activerecord.attributes.user_profile.name') %></dt>
45
+ <dd>
46
+ <%= text_field_tag 'user_profile[name]', entity.user_profile&.name, size: 30, maxlength: UserProfile::NAME_LIMIT %>
47
+ </dd>
48
+
49
+ <dt><%= label_tag :user_profile_patronymic, t('activerecord.attributes.user_profile.patronymic') %></dt>
57
50
  <dd>
58
- <%= f.select :gender, genders_for_select %>
51
+ <%= text_field_tag 'user_profile[patronymic]', entity.user_profile&.patronymic, size: 30, maxlength: UserProfile::NAME_LIMIT %>
52
+ </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 %>
59
67
  </dd>
60
68
 
61
69
  <dt><%= f.label :notice %></dt>
62
70
  <dd>
63
71
  <%= f.text_field :notice, size: nil, maxlength: User::NOTICE_LIMIT %>
64
72
  </dd>
65
- </dl>
66
73
 
67
- <ul class="flags">
68
- <li><%= f.check_box :bot %><%= f.label :bot %></li>
69
- <li><%= f.check_box :allow_login %><%= f.label :allow_login %></li>
70
- <li><%= f.check_box :email_confirmed %><%= f.label :email_confirmed %></li>
71
- <li><%= f.check_box :phone_confirmed %><%= f.label :phone_confirmed %></li>
72
- <li><%= f.check_box :allow_mail %><%= f.label :allow_mail %></li>
73
- </ul>
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>
74
85
 
75
86
  <div class="buttons">
76
87
  <%= f.button t(:save), type: :submit %>
@@ -4,7 +4,7 @@
4
4
  <span><%= t(:create) %></span>
5
5
  <% end %>
6
6
 
7
- <article class="entity-page">
7
+ <article class="user">
8
8
  <h1><%= t('.title') %></h1>
9
9
 
10
10
  <ul class="actions">
@@ -99,3 +99,13 @@ ru:
99
99
  admin:
100
100
  footer:
101
101
  support: "Поддержка"
102
+ about:
103
+ index:
104
+ nav_text: "О проекте"
105
+ tos:
106
+ nav_text: "Пользовательское соглашение"
107
+ editable:
108
+ title: "Раздел в разработке"
109
+ heading: "Раздел наполняется"
110
+ message: "Информация ещё не готова, зайдите позже"
111
+ flags: "Флаги"