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
@@ -19,6 +19,6 @@
19
19
  </div>
20
20
 
21
21
  <ul class="actions">
22
- <li><%= edit_icon edit_code_path(entity.id) %></li>
22
+ <li><%= edit_icon edit_code_path(id: entity.id) %></li>
23
23
  </ul>
24
24
  </div>
@@ -9,7 +9,7 @@
9
9
 
10
10
  <ul class="actions">
11
11
  <li><%= back_icon(admin_codes_path) %></li>
12
- <li><%= edit_icon(edit_code_path(@entity.id)) %></li>
12
+ <li><%= edit_icon(edit_code_path(id: @entity.id)) %></li>
13
13
  </ul>
14
14
 
15
15
  <dl>
@@ -6,8 +6,14 @@
6
6
  <div class="info">
7
7
  <%= entity.slug %>
8
8
  </div>
9
+ <% unless entity.language.nil? %>
10
+ <div class="secondary info">
11
+ <%= t('activerecord.attributes.editable_page.language') %>:
12
+ <%= language_name(entity.language) %>
13
+ </div>
14
+ <% end %>
9
15
 
10
16
  <ul class="actions">
11
- <li><%= edit_icon(edit_editable_page_path(entity)) %></li>
17
+ <li><%= edit_icon(edit_editable_page_path(id: entity.id)) %></li>
12
18
  </ul>
13
19
  </div>
@@ -1,7 +1,7 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.name) %>
2
2
  <% content_for :breadcrumbs do %>
3
- <%= link_to(t('admin.editable_pages.nav_item.text'), admin_editable_pages_path) %>
4
- <span><%= @entity.name %></span>
3
+ <%= link_to(t('admin.editable_pages.nav_item.text'), admin_editable_pages_path) %>
4
+ <span><%= @entity.name %></span>
5
5
  <% end %>
6
6
 
7
7
  <article>
@@ -9,37 +9,44 @@
9
9
 
10
10
  <ul class="actions">
11
11
  <li><%= back_icon(admin_editable_pages_path) %></li>
12
- <li><%= edit_icon(edit_editable_page_path(@entity.id)) %></li>
12
+ <li><%= edit_icon(edit_editable_page_path(id: @entity.id)) %></li>
13
13
  </ul>
14
14
 
15
- <% unless @entity.image.blank? %>
16
- <figure>
17
- <%= editable_page_image_medium(@entity) %>
18
- <figcaption><%= t(:current_image) %></figcaption>
19
- </figure>
20
- <% end %>
21
-
22
15
  <dl>
16
+ <% unless @entity.language.nil? %>
17
+ <dt><%= t('activerecord.attributes.editable_page.language') %></dt>
18
+ <dd><%= language_name(@entity.language) %></dd>
19
+ <% end %>
20
+
21
+ <% unless @entity.image.blank? %>
22
+ <dt><%= t('activerecord.attributes.editable_page.image') %></dt>
23
+ <dd>
24
+ <figure>
25
+ <%= editable_page_image_medium(@entity) %>
26
+ </figure>
27
+ </dd>
28
+ <% end %>
29
+
30
+ <dt><%= t('activerecord.attributes.editable_page.slug') %></dt>
31
+ <dd><%= @entity.slug %></dd>
32
+
23
33
  <dt><%= t(:created_at) %></dt>
24
34
  <dd><%= time_tag(@entity.created_at) %></dd>
25
35
 
26
36
  <dt><%= t(:updated_at) %></dt>
27
37
  <dd><%= time_tag(@entity.updated_at) %></dd>
28
38
 
29
- <dt><%= t('activerecord.attributes.editable_page.slug') %></dt>
30
- <dd><%= @entity.slug %></dd>
31
-
32
39
  <% unless @entity.title.blank? %>
33
- <dt><%= t('activerecord.attributes.editable_page.title') %></dt>
34
- <dd><%= @entity.title %></dd>
40
+ <dt><%= t('activerecord.attributes.editable_page.title') %></dt>
41
+ <dd><%= @entity.title %></dd>
35
42
  <% end %>
36
43
  <% unless @entity.keywords.blank? %>
