-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from maximehuran/feature/customize-contact-page
Be able to customize contact request page
- Loading branch information
Showing
13 changed files
with
208 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Monsieur Biz' Contact Request plugin for Sylius. | ||
* | ||
* (c) Monsieur Biz <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE.txt | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MonsieurBiz\SyliusContactRequestPlugin\Form\Type; | ||
|
||
use MonsieurBiz\SyliusRichEditorPlugin\Form\Type\RichEditorType; | ||
use MonsieurBiz\SyliusSettingsPlugin\Form\AbstractSettingsType; | ||
use MonsieurBiz\SyliusSettingsPlugin\Form\SettingsTypeInterface; | ||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; | ||
use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
|
||
final class ContactSettingsType extends AbstractSettingsType implements SettingsTypeInterface | ||
{ | ||
/** | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function buildForm(FormBuilderInterface $builder, array $options): void | ||
{ | ||
$this->addWithDefaultCheckbox( | ||
$builder, | ||
'content_before_form', | ||
RichEditorType::class, | ||
[ | ||
'label' => 'monsieurbiz.contact_request.ui.content_before_form', | ||
'required' => false, | ||
] | ||
); | ||
$this->addWithDefaultCheckbox( | ||
$builder, | ||
'content_after_form', | ||
RichEditorType::class, | ||
[ | ||
'label' => 'monsieurbiz.contact_request.ui.content_after_form', | ||
'required' => false, | ||
] | ||
); | ||
$this->addWithDefaultCheckbox( | ||
$builder, | ||
'meta_title', | ||
TextType::class, | ||
[ | ||
'label' => 'monsieurbiz.contact_request.ui.meta_title', | ||
'required' => false, | ||
] | ||
); | ||
$this->addWithDefaultCheckbox( | ||
$builder, | ||
'meta_description', | ||
TextType::class, | ||
[ | ||
'label' => 'monsieurbiz.contact_request.ui.meta_description', | ||
'required' => false, | ||
] | ||
); | ||
$this->addWithDefaultCheckbox( | ||
$builder, | ||
'meta_keywords', | ||
TextType::class, | ||
[ | ||
'label' => 'monsieurbiz.contact_request.ui.meta_keywords', | ||
'required' => false, | ||
] | ||
); | ||
$this->addWithDefaultCheckbox( | ||
$builder, | ||
'hide_sylius_default_content', | ||
CheckboxType::class, | ||
[ | ||
'label' => 'monsieurbiz.contact_request.ui.hide_sylius_default_content', | ||
'required' => false, | ||
] | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
imports: | ||
- { resource: 'resources.yaml' } | ||
- { resource: 'grids/*' } | ||
- { resource: 'monsieurbiz/*.yaml' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
monsieurbiz_sylius_settings: | ||
plugins: | ||
monsieurbiz_contact_request.contact: | ||
vendor_name: Monsieur Biz | ||
plugin_name: monsieurbiz.contact_request.settings.plugin_name | ||
description: monsieurbiz.contact_request.settings.description | ||
icon: phone | ||
use_locales: true | ||
classes: | ||
form: MonsieurBiz\SyliusContactRequestPlugin\Form\Type\ContactSettingsType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{% extends '@SyliusShop/layout.html.twig' %} | ||
|
||
{% form_theme form '@SyliusShop/Form/theme.html.twig' %} | ||
|
||
{% set metaTitle = setting('monsieurbiz_contact_request.contact', 'meta_title')|default('') %} | ||
{% set metaDescription = setting('monsieurbiz_contact_request.contact', 'meta_description')|default('') %} | ||
{% set metaKeywords = setting('monsieurbiz_contact_request.contact', 'meta_keywords')|default('') %} | ||
|
||
{% block title %}{{ metaTitle is not empty ? metaTitle : (('sylius.ui.contact_us'|trans) ~ ' | ' ~ parent()) }}{% endblock %} | ||
|
||
{% block metatags %} | ||
{{ parent() }} | ||
<meta property="og:type" content="page" /> | ||
{% if metaTitle is not empty %} | ||
<meta property="og:title" content="{{ metaTitle }}"/> | ||
{% endif %} | ||
{% if metaDescription is not empty %} | ||
<meta name="description" property="og:description" content="{{ metaDescription }}"/> | ||
{% endif %} | ||
{% if metaKeywords is not empty %} | ||
<meta name="keywords" content="{{ metaKeywords }}"/> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="ui hidden divider"></div> | ||
<div class="ui two column centered stackable grid"> | ||
<div class="column"> | ||
{% set hideSyliusDefaultContent = setting('monsieurbiz_contact_request.contact', 'hide_sylius_default_content')|default(false) %} | ||
{% if not hideSyliusDefaultContent %} | ||
<h1 class="ui header"> | ||
<i class="circular mail icon"></i> | ||
<div class="content"> | ||
{{ 'sylius.ui.contact_us'|trans }} | ||
<div class="sub header">{{ 'sylius.ui.use_the_contact_form_below_to_send_us_a_message'|trans }}</div> | ||
|
||
{{ sylius_template_event('sylius.shop.contact.request.after_content_header') }} | ||
</div> | ||
</h1> | ||
{% endif %} | ||
|
||
{% set contentBeforeForm = setting('monsieurbiz_contact_request.contact', 'content_before_form')|default('') %} | ||
{% if contentBeforeForm is not empty %} | ||
{{ contentBeforeForm|monsieurbiz_richeditor_render_field }} | ||
{% endif %} | ||
|
||
<div class="ui segment"> | ||
{{ form_start(form, {'action': path('sylius_shop_contact_request'), 'attr': {'class': 'ui large loadable form', 'novalidate': 'novalidate'}}) }} | ||
{{ form_row(form.email, sylius_test_form_attribute('contact-email')) }} | ||
{{ form_row(form.message, sylius_test_form_attribute('contact-message')) }} | ||
|
||
{{ sylius_template_event('sylius.shop.contact.request.form', {'form': form}) }} | ||
|
||
{{ form_row(form._token) }} | ||
<button type="submit" class="ui fluid large primary submit button" {{ sylius_test_html_attribute('send-button') }}>{{ 'sylius.ui.send'|trans }}</button> | ||
{{ form_end(form, {'render_rest': false}) }} | ||
</div> | ||
|
||
{% set contentAfterForm = setting('monsieurbiz_contact_request.contact', 'content_after_form')|default('') %} | ||
{% if contentAfterForm is not empty %} | ||
{{ contentAfterForm|monsieurbiz_richeditor_render_field }} | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endblock %} |