{!! Theme::section('community.pannel.cms.pages-menu',['subpage'=>'longforms']) !!}

<style type="text/css">
table td {
  word-break: break-all;
}
</style>

<br />
	<span class="community-pannel-heading">Award List</span>
    
    @if($community->present()->canManage())
    	<a class="btn-sm btn black-color-button pull-right" href="{{$community->present()->url('managesurveyemails')}}" style="margin-left:10px">Business Contacts</a>
    @endif
        
    <a class="btn-sm btn black-color-button pull-right" href="{{$community->present()->url('createaward')}}">Start an Award</a>
    
   <br />
   
   @if(Session::has('success_message'))
	  <div class="alert alert-dismissible alert-success"> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>{{Session::get('success_message')}}</div>
   @endif
   
   <br />
    <div class="">
         <table class="table table-bordered">
            <thead>
                <tr>
                	<th style="width: 2%">{{trans('formsurveys.sr-no')}}</th>
                    <th style="width: 15%">Award Title</th>
                    <th style="width: 35%">Award URL</th>
					<th style="width: 15%">QR Code</th>
                    <th style="width: 20%">{{trans('formsurveys.nomination-action')}}</th>
                </tr>
            </thead>
            <tbody>
            	<?php $i=1; $cnt=0;?>
                @foreach($forms as $form)
                    <tr @if($cnt%2==0) style="background-color:#fff;" @else style="background-color:#eee;" @endif>
                    	<td rowspan="2">{{$i++}}</td>
                        <td rowspan="2">
						    {{strip_tags($form->title)}} <br>
						
                            @if($community->present()->canManage())								
                        		<a style="margin-top:10px;" class="btn btn-sm black-color-button" href="{{$community->present()->url('surveyinvite')}}/{{$form->id}}" title="Edit Form">Invitation by Email</a>
                            @endif

							<a class="btn btn-sm btn-info" style="margin-top:10px;" href="{{$community->present()->url('formcategories')}}/{{$form->id}}" title="Add/Edit Questions">Edit Award Categories</a>	
					    
							<a style="margin-top:10px;" class="btn btn-sm red-color-button delete-action-confirm" data-url="{{$community->present()->url('deleteform')}}/{{$form->id}}" title="Delete Form">{{trans('formsurveys.nomination-delete')}}</a>
						
						</td>
						
                        <td>
                        	<b>Nomination URL</b> - <br> {{$community->present()->url('sform')}}/{{$form->slug}} <br /><br />
                       		
                        </td>
                        
						<td>
							 <img src="https://quickchart.io/chart?chs=100x100&cht=qr&chl={{$community->present()->url('sform')}}/{{$form->slug}}%2F" alt="barcode"/>
						</td>
						
						<td>
                        	<!--<a class="btn btn-sm black-color-button" href="{{$community->present()->url('editlongform')}}/{{$form->id}}" title="Edit Form">{{trans('formsurveys.nomination-edit-form')}}</a>-->
                                                    
                            <a class="btn btn-sm black-color-button" href="{{$community->present()->url('editlongform')}}/{{$form->id}}" title="Edit Nomination Page">Edit Nomination Page</a>
							<br>
							<a style="margin-top:10px;" class="btn btn-sm btn-info" href="{{$community->present()->url('sform')}}/{{$form->slug}}" title="Preview" target="_blank">Preview</a>
						</td>
                    </tr>
					
					<tr @if($cnt%2==0) style="background-color:#fff;" @else style="background-color:#eee;" @endif>						
						
						<td @if($cnt%2==0) style="background-color:#fff;" @else style="background-color:#eee;" @endif>
							<b>Voting URL</b> -  <br>  {{$community->present()->url('voting')}}/{{$form->slug}}
						</td>
						
						<td @if($cnt%2==0) style="background-color:#fff;" @else style="background-color:#eee;" @endif>
							<img src="https://quickchart.io/chart?chs=100x100&cht=qr&chl={{$community->present()->url('voting')}}/{{$form->slug}}%2F" alt="barcode"/>
						</td>
						
						<td @if($cnt%2==0) style="background-color:#fff;" @else style="background-color:#eee;" @endif>
							<a class="btn btn-sm black-color-button" href="{{$community->present()->url('awardvotingsetup')}}/{{$form->id}}" title="Edit Voting Page">Edit Voting Page</a>
							<br>
							<a style="margin-top:10px;" class="btn btn-sm btn-info" href="{{$community->present()->url('voting')}}/{{$form->slug}}" title="Preview" target="_blank">Preview</a>
						</td>
					</tr>
					
					<?php $cnt++; ?>
                @endforeach
            </tbody>
        </table>
       
        {!! $forms->appends(request()->except('page'))->render() !!}
   </div>
<br />