37
- <dt><%= t('activerecord.attributes.editable_page.keywords') %></dt>
38
- <dd><%= @entity.keywords %></dd>
44
+ <dt><%= t('activerecord.attributes.editable_page.keywords') %></dt>
45
+ <dd><%= @entity.keywords %></dd>
39
46
  <% end %>
40
47
  <% unless @entity.description.blank? %>
41
- <dt><%= t('activerecord.attributes.editable_page.description') %></dt>
42
- <dd><%= @entity.description %></dd>
48
+ <dt><%= t('activerecord.attributes.editable_page.description') %></dt>
49
+ <dd><%= @entity.description %></dd>
43
50
  <% end %>
44
51
  </dl>
45
52
 
@@ -14,5 +14,5 @@
14
14
  </div>
15
15
  <% end %>
16
16
 
17
- <%= render partial: 'shared/admin/toggleable', locals: { entity: entity, url: toggle_admin_feedback_request_path(entity.id) } %>
17
+ <%= render partial: 'shared/admin/toggleable', locals: { entity: entity, url: toggle_admin_feedback_request_path(id: entity.id) } %>
18
18
  </div>
@@ -4,4 +4,5 @@
4
4
  <%= render 'admin/index/dashboard/biovision_user' %>
5
5
  <%= render 'admin/index/dashboard/editorial' %>
6
6
  <%= render 'admin/index/dashboard/biovision_post' if Gem.loaded_specs.key?('biovision-post') %>
7
+ <%= render 'admin/index/dashboard/biovision_courses' if Gem.loaded_specs.key?('biovision-courses') %>
7
8
  <%= render 'admin/index/dashboard/biovision_feedback' %>
@@ -20,7 +20,7 @@
20
20
 
21
21
  <ul class="actions">
22
22
  <% if entity.editable_by?(current_user) %>
23
- <li><%= edit_icon(edit_media_file_path(entity.id)) %></li>
23
+ <li><%= edit_icon(edit_media_file_path(id: entity.id)) %></li>
24
24
  <% end %>
25
25
  </ul>
26
26
  </div>
@@ -12,10 +12,10 @@
12
12
  <% if @entity.media_folder.nil? %>
13
13
  <%= return_icon(admin_media_files_path) %>
14
14
  <% else %>
15
- <%= return_icon(admin_media_folder_path(@entity.media_folder_id)) %>
15
+ <%= return_icon(admin_media_folder_path(id: @entity.media_folder_id)) %>
16
16
  <% end %>
17
17
  </li>
18
- <li><%= edit_icon(edit_media_file_path(@entity.id)) %></li>
18
+ <li><%= edit_icon(edit_media_file_path(id: @entity.id)) %></li>
19
19
  </ul>
20
20
 
21
21
  <dl>
@@ -10,7 +10,7 @@
10
10
  <%= editor_user_link(entity.user) %>
11
11
  </div>
12
12
  <div class="secondary info">
13
- <%= link_to(t(:media_file_count, count: entity.media_files_count), files_admin_media_folder_path(entity.id)) %>
13
+ <%= link_to(t(:media_file_count, count: entity.media_files_count), files_admin_media_folder_path(id: entity.id)) %>
14
14
  (<%= t(:total) %> <%= entity.file_count %>)
15
15
  </div>
16
16
  <% if entity.children_cache.any? %>
@@ -26,7 +26,7 @@
26
26
 
27
27
  <% if entity.editable_by?(current_user) %>
28
28
  <ul class="actions">
29
- <li><%= edit_icon(edit_media_folder_path(entity.id)) %></li>
29
+ <li><%= edit_icon(edit_media_folder_path(id: entity.id)) %></li>
30
30
  </ul>
31
31
  <% end %>
32
32
  </div>
@@ -13,7 +13,7 @@
13
13
  <h2><%= t(:media_file_count, count: @entity.media_files_count) %></h2>
14
14
 
15
15
  <ul class="actions">
16
- <li><%= return_icon(admin_media_folder_path(@entity.id)) %></li>
16
+ <li><%= return_icon(admin_media_folder_path(id: @entity.id)) %></li>
17
17
  </ul>
18
18
 
