app/template/default/Contact/index.twig line 1

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% form_theme form 'Form/form_div_layout.twig' %}
  3. {% block stylesheet %}
  4.     <link rel="stylesheet" href="{{ asset('assets/css/contact.css', 'user_data') }}" />
  5. {% endblock %}
  6. {% block javascript %}
  7.     <script src="//yubinbango.github.io/yubinbango/yubinbango.js" charset="UTF-8"></script>
  8.     <script>
  9.         // 郵便番号が入力されたら、都道府県のプルダウンの文字カラーを変更する
  10.         document.getElementById('contact_postal_code').addEventListener('blur', function() {
  11.             var pref_code = document.getElementById('contact_address_pref').value;
  12.             if ( pref_code ) {
  13.                 document.getElementById('contact_address_pref').style.color = '#000';
  14.             }
  15.         });
  16.         const contactAddressPref = document.getElementById('contact_address_pref');
  17.         if (contactAddressPref) {
  18.             const value = contactAddressPref.value;
  19.             if (value !== "") {
  20.                 contactAddressPref.style.color = '#000';
  21.             }
  22.         }
  23.     </script>
  24. {% endblock javascript %}
  25. {% block main %}
  26.     <div class="common-bg">
  27.         {{ include('@admin/alert.twig') }}
  28.         <div class="content__wrapper">
  29.             <form method="post" action="{{ url('contact') }}" class="h-adr" novalidate>
  30.                 <span class="p-country-name" style="display:none;">Japan</span>
  31.                 {{ form_widget(form._token) }}
  32.                 <section class="contact">
  33.                     <h1 class="h__ttl02">{{ 'お問い合わせ'|trans }}</h1>
  34.                     <div class="contact__txt content__txt">
  35.                         {{ '内容によっては回答をさしあげるのにお時間をいただくこともございます。
  36. また、休業日は翌営業日以降の対応となりますのでご了承ください。
  37. '|trans|nl2br }}
  38.                     </div>
  39.                     <div class="contact__item__wrap">
  40.                         <div class="contact__item">
  41.                             <p class="contact__label">
  42.                                 <span class="contact__required">必須</span>お名前
  43.                             </p>
  44.                             <div class="contact__name{{ has_errors(form.name.name01, form.name.name02) ? ' error' }}">
  45.                                 {{ form_widget(form.name.name01, {'attr': { 'placeholder': '姓', 'class': 'contact__input' }}) }}
  46.                                 {{ form_widget(form.name.name02, {'attr': { 'placeholder': '名', 'class': 'contact__input' }}) }}
  47.                             </div>
  48.                         </div>
  49.                         <div class="contact__item">
  50.                             <p class="contact__label">
  51.                                 <span class="contact__sub-required">任意</span>お名前(フリガナ)
  52.                             </p>
  53.                             <div class="contact__name{{ has_errors(form.kana.kana01, form.kana.kana02) ? ' error' }}">
  54.                                 {{ form_widget(form.kana.kana01, {'attr': { 'placeholder': 'セイ', 'class': 'contact__input' }}) }}
  55.                                 {{ form_widget(form.kana.kana02, {'attr': { 'placeholder': 'メイ', 'class': 'contact__input' }}) }}
  56.                             </div>
  57.                         </div>
  58.                         <div class="contact__item">
  59.                             <input type="hidden" class="p-country-name" value="Japan">
  60.                             <p class="contact__label"><span class="contact__sub-required">任意</span>ご住所</p>
  61.                             <div class="{{ has_errors(form.postal_code) ? ' error' }}">
  62.                                 {{ form_widget(form.postal_code, {'attr': { 'placeholder': '郵便番号(例:1234567)', 'class': 'contact__input contact__small-input p-postal-code' }}) }}
  63.                             </div>
  64.                             <div class="form__input quantity{{ has_errors(form.address.pref) ? ' error' }}">
  65.                                 {{ form_widget(form.address.pref, {'attr': { 'class': 'contact__input is-empty contact__small-input contact__select p-region-id', 'onchange': 'changeColor(this)' }}) }}
  66.                             </div>
  67.                             <div class="contact__small-input contact__small-input02{{ has_errors(form.address.addr01) ? ' error' }}">
  68.                                 {{ form_widget(form.address.addr01, { 'attr': { 'placeholder': '市区町村名(例:大阪府大阪市福島区)', 'class': 'contact__input p-locality p-street-address' }}) }}
  69.                             </div>
  70.                             <div class="contact__small-input contact__small-input02 contact__small-input03{{ has_errors(form.address.addr02) ? ' error' }}">
  71.                                 {{ form_widget(form.address.addr02,  { 'attr': { 'placeholder': '番地・ビル名(福島1丁目3-15)', 'class': 'contact__input  p-extended-address' }}) }}
  72.                             </div>
  73.                         </div>
  74.                         <div class="contact__item">
  75.                             <p class="contact__label"><span class="contact__sub-required">任意</span>電話番号</p>
  76.                             <div class="{{ has_errors(form.phone_number) ? ' error' }}">
  77.                                 {{ form_widget(form.phone_number,  { 'attr': { 'placeholder': '012-345-6789', 'class': 'contact__input' }}) }}
  78.                             </div>
  79.                         </div>
  80.                         <div class="contact__item">
  81.                             <p class="contact__label"><span class="contact__required">必須</span>メールアドレス</p>
  82.                             <div class="{{ has_errors(form.email) ? ' error' }}">
  83.                                 {{ form_widget(form.email,  { 'attr': { 'placeholder': 'nihon_taro@nihon.co.jp', 'class': 'contact__input' }}) }}
  84.                             </div>
  85.                         </div>
  86.                         <div class="contact__item">
  87.                             <p class="contact__label"><span class="contact__required">必須</span>お問い合わせ内容</p>
  88.                             <div class="{{ has_errors(form.contents) ? ' error' }}">
  89.                                 {{ form_widget(form.contents,  { 'attr': { 'class': 'contact__textarea recruit__textarea' }}) }}
  90.                             </div>
  91.                         </div>
  92.                         {# エンティティ拡張の自動出力 #}
  93.                         {% for f in form|filter(f => f.vars.eccube_form_options.auto_render) %}
  94.                             {% if f.vars.eccube_form_options.form_theme %}
  95.                                 {% form_theme f f.vars.eccube_form_options.form_theme %}
  96.                                 {{ form_row(f) }}
  97.                             {% else %}
  98.                                 <dl>
  99.                                     <dt>
  100.                                         {% set label_class =  f.vars.label_attr.class is defined ? f.vars.label_attr.class : '' %}
  101.                                         {{ form_label(f, f.vars.label, { 'label_attr': {'class': label_class ~ ' ec-label' }}) }}
  102.                                     </dt>
  103.                                     <dd>
  104.                                         <div class="{{ f.vars.eccube_form_options.style_class }}{{ has_errors(f) ? ' error' }}">
  105.                                             {{ form_widget(f) }}
  106.                                             {{ form_errors(f) }}
  107.                                         </div>
  108.                                     </dd>
  109.                                 </dl>
  110.                             {% endif %}
  111.                         {% endfor %}
  112.                     </div>
  113.                     <div class="contact__under__txt">※{{ 'ご注文に関するお問い合わせには、必ず「ご注文番号」をご記入くださいますようお願いいたします。'|trans }}</div>
  114.                     <div class="common__btn">
  115.                         <button type="submit" name="mode" value="confirm" class="common__btn__inner">{{ '入力した内容の確認画面へ'|trans }}</button>
  116.                     </div>
  117.                 </section>
  118.             </form>
  119.         </div>
  120.     </div>
  121. {% endblock %}