app/template/unishop/Entry/school_certification.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved.
  4. http://www.lockon.co.jp/
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  16. #}
  17. {% extends 'default_frame.twig' %}
  18. {% set body_class = 'registration_page' %}
  19. {% block javascript %}
  20.     <script>
  21.         {% for school in Schools %}
  22.             $('#School option[value="{{ school.school_id }}"]').attr('data-key-visible', {{ school.visible_school_key ? 1 : 0 }});
  23.         {% endfor %}
  24.         $('#School').change(function(){
  25.             if($('option:selected', $(this)).data('key-visible')) {
  26.                 $('#top_box__name').show();
  27.             }
  28.             else {
  29.                 $('#top_box__name').hide();
  30.             }
  31.         });
  32.         $('#top_box__body').submit(function(){
  33.             $('#top_box__name .form-group .error').remove();
  34.             if($('#top_box__name').is(":visible") && !$('#school_key').val()) {
  35.                 $('#top_box__name .form-group').append('<p class="red error">入力してください</p>');
  36.                 return false;
  37.             }
  38.         });
  39.         // パスワード表示/非表示を切り替える関数
  40.         function togglePasswordVisibility(event) {
  41.             const parent = $(event.target).closest('.password-wrap');
  42.             const eyeSlash = parent.find('.eye-slash-solid');
  43.             const eye = parent.find('.eye-solid');
  44.             const passwordInput = parent.find('.password-input');
  45.             // 表示/非表示を切り替える処理
  46.             eyeSlash.toggle();
  47.             eye.toggle();
  48.             passwordInput.attr('type', passwordInput.attr('type') === 'password' ? 'text' : 'password');
  49.         }
  50.         // イベントリスナーの設定
  51.         $('.eye-slash-solid, .eye-solid').on('click', togglePasswordVisibility);
  52.         $('.eye-solid').click();
  53.     </script>
  54. {% endblock javascript %}
  55. {% block stylesheet %}
  56. <style>
  57. .input_School select{
  58.     width: 48% !important;
  59. }
  60. .password-wrap {
  61.     position: relative;
  62. }
  63. .password-wrap img {
  64.     position: absolute;
  65.     top: 50%;
  66.     right: 16px;
  67.     transform: translateY(-50%);
  68.     width: 15px;
  69. }
  70. .input_School select,
  71. input#school_key{
  72.     width: 100% !important;
  73.     }
  74. a.forgot{
  75.     color: #007EBE; 
  76.     text-decoration: underline; 
  77.     font-size:90%;
  78.     text-align:center;
  79. }
  80. @media only screen and (min-width: 768px){
  81. .input_School select,
  82. input#school_key{
  83.     width: 55% !important;
  84.     }
  85. .password-wrap img {
  86.     right: 48%;
  87.     }
  88. }
  89. </style>
  90. {% endblock stylesheet %}
  91. {% block main %}
  92. <h1 class="title_bar nikke">学校情報認証</h1>
  93. <div id="top_wrap" class="container-fluid">
  94.     <div id="top_box" class="row">
  95.         <div id="top_box__body" class="col-md-10 col-md-offset-1">
  96.         {% if School is null or School.visible %}
  97.             {% if school_not_found %}
  98.                 <p>※ 学校コードに該当していないので、ご確認お願い致します。</p>
  99.             {% else %}
  100.                 <form method="post" action="{{ url('entry', { gcd : gcd }) }}">
  101.                     {{ form_widget(form._token) }}
  102.                     <div id="top_box__body_inner" class="dl_table">
  103.                         {% if School is null %}
  104.                             <dl id="top_box__School" class="entrybox_select_input">
  105.                                 <dt>{{ form_label(form.School) }}</dt>
  106.                                 <dd class="form-group input_School">
  107.                                     {{ form_widget(form.School) }}
  108.                                     {{ form_errors(form.School) }}
  109.                                 </dd>
  110.                             </dl>
  111.                         {% else %}
  112.                             <dl id="top_box__kana">
  113.                                 <dt></dt>
  114.                                 <dd class="form-group input_name">
  115.                                     {{ School.school_name }}
  116.                                 </dd>
  117.                             </dl>
  118.                         {% endif %}
  119.                         {% if School and School.visible_school_key != 1 %}
  120.                             <div style="display:none">
  121.                                 {{ form_widget(form.school_key, {'attr': {'value': School.school_key}}) }}
  122.                                 {{ form_errors(form.school_key) }}
  123.                             </div>
  124.                         {% else %}
  125.                             <dl id="top_box__name" class="entrybox_select_input">
  126.                                 <dt><label>学校キー</label></dt>
  127.                                 <dd class="form-group password-wrap">
  128.                                     {{ form_widget(form.school_key, {attr : {class : 'password-input'}}) }}
  129.                                     {{ form_errors(form.school_key) }}
  130.                                     <img class="eye-slash-solid" src="{{ asset('assets/icon/eye-slash-solid.svg') }}">
  131.                                     <img class="eye-solid" src="{{ asset('assets/icon/eye-solid.svg') }}" style="display: none;">
  132.                                     {% if certification_error_flg == 1 %}
  133.                                     <span>※認証に失敗しました。</span>
  134.                                     {% endif %}
  135.                                 </dd>
  136.                             </dl>
  137.                         {% endif %}
  138.                         <input id="top_box__hidden_mode" type="hidden" name="mode" value="certify">
  139.                     </div>
  140.                     <div id="top_box__footer" class="row no-padding">
  141.                         <div id="top_box__button_menu" class="btn_group col-sm-offset-4 col-sm-4">
  142.                             <p>
  143.                                 <button type="submit" class="btn btn-primary btn-block def_btn ya radius1">生徒情報の登録へ</button>
  144.                             </p>
  145.                 <p>
  146.                     <a class="def_btn ya radius1 color05" href="{{ url('mypage_login') }}">会員登録済みの方はこちら</a>
  147.                 </p>
  148.                         </div>
  149.                     </div>
  150.                 </form>
  151.             {% endif %}
  152.         {% else %}
  153.             <p style="text-align: center">この学校URLは現在非公開となっています。</p>
  154.         {% endif %}
  155.         </div>
  156.         <!-- /.col -->
  157.     </div>
  158.     <!-- /.row -->
  159. </div>
  160. {% endblock %}