19
19
  <%= paginate @collection %>
@@ -15,10 +15,10 @@
15
15
  <% if @entity.parent.nil? %>
16
16
  <%= return_icon(admin_media_folders_path) %>
17
17
  <% else %>
18
- <%= return_icon(admin_media_folder_path(@entity.parent_id)) %>
18
+ <%= return_icon(admin_media_folder_path(id: @entity.parent_id)) %>
19
19
  <% end %>
20
20
  </li>
21
- <li><%= edit_icon(edit_media_folder_path(@entity.id)) %></li>
21
+ <li><%= edit_icon(edit_media_folder_path(id: @entity.id)) %></li>
22
22
  </ul>
23
23
 
24
24
  <% unless @entity.snapshot.blank? %>
@@ -54,8 +54,10 @@
54
54
  <dt><%= t('.media_files') %></dt>
55
55
  <dd>
56
56
  <%=
57
- link_to(t(:media_file_count, count: @entity.media_files_count),
58
- files_admin_media_folder_path(@entity.id))
57
+ link_to(
58
+ t(:media_file_count, count: @entity.media_files_count),
59
+ files_admin_media_folder_path(id: @entity.id)
60
+ )
59
61
  %>
60
62
  </dd>
61
63
 
@@ -11,9 +11,9 @@
11
11
  <tr>
12
12
  <td>
13
13
  <% if entity.description.blank? %>
14
- <%= link_to entity.name, admin_metric_path(entity.id) %>
14
+ <%= link_to entity.name, admin_metric_path(id: entity.id) %>
15
15
  <% else %>
16
- <%= link_to entity.description, admin_metric_path(entity.id) %>
16
+ <%= link_to entity.description, admin_metric_path(id: entity.id) %>
17
17
  <% end %>
18
18
  </td>
19
19
  <td><%= entity.value %></td>
@@ -9,12 +9,12 @@
9
9
 
10
10
  <ul class="actions">
11
11
  <li><%= return_icon(admin_metrics_path) %></li>
12
- <li><%= edit_icon(edit_metric_path(@entity.id)) %></li>
12
+ <li><%= edit_icon(edit_metric_path(id: @entity.id)) %></li>
13
13
  </ul>
14
14
 
15
15
  <div><%= @entity.description %></div>
16
16
 
17
- <canvas id="metric-chart" width="640" height="480" data-source="<%= data_admin_metric_path(@entity.id) %>"></canvas>
17
+ <canvas id="metric-chart" width="640" height="480" data-source="<%= data_admin_metric_path(id: @entity.id) %>"></canvas>
18
18
  </article>
19
19
 
20
20
  <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.0/Chart.bundle.min.js"></script>
@@ -5,6 +5,6 @@
5
5
  </div>
6
6
 
7
7
  <ul class="actions">
8
- <li><%= edit_icon(edit_privilege_group_path(entity.id)) %></li>
8
+ <li><%= edit_icon(edit_privilege_group_path(id: entity.id)) %></li>
9
9
  </ul>
10
10
  </div>
@@ -9,7 +9,7 @@
9
9
 
10
10
  <ul class="actions">
11
11
  <li><%= return_icon(admin_privilege_groups_path) %></li>
12
- <li><%= edit_icon(edit_privilege_group_path(@entity.id)) %></li>
12
+ <li><%= edit_icon(edit_privilege_group_path(id: @entity.id)) %></li>
13
13
  <li class="danger"><%= destroy_icon(@entity) %></li>
14
14
  </ul>
15
15
 
@@ -6,16 +6,16 @@
6
6
  <div class="info">
7
7
  <div><%= entity.slug %></div>
8
8
  <div><%= entity.privilege_groups.map(&:name).join(', ') %></div>
9
- <div><%= link_to t(:user_count, count: entity.users_count), users_admin_privilege_path(entity.id) %></div>
9
+ <div><%= link_to t(:user_count, count: entity.users_count), users_admin_privilege_path(id: entity.id) %></div>
10
10
  </div>
11
- <%= render partial: 'shared/admin/toggleable', locals: { entity: entity, url: toggle_admin_privilege_path(entity.id) } %>
11
+ <%= render partial: 'shared/admin/toggleable', locals: { entity: entity, url: toggle_admin_privilege_path(id: entity.id) } %>
12
12
 
