mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-13 16:45:18 +08:00
Add promo for forms [SCI-11555]
This commit is contained in:
parent
67dc83d8cf
commit
cdcab6eb6a
5 changed files with 118 additions and 25 deletions
87
app/assets/images/forms/promo.svg
Normal file
87
app/assets/images/forms/promo.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 42 KiB |
|
@ -223,7 +223,7 @@ class FormsController < ApplicationController
|
|||
end
|
||||
|
||||
def check_forms_enabled
|
||||
render_404 unless Form.forms_enabled?
|
||||
render :promo unless Form.forms_enabled?
|
||||
end
|
||||
|
||||
def log_activity(form, type_of, message_items = {})
|
||||
|
|
|
@ -34,7 +34,22 @@ module LeftMenuBarHelper
|
|||
name: t('left_menu_bar.templates'),
|
||||
icon: 'sn-icon-protocols-templates',
|
||||
active: protocols_are_selected? || label_templates_are_selected? || forms_are_selected?,
|
||||
submenu: template_submenu
|
||||
submenu: [
|
||||
{
|
||||
url: forms_path,
|
||||
name: t('left_menu_bar.forms'),
|
||||
active: forms_are_selected?
|
||||
},
|
||||
{
|
||||
url: protocols_path,
|
||||
name: t('left_menu_bar.protocol'),
|
||||
active: protocols_are_selected?
|
||||
}, {
|
||||
url: label_templates_path,
|
||||
name: t('left_menu_bar.label'),
|
||||
active: label_templates_are_selected?
|
||||
}
|
||||
]
|
||||
}, {
|
||||
url: reports_path,
|
||||
name: t('left_menu_bar.reports'),
|
||||
|
@ -91,27 +106,4 @@ module LeftMenuBarHelper
|
|||
def activities_are_selected?
|
||||
controller_name == 'global_activities'
|
||||
end
|
||||
|
||||
def template_submenu
|
||||
submenu = [
|
||||
{
|
||||
url: protocols_path,
|
||||
name: t('left_menu_bar.protocol'),
|
||||
active: protocols_are_selected?
|
||||
}, {
|
||||
url: label_templates_path,
|
||||
name: t('left_menu_bar.label'),
|
||||
active: label_templates_are_selected?
|
||||
}
|
||||
]
|
||||
|
||||
if Form.forms_enabled?
|
||||
submenu.unshift({
|
||||
url: forms_path,
|
||||
name: t('left_menu_bar.forms'),
|
||||
active: forms_are_selected?
|
||||
})
|
||||
end
|
||||
submenu
|
||||
end
|
||||
end
|
||||
|
|
12
app/views/forms/promo.html.erb
Normal file
12
app/views/forms/promo.html.erb
Normal file
|
@ -0,0 +1,12 @@
|
|||
<div class="h-full">
|
||||
<div class="flex items-center justify-center h-full">
|
||||
<div class="w-[489px]">
|
||||
<div class="flex justify-center">
|
||||
<%= image_tag 'forms/promo.svg' %>
|
||||
</div>
|
||||
<div class='promo-text mt-6 flex flex-col gap-7'>
|
||||
<h1 class='m-0'><%= t('forms.promo.promo_title') %></h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1153,6 +1153,8 @@ en:
|
|||
submitted_on: 'Submitted on'
|
||||
not_submitted: 'Not submitted yet'
|
||||
by: 'by'
|
||||
promo:
|
||||
promo_title: 'This feature is disabled by default in open source SciNote'
|
||||
label_templates:
|
||||
types:
|
||||
fluics_label_template: 'Fluics'
|
||||
|
|
Loading…
Add table
Reference in a new issue