src/Eccube/Resource/template/default/Entry/index.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% extends 'default_frame.twig' %}
  9. {% set body_class = 'registration_page' %}
  10. {% form_theme form 'Form/form_div_layout.twig' %}
  11. {% block stylesheet %}
  12. <style>
  13. .attention-modal {
  14.     display: none;
  15. }
  16. .attention-modal.is-active {
  17.     display: block;
  18. }
  19. .attention-modal {
  20.     width: 100%;
  21.     height: 100%;
  22.     position: fixed;
  23.     top: 0;
  24.     left: 0;
  25.     z-index: 999;
  26. }
  27. .attention-modal-overlay {
  28.     display: flex;
  29.     justify-content: center;
  30.     align-items: center;
  31.     width: 100%;
  32.     height: 100%;
  33. }
  34. .attention-modal .modal-layer-mask {
  35.     background-color: rgba(0, 0, 0, 0.3);
  36.     width: 100%;
  37.     height: 100vh;
  38.     z-index: 5;
  39. }
  40. .attention-modal-inner {
  41.     display: flex;
  42.     flex-flow: column;
  43.     justify-content: center;
  44.     align-items: center;
  45.     background: #eee;
  46.     border-radius: 6px;
  47.     padding: 30px 10px;
  48.     text-align: center;
  49.     width: 100%;
  50.     max-width: 520px;
  51.     position: absolute;
  52.     z-index: 10;
  53. }
  54. .attention-modal-text {
  55.     font-size: 16px;
  56.     font-weight: 600;
  57.     line-height: 1.6;
  58.     margin: 0 0 20px;
  59. }
  60. .attention-modal-text strong {
  61.     color: #DE5D50;
  62. }
  63. .checked-attention {
  64.     display: inline-block;
  65.     font-weight: 300;
  66.     margin: 0 0 35px;
  67. }
  68. .checkbox-button-wrap {
  69.     text-align: end;
  70. }
  71. .checkbox-button-wrap button {
  72.     border-radius: 3px;
  73.     border: none;
  74.     color: #fff;
  75.     display: inline-block;
  76.     font-weight: 600;
  77.     padding: 15px 25px;
  78. }
  79. .attention-modal-return {
  80.     background: #525263;
  81.     margin: 0 20px 0 0 ;
  82. }
  83. .attention-modal-move {
  84.     background-color: #e28e86;
  85.     pointer-events: none;
  86. }
  87. .attention-modal-move.is-move {
  88.     background: #DE5D50;
  89.     pointer-events: unset;
  90. }
  91. @media screen and (max-width: 480px) {
  92.     .attention-modal-inner {
  93.         padding: 25px 10px;
  94.         width: 95%;
  95.     }
  96.     .attention-modal-text {
  97.         font-size: 14px;
  98.     }
  99.     .checked-attention {
  100.         font-size: 12px;
  101.     }
  102. }
  103. </style>
  104. {% endblock stylesheet %}
  105. {% block javascript %}
  106.     <script src="//yubinbango.github.io/yubinbango/yubinbango.js" charset="UTF-8"></script>
  107.     <script>
  108.     validatePostalCode = (postal_codes) =>
  109.     {
  110.         const validate_postal_code = document.getElementById('entry_postal_code')
  111.         let array_postal_code = postal_codes
  112.             .replace(/,+$/, '').split(',')
  113.             .map((val) => val.replace(/-|\s+/g, ''))
  114.             .filter((empty) => {return empty !== ''})
  115.             console.log(array_postal_code)
  116.             console.log('郵便番号_登録数:' + array_postal_code.length + '件')
  117.         matchPostalCode = (input_val) =>
  118.         {
  119.             document.querySelector('.ec-registerRole__actions').remove()
  120.             alert('〒'+input_val+':'+'住⺠票住所が当⾃治体に該当する⽅は本サービスをご利⽤いただけません。')
  121.             location.href = '/'
  122.         }
  123.         changePostalCode = () =>
  124.         {
  125.             const input_val = validate_postal_code.value.replace(/-/, '')
  126.             array_postal_code.some(array_val => {
  127.                 if(input_val.match(array_val)) {
  128.                     console.log('該当しました')
  129.                     matchPostalCode(input_val)
  130.                     return true
  131.                 }
  132.                 console.log('該当はありませんでした')
  133.             })
  134.         }
  135.         validate_postal_code.value ?
  136.         changePostalCode() : console.log('郵便番号フォームは未入力の状態です');
  137.         validate_postal_code.addEventListener('change', changePostalCode)
  138.     }
  139.     setAttentionModal = () =>
  140.     {
  141.         const attention_modal = document.getElementById('attention_modal')
  142.         const register_move = document.querySelector('.attention-modal-move')
  143.         const register_return = document.querySelector('.attention-modal-return')
  144.         let move_checkbox = document.getElementById('checked_attention')
  145.             move_checkbox.checked = false
  146.         !document.querySelector('.ec-errorMessage') ?
  147.         attention_modal.classList.add('is-active') : console.log('モーダル非表示');
  148.         move_checkbox.addEventListener('change',() => register_move.classList.toggle('is-move'))
  149.         register_move.addEventListener('click',() => attention_modal.remove())
  150.         register_return.addEventListener('click',() => {
  151.             window.history.length > 2 ?
  152.             window.history.back() : location.href = '/';
  153.         })
  154.     }
  155.     document.addEventListener('DOMContentLoaded', () =>
  156.     {
  157.         const postal_codes = '{{BaseInfo.message}}'
  158.         postal_codes ?
  159.         validatePostalCode(postal_codes) : console.log('郵便番号データの登録はありません');
  160.         !document.getElementById('entry_user_policy_check').checked ?
  161.         setAttentionModal() : console.log('モーダル非表示');
  162.     })
  163.     </script>
  164. {% endblock javascript %}
  165. {% block main %}
  166.     <div id="attention_modal" class="attention-modal">
  167.         <div class="attention-modal-overlay">
  168.             <div class="modal-layer-mask"></div>
  169.             <div class="attention-modal-inner">
  170.                 <p class="attention-modal-text">
  171.                     住⺠票に記載された⾃治体に寄付をする場合、<br><strong>「お礼の品」を受け取ることはできません。</strong><br><br>
  172.                     誠に恐れ⼊りますが、<br>本サービスでは<strong>住⺠票住所が当⾃治体に該当する⽅</strong>の<br>
  173.                     会員登録をお断りさせて頂いております。<br>何卒ご理解のほどよろしくお願いいたします。
  174.                 </p>
  175.                 <div class="attention-checkbox">
  176.                     <input type="checkbox" id="checked_attention" name="checked-attention">
  177.                     <label for="checked-attention" class="checked-attention">記載事項をご確認の上、会員登録へお進みください</label>
  178.                     <div class="checkbox-button-wrap">
  179.                         <button class="attention-modal-return">戻る</button>
  180.                         <button class="attention-modal-move">会員登録へ進む</button>
  181.                     </div>
  182.                 </div>
  183.             </div>
  184.         </div>
  185.     </div>
  186.     <div class="ec-registerRole ec-entry-wrap">
  187.         <div class="ec-pageHeader">
  188.             <h1>{{ '新規会員登録'|trans }}</h1>
  189.         </div>
  190.         <div class="ec-off1Grid">
  191.             <div class="ec-off1Grid__cell">
  192.                 <h2 class="ec-entry-title">寄付者情報の入力</h2>
  193.                 <p class="ec-entry-desc">こちらの入力内容は、お申込み時に反映されます。</p>
  194.                 <form method="post" action="{{ url('entry') }}" novalidate class="h-adr">
  195.                     <span class="p-country-name" style="display:none;">Japan</span>
  196.                     {{ form_widget(form._token) }}
  197.                     <div class="ec-borderedDefs">
  198.                         <dl>
  199.                             <dt>
  200.                                 {{ form_label(form.name, 'お名前', { 'label_attr': { 'class': 'ec-label' }}) }}
  201.                                 <p class="emphasis">※控除を受ける方のお名前をご入力ください。</p>
  202.                                 <p class="emphasis">住民票の情報と異なる場合、寄付金控除の対象外となる可能性があります。</p>
  203.                             </dt>
  204.                             <dd>
  205.                                 <div class="ec-halfInput{{ has_errors(form.name.name01, form.name.name02) ? ' error'}}">
  206.                                     {{ form_widget(form.name.name01, { 'attr': { 'placeholder': '姓' }}) }}
  207.                                     {{ form_widget(form.name.name02, { 'attr': { 'placeholder': '名' }}) }}
  208.                                     {{ form_errors(form.name.name01) }}
  209.                                     {{ form_errors(form.name.name02) }}
  210.                                 </div>
  211.                             </dd>
  212.                         </dl>
  213.                         <dl>
  214.                             <dt>
  215.                                 {{ form_label(form.kana, 'お名前(カナ)', { 'label_attr': { 'class': 'ec-label' }}) }}
  216.                             </dt>
  217.                             <dd>
  218.                                 <div class="ec-halfInput{{ has_errors(form.kana.kana01, form.kana.kana02) ? ' error'}}">
  219.                                     {{ form_widget(form.kana.kana01, { 'attr': { 'placeholder': 'セイ' }}) }}
  220.                                     {{ form_widget(form.kana.kana02, { 'attr': { 'placeholder': 'メイ' }}) }}
  221.                                     {{ form_errors(form.kana.kana01) }}
  222.                                     {{ form_errors(form.kana.kana02) }}
  223.                                 </div>
  224.                             </dd>
  225.                         </dl>
  226.                         <dl>
  227.                             <dt>
  228.                                 {{ form_label(form.address, '住所', { 'label_attr': { 'class': 'ec-label' }}) }}
  229.                                 <p class="emphasis">※控除を受ける方の住民票住所をご入力ください。</p>
  230.                                 <p class="emphasis">住民票の情報と異なる場合、寄付金控除の対象外となる可能性があります。</p>
  231.                                 <p class="emphasis">ふるさと納税関連の書類は住民票住所へお届けします。</p>
  232.                             </dt>
  233.                             <dd>
  234.                                 <div class="ec-zipInput{{ has_errors(form.postal_code) ? ' error' }}"><span>{{ '〒'|trans }}</span>
  235.                                     {{ form_widget(form.postal_code) }}
  236.                                     <div class="ec-zipInputHelp">
  237.                                         <div class="ec-zipInputHelp__icon">
  238.                                             <div class="ec-icon"><img
  239.                                                         src="{{ asset('assets/icon/question-white.svg') }}" alt="">
  240.                                             </div>
  241.                                         </div><a href="https://www.post.japanpost.jp/zipcode/" target="_blank"><span>{{ '郵便番号検索'|trans }}</span></a>
  242.                                     </div>
  243.                                     {{ form_errors(form.postal_code) }}
  244.                                 </div>
  245.                                 <div class="ec-select{{ has_errors(form.address.pref) ? ' error' }}">
  246.                                     {{ form_widget(form.address.pref) }}
  247.                                     {{ form_errors(form.address.pref) }}
  248.                                 </div>
  249.                                 <div class="ec-input{{ has_errors(form.address.addr01) ? ' error' }}">
  250.                                     {{ form_widget(form.address.addr01, { 'attr': { 'placeholder': '市区町村名(例:大阪市北区)' }}) }}
  251.                                     {{ form_errors(form.address.addr01) }}
  252.                                 </div>
  253.                                 <div class="ec-input{{ has_errors(form.address.addr02) ? ' error' }}">
  254.                                     {{ form_widget(form.address.addr02,  { 'attr': { 'placeholder': '番地・ビル名(例:西梅田1丁目6-8)' }}) }}
  255.                                     {{ form_errors(form.address.addr02) }}
  256.                                 </div>
  257.                             </dd>
  258.                         </dl>
  259.                         <dl>
  260.                             <dt>
  261.                                 {{ form_label(form.birth, '生年月日', { 'label_attr': {'class': 'ec-label' }}) }}
  262.                                 <p class="emphasis">※控除を受ける方の生年月日をご入力ください。</p>
  263.                             </dt>
  264.                             <dd>
  265.                                 <div class="ec-birth{{ has_errors(form.birth) ? ' error' }}">
  266.                                     {{ form_widget(form.birth.year) }}<span>/</span>
  267.                                     {{ form_widget(form.birth.month) }}<span>/</span>
  268.                                     {{ form_widget(form.birth.day) }}
  269.                                     {{ form_errors(form.birth) }}
  270.                                 </div>
  271.                             </dd>
  272.                         </dl>
  273.                         <dl>
  274.                             <dt>
  275.                                 {{ form_label(form.sex, '性別', { 'label_attr': { 'class': 'ec-label' }}) }}
  276.                             </dt>
  277.                             <dd>
  278.                                 <div class="ec-select{{ has_errors(form.sex) ? ' error' }}">
  279.                                     {{ form_widget(form.sex) }}
  280.                                     {{ form_errors(form.sex) }}
  281.                                 </div>
  282.                             </dd>
  283.                         </dl>
  284.                         <dl>
  285.                             <dt>
  286.                                 {{ form_label(form.phone_number, '電話番号', { 'label_attr': { 'class': 'ec-label' }}) }}
  287.                                 <p class="emphasis">※携帯電話など日中につながりやすい連絡先をご入力ください。</p>
  288.                             </dt>
  289.                             <dd>
  290.                                 <div class="ec-telInput{{ has_errors(form.phone_number) ? ' error' }}">
  291.                                     {{ form_widget(form.phone_number) }}
  292.                                     {{ form_errors(form.phone_number) }}
  293.                                 </div>
  294.                             </dd>
  295.                         </dl>
  296.                         <dl>
  297.                             <dt>
  298.                                 {{ form_label(form.email, 'メールアドレス', { 'label_attr': { 'class': 'ec-label' }}) }}
  299.                                 <p class="emphasis">※迷惑メールの拒否設定をされている場合、メールが届かない場合があります。</p>
  300.                                 <p class="emphasis">「@cocofuru.jp」を受信できるように設定してください
  301.                                 。</p>
  302.                             </dt>
  303.                             <dd>
  304.                                 <div class="ec-input{{ has_errors(form.email.first) ? ' error' }}">
  305.                                     {{ form_widget(form.email.first, { 'attr': { 'placeholder': '例:ec-cube@example.com' }}) }}
  306.                                     {{ form_errors(form.email.first) }}
  307.                                 </div>
  308.                                 <div class="ec-input{{ has_errors(form.email.second) ? ' error' }}">
  309.                                     {{ form_widget(form.email.second, { 'attr': { 'placeholder': '確認のためもう一度入力してください' }}) }}
  310.                                     {{ form_errors(form.email.second) }}
  311.                                 </div>
  312.                             </dd>
  313.                         </dl>
  314.                         <dl>
  315.                             <dt>
  316.                                 {{ form_label(form.password, 'パスワード', { 'label_attr': {'class': 'ec-label' }}) }}
  317.                             </dt>
  318.                             <dd>
  319.                                 <div class="ec-input{{ has_errors(form.password.first) ? ' error' }}">
  320.                                     {{ form_widget(form.password.first, {
  321.                                         'attr': { 'placeholder': '半角英数記号%min%〜%max%文字'|trans({ '%min%': eccube_config.eccube_password_min_len, '%max%': eccube_config.eccube_password_max_len }) },
  322.                                         'type': 'password'
  323.                                     }) }}
  324.                                     {{ form_errors(form.password.first) }}
  325.                                 </div>
  326.                                 <div class="ec-input{{ has_errors(form.password.second) ? ' error' }}">
  327.                                     {{ form_widget(form.password.second, {
  328.                                         'attr': { 'placeholder': '確認のためもう一度入力してください'|trans },
  329.                                         'type': 'password'
  330.                                     }) }}
  331.                                     {{ form_errors(form.password.second) }}
  332.                                 </div>
  333.                             </dd>
  334.                         </dl>
  335.                         {# エンティティ拡張の自動出力 #}
  336.                         {% for f in form|filter(f => f.vars.eccube_form_options.auto_render) %}
  337.                             {% if f.vars.eccube_form_options.form_theme %}
  338.                                 {% form_theme f f.vars.eccube_form_options.form_theme %}
  339.                                 {{ form_row(f) }}
  340.                             {% else %}
  341.                                 <dl>
  342.                                     <dt>
  343.                                         {{ form_label(f) }}
  344.                                     </dt>
  345.                                     <dd>
  346.                                         <div class="{{ f.vars.eccube_form_options.style_class }}{{ has_errors(f) ? ' error' }}">
  347.                                             {{ form_widget(f) }}
  348.                                             {{ form_errors(f) }}
  349.                                         </div>
  350.                                     </dd>
  351.                                 </dl>
  352.                             {% endif %}
  353.                         {% endfor %}
  354.                     </div>
  355.                     <div class="ec-registerRole__actions">
  356.                         <div class="ec-off4Grid">
  357.                             <div class="ec-off4Grid__cell">
  358.                                 <div class="ec-checkbox{{ has_errors(form.user_policy_check) ? ' error' }}">
  359.                                     <label>
  360.                                         {{ form_widget(form.user_policy_check) }}
  361.                                         {{ '<a class="ec-link" href="%url%" target="_blank">利用規約</a>に同意してお進みください'|trans({ '%url%': url('help_agreement') })|raw }}
  362.                                     </label>
  363.                                     {{ form_errors(form.user_policy_check) }}
  364.                                 </div>
  365.                                 <button class="ec-blockBtn--action" type="submit" name="mode" value="confirm">{{ '同意する'|trans }}</button>
  366.                                 <a class="ec-blockBtn--cancel" href="{{ url('homepage') }}">{{ '同意しない'|trans }}</a>
  367.                             </div>
  368.                         </div>
  369.                     </div>
  370.                 </form>
  371.             </div>
  372.         </div>
  373.     </div>
  374. {% endblock %}