diff --git a/lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php b/lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php index f9794112a8..904a261a90 100644 --- a/lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php +++ b/lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php @@ -56,6 +56,12 @@ class GeneralFormType extends AbstractType 'attr' => ['min' => -1], 'constraints' => new GreaterThanOrEqual(['value' => -1]), ]); + $builder->add('personalize-logo-choice', new PersonalisationLogoForm(), [ + 'label' => 'Design of personalization logo section', + 'attr' => [ + 'id' => 'personalize-logo-container' + ] + ]); } public function getName() diff --git a/lib/Alchemy/Phrasea/Form/Configuration/PersonalisationLogoForm.php b/lib/Alchemy/Phrasea/Form/Configuration/PersonalisationLogoForm.php new file mode 100644 index 0000000000..eb9f7eae07 --- /dev/null +++ b/lib/Alchemy/Phrasea/Form/Configuration/PersonalisationLogoForm.php @@ -0,0 +1,44 @@ +add('originalChoiceInput', 'choice', [ + 'label' => false, + 'choices' => ['original' => 'original-choice-label'], + 'expanded' => true, + + ]); + $builder->add('personaliseChoiceInput', 'choice', [ + 'label' => false, + 'choices' => ['personalise' => 'personalise-choice-label'], + 'expanded' => true, + + ]); + $builder->add('personalizeLogoInput', 'file', [ + 'label' => false, + ]); + $builder->add('logoChoice', 'hidden', [ + 'label' => false, + ]); + } + + public function getName() + { + return null; + } +} \ No newline at end of file diff --git a/resources/www/admin/styles/main.scss b/resources/www/admin/styles/main.scss index 1ee2799b96..eb2052db1e 100644 --- a/resources/www/admin/styles/main.scss +++ b/resources/www/admin/styles/main.scss @@ -763,6 +763,87 @@ span.simplecolorpicker.picker { } } +.personalise-logo-row-container { + height: 105px; + td:first-child { + border-right: 1px solid #3b99fc; + } + td { + padding: 4px 40px 10px 40px; + min-width: 100px; + max-width: 200px; + vertical-align: top; + input[type="radio"] { + height: 25px; + margin: 0; + } + label { + display: inline-block; + line-height: 25px; + margin-left: 10px; + } + .image-container { + height: 42px; + width: 52px; + border: 1px solid #979797; + display: block; + } + img { + width: 100%; + height: 100%; + object-fit: scale-down; + } + a { + font-family: Roboto; + font-size: 10px; + font-weight: normal; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + color: #3b99fc; + text-align: left; + display: block; + margin-top: 10px; + } + #select-logo-btn { + border-radius: 5px; + box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.09); + background-color: #ffffff; + border: solid 1px #c3c3c3; + font-family: Roboto; + font-size: 11px; + text-align: left; + color: #000000; + margin-top: 10px; + padding: 3px 20px; + line-height: 11px; + margin-left: 0; + } + #help-text { + font-family: Roboto; + font-size: 12px; + line-height: 1.33; + letter-spacing: normal; + text-align: left; + color: #000000; + } + #error-text { + font-family: Roboto; + font-size: 12px; + font-weight: normal; + font-style: italic; + line-height: 1.33; + letter-spacing: normal; + text-align: left; + color: #ff0404; + } + input[type="file"] { + display: none; + } + } +} + @media screen and (max-width: 1150px) { .langTab { display: block; diff --git a/templates/web/admin/personalisation_logo.html.twig b/templates/web/admin/personalisation_logo.html.twig new file mode 100644 index 0000000000..4224814a32 --- /dev/null +++ b/templates/web/admin/personalisation_logo.html.twig @@ -0,0 +1,124 @@ + + + + + + {{ form_widget(form.logoChoice) }} +
+ {{ form_widget(form.originalChoiceInput, { 'attr': {'class': 'choice-radio'} }) }} +
+ gabari +
+ {{ 'prod::setup: download gabari' | trans }} +
+ {{ form_widget(form.personaliseChoiceInput) }} + {{ 'prod::setup: help text' | trans }} + +
+ +
+
+ {{ form_widget(form.personalizeLogoInput) }} + +
+
+ + + + diff --git a/templates/web/admin/setup.html.twig b/templates/web/admin/setup.html.twig index 020cc46753..098c35625c 100644 --- a/templates/web/admin/setup.html.twig +++ b/templates/web/admin/setup.html.twig @@ -30,24 +30,37 @@ - -{{ form_start(form, {'method': 'POST', 'action' : path('setup_display_globals'), 'attr': {'class' : 'form-horizontal'}}) }} +{{ form_start(form, {'method': 'POST', 'action' : path('setup_display_globals'), 'attr': {'class' : 'form-horizontal', 'id': 'setupForm'}}) }} {{ form_errors(form) }} {% for daform in form %} {% if daform.vars['label'] != null %}
{{ daform.vars['label'] }} {% for formdata in daform %} -
- {{ form_errors(formdata) }} - {{ form_label(formdata, null, { 'label_attr': {'class' : 'control-label'} } ) }} -
- {{ form_widget(formdata, {'attr': {'class': 'input-xxlarge'}}) }} -
+ {% if formdata.vars['attr'] is defined and formdata.vars['attr']['id'] is defined + and formdata.vars['attr']['id'] == 'personalize-logo-container' %} +
+ {{ form_errors(formdata) }} + {{ form_label(formdata, null, { 'label_attr': {'class' : 'control-label'} } ) }} +
+ {% include 'admin/personalisation_logo.html.twig' with {'form': formdata} %} +
-
{{ formdata.vars['help_message'] }}
- {{ form_rest(formdata) }} -
+
{{ formdata.vars['help_message'] }}
+ {{ form_rest(formdata) }} +
+ {% else %} +
+ {{ form_errors(formdata) }} + {{ form_label(formdata, null, { 'label_attr': {'class' : 'control-label'} } ) }} +
+ {{ form_widget(formdata, {'attr': {'class': 'input-xxlarge'}}) }} +
+ +
{{ formdata.vars['help_message'] }}
+ {{ form_rest(formdata) }} +
+ {% endif %} {% endfor %} {{ form_rest(daform) }}
@@ -66,7 +79,8 @@
- +
{{ form_end(form) }}