|
@@ -22,7 +22,7 @@
|
|
<select name="handoutUid" class="form-control form-control-sm">
|
|
<select name="handoutUid" class="form-control form-control-sm">
|
|
<option value=""> --select--</option>
|
|
<option value=""> --select--</option>
|
|
@foreach($handouts as $handout)
|
|
@foreach($handouts as $handout)
|
|
- <option value="{{$handout->uid}}">
|
|
|
|
|
|
+ <option data-img_src="/api/handout/download-thumbnail/{{ $handout->uid }}" value="{{$handout->uid}}">
|
|
{{$handout->display_name}}
|
|
{{$handout->display_name}}
|
|
</option>
|
|
</option>
|
|
@endforeach
|
|
@endforeach
|
|
@@ -47,11 +47,11 @@
|
|
</tr>
|
|
</tr>
|
|
</thead>
|
|
</thead>
|
|
<tbody>
|
|
<tbody>
|
|
- @foreach($clientHandouts as $clientHandout)
|
|
|
|
|
|
+ @foreach($clientHandouts as $clientHandout)
|
|
<?php $downloadLink = config('app.url') . "/guest/handout/".$clientHandout->uid; ?>
|
|
<?php $downloadLink = config('app.url') . "/guest/handout/".$clientHandout->uid; ?>
|
|
<tr>
|
|
<tr>
|
|
<td>
|
|
<td>
|
|
- <img width="100" src="/api/handout/download-thumbnail/{{ $clientHandout->handout->uid }}" alt="{{$clientHandout->handout->display_name}}">
|
|
|
|
|
|
+ <img width="50" src="/api/handout/download-thumbnail/{{ $clientHandout->handout->uid }}" alt="{{$clientHandout->handout->display_name}}" onerror="if (this.src != '/img/pdf.png') this.src = '/img/pdf.png';">
|
|
</td>
|
|
</td>
|
|
<td>{{$clientHandout->handout->internal_name}}</td>
|
|
<td>{{$clientHandout->handout->internal_name}}</td>
|
|
<td>{{$clientHandout->handout->display_name}}</td>
|
|
<td>{{$clientHandout->handout->display_name}}</td>
|
|
@@ -89,7 +89,20 @@
|
|
</table>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
<script>
|
|
- $(document).ready(function(){
|
|
|
|
- $('select[name=handoutUid]').select2();
|
|
|
|
|
|
+ $(document).ready(function(){
|
|
|
|
+ function custom_template(obj){
|
|
|
|
+ var data = $(obj.element).data();
|
|
|
|
+ var text = $(obj.element).text();
|
|
|
|
+ if(data && data['img_src']){
|
|
|
|
+ img_src = data['img_src'];
|
|
|
|
+ template = $("<div class='d-flex align-items-center border-bottom:1px solid #eee;'><img src=\"" + img_src + "\" style=\"height:70px;\" onerror=\"if (this.src != '/img/pdf.png') this.src = '/img/pdf.png';\"/><p style=\"padding-left:5px; margin-bottom:0; text-align:center;\">" + text + "</p></div>");
|
|
|
|
+ return template;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ var options = {
|
|
|
|
+ 'templateSelection': custom_template,
|
|
|
|
+ 'templateResult': custom_template,
|
|
|
|
+ }
|
|
|
|
+ $('select[name=handoutUid]').select2(options);
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|