@extends('layouts.manage')

@section('title', 'Settings')

@section('header')
  <a href="{{ route('manage.settings') }}" class="{{ Nav::isRoute('manage.settings') }}">
    <span class="menu-icon">
      <img src="{{ asset($storage_url.'img/manage-icons/settings.jpg') }}" alt="">
    </span><span class="menu-text">
      @lang('manage.settings')
    </span>
  </a>
@endsection

@section('content')
	<div class="container-fluid">
	  <div class="row">
    
      <div class="content-wrapper">
        @include('flash::message')
        @include('manage.errors')
        
        <form action="{{ route('manage.settings.store') }}" method="POST" enctype="multipart/form-data">
          {{ csrf_field() }} 
          {{-- name --}}
          <div class="col-lg-6 col-md-6 col-sm-8 col-xs-12 col-lg-offset-3 col-md-offset-3 col-sm-offset-1 col-xs-offset-0">
            <div class="form-group">
              <label for="name" class="control-label">@lang('manage.name')</label>
              <input type="text" class="form-control" name="name" value="{{ $masterName or '' }}">
            </div>
          </div>
          {{-- /. name --}}

          {{-- language --}}
          <div class="col-lg-6 col-md-6 col-sm-8 col-xs-12 col-lg-offset-3 col-md-offset-3 col-sm-offset-1 col-xs-offset-0">
            <div class="form-group">
              <select class="selectpicker show-tick" 
                title="@lang('manage.language')" 
                data-width="100%" name="language">
                @foreach (config('translatable.locales') as $key => $value)
                  <option value="{{ $key }}">{{ $value }}</option>
                @endforeach
              </select> 
            </div>
          </div>
          {{-- /. language --}}

          {{-- icon --}}
          <div class="col-lg-6 col-md-6 col-sm-8 col-xs-12 col-lg-offset-3 col-md-offset-3 col-sm-offset-1 col-xs-offset-0">
            <div class="form-group">
              <label for="icon" class="control-label">@lang('manage.icon')</label>
              <img 
                class="prev-img img-bordered img-responsive" 
                alt="Favicon" 
                src="{{ !empty($masterFavicon->setting_value)?asset($storage_url.'img/'.$masterFavicon->setting_value):'http://via.placeholder.com/200x200' }}" style="padding:5px; max-height: 100px; max-width: 100px; margin: 0 auto;">
              <input type="file" name="icon" class="form-control">
              <div class="upload-rules text-left">
                <ul>
                  <li>Min resolution <strong>32 x 32 px</strong></li>
                  <li>File type <strong>*.ico</strong></li>
                  <li>Max file size <strong>50kb</strong></li>
                </ul>
              </div>
              
            </div>
          </div>
          {{-- /. icon --}}

          {{-- logo --}}
          <div class="col-lg-6 col-md-6 col-sm-8 col-xs-12 col-lg-offset-3 col-md-offset-3 col-sm-offset-1 col-xs-offset-0">
            <div class="form-group">
              <label for="logo" class="control-label">@lang('manage.logo')</label>
              <img 
                class="prev-img img-bordered img-responsive" 
                alt="Logo" 
                src="{{ !empty($manageLogo)?asset($storage_url.'img/'.$manageLogo):'' }}" style="padding:5px; max-height: 300px; max-width: 300px; margin: 0 auto;">
              <input type="file" name="logo" class="form-control">
              <div class="upload-rules text-left">
                <ul>
                  <li>Min resolution <strong>250 x 250 px</strong></li>
                  <li>File type <strong>PNG/JPG</strong></li>
                  <li>Max file size <strong>500kb</strong></li>
                </ul>
              </div>
              
            </div>
          </div>
          {{-- /. logo --}}

          {{-- submit button --}}
          <div class="m-t-20 col-lg-6 col-md-6 col-sm-8 col-xs-12 col-lg-offset-3 col-md-offset-3 col-sm-offset-1 col-xs-offset-0">
            <button class="btn btn-primary btn-sm btn-block" type="submit">
              @lang('manage.save')
            </button>
          </div>
          {{-- /. submit button --}}

        </form>
        


      </div>

  	</div>
  </div>
@endsection