@extends('user-layouts.user_template')
@section('content')
<style>
    .design-name-holder {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
</style>
<div class="content-wrapper" style="min-height: 916px;">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            My Designs
            <!-- <small>Control panel</small> -->
        </h1>
        <ol class="breadcrumb">
            <li><a href="{{ url('user') }}"><i class="fa fa-home"></i> Home</a></li>
            <li class="active">My Designs</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <!-- <div class="box-header with-border">
                            asda
                        </div> -->
                    <div class="box-body custom-box-body">
                        <div class="row">
                            @foreach($array_client_designs as $row)
                            <div class="col-md-3 col-sm-6">
                                <span class="thumbnail">
                                    <img src="{{ config('filesystems.disks.minio.url') }}/crewsportswear/images/{{ $row->DesignCode }}-front-thumbnail.png" alt="{{ $row->DesignName }}">
                                    <h4 class="design-name-holder">{{ $row->DesignName }}</h4>
                                    <small>{{ date('F j, Y g:i a', strtotime($row->DateCreated)) }}</small>
                                    <hr class="line">
                                    <div class="row">
                                        <div class="col-md-12 col-sm-12">
                                            <a href="{{ url('/') }}/{{ Request::path() }}/view/{{ $row->DesignCode }} " class="btn btn-warning btn-xs"><i class="fa fa-eye"></i> View</a>
                                            <!-- <a href="{{ url('designer/edit') }}/{{ $row->DesignCode }}" class="btn btn-default btn-xs"><i class="fa fa-edit"></i> Edit Design</a> -->
                                            <!-- <a href="{{ url('user/my-designs/buy-design') }}/{{ $row->DesignCode }}" class="btn btn-primary btn-xs"><i class="fa fa-shopping-cart"></i> Buy</a> -->
                                            <button class="btn btn-primary btn-xs btn-purchase" data-design-code="{{ $row->DesignCode }}"><i class="fa fa-plus-square"></i> Purchase</button>
                                            
                                            @if(Auth::user()->role == "store_owner")
                                            <a href="{{ url('user/my-designs/sell-design/' . $row->DesignCode) }}" class="btn btn-success btn-xs"><i class="fa fa-usd"></i> Sell</a>
                                            @endif
                                        </div>
                                    </div>
                                </span>
                            </div>
                            @endforeach
                            <div class="col-md-12 col-sm-12 pull-right">
                                {!! $array_client_designs->render() !!}
                            </div>
                        </div>
                    </div>
                    <div>
                    </div>
                </div>
    </section>
    <!-- /.content -->
</div>
@endsection