13
13
  <ul class="actions">
14
14
  <li class="lockable <%= entity.locked? ? 'hidden' : '' %>">
15
15
  <%= edit_icon(edit_privilege_path(entity.id)) %>
16
16
  </li>
17
- <%= render partial: 'shared/actions/priority_changer', locals: { path: priority_admin_privilege_path(entity.id) } %>
18
- <%= render partial: 'shared/actions/locks', locals: { entity: entity, path: lock_admin_privilege_path(entity.id) } %>
17
+ <%= render partial: 'shared/actions/priority_changer', locals: { path: priority_admin_privilege_path(id: entity.id) } %>
18
+ <%= render partial: 'shared/actions/locks', locals: { entity: entity, path: lock_admin_privilege_path(id: entity.id) } %>
19
19
  </ul>
20
20
 
21
21
  <% if entity.children.any? %>
@@ -13,14 +13,14 @@
13
13
  <ul class="actions">
14
14
  <li><%= return_icon(admin_privileges_path) %></li>
15
15
  <% unless @entity.locked? %>
16
- <li><%= edit_icon(edit_privilege_path(@entity.id)) %></li>
16
+ <li><%= edit_icon(edit_privilege_path(id: @entity.id)) %></li>
17
17
  <% end %>
18
18
  </ul>
19
19
 
20
20
  <dl>
21
21
  <% unless @entity.parent.nil? %>
22
22
  <dt><%= t('activerecord.attributes.privilege.parent_id') %></dt>
23
- <dd><%= link_to @entity.parent.name, admin_privilege_path(@entity.parent_id) %></dd>
23
+ <dd><%= link_to @entity.parent.name, admin_privilege_path(id: @entity.parent_id) %></dd>
24
24
  <% end %>
25
25
  <dt><%= t('activerecord.attributes.privilege.slug') %></dt>
26
26
  <dd><%= @entity.slug %></dd>
@@ -44,11 +44,11 @@
44
44
  <% end %>
45
45
  </dl>
46
46
 
47
- <%= render partial: 'shared/admin/toggleable', locals: { entity: @entity, url: toggle_admin_privilege_path(@entity.id) } %>
47
+ <%= render partial: 'shared/admin/toggleable', locals: { entity: @entity, url: toggle_admin_privilege_path(id: @entity.id) } %>
48
48
 
49
49
  <nav>
50
50
  <ul>
51
- <li><%= link_to t(:user_count, count: @entity.users_count), users_admin_privilege_path(@entity.id) %></li>
51
+ <li><%= link_to t(:user_count, count: @entity.users_count), users_admin_privilege_path(id: @entity.id) %></li>
52
52
  </ul>
53
53
  </nav>
54
54
 
@@ -11,7 +11,7 @@
11
11
  <article>
12
12
  <h1><%= @entity.full_title %></h1>
13
13
  <ul class="actions">
14
- <li><%= return_icon(admin_privilege_path(@entity)) %></li>
14
+ <li><%= return_icon(admin_privilege_path(id: @entity.id)) %></li>
15
15
  </ul>
16
16
 
17
17
  <section>
@@ -10,6 +10,6 @@
10
10
  <% end %>
11
11
 
12
12
  <ul class="actions">
13
- <li><%= edit_icon(edit_stored_value_path(entity.id)) %></li>
13
+ <li><%= edit_icon(edit_stored_value_path(id: entity.id)) %></li>
14
14
  </ul>
15
15
  </div>
@@ -9,7 +9,7 @@
9
9
 
10
10
  <ul class="actions">
11
11
  <li><%= back_icon(admin_stored_values_path) %></li>
12
- <li><%= edit_icon(edit_stored_value_path(@entity.id)) %></li>
12
+ <li><%= edit_icon(edit_stored_value_path(id: @entity.id)) %></li>
13
13
  </ul>
14
14
 
15
15
  <dl>
@@ -17,9 +17,9 @@
17
17
  <div class="truncate"><%= entity.agent.name %></div>
18
18
  <% end %>
