{#
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;
}
});
</script>
{% endblock javascript %}
{% block stylesheet %}
<style>
.input_School select{
width: 48% !important;
}
</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">
<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">
<dt></dt>
<dd class="form-group input_name">
{{ form_widget(form.school_key) }}
{{ form_errors(form.school_key) }}
{% 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>
</div>
</div>
</form>
{% endif %}
{% else %}
<p style="text-align: center">この学校URLは現在非公開となっています。</p>
{% endif %}
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
{% endblock %}