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
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# User in ACL group
|
4
|
+
#
|
5
|
+
# Attributes:
|
6
|
+
# created_at [DateTime]
|
7
|
+
# group_id [Group]
|
8
|
+
# updated_at [DateTime]
|
9
|
+
# user_id [User]
|
10
|
+
class UserGroup < ApplicationRecord
|
11
|
+
include HasOwner
|
12
|
+
|
13
|
+
belongs_to :user
|
14
|
+
belongs_to :group, counter_cache: :user_count
|
15
|
+
|
16
|
+
validates_uniqueness_of :group_id, scope: :user_id
|
17
|
+
|
18
|
+
after_create { group.users_changed! }
|
19
|
+
after_destroy { group.users_changed! }
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# ACL role for user
|
4
|
+
#
|
5
|
+
# Attributes:
|
6
|
+
# created_at [DateTime]
|
7
|
+
# inclusive [Boolean]
|
8
|
+
# role_id [Role]
|
9
|
+
# updated_at [DateTime]
|
10
|
+
# user_id [User]
|
11
|
+
class UserRole < ApplicationRecord
|
12
|
+
belongs_to :user
|
13
|
+
belongs_to :role
|
14
|
+
|
15
|
+
validates_uniqueness_of :role_id, scope: :user_id
|
16
|
+
|
17
|
+
after_create { role.count_users! }
|
18
|
+
after_destroy { role.count_users! }
|
19
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Simple file uploader without any processing
|
4
|
+
class SimpleFileUploader < CarrierWave::Uploader::Base
|
5
|
+
storage :file
|
6
|
+
|
7
|
+
def store_dir
|
8
|
+
slug = "#{model.id / 100}/#{model.id}"
|
9
|
+
|
10
|
+
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{slug}"
|
11
|
+
end
|
12
|
+
|
13
|
+
def extension_blacklist
|
14
|
+
%w[
|
15
|
+
htm html action apk app bat bin cmd com command cpl csh exe gadget inf ins
|
16
|
+
inx ipa isu job jse ksh lnk msc msi msp mst osx out paf pif prg ps1 reg
|
17
|
+
rgs run scr sct shb shs u3p vb vbe vbs vbscript workflow ws wsf wsh 0xe
|
18
|
+
73k 89k a6p ac acc acr actm ahk air app arscript as asb awk azw2 beam btm
|
19
|
+
cel celx chm cof crt dek dld dmc docm dotm dxl ear ebm ebs ebs2 ecf eham
|
20
|
+
elf es ex4 exopc ezs fas fky fpi frs fxp gs ham hms hpf hta iim ipf isp
|
21
|
+
jar js jsx kix lo ls mam mcr mel mpx mrc ms ms mxe nexe obs ore otm pex
|
22
|
+
plx potm ppam ppsm pptm prc pvd pwc pyc pyo qpx rbx rox rpj s2a sbs sca
|
23
|
+
scar scb script smm spr tcp thm tlb tms udf upx url vlx vpm wcm widget wiz
|
24
|
+
wpk wpm xap xbap xlam xlm xlsm xltm xqt xys zl9 dmg pkg php rb
|
25
|
+
]
|
26
|
+
end
|
27
|
+
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
# Uploader for universal simple images
|
4
4
|
class SimpleImageUploader < CarrierWave::Uploader::Base
|
5
|
+
include CarrierWave::ImageOptim
|
5
6
|
include CarrierWave::MiniMagick
|
6
7
|
|
7
8
|
storage :file
|
@@ -14,6 +15,17 @@ class SimpleImageUploader < CarrierWave::Uploader::Base
|
|
14
15
|
ActionController::Base.helpers.asset_path('biovision/placeholders/1x1.svg')
|
15
16
|
end
|
16
17
|
|
18
|
+
process :auto_orient
|
19
|
+
process optimize: [{ jpegoptim: true, optipng: true, svgo: true }]
|
20
|
+
|
21
|
+
def auto_orient
|
22
|
+
return unless raster?
|
23
|
+
|
24
|
+
manipulate! do |image|
|
25
|
+
image.tap(&:auto_orient)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
17
29
|
version :hd, if: :raster_image? do
|
18
30
|
resize_to_fit(1920, 1920)
|
19
31
|
end
|
@@ -34,6 +46,10 @@ class SimpleImageUploader < CarrierWave::Uploader::Base
|
|
34
46
|
resize_to_fit(160, 160)
|
35
47
|
end
|
36
48
|
|
49
|
+
version :tiny, from_version: :preview, if: :raster_image? do
|
50
|
+
resize_to_fit(48, 48)
|
51
|
+
end
|
52
|
+
|
37
53
|
# Add a white list of extensions which are allowed to be uploaded.
|
38
54
|
# For images you might use something like this:
|
39
55
|
def extension_whitelist
|
@@ -62,6 +78,10 @@ class SimpleImageUploader < CarrierWave::Uploader::Base
|
|
62
78
|
!File.extname(path).match?(/\.svgz?\z/i)
|
63
79
|
end
|
64
80
|
|
81
|
+
def tiny_url
|
82
|
+
raster? ? tiny.url : url
|
83
|
+
end
|
84
|
+
|
65
85
|
def preview_url
|
66
86
|
raster? ? preview.url : url
|
67
87
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
json.data do
|
2
|
+
json.id entity.id
|
3
|
+
json.type entity.class.table_name
|
4
|
+
json.attributes do
|
5
|
+
json.call(entity, :uuid, :caption, :image_alt_text, :source_name, :source_link, :object_count)
|
6
|
+
end
|
7
|
+
json.meta do
|
8
|
+
json.name entity.name
|
9
|
+
json.size number_to_human_size(entity.file_size)
|
10
|
+
json.object_count t(:object_count, count: entity.object_count)
|
11
|
+
json.url do
|
12
|
+
json.preview entity.image.preview_url
|
13
|
+
json.small entity.image.small_url
|
14
|
+
json.medium entity.image.medium_url
|
15
|
+
json.hd entity.image.hd_url
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
json.partial! 'image', locals: { entity: @entity }
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<li><%= render 'admin/navigation_groups/nav_item' %></li>
|
2
|
+
<li><%= render 'admin/dynamic_blocks/nav_item' %></li>
|
3
|
+
<li><%= render 'admin/dynamic_pages/nav_item' %></li>
|
4
|
+
<%=
|
5
|
+
render(
|
6
|
+
partial: 'admin/components/links/extra/content',
|
7
|
+
locals: { handler: handler }
|
8
|
+
)
|
9
|
+
%>
|
@@ -1,11 +1,4 @@
|
|
1
|
-
|
2
|
-
<!-- <li><%#= render 'admin/users/nav_item' %></li>-->
|
3
|
-
<!-- <li><%#= render 'admin/foreign_users/nav_item' %></li>-->
|
4
|
-
<% end %>
|
5
|
-
<% if handler.administrator? %>
|
1
|
+
<li><%= render 'admin/users/nav_item' %></li>
|
6
2
|
<!-- <li><%#= render 'admin/login_attempts/nav_item' %></li>-->
|
7
3
|
<!-- <li><%#= render 'admin/tokens/nav_item' %></li>-->
|
8
|
-
<% end %>
|
9
|
-
<% if handler.allow?('manage_codes') %>
|
10
4
|
<!-- <li><%#= render 'admin/codes/nav_item' %></li>-->
|
11
|
-
<% end %>
|
File without changes
|
@@ -14,22 +14,4 @@
|
|
14
14
|
%>
|
15
15
|
<%= label_tag(element_id, t('activerecord.attributes.biovision_component_user.administrator')) %>
|
16
16
|
</li>
|
17
|
-
<%
|
18
|
-
privilege_names = handler.class.privilege_names
|
19
|
-
privilege_names.unshift('settings') if handler.use_settings?
|
20
|
-
%>
|
21
|
-
<% privilege_names.each do |privilege_slug| %>
|
22
|
-
<li>
|
23
|
-
<%=
|
24
|
-
render(
|
25
|
-
partial: 'admin/components/privileges/privilege_flag',
|
26
|
-
locals: {
|
27
|
-
entity: entity,
|
28
|
-
handler: handler,
|
29
|
-
slug: privilege_slug
|
30
|
-
}
|
31
|
-
)
|
32
|
-
%>
|
33
|
-
</li>
|
34
|
-
<% end %>
|
35
17
|
</ul>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
>
|
5
5
|
<h2><%= t('.heading') %></h2>
|
6
6
|
|
7
|
-
<dl>
|
7
|
+
<dl class="fields">
|
8
8
|
<div>
|
9
9
|
<dt><%= label_tag(:new_parameter_slug, t('.parameter_slug')) %></dt>
|
10
10
|
<dd>
|
@@ -13,6 +13,7 @@
|
|
13
13
|
:slug,
|
14
14
|
'',
|
15
15
|
autocomplete: :off,
|
16
|
+
class: 'input-text',
|
16
17
|
id: :new_parameter_slug,
|
17
18
|
maxlength: 50,
|
18
19
|
pattern: BiovisionComponent::SLUG_PATTERN_HTML,
|
@@ -32,6 +33,7 @@
|
|
32
33
|
:value,
|
33
34
|
'',
|
34
35
|
autocomplete: :off,
|
36
|
+
class: 'input-text',
|
35
37
|
id: :new_parameter_value,
|
36
38
|
maxlength: 255,
|
37
39
|
size: nil
|
@@ -42,5 +44,5 @@
|
|
42
44
|
</div>
|
43
45
|
</dl>
|
44
46
|
|
45
|
-
<%= button_tag(t(:save), class: 'button-save', type: :button) %>
|
47
|
+
<%= button_tag(t(:save), class: 'button button-save', type: :button) %>
|
46
48
|
</section>
|
@@ -4,14 +4,20 @@
|
|
4
4
|
>
|
5
5
|
<h2><%= t('.heading') %></h2>
|
6
6
|
|
7
|
-
<dl>
|
7
|
+
<dl class="fields">
|
8
8
|
<% parameters.each do |parameter, value| %>
|
9
9
|
<% element_id = "parameter-#{parameter}" %>
|
10
10
|
<div>
|
11
11
|
<dt><%= label_tag(element_id, parameter) %></dt>
|
12
12
|
<dd>
|
13
13
|
<%=
|
14
|
-
text_field_tag(
|
14
|
+
text_field_tag(
|
15
|
+
parameter,
|
16
|
+
value,
|
17
|
+
autocomplete: :off,
|
18
|
+
class: 'input-text',
|
19
|
+
id: element_id
|
20
|
+
)
|
15
21
|
%>
|
16
22
|
</dd>
|
17
23
|
</div>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
json.data do
|
2
|
+
json.id @entity.id
|
3
|
+
json.type @entity.class.table_name
|
4
|
+
json.attributes do
|
5
|
+
json.call(@entity, :user_id, :data)
|
6
|
+
end
|
7
|
+
json.relationships do
|
8
|
+
json.user do
|
9
|
+
json.data do
|
10
|
+
json.id @entity.user.id
|
11
|
+
json.type @entity.user.class.table_name
|
12
|
+
json.attributes do
|
13
|
+
json.call(@entity.user, :screen_name)
|
14
|
+
end
|
15
|
+
json.meta do
|
16
|
+
json.full_name @entity.user.full_name
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%= form_with(**Biovision::Components::BaseComponent.form_options(entity)) do |f| %>
|
2
|
+
<%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
|
3
|
+
|
4
|
+
<dl class="fields">
|
5
|
+
<%= render partial: 'shared/forms/text_field', locals: { f: f, field: :slug } %>
|
6
|
+
<%= render partial: 'shared/forms/text_area', locals: { f: f, field: :body } %>
|
7
|
+
<%= render partial: 'shared/forms/entity_flags', locals: { f: f } %>
|
8
|
+
</dl>
|
9
|
+
|
10
|
+
<%= render 'shared/forms/state_container' %>
|
11
|
+
|
12
|
+
<div class="buttons">
|
13
|
+
<%= hidden_field_tag :entity_id, entity.id %>
|
14
|
+
<%= f.button t(:save), class: 'button button-save' %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% content_for :meta_title, t('.title') %>
|
2
|
+
<% content_for :breadcrumbs do %>
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<span><%= t('admin.dynamic_blocks.nav_item.text') %></span>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<article>
|
8
|
+
<h1><%= t('.heading') %></h1>
|
9
|
+
|
10
|
+
<nav class="entity-actions">
|
11
|
+
<%= create_icon(new_admin_dynamic_block_path) %>
|
12
|
+
</nav>
|
13
|
+
|
14
|
+
<%= render partial: 'shared/admin/list', locals: { collection: @collection } %>
|
15
|
+
</article>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<% content_for :meta_title, t('.title', slug: @entity.slug) %>
|
2
|
+
<% content_for :breadcrumbs do %>
|
3
|
+
<%= admin_biovision_component_link(component_handler.component) %>
|
4
|
+
<%= link_to(t('admin.dynamic_blocks.nav_item.text'), admin_dynamic_blocks_path) %>
|
5
|
+
<span><%= @entity.slug %></span>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<article>
|
9
|
+
<h1><%= @entity.class.model_name.human %> <q><%= @entity.slug %></q></h1>
|
10
|
+
|
11
|
+
<nav class="entity-actions">
|
12
|
+
<%= edit_icon(@entity) %>
|
13
|
+
<%= destroy_icon(@entity) %>
|
14
|
+
</nav>
|
15
|
+
|
16
|
+
<dl class="fields">
|
17
|
+
<%= render partial: 'shared/entity/slug', locals: { entity: @entity } %>
|
18
|
+
<%= render partial: 'shared/entity/text_field', locals: { entity: @entity, field: :body } %>
|
19
|
+
<%= render partial: 'shared/entity/timestamps', locals: { entity: @entity } %>
|
20
|
+
</dl>
|
21
|
+
|
22
|
+
<%= render(partial: 'shared/admin/toggle', locals: { entity: @entity }) %>
|
23
|
+
</article>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<%= form_with(**Biovision::Components::BaseComponent.form_options(entity)) do |f| %>
|
2
|
+
<%= render partial: 'shared/list_of_errors', locals: { entity: entity } %>
|
3
|
+
|
4
|
+
<dl class="fields">
|
5
|
+
<%= render partial: 'shared/forms/text_field', locals: { f: f, field: :slug } %>
|
6
|
+
<%= render partial: 'shared/forms/language', locals: { f: f } %>
|
7
|
+
<%= render partial: 'shared/forms/text_field', locals: { f: f, field: :name } %>
|
8
|
+
<%= render partial: 'shared/forms/text_field', locals: { f: f, field: :url } %>
|
9
|
+
<%= render partial: 'shared/forms/simple_image', locals: { f: f } %>
|
10
|
+
<%= render partial: 'shared/forms/text_area', locals: { f: f, field: :body } %>
|
11
|
+
<%= render partial: 'shared/forms/entity_flags', locals: { f: f } %>
|
12
|
+
<%= render partial: 'shared/forms/meta_texts', locals: { f: f } %>
|
13
|
+
</dl>
|
14
|
+
|
15
|
+
<%= render 'shared/forms/state_container' %>
|
16
|
+
|
17
|
+
<div class="buttons">
|
18
|
+
<%= hidden_field_tag :entity_id, entity.id %>
|
19
|
+
<%= f.button t(:save), class: 'button button-save' %>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<figure class="image"><%= simple_image_preview(entity) %></figure>
|
2
|
+
<div class="data">
|
3
|
+
<div><%= admin_entity_link(entity) %></div>
|
4
|
+
<% unless entity.name.blank? %>
|
5
|
+
<div class="info"><%= entity.name %></div>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<%= render(partial: 'shared/admin/toggle', locals: { entity: entity }) %>
|
9
|
+
|
10
|
+
<div class="entity-actions">
|
11
|
+
<%= world_icon(entity) unless entity.url.blank? %>
|
12
|
+
<%= edit_icon(entity) %>
|
13
|
+
<%= destroy_icon(entity) %>
|
14
|
+
</div>
|
15
|
+
</div>
|