19
19
  </div>
20
- <%= render partial: 'shared/admin/toggleable', locals: { entity: entity, url: toggle_admin_token_path(entity.id) } %>
20
+ <%= render partial: 'shared/admin/toggleable', locals: { entity: entity, url: toggle_admin_token_path(id: entity.id) } %>
21
21
 
22
22
  <ul class="actions">
23
- <li><%= edit_icon edit_token_path(entity) %></li>
23
+ <li><%= edit_icon edit_token_path(id: entity.id) %></li>
24
24
  </ul>
25
25
  </div>
@@ -9,7 +9,7 @@
9
9
 
10
10
  <ul class="actions">
11
11
  <li><%= return_icon(admin_tokens_path) %></li>
12
- <li><%= edit_icon(edit_token_path(@entity)) %></li>
12
+ <li><%= edit_icon(edit_token_path(id: @entity.id)) %></li>
13
13
  <li class="danger"><%= destroy_icon(@entity) %></li>
14
14
  </ul>
15
15
 
@@ -39,5 +39,5 @@
39
39
  <% end %>
40
40
  </dl>
41
41
 
42
- <%= render partial: 'shared/admin/toggleable', locals: { entity: @entity, url: toggle_admin_token_path(@entity.id) } %>
42
+ <%= render partial: 'shared/admin/toggleable', locals: { entity: @entity, url: toggle_admin_token_path(id: @entity.id) } %>
43
43
  </article>
@@ -9,7 +9,7 @@
9
9
  <h1><%= t('admin.codes.index.heading') %></h1>
10
10
 
11
11
  <ul class="actions">
12
- <li><%= return_icon(admin_user_path(@entity.id)) %></li>
12
+ <li><%= return_icon(admin_user_path(id: @entity.id)) %></li>
13
13
  </ul>
14
14
 
15
15
  <%= paginate @collection %>
@@ -18,8 +18,9 @@
18
18
  <% end %>
19
19
  </div>
20
20
 
21
- <%= render partial: 'shared/admin/toggleable', locals: { entity: entity, url: toggle_admin_user_path(entity.id) } %>
21
+ <%= render partial: 'shared/admin/toggleable', locals: { entity: entity, url: toggle_admin_user_path(id: entity.id) } %>
22
22
  <ul class="actions">
23
- <li><%= edit_icon(edit_user_path(entity.id)) %></li>
23
+ <li><%= edit_icon(edit_user_path(id: entity.id)) %></li>
24
+ <li><%= world_icon(user_profile_path(slug: entity.screen_name)) %></li>
24
25
  </ul>
25
26
  </div>
@@ -2,7 +2,7 @@
2
2
  <div data-url="<%= privilege_admin_user_path(id: user.id, privilege_id: privilege.id) %>" class="entity">
3
3
  <% if privilege.regional? && Gem.loaded_specs.key?('biovision-regions') %>
4
4
  <span><%= privilege.name %></span>
5
- <ul data-url="<%= regions_admin_privilege_path(privilege.id, user_id: user.id) %>" class="regions">
5
+ <ul data-url="<%= regions_admin_privilege_path(id: privilege.id, user_id: user.id) %>" class="regions">
6
6
  <% user.user_privileges.where(privilege: privilege).order('region_id asc').each do |link| %>
7
7
  <li>
8
8
  <% element_id = "user_privilege_#{privilege.id}_#{link.region_id}" %>
@@ -0,0 +1,17 @@
1
+ <% unless data['name'].blank? %>
2
+ <dt><%= t('activerecord.attributes.user_profile.name') %></dt>
3
+ <dd><%= data['name'] %></dd>
4
+ <% end %>
5
+
6
+ <% unless data['patronymic'].blank? %>
7
+ <dt><%= t('activerecord.attributes.user_profile.patronymic') %></dt>
8
+ <dd><%= data['patronymic'] %></dd>
9
+ <% end %>
10
+
11
+ <% unless data['surname'].blank? %>
12
+ <dt><%= t('activerecord.attributes.user_profile.surname') %></dt>
13
+ <dd><%= data['surname'] %></dd>
14
+ <% end %>
15
+
16
+ <dt><%= t('activerecord.attributes.user_profile.gender') %></dt>
17
+ <dd><%= gender_name(data['gender']) %></dd>
@@ -9,7 +9,7 @@
9
9
  <h1><%= @entity.profile_name %></h1>
