<div class="d-flex align-items-center">

    <i class="fa fa-user"></i>
    <span class="ml-2 font-weight-bold text-secondary">Guest Access</span>

    @if($section->guest_access_level == 'NONE')
        <i class="fa fa-ban text-danger ml-2"></i>
    @else
        <i class="fa fa-check text-success ml-2"></i>
    @endif
    <span class="ml-1">Read</span>

    @if($section->guest_access_level == 'NONE')
        <div moe relative wide class="ml-1 d-none if-edit">
            <a start show class="font-weight-bold">
                Allow
            </a>
            <form url="/api/section/enableGuestReadAccess" right>
                <input type="hidden" name="uid" value="{{$section->uid}}">

                <div class="form-group">
                    Enable guest read access?
                </div>

                <div class="form-group m-0">
                    <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
                    <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
                </div>
            </form>
        </div>
    @endif

    @if($section->guest_access_level != 'WRITE')
        <i class="fa fa-ban text-danger ml-2"></i>
    @else
        <i class="fa fa-check text-success ml-2"></i>
    @endif
    <span class="ml-1">Write</span>

    @if($section->guest_access_level != 'WRITE')
        <div moe relative wide class="ml-1 d-none if-edit">
            <a start show class="font-weight-bold">
                Allow
            </a>
            <form url="/api/section/enableGuestWriteAccess" right>
                <input type="hidden" name="uid" value="{{$section->uid}}">

                <div class="form-group">
                    Enable guest write access?
                </div>

                <div class="form-group m-0">
                    <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
                    <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
                </div>
            </form>
        </div>
    @endif

    @if($section->guest_access_level != 'NONE')
        <div class="d-none if-edit">
            <div class="d-flex align-items-center">
                <span class="mx-2 text-secondary">|</span>
                <?php $id = "guest_link_" . Illuminate\Support\Str::random(10); ?>
                <input tabindex="-1" type="text" class="hidden-link-input" aria-hidden="true"
                       id="{{ $id }}"
                       value="{{ route('guest_section_access', $section->guest_access_code) }}">
                <a href="#" class="copy-link" data-id="{{ $id }}">Copy Access Link</a>
                <span class="mx-2 text-secondary">|</span>
                <div moe wide relative>
                    <a start show>
                        Disable Access
                    </a>
                    <form url="/api/section/disableGuestAccess" right>
                        <input type="hidden" name="uid" value="{{$section->uid}}">

                        <div class="form-group">
                            Disable guest access?
                        </div>

                        <div class="form-group m-0">
                            <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
                            <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
                        </div>
                    </form>
                </div>
                <span class="ml-2 text-secondary">|</span>
            </div>
        </div>
    @endif
</div>
