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

Open in your IDE?
  1. {#
    This file is part of EC-CUBE
    
    Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved.
    
    http://www.lockon.co.jp/
    
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    #}
    {% extends 'default_frame.twig' %}
    
    {% set body_class = 'registration_page' %}
    
    {% block javascript %}
        <script>
            {% for school in Schools %}
                $('#School option[value="{{ school.school_id }}"]').attr('data-key-visible', {{ school.visible_school_key ? 1 : 0 }});
            {% endfor %}
            $('#School').change(function(){
                if($('option:selected', $(this)).data('key-visible')) {
                    $('#top_box__name').show();
                }
                else {
                    $('#top_box__name').hide();
                }
            });
            $('#top_box__body').submit(function(){
                $('#top_box__name .form-group .error').remove();
                if($('#top_box__name').is(":visible") && !$('#school_key').val()) {
                    $('#top_box__name .form-group').append('<p class="red error">入力してください</p>');
                    return false;
                }
            });
    
            // パスワード表示/非表示を切り替える関数
            function togglePasswordVisibility(event) {
                const parent = $(event.target).closest('.password-wrap');
                const eyeSlash = parent.find('.eye-slash-solid');
                const eye = parent.find('.eye-solid');
                const passwordInput = parent.find('.password-input');
    
                // 表示/非表示を切り替える処理
                eyeSlash.toggle();
                eye.toggle();
                passwordInput.attr('type', passwordInput.attr('type') === 'password' ? 'text' : 'password');
            }
    
            // イベントリスナーの設定
            $('.eye-slash-solid, .eye-solid').on('click', togglePasswordVisibility);
    
            $('.eye-solid').click();
        </script>
    {% endblock javascript %}
    
    {% block stylesheet %}
    <style>
    .input_School select{
        width: 48% !important;
    }
    .password-wrap {
        position: relative;
    }
    .password-wrap img {
        position: absolute;
        top: 50%;
        right: 16px;
        transform: translateY(-50%);
        width: 15px;
    }
    .input_School select,
    input#school_key{
        width: 100% !important;
        }
    a.forgot{
        color: #007EBE; 
        text-decoration: underline; 
        font-size:90%;
        text-align:center;
    }
    @media only screen and (min-width: 768px){
    .input_School select,
    input#school_key{
        width: 55% !important;
        }
    .password-wrap img {
        right: 48%;
        }
    }
    </style>
    {% endblock stylesheet %}
    
    {% block main %}
    <h1 class="title_bar nikke">学校情報認証</h1>
    
    <div id="top_wrap" class="container-fluid">
        <div id="top_box" class="row">
            <div id="top_box__body" class="col-md-10 col-md-offset-1">
            {% if School is null or School.visible %}
                {% if school_not_found %}
                    <p>※ 学校コードに該当していないので、ご確認お願い致します。</p>
                {% else %}
                    <form method="post" action="{{ url('entry', { gcd : gcd }) }}">
    
                        {{ form_widget(form._token) }}
                        <div id="top_box__body_inner" class="dl_table">
                            {% if School is null %}
                                <dl id="top_box__School" class="entrybox_select_input">
                                    <dt>{{ form_label(form.School) }}</dt>
                                    <dd class="form-group input_School">
                                        {{ form_widget(form.School) }}
                                        {{ form_errors(form.School) }}
                                    </dd>
                                </dl>
                            {% else %}
                                <dl id="top_box__kana">
                                    <dt></dt>
                                    <dd class="form-group input_name">
                                        {{ School.school_name }}
                                    </dd>
                                </dl>
                            {% endif %}
                            {% if School and School.visible_school_key != 1 %}
                                <div style="display:none">
                                    {{ form_widget(form.school_key, {'attr': {'value': School.school_key}}) }}
                                    {{ form_errors(form.school_key) }}
                                </div>
                            {% else %}
                                <dl id="top_box__name" class="entrybox_select_input">
                                    <dt><label>学校キー</label></dt>
                                    <dd class="form-group password-wrap">
                                        {{ form_widget(form.school_key, {attr : {class : 'password-input'}}) }}
                                        {{ form_errors(form.school_key) }}
                                        <img class="eye-slash-solid" src="{{ asset('assets/icon/eye-slash-solid.svg') }}">
                                        <img class="eye-solid" src="{{ asset('assets/icon/eye-solid.svg') }}" style="display: none;">
                                        {% if certification_error_flg == 1 %}
                                        <span>※認証に失敗しました。</span>
                                        {% endif %}
                                    </dd>
                                </dl>
                            {% endif %}
                            <input id="top_box__hidden_mode" type="hidden" name="mode" value="certify">
                        </div>
    
                        <div id="top_box__footer" class="row no-padding">
                            <div id="top_box__button_menu" class="btn_group col-sm-offset-4 col-sm-4">
                                <p>
                                    <button type="submit" class="btn btn-primary btn-block def_btn ya radius1">生徒情報の登録へ</button>
                                </p>
                    <p>
                        <a class="def_btn ya radius1 color05" href="{{ url('mypage_login') }}">会員登録済みの方はこちら</a>
                    </p>
                            </div>
                        </div>
                    </form>
                {% endif %}
            {% else %}
                <p style="text-align: center">この学校URLは現在非公開となっています。</p>
            {% endif %}
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </div>
    {% endblock %}