10
10
 
11
11
  <ul class="actions">
12
- <li><%= return_icon(admin_user_path(@entity.id)) %></li>
12
+ <li><%= return_icon(admin_user_path(id: @entity.id)) %></li>
13
13
  </ul>
14
14
 
15
15
  <section>
@@ -2,8 +2,8 @@ json.data do
2
2
  if @collection.any?
3
3
  json.users @collection do |user|
4
4
  json.(user, :id, :slug, :email)
5
- json.surname user.user_profile&.surname
6
- json.name user.user_profile&.name
5
+ json.surname user.profile_data['surname']
6
+ json.name user.profile_data['name']
7
7
  end
8
8
  else
9
9
  json.users []
@@ -1,33 +1,34 @@
1
1
  <% content_for :meta_title, t('.title', name: @entity.profile_name) %>
2
2
  <% content_for :breadcrumbs do %>
3
- <%= link_to(t('admin.users.nav_item.text'), admin_users_path) %>
4
- <span><%= @entity.profile_name %></span>
3
+ <%= link_to(t('admin.users.nav_item.text'), admin_users_path) %>
4
+ <span><%= @entity.profile_name %></span>
5
5
  <% end %>
6
6
 
7
7
  <article>
8
8
  <h1><%= @entity.screen_name %></h1>
9
9
  <% if @entity.deleted? %>
10
- <div class="message-box-alert"><%= t(:deleted_entity) %></div>
10
+ <div class="message-box-alert"><%= t(:deleted_entity) %></div>
11
11
  <% end %>
12
12
  <ul class="actions">
13
13
  <li><%= back_icon(admin_users_path) %></li>
14
14
  <% unless @entity.deleted? %>
15
- <li><%= edit_icon(edit_user_path(@entity.id)) %></li>
15
+ <li><%= world_icon(user_profile_path(slug: @entity.screen_name)) %></li>
16
+ <li><%= edit_icon(edit_user_path(id: @entity.id)) %></li>
16
17
  <% end %>
17
18
  </ul>
18
19
 
19
20
  <nav>
20
21
  <ul>
21
- <li><%= link_to t('.privileges'), privileges_admin_user_path(@entity.id) %></li>
22
- <li><%= link_to t('admin.tokens.index.heading'), tokens_admin_user_path(@entity) %></li>
23
- <li><%= link_to t('admin.codes.index.heading'), codes_admin_user_path(@entity) %></li>
22
+ <li><%= link_to t('.privileges'), privileges_admin_user_path(id: @entity.id) %></li>
23
+ <li><%= link_to t('admin.tokens.index.heading'), tokens_admin_user_path(id: @entity.id) %></li>
24
+ <li><%= link_to t('admin.codes.index.heading'), codes_admin_user_path(id: @entity.id) %></li>
24
25
  <% unless @entity == current_user %>
25
- <li><%= link_to t('.authenticate'), authenticate_admin_user_path(@entity.id), method: :post %></li>
26
+ <li><%= link_to t('.authenticate'), authenticate_admin_user_path(id: @entity.id), method: :post %></li>
26
27
  <% end %>
27
28
  </ul>
28
29
  </nav>
29
30
 
30
- <figure>
31
+ <figure role="group">
31
32
  <%= profile_avatar @entity %>
32
33
  <figcaption>
33
34
  <%= @entity.slug %>
@@ -36,44 +37,28 @@
36
37
 
37
38
  <dl>
38
39
  <% unless @entity.notice.blank? %>
39
- <dt><%= t('activerecord.attributes.user.notice') %></dt>
40
- <dd><%= @entity.notice %></dd>
40
+ <dt><%= t('activerecord.attributes.user.notice') %></dt>
41
+ <dd><%= @entity.notice %></dd>
41
42
  <% end %>
42
43
 
43
44
  <dt><%= t('activerecord.attributes.user.screen_name') %></dt>
44
45
  <dd><%= user_link @entity %></dd>
