@extends('theme.'.env('THEME').'.site')

@section('content')

<div class="within">
  <div class="bar">{{ __('site.profilenohensyu') }}</div>
  <div class="back">
    @if ($err)
    <div class="alert alert-danger" role="alert">
      {{ $err }}
    </div>
    @elseif ($suc)
    <div class="alert alert-success" role="alert">
      {{ $suc }}
    </div>
    @endif
    <form method="POST" action="/profile/{{ $res->id }}/edit">
      @csrf
      <div class="row body">
        <div class="col-sm-4"><b>{{ __('site.hyojiname') }}</b></div>
        <div class="col">
          <input name="display_name" id="display_name" type="text" class="form-control" value="{{ $res->profile->display_name }}" />
          {{ __('site.hyojiname_memo') }}
        </div>
      </div>
      <div class="row body">
        <div class="col-sm-4"><b>{{ __('site.password') }}</b></div>
        <div class="col">
          <input name="password" id="password" type="password" class="form-control" />
          {{ __('site.password_memo') }}
        </div>
      </div>
      <div class="row body">
        <div class="col-sm-4"><b>{{ __('site.passwordkakunin') }}</b></div>
        <div class="col">
          <input name="password_check" id="confirm" type="password" class="form-control" />
          {{ __('site.password_memo') }}
        </div>
      </div>
      <div class="row body">
        <div class="col-sm-4"><b>{{ __('site.densimail') }} <span class="badge badge-danger">{{ __('site.hissu') }}</span></b></div>
        <div class="col"><input name="email" id="email" type="text" class="form-control" value="{{ $res->email }}" /></div>
      </div>
      <div class="row body">
        <div class="col-sm-4"><b>{{ __('site.kuni') }}</b></div>
        <div class="col">
          <select name="country" id="country" class="custom-select">
            @foreach (getCountries() as $r)
              @if ($res->profile->country == $r['value'])
                <option value="{{$r['value']}}" selected>{{$r['label']}}</option>
              @else
                <option value="{{$r['value']}}">{{$r['label']}}</option>
              @endif
            @endforeach
          </select>
        </div>
      </div>
      <div class="row body">
        <div class="col-sm-4"><b>{{ __('site.seibetu') }}</b></div>
        <div class="col">
          <fieldset class="form-group">
            <div tabindex="-1" role="group">
              <div id="gender" role="radiogroup" tabindex="-1">
                <label>
                  <input id="gender0" name="gender" type="radio" autocomplete="off" class="" @if ($res->profile->gender == 0) checked @endif value="0" />
                  <span>不明</span>
                </label>
                <label>
                  <input id="gender1" name="gender" type="radio" autocomplete="off" class="" @if ($res->profile->gender == 1) checked @endif value="1" />
                  <span>男性</span>
                </label>
                <label>
                  <input id="gender2" name="gender" type="radio" autocomplete="off" class="" @if ($res->profile->gender == 2) checked @endif value="2" />
                  <span>女性</span>
                </label>
              </div>
            </div>
          </fieldset>
        </div>
      </div>
      <div class="row body">
        <div class="col-sm-4"></div>
        <div class="col"><input name="submit" type="submit" class="btn btn-success btn-block" value="{{ __('site.hensyu') }}" /></div>
      </div>
    </form>
  </div>
</div>

@endsection
