biovision 0.0.200518.1 → 0.1.210414.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +60 -18
- data/app/assets/images/biovision/icons/back.svg +19 -0
- data/app/assets/images/biovision/icons/create.svg +19 -0
- data/app/assets/images/biovision/icons/destroy.svg +12 -0
- data/app/assets/images/biovision/icons/dropdown.svg +3 -0
- data/app/assets/images/biovision/icons/edit.svg +22 -0
- data/app/assets/images/biovision/icons/gear.svg +11 -0
- data/app/assets/images/biovision/icons/return.svg +25 -0
- data/app/assets/images/biovision/icons/world.svg +11 -0
- data/app/assets/stylesheets/biovision/admin/components.scss +3 -1
- data/app/assets/stylesheets/biovision/admin/components/users.scss +16 -0
- data/app/assets/stylesheets/biovision/admin/layout.scss +6 -17
- data/app/assets/stylesheets/biovision/biovision.scss +42 -1
- data/app/assets/stylesheets/biovision/components.scss +6 -0
- data/app/assets/stylesheets/biovision/components/breadcrumbs.scss +13 -0
- data/app/assets/stylesheets/biovision/components/buttons.scss +130 -0
- data/app/assets/stylesheets/biovision/components/forms.scss +162 -1
- data/app/assets/stylesheets/biovision/components/lists.scss +6 -7
- data/app/assets/stylesheets/biovision/{biovision → components}/messages.scss +9 -0
- data/app/assets/stylesheets/biovision/components/pagination.scss +34 -0
- data/app/assets/stylesheets/biovision/components/simple_image.scss +112 -0
- data/app/assets/stylesheets/biovision/components/toggleable.scss +71 -0
- data/app/assets/stylesheets/biovision/themes/default_theme/components.scss +2 -3
- data/app/assets/stylesheets/biovision/themes/default_theme/components/users.scss +2 -0
- data/app/assets/stylesheets/biovision/themes/default_theme/components/users/form_tabs.scss +101 -0
- data/app/assets/stylesheets/biovision/themes/default_theme/components/users/profile.scss +77 -0
- data/app/assets/stylesheets/biovision/themes/default_theme/layout.scss +2 -16
- data/app/controllers/admin/components_controller.rb +9 -19
- data/app/controllers/admin/dynamic_blocks_controller.rb +15 -0
- data/app/controllers/admin/dynamic_pages_controller.rb +15 -0
- data/app/controllers/admin/navigation_groups_controller.rb +14 -0
- data/app/controllers/admin/users_controller.rb +70 -0
- data/app/controllers/admin_controller.rb +3 -2
- data/app/controllers/authentication_controller.rb +6 -34
- data/app/controllers/concerns/authentication.rb +12 -12
- data/app/controllers/concerns/crud_entities.rb +132 -0
- data/app/controllers/concerns/entity_priority.rb +10 -0
- data/app/controllers/concerns/toggleable_entity.rb +31 -0
- data/app/controllers/contact_controller.rb +49 -0
- data/app/controllers/fallback_controller.rb +12 -0
- data/app/controllers/index_controller.rb +1 -0
- data/app/controllers/legal_controller.rb +14 -0
- data/app/controllers/my/components_controller.rb +5 -0
- data/app/controllers/my/confirmations_controller.rb +44 -0
- data/app/controllers/my/index_controller.rb +8 -0
- data/app/controllers/my/profiles_controller.rb +31 -16
- data/app/controllers/profile_controller.rb +12 -0
- data/app/controllers/users_controller.rb +61 -0
- data/app/helpers/biovision_helper.rb +171 -0
- data/app/helpers/simple_image_helper.rb +125 -0
- data/app/jobs/application_job.rb +7 -0
- data/app/jobs/send_phone_confirmation_job.rb +16 -0
- data/app/lib/biovision/components/base/component_parameters.rb +44 -0
- data/app/lib/biovision/components/base/component_privileges.rb +65 -0
- data/app/lib/biovision/components/base/component_settings.rb +32 -0
- data/app/lib/biovision/components/base/privilege_handler.rb +79 -0
- data/app/lib/biovision/components/base_component.rb +51 -54
- data/app/lib/biovision/components/contact_component.rb +22 -0
- data/app/lib/biovision/components/content_component.rb +28 -0
- data/app/lib/biovision/components/track_component.rb +3 -0
- data/app/lib/biovision/components/users/authentication.rb +15 -7
- data/app/lib/biovision/components/users/codes.rb +104 -0
- data/app/lib/biovision/components/users/flag_helpers.rb +72 -0
- data/app/lib/biovision/components/users/profile_handler.rb +111 -1
- data/app/lib/biovision/components/users/registration_handler.rb +40 -52
- data/app/lib/biovision/components/users/validation.rb +83 -0
- data/app/lib/biovision/components/users_component.rb +82 -19
- data/app/lib/biovision/notifiers/base_notifier.rb +2 -2
- data/app/lib/biovision/notifiers/contact_notifier.rb +15 -0
- data/app/lib/canonizer.rb +38 -0
- data/app/lib/carrier_wave/image_optim.rb +32 -0
- data/app/mailers/code_sender.rb +29 -0
- data/app/models/agent.rb +4 -0
- data/app/models/biovision_component.rb +22 -2
- data/app/models/browser.rb +1 -1
- data/app/models/code.rb +32 -9
- data/app/models/concerns/has_simple_image.rb +9 -0
- data/app/models/concerns/meta_texts.rb +25 -5
- data/app/models/concerns/tree_structure.rb +72 -0
- data/app/models/contact_method.rb +47 -0
- data/app/models/contact_type.rb +27 -0
- data/app/models/dynamic_block.rb +43 -0
- data/app/models/dynamic_page.rb +71 -0
- data/app/models/feedback_message.rb +59 -0
- data/app/models/feedback_response.rb +50 -0
- data/app/models/group.rb +48 -0
- data/app/models/language.rb +4 -0
- data/app/models/navigation_group.rb +33 -0
- data/app/models/navigation_group_page.rb +23 -0
- data/app/models/role.rb +56 -0
- data/app/models/role_group.rb +13 -0
- data/app/models/simple_image.rb +22 -8
- data/app/models/simple_image_tag.rb +1 -1
- data/app/models/token.rb +4 -4
- data/app/models/user.rb +94 -26
- data/app/models/user_group.rb +20 -0
- data/app/models/user_role.rb +19 -0
- data/app/uploaders/simple_file_uploader.rb +27 -0
- data/app/uploaders/simple_image_uploader.rb +20 -0
- data/app/views/admin/agents/index.html.erb +0 -2
- data/app/views/admin/components/_image.jbuilder +18 -0
- data/app/views/admin/components/_list.html.erb +1 -1
- data/app/views/admin/components/entity/_links.html.erb +1 -1
- data/app/views/admin/components/image.jbuilder +1 -0
- data/app/views/admin/components/images.jbuilder +4 -0
- data/app/views/admin/components/links/_content.html.erb +9 -0
- data/app/views/admin/components/links/_users.html.erb +1 -8
- data/app/views/admin/components/links/extra/_content.html.erb +0 -0
- data/app/views/admin/components/privileges/_links.html.erb +0 -18
- data/app/views/admin/components/settings/_new_parameter.html.erb +4 -2
- data/app/views/admin/components/settings/_parameters.html.erb +8 -2
- data/app/views/admin/components/settings/_settings.html.erb +1 -1
- data/app/views/admin/components/update_privileges.jbuilder +21 -0
- data/app/views/admin/dynamic_blocks/_form.html.erb +16 -0
- data/app/views/admin/dynamic_blocks/_nav_item.html.erb +6 -0
- data/app/views/admin/dynamic_blocks/entity/_in_list.html.erb +10 -0
- data/app/views/admin/dynamic_blocks/index.html.erb +15 -0
- data/app/views/admin/dynamic_blocks/show.html.erb +23 -0
- data/app/views/admin/dynamic_pages/_form.html.erb +21 -0
- data/app/views/admin/dynamic_pages/_nav_item.html.erb +6 -0
- data/app/views/admin/dynamic_pages/entity/_in_list.html.erb +15 -0
- data/app/views/admin/dynamic_pages/index.html.erb +15 -0
- data/app/views/admin/dynamic_pages/show.html.erb +28 -0
- data/app/views/admin/ip_addresses/index.html.erb +0 -2
- data/app/views/admin/navigation_groups/_form.html.erb +15 -0
- data/app/views/admin/navigation_groups/_nav_item.html.erb +6 -0
- data/app/views/admin/navigation_groups/entity/_in_list.html.erb +12 -0
- data/app/views/admin/navigation_groups/index.html.erb +15 -0
- data/app/views/admin/navigation_groups/show.html.erb +20 -0
- data/app/views/admin/unauthorized.html.erb +2 -5
- data/app/views/admin/users/_form.html.erb +81 -0
- data/app/views/admin/users/_nav_item.html.erb +6 -0
- data/app/views/admin/users/entity/_fields.html.erb +53 -0
- data/app/views/admin/users/entity/_in_list.html.erb +38 -0
- data/app/views/admin/users/entity/_profile.html.erb +26 -0
- data/app/views/admin/users/entity/in_list/_additional_data.html.erb +0 -0
- data/app/views/admin/users/index.html.erb +15 -0
- data/app/views/admin/users/show.html.erb +44 -0
- data/app/views/application/forbidden.html.erb +9 -0
- data/app/views/application/forbidden.jbuilder +4 -0
- data/app/views/application/not_found.html.erb +9 -0
- data/app/views/application/not_found.jbuilder +4 -0
- data/app/views/application/unauthorized.html.erb +16 -0
- data/app/views/application/unauthorized.jbuilder +4 -0
- data/app/views/authentication/new.html.erb +2 -8
- data/app/views/components/content/_dynamic_page.html.erb +21 -0
- data/app/views/components/users/_form_tabs.html.erb +31 -0
- data/app/views/components/users/_join_form.html.erb +192 -0
- data/app/views/components/users/_login_form.html.erb +45 -0
- data/app/views/components/users/form/_image.html.erb +17 -0
- data/app/views/components/users/form/_profile_data.html.erb +54 -0
- data/app/views/contact/_form.html.erb +108 -0
- data/app/views/contact/create_feedback_message.js.erb +1 -0
- data/app/views/contact/feedback.html.erb +13 -0
- data/app/views/contact/index.html.erb +16 -0
- data/app/views/fallback/show.html.erb +6 -0
- data/app/views/layouts/admin.html.erb +1 -1
- data/app/views/layouts/admin/_footer.html.erb +1 -1
- data/app/views/layouts/application/header/_authentication.html.erb +1 -1
- data/app/views/legal/privacy.html.erb +5 -0
- data/app/views/legal/tos.html.erb +5 -0
- data/app/views/my/confirmations/show.html.erb +62 -0
- data/app/views/my/index/index.html.erb +33 -0
- data/app/views/my/profiles/_form.html.erb +10 -0
- data/app/views/my/profiles/check.jbuilder +4 -0
- data/app/views/my/profiles/edit.html.erb +14 -0
- data/app/views/my/profiles/form/_basic_parameters.html.erb +9 -0
- data/app/views/my/profiles/form/_sensitive_parameters.html.erb +68 -0
- data/app/views/my/profiles/new.html.erb +6 -8
- data/app/views/my/profiles/show.html.erb +23 -0
- data/app/views/shared/_flash_messages.html.erb +1 -1
- data/app/views/shared/_list_of_errors.html.erb +7 -0
- data/app/views/shared/admin/_breadcrumbs.html.erb +8 -0
- data/app/views/shared/admin/_list.html.erb +4 -4
- data/app/views/shared/admin/_list_with_priority.html.erb +4 -4
- data/app/views/shared/admin/_priority.html.erb +5 -0
- data/app/views/shared/admin/_toggle.html.erb +11 -0
- data/app/views/shared/entity/_formatted_text_field.html.erb +10 -0
- data/app/views/shared/entity/_image.html.erb +31 -0
- data/app/views/shared/entity/_language.html.erb +6 -0
- data/app/views/shared/entity/_linked_entity.html.erb +6 -0
- data/app/views/shared/entity/_meta_texts.html.erb +16 -0
- data/app/views/shared/entity/_metadata.html.erb +18 -0
- data/app/views/shared/entity/_parent.html.erb +6 -0
- data/app/views/shared/entity/_priority.html.erb +4 -0
- data/app/views/shared/entity/_raw_text_field.html.erb +10 -0
- data/app/views/shared/entity/_simple_image.html.erb +10 -0
- data/app/views/shared/entity/_slug.html.erb +6 -0
- data/app/views/shared/entity/_text_field.html.erb +6 -0
- data/app/views/shared/entity/_text_fields.html.erb +9 -0
- data/app/views/shared/entity/_timestamps.html.erb +13 -0
- data/app/views/shared/entity/_tree_caches.html.erb +12 -0
- data/app/views/shared/entity/_uuid.html.erb +4 -0
- data/app/views/shared/entity/edit.html.erb +21 -0
- data/app/views/shared/entity/new.html.erb +16 -0
- data/app/views/shared/forms/_entity_flags.html.erb +15 -0
- data/app/views/shared/forms/_field.html.erb +46 -0
- data/app/views/shared/forms/_fields.html.erb +3 -0
- data/app/views/shared/forms/_language.html.erb +40 -0
- data/app/views/shared/forms/_meta_texts.html.erb +27 -0
- data/app/views/shared/forms/_priority.html.erb +13 -0
- data/app/views/shared/forms/_simple_image.html.erb +39 -0
- data/app/views/shared/forms/_state_container.html.erb +7 -0
- data/app/views/shared/forms/_text_area.html.erb +25 -0
- data/app/views/shared/forms/_text_field.html.erb +24 -0
- data/app/views/shared/forms/_text_fields.html.erb +3 -0
- data/app/views/shared/forms/check.jbuilder +4 -0
- data/app/views/shared/forms/errors.jbuilder +3 -0
- data/app/views/shared/forms/simple_image/_browse.html.erb +14 -0
- data/app/views/shared/forms/simple_image/_load_image.html.erb +38 -0
- data/app/views/shared/my/_list.html.erb +19 -0
- data/app/views/shared/my/_list_with_priority.html.erb +19 -0
- data/app/views/users/_profile.html.erb +30 -0
- data/app/views/users/profile/_data.html.erb +20 -0
- data/app/views/users/show.html.erb +21 -0
- data/config/locales/biovision-ru.yml +58 -0
- data/config/locales/components-ru.yml +30 -2
- data/config/locales/contact-ru.yml +106 -0
- data/config/locales/content-ru.yml +103 -0
- data/config/locales/users-ru.yml +117 -3
- data/config/routes.rb +70 -50
- data/db/migrate/20191228000000_create_biovision_components.rb +4 -5
- data/db/migrate/20200224000000_create_track_component.rb +7 -8
- data/db/migrate/20200224000010_create_users_component.rb +15 -43
- data/db/migrate/20200404000000_create_simple_images.rb +3 -3
- data/db/migrate/20200529000000_create_content_component.rb +74 -0
- data/db/migrate/20210401000000_create_contact_component.rb +95 -0
- data/db/migrate/20210405000000_create_acl.rb +74 -0
- data/lib/biovision/base_methods.rb +18 -10
- data/lib/biovision/engine.rb +8 -13
- data/lib/biovision/version.rb +1 -1
- metadata +186 -20
- data/app/assets/images/biovision/placeholders/user.svg +0 -15
- data/app/helpers/users_helper.rb +0 -11
- data/app/lib/biovision/components/component_settings.rb +0 -30
- data/app/lib/biovision/components/privilege_handler.rb +0 -77
- data/app/lib/biovision/components/users/code_handler.rb +0 -23
- data/app/models/foreign_site.rb +0 -34
- data/app/models/foreign_user.rb +0 -21
- data/app/uploaders/user_image_uploader.rb +0 -58
- data/app/views/admin/components/privileges/_privilege_flag.html.erb +0 -28
- data/app/views/authentication/_form.html.erb +0 -40
- data/app/views/authentication/failed.js.erb +0 -3
- data/app/views/my/profiles/new/_form.html.erb +0 -147
- data/app/views/shared/admin/_toggleable.html.erb +0 -8
@@ -1,77 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Biovision
|
4
|
-
module Components
|
5
|
-
# Handling user privileges in component
|
6
|
-
class PrivilegeHandler
|
7
|
-
attr_accessor :component
|
8
|
-
|
9
|
-
# @param [BaseComponent] component
|
10
|
-
def initialize(component)
|
11
|
-
@component = component
|
12
|
-
end
|
13
|
-
|
14
|
-
# @param [String|Symbol]
|
15
|
-
def privilege?(slug)
|
16
|
-
return false if @component.user_link.nil?
|
17
|
-
|
18
|
-
privileges = Array(@component.user_link.data['privileges'])
|
19
|
-
privileges.include?(slug)
|
20
|
-
end
|
21
|
-
|
22
|
-
def administrator!
|
23
|
-
return if @component.user.nil?
|
24
|
-
|
25
|
-
link = @component.user_link!
|
26
|
-
link.administrator = true
|
27
|
-
link.save
|
28
|
-
end
|
29
|
-
|
30
|
-
def not_administrator!
|
31
|
-
return if @component.user.nil? || @component.user_link.nil?
|
32
|
-
|
33
|
-
@component.user_link.update(administrator: false)
|
34
|
-
end
|
35
|
-
|
36
|
-
# @param [Array] new_privileges
|
37
|
-
def privileges=(new_privileges)
|
38
|
-
return if @component.user.nil?
|
39
|
-
|
40
|
-
link = @component.user_link!
|
41
|
-
link.data['privileges'] = Array(new_privileges).uniq
|
42
|
-
link.save
|
43
|
-
end
|
44
|
-
|
45
|
-
# @param [Hash] new_settings
|
46
|
-
def settings=(new_settings)
|
47
|
-
return if @component.user.nil?
|
48
|
-
|
49
|
-
link = @component.user_link!
|
50
|
-
link.data['settings'] = new_settings
|
51
|
-
link.save
|
52
|
-
end
|
53
|
-
|
54
|
-
# @param [String] slug
|
55
|
-
def add_privilege(slug)
|
56
|
-
return if @component.user.nil?
|
57
|
-
|
58
|
-
link = @component.user_link!
|
59
|
-
link.data['privileges'] ||= []
|
60
|
-
link.data['privileges'] += [slug.to_s]
|
61
|
-
link.data['privileges'].uniq!
|
62
|
-
link.save
|
63
|
-
end
|
64
|
-
|
65
|
-
# @param [String] slug
|
66
|
-
def remove_privilege(slug)
|
67
|
-
link = @component.user_link
|
68
|
-
|
69
|
-
return if link.nil?
|
70
|
-
|
71
|
-
link.data['privileges'] ||= []
|
72
|
-
link.data['privileges'] -= [slug.to_s]
|
73
|
-
link.save
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Biovision
|
4
|
-
module Components
|
5
|
-
module Users
|
6
|
-
# Handling user codes for different components
|
7
|
-
class CodeHandler
|
8
|
-
attr_accessor :code
|
9
|
-
|
10
|
-
# @param [Biovision::Components::BaseComponent] component
|
11
|
-
# @param [Code] code
|
12
|
-
def initialize(component, code = nil)
|
13
|
-
@component = component
|
14
|
-
self.code = code
|
15
|
-
end
|
16
|
-
|
17
|
-
def valid?
|
18
|
-
true
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
data/app/models/foreign_site.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Foreign site for external authentication
|
4
|
-
#
|
5
|
-
# Attributes:
|
6
|
-
# slug [string]
|
7
|
-
# name [string]
|
8
|
-
# foreign_users_count [integer]
|
9
|
-
class ForeignSite < ApplicationRecord
|
10
|
-
include RequiredUniqueName
|
11
|
-
include RequiredUniqueSlug
|
12
|
-
|
13
|
-
NAME_LIMIT = 50
|
14
|
-
SLUG_LIMIT = 50
|
15
|
-
|
16
|
-
has_many :foreign_users, dependent: :delete_all
|
17
|
-
|
18
|
-
validates_length_of :name, maximum: NAME_LIMIT
|
19
|
-
validates_length_of :slug, maximum: SLUG_LIMIT
|
20
|
-
|
21
|
-
scope :list_for_administration, -> { ordered_by_name }
|
22
|
-
|
23
|
-
# @param [String] slug
|
24
|
-
def self.[](slug)
|
25
|
-
find_by(slug: slug)
|
26
|
-
end
|
27
|
-
|
28
|
-
# @param [Hash] data
|
29
|
-
# @param [Hash] tracking
|
30
|
-
def authenticate(data, tracking)
|
31
|
-
user = foreign_users.find_by(slug: data[:uid])&.user
|
32
|
-
user || create_user(data, tracking)
|
33
|
-
end
|
34
|
-
end
|
data/app/models/foreign_user.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Foreign user
|
4
|
-
#
|
5
|
-
# Attributes:
|
6
|
-
# agent_id [Agent], optional
|
7
|
-
# created_at [DateTime]
|
8
|
-
# data [jsonb]
|
9
|
-
# foreign_site_id [ForeignSite]
|
10
|
-
# ip_address_id [IpAddress], optional
|
11
|
-
# updated_at [DateTime]
|
12
|
-
# user_id [User]
|
13
|
-
# slug [string]
|
14
|
-
class ForeignUser < ApplicationRecord
|
15
|
-
include HasOwner
|
16
|
-
|
17
|
-
belongs_to :foreign_site
|
18
|
-
belongs_to :user
|
19
|
-
belongs_to :agent
|
20
|
-
belongs_to :ip_address
|
21
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Uploader for user images
|
4
|
-
class UserImageUploader < CarrierWave::Uploader::Base
|
5
|
-
include CarrierWave::MiniMagick
|
6
|
-
include CarrierWave::BombShelter
|
7
|
-
|
8
|
-
storage :file
|
9
|
-
|
10
|
-
def max_pixel_dimensions
|
11
|
-
[4000, 4000]
|
12
|
-
end
|
13
|
-
|
14
|
-
# Override the directory where uploaded files will be stored.
|
15
|
-
# This is a sensible default for uploaders that are meant to be mounted:
|
16
|
-
def store_dir
|
17
|
-
uuid = model&.uuid.to_s
|
18
|
-
slug = "#{uuid[0..2]}/#{uuid[3..5]}/#{uuid[6..7]}/#{uuid}"
|
19
|
-
|
20
|
-
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{slug}"
|
21
|
-
end
|
22
|
-
|
23
|
-
def default_url(*)
|
24
|
-
ActionController::Base.helpers.asset_path('biovision/placeholders/user.svg')
|
25
|
-
end
|
26
|
-
|
27
|
-
process :auto_orient
|
28
|
-
|
29
|
-
def auto_orient
|
30
|
-
manipulate! do |image|
|
31
|
-
image.tap(&:auto_orient)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
version :hd do
|
36
|
-
resize_to_fit(1280, 1280)
|
37
|
-
end
|
38
|
-
|
39
|
-
version :large, from_version: :hd do
|
40
|
-
resize_to_fit(640, 640)
|
41
|
-
end
|
42
|
-
|
43
|
-
version :profile, from_version: :large do
|
44
|
-
resize_to_fit(320, 320)
|
45
|
-
end
|
46
|
-
|
47
|
-
version :preview, from_version: :profile do
|
48
|
-
resize_to_fit(160, 160)
|
49
|
-
end
|
50
|
-
|
51
|
-
version :tiny, from_version: :preview do
|
52
|
-
resize_to_fit(48, 48)
|
53
|
-
end
|
54
|
-
|
55
|
-
def extension_whitelist
|
56
|
-
%w[jpg jpeg png]
|
57
|
-
end
|
58
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<% element_id = "component_privilege_#{slug}_#{entity.user_id}" %>
|
2
|
-
<%=
|
3
|
-
check_box_tag(
|
4
|
-
'user_id',
|
5
|
-
entity.user_id,
|
6
|
-
Array(entity.data['privileges']).include?(slug),
|
7
|
-
data: {
|
8
|
-
url: admin_component_privilege_path(
|
9
|
-
privilege_slug: slug,
|
10
|
-
slug: handler.slug,
|
11
|
-
user_id: entity.user_id
|
12
|
-
)
|
13
|
-
},
|
14
|
-
id: element_id
|
15
|
-
)
|
16
|
-
%>
|
17
|
-
<%=
|
18
|
-
label_tag(
|
19
|
-
element_id,
|
20
|
-
t(
|
21
|
-
"biovision.components.#{handler.slug}.privileges.#{slug}",
|
22
|
-
default: [
|
23
|
-
"biovision.components.common.privileges.#{slug}".to_sym,
|
24
|
-
slug
|
25
|
-
]
|
26
|
-
)
|
27
|
-
)
|
28
|
-
%>
|
@@ -1,40 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
component = Biovision::Components::UsersComponent[current_user]
|
3
|
-
form_id = local_assigns[:form_id]
|
4
|
-
from = local_assigns[:from]
|
5
|
-
%>
|
6
|
-
<%=
|
7
|
-
form_with(
|
8
|
-
url: login_path,
|
9
|
-
html: { class: 'authentication-form', id: form_id }
|
10
|
-
) do
|
11
|
-
%>
|
12
|
-
<dl class="fields">
|
13
|
-
<div>
|
14
|
-
<dt><%= label_tag :login, t('.login') %></dt>
|
15
|
-
<dd>
|
16
|
-
<%=
|
17
|
-
text_field_tag(:login, '', class: 'input-text', required: true)
|
18
|
-
%>
|
19
|
-
</dd>
|
20
|
-
</div>
|
21
|
-
<div>
|
22
|
-
<dt>
|
23
|
-
<%= label_tag :password, t('activerecord.attributes.user.password') %>
|
24
|
-
</dt>
|
25
|
-
<dd>
|
26
|
-
<%=
|
27
|
-
password_field_tag(:password, '', class: 'input-text', required: true)
|
28
|
-
%>
|
29
|
-
</dd>
|
30
|
-
</div>
|
31
|
-
</dl>
|
32
|
-
<div class="actions">
|
33
|
-
<%= hidden_field_tag :from, from unless from.blank? %>
|
34
|
-
<%= hidden_field_tag :form_id, form_id %>
|
35
|
-
<%= button_tag t('.log_in'), class: 'button-primary' %>
|
36
|
-
<% if component.settings['registration_open'] %>
|
37
|
-
<%= link_to t('my.profiles.new.title'), new_my_profile_path, class: 'button-nav' %>
|
38
|
-
<% end %>
|
39
|
-
</div>
|
40
|
-
<% end %>
|
@@ -1,147 +0,0 @@
|
|
1
|
-
<% model_name = entity.class.to_s.underscore %>
|
2
|
-
<%=
|
3
|
-
form_with(
|
4
|
-
model: entity,
|
5
|
-
scope: model_name,
|
6
|
-
url: my_profile_path,
|
7
|
-
class: 'users_registration-form',
|
8
|
-
id: "#{model_name}-form",
|
9
|
-
data: { check_url: check_my_profile_path }
|
10
|
-
) do |f|
|
11
|
-
%>
|
12
|
-
<%=
|
13
|
-
render(
|
14
|
-
partial: 'shared/entity/list_of_errors',
|
15
|
-
locals: { entity: entity }
|
16
|
-
)
|
17
|
-
%>
|
18
|
-
<dl class="fields">
|
19
|
-
<% unless component_handler.settings['email_as_login'] %>
|
20
|
-
<div>
|
21
|
-
<dt>
|
22
|
-
<%= f.label :screen_name, t('activerecord.attributes.user.screen_name') %>
|
23
|
-
</dt>
|
24
|
-
<dd>
|
25
|
-
<%=
|
26
|
-
f.text_field(
|
27
|
-
:screen_name,
|
28
|
-
class: 'input-text',
|
29
|
-
data: { check: :screen_name },
|
30
|
-
maxlength: 30,
|
31
|
-
pattern: '^[-_a-z0-9A-Z]+$',
|
32
|
-
required: true,
|
33
|
-
title: t('.guidelines.screen_name'),
|
34
|
-
)
|
35
|
-
%>
|
36
|
-
<div class="check-result-error" data-field="screen_name"></div>
|
37
|
-
<div class="guideline"><%= t('.guidelines.screen_name') %></div>
|
38
|
-
</dd>
|
39
|
-
</div>
|
40
|
-
<% end %>
|
41
|
-
|
42
|
-
<div>
|
43
|
-
<dt>
|
44
|
-
<%= f.label :email, t('activerecord.attributes.user.email') %>
|
45
|
-
</dt>
|
46
|
-
<dd>
|
47
|
-
<%=
|
48
|
-
f.email_field(
|
49
|
-
:email,
|
50
|
-
class: 'input-text',
|
51
|
-
data: { check: :email },
|
52
|
-
maxlength: User::EMAIL_LIMIT,
|
53
|
-
required: component_handler.settings['require_email'],
|
54
|
-
size: nil
|
55
|
-
)
|
56
|
-
%>
|
57
|
-
<div class="check-result-error" data-field="email"></div>
|
58
|
-
<% unless component_handler.settings['email_as_login'] %>
|
59
|
-
<div class="guideline"><%= t('.guidelines.email') %></div>
|
60
|
-
<% end %>
|
61
|
-
</dd>
|
62
|
-
</div>
|
63
|
-
|
64
|
-
<div>
|
65
|
-
<dt>
|
66
|
-
<%= f.label :password, t('activerecord.attributes.user.password') %>
|
67
|
-
</dt>
|
68
|
-
<dd>
|
69
|
-
<%=
|
70
|
-
f.password_field(
|
71
|
-
:password,
|
72
|
-
class: 'input-text',
|
73
|
-
data: { check: :password },
|
74
|
-
maxlength: 70,
|
75
|
-
required: true,
|
76
|
-
size: nil
|
77
|
-
)
|
78
|
-
%>
|
79
|
-
<div class="check-result-error" data-field="password"></div>
|
80
|
-
<div class="guideline"><%= t('.guidelines.password') %></div>
|
81
|
-
</dd>
|
82
|
-
</div>
|
83
|
-
|
84
|
-
<div>
|
85
|
-
<dt>
|
86
|
-
<%= f.label :password_confirmation, t('activerecord.attributes.user.password_confirmation') %>
|
87
|
-
</dt>
|
88
|
-
<dd>
|
89
|
-
<%=
|
90
|
-
f.password_field(
|
91
|
-
:password_confirmation,
|
92
|
-
class: 'input-text',
|
93
|
-
data: { check: :password_confirmation },
|
94
|
-
maxlength: 70,
|
95
|
-
required: true,
|
96
|
-
size: nil
|
97
|
-
)
|
98
|
-
%>
|
99
|
-
<div class="check-result-error" data-field="password_confirmation"></div>
|
100
|
-
<div class="guideline"><%= t('.guidelines.password_confirmation') %></div>
|
101
|
-
</dd>
|
102
|
-
</div>
|
103
|
-
|
104
|
-
<% if component_handler.settings['use_invites'] %>
|
105
|
-
<div>
|
106
|
-
<dt>
|
107
|
-
<%= label_tag :code, t('.invitation_code') %>
|
108
|
-
</dt>
|
109
|
-
<dd>
|
110
|
-
<%=
|
111
|
-
text_field_tag(
|
112
|
-
:code,
|
113
|
-
param_from_request(:code),
|
114
|
-
class: 'input-text',
|
115
|
-
data: { check: :code },
|
116
|
-
maxlength: Code::BODY_LIMIT,
|
117
|
-
required: component_handler.settings['invite_only'],
|
118
|
-
size: nil
|
119
|
-
)
|
120
|
-
%>
|
121
|
-
<div class="check-result-error" data-field="code"></div>
|
122
|
-
</dd>
|
123
|
-
</div>
|
124
|
-
<% end %>
|
125
|
-
</dl>
|
126
|
-
|
127
|
-
<ul class="flags">
|
128
|
-
<li>
|
129
|
-
<%= f.check_box :consent, id: "#{model_name}_consent", required: true %>
|
130
|
-
<%= f.label :consent, t('.consent') %>
|
131
|
-
</li>
|
132
|
-
<li>
|
133
|
-
<%= f.check_box :allow_mail, id: :user_allow_mail %>
|
134
|
-
<%= f.label :allow_mail, t('activerecord.attributes.user.allow_mail') %>
|
135
|
-
</li>
|
136
|
-
</ul>
|
137
|
-
|
138
|
-
<div class="visually-hidden">
|
139
|
-
<%= check_box_tag :agree, '1', false, tabindex: '-1' %>
|
140
|
-
<%= label_tag :agree, t('.i_am_bot') %>
|
141
|
-
</div>
|
142
|
-
|
143
|
-
<div class="actions">
|
144
|
-
<%= button_tag t('.join'), type: :submit, class: 'button-primary' %>
|
145
|
-
<%#= link_to t('authentication.nav_item.log_in'), login_path, class: 'button-nav' %>
|
146
|
-
</div>
|
147
|
-
<% end %>
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<% prefix = "activerecord.attributes.#{entity.class.to_s.underscore}"%>
|
2
|
-
<div class="toggleable" data-url="<%= url %>">
|
3
|
-
<% entity.class.toggleable_attributes.each do |flag| %>
|
4
|
-
<span class="<%= entity.attributes[flag.to_s] ? 'active' : 'inactive' %>" data-flag="<%= flag %>">
|
5
|
-
<%= t("#{prefix}.#{flag}", default: ["attributes.#{flag}".to_sym, flag.to_s]) %>
|
6
|
-
</span>
|
7
|
-
<% end %>
|
8
|
-
</div>
|