45
46
 
46
- <% unless @entity.user_profile.name.blank? %>
47
- <dt><%= t('activerecord.attributes.user_profile.name') %></dt>
48
- <dd><%= @entity.user_profile.name %></dd>
49
- <% end %>
50
-
51
- <% unless @entity.user_profile.patronymic.blank? %>
52
- <dt><%= t('activerecord.attributes.user_profile.patronymic') %></dt>
53
- <dd><%= @entity.user_profile.patronymic %></dd>
54
- <% end %>
55
-
56
- <% unless @entity.user_profile.surname.blank? %>
57
- <dt><%= t('activerecord.attributes.user_profile.surname') %></dt>
58
- <dd><%= @entity.user_profile.surname %></dd>
59
- <% end %>
60
-
61
47
  <% unless @entity.email.blank? %>
62
- <dt><%= t('activerecord.attributes.user.email') %></dt>
63
- <dd><%= link_to @entity.email, "mailto:#{@entity.email}" %></dd>
48
+ <dt><%= t('activerecord.attributes.user.email') %></dt>
49
+ <dd><%= link_to @entity.email, "mailto:#{@entity.email}" %></dd>
64
50
  <% end %>
65
51
 
66
52
  <% unless @entity.phone.blank? %>
67
- <dt><%= t('activerecord.attributes.user.phone') %></dt>
68
- <dd><%= link_to @entity.phone, "tel:#{@entity.phone}" %></dd>
53
+ <dt><%= t('activerecord.attributes.user.phone') %></dt>
54
+ <dd><%= link_to @entity.phone, "tel:#{@entity.phone}" %></dd>
69
55
  <% end %>
70
56
 
71
- <dt><%= t('activerecord.attributes.user_profile.gender') %></dt>
72
- <dd><%= @entity.user_profile.gender.blank? ? t(:not_selected) : t("activerecord.attributes.user_profile.genders.#{@entity.user_profile.gender}") %></dd>
57
+ <%= render partial: 'admin/users/entity/profile', locals: { data: @entity.profile_data } %>
73
58
 
74
59
  <% unless @entity.ip.blank? %>
75
- <dt><%= t('activerecord.attributes.user.ip') %></dt>
76
- <dd><%= @entity.ip %></dd>
60
+ <dt><%= t('activerecord.attributes.user.ip') %></dt>
61
+ <dd><%= @entity.ip %></dd>
77
62
  <% end %>
78
63
 
79
64
  <dt><%= t(:created_at) %></dt>
@@ -83,24 +68,24 @@
83
68
  <dd><%= time_tag @entity.updated_at %></dd>
84
69
 
85
70
  <% unless @entity.last_seen.blank? %>
86
- <dt><%= t('activerecord.attributes.user.last_seen') %></dt>
87
- <dd><%= time_tag @entity.last_seen %></dd>
71
+ <dt><%= t('activerecord.attributes.user.last_seen') %></dt>
72
+ <dd><%= time_tag @entity.last_seen %></dd>
88
73
  <% end %>
89
74
 
90
75
  <% if @entity.user_privileges.any? %>
91
- <dt><%= t('.privileges') %></dt>
92
- <dd>
93
- <ol>
94
- <% @entity.user_privileges.order('privilege_id, region_id asc nulls first').each do |link| %>
95
- <li>
96
- <%= link.privilege.name %>
97
- <% unless link.region_id.nil? %>
98
- (<%= link.region_id %><%# link.region.long_name %>)
99
- <% end %>
100
- </li>
101
- <% end %>
102
- </ol>
103
- </dd>
76
+ <dt><%= t('.privileges') %></dt>
77
+ <dd>
78
+ <ol>
79
+ <% @entity.user_privileges.order('privilege_id, region_id asc nulls first').each do |link| %>
80
+ <li>
81
+ <%= link.privilege.name %>
82
+ <% unless link.region_id.nil? %>
83
+ (<%= link.region_id %><%# link.region.long_name %>)
84
+ <% end %>
85
+ </li>
86
+ <% end %>
87
+ </ol>
88
+ </dd>
104
89
  <% end %>
105
90
  </dl>
106
91