<div class="row py-5">
    @foreach ($stores_array as $store)
        <div class="col-lg-2 col-md-3 col-sm-4">
            <div class="p-3 store">
                {{-- @if ($store->Password != null)
            <a class="thumbnail password-protected" href="#" data-store-id="{{  $store->Id }}" data-store-url="{{  $store->StoreUrl }}">
                <img class="store-logo" src="{{ config('site_config.uploads') . 'teamstore/'. $store->ImageFolder . '/' . $store->StoreLogo  }}">
            </a>
            <h4  style="border-top: 1px solid #dddddd; padding: 10px; font-size: 16px; font-weight: bold; text-transform: uppercase;" class="text-center">{{  $store->StoreName }}  <i class="fa fa-lock" title="This store is password protected."></i></h4>
                @else
                    <a class="thumbnail" href="{{ url('teamstore') . '/' . $store->StoreUrl }}">
                        <img class="store-logo" src="{{ config('site_config.uploads') . 'teamstore/' .  $store->ImageFolder . '/' . $store->StoreLogo  }}">
                    </a>
                    <h4 style="border-top: 1px solid #dddddd; padding: 10px; font-size: 16px; font-weight: bold; text-transform: uppercase;" class="text-center">{{  $store->StoreName }}</h4>
                @endif --}}
                @if ($store->Password != null)
                    <a href="#">
                        <div class="store-logo password-protected" data-store-id="{{ $store->Id }}"
                            data-store-url="{{ $store->StoreUrl }}">
                            <img src="{{ minio_url('teamstore/' . $store->ImageFolder . '/' . $store->StoreLogo) }}"
                                class="d-block" alt="{{ $store->StoreName }}" />
                            <div class="store-locked">
                                <i class="fa fa-lock"></i>
                            </div>
                        </div>
                        <div class="store-name">{{ $store->StoreName }} <i class="fa fa-lock"
                                title="This store is password protected."></i></div>
                    </a>
                @else
                    <a href="{{ url('store') . '/' . $store->StoreUrl }}">
                        <div class="store-logo">
                            <img src="{{ minio_url('teamstore/' . $store->ImageFolder . '/' . $store->StoreLogo) }}"
                                class="d-block" alt="{{ $store->StoreName }}" />
                        </div>
                        <div class="store-name">{{ $store->StoreName }}</div>
                    </a>
                @endif
            </div>
        </div>
    @endforeach

    {{-- <div class="col-lg-12">
      <div class="py-4 text-center">
        <button type="submit" class="btn btn-black mb-3 px-5">
          View all store
        </button>
      </div>
    </div> --}}
</div>

{{-- <div id="team-store-login" class="modal fade" role="dialog">
    <div class="modal-dialog">

        <!-- Modal content-->
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Teamstore Login</h4>
            </div>
        <div class="modal-body">
            @if (\Session::has('errors'))
                <div class="alert alert-danger data-errors">
                    <strong>Whoops!</strong> {!! \Session::get('errors') !!}.<br><br>
                </div>
            @endif

            <form class="form-horizontal" role="form" method="POST" action="{{ url('teamstore/checkpassword') }}">
                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                <input type="hidden" class="form-control" id="_teamstore_id" name="store_id">
                <div class="form-group">
                    <label class="col-md-4 control-label">Password</label>
                    <div class="col-md-6">
                        <div class="input-group">
                            
                            <input type="password" class="form-control pwd" name="password">
                            <span class="input-group-btn">
                                <button class="btn btn-default reveal-password" type="button"><i class="fa fa-eye"></i></button>
                            </span>          
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6 col-md-offset-4">
                        <button type="submit" class="btn btn-primary btn-block">Login</button>
                    </div>
                </div>
            </form>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
    </div>

    </div>
</div> --}}

{{-- <div id="team-store-login" class="modal fade" role="dialog"> --}}
<div class="modal fade" id="team-store-login" tabindex="-1" aria-labelledby="storeLoginLabel" aria-hidden="true"
    data-bs-backdrop="static" data-bs-keyboard="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <form class="form-horizontal" role="form" method="POST" action="{{ url('store/checkpassword') }}">
                <div class="modal-header">
                    <h5 class="modal-title" id="storeLoginLabel">Store Login</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    @if (\Session::has('errors'))
                        <div class="alert alert-danger alert-dismissible fade show" role="alert">
                            <strong>Whoops!</strong> {!! \Session::get('errors') !!}.
                            <button type="button" class="btn-close" data-bs-dismiss="alert"
                                aria-label="Close"></button>
                        </div>
                    @endif

                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                    <input type="hidden" class="form-control" id="_teamstore_id" name="store_id">
                    <label class="col-md-4 control-label">Store Password</label>
                    <div class="input-group mb-3">
                        <input type="password" class="form-control pwd" name="password" placeholder="Store Password"
                            aria-label="Store Password" aria-describedby="button-addon2" required>
                        <button class="btn btn-outline-secondary reveal-password" type="button" id="button-addon2"><i
                                class="fa fa-eye"></i></button>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn" data-bs-dismiss="modal">Cancel</button>
                    <button type="submit" class="btn btn-black">Submit</button>
                </div>
            </form>
        </div>
    </div>
</div>
