|
@@ -3,8 +3,8 @@
|
|
|
|
|
|
<style>
|
|
|
.select2-container {
|
|
|
- width: 100% !important;
|
|
|
-}
|
|
|
+ width: 100% !important;
|
|
|
+ }
|
|
|
</style>
|
|
|
|
|
|
<div class="">
|
|
@@ -16,20 +16,26 @@
|
|
|
<form url="/api/handoutClient/create" style="width: 500px;">
|
|
|
<input type="hidden" name="clientUid" value="{{ $patient->uid }}">
|
|
|
@if(@$note)
|
|
|
- <input type="hidden" name="noteUid" value="{{ $note->uid }}">
|
|
|
+ <input type="hidden" name="noteUid" value="{{ $note->uid }}">
|
|
|
@endif
|
|
|
<div id="handoutSelectComponent" class="mb-2" v-cloak>
|
|
|
<input type="hidden" name="handoutUid" :value="selectedHandoutUid" />
|
|
|
<input type="search" class="form-control" placeholder="Search Handout" @keyup="filterHandouts" />
|
|
|
- <div class="row mt-3">
|
|
|
- <div v-for="handout in handoutsList" class="col-md-4 mb-2 handout" :class="selectedHandoutUid == handout.uid ? 'selected':''" @click="selectedHandoutUid = handout.uid">
|
|
|
- <div class="d-flex flex-column h-100 border rounded p-2 handout-detail">
|
|
|
- <i v-if="selectedHandoutUid == handout.uid" class="fas fa-check-circle"></i>
|
|
|
- <img :src="'/api/handout/download-thumbnail/'+handout.uid" :alt="handout.display_name" onerror="if (this.src != '/img/pdf.png') this.src = '/img/pdf.png';">
|
|
|
- <h6 class="mt-2 mb-0 text-center">@{{ handout.display_name }}</h6>
|
|
|
+ <div class="mt-3" style="max-height: 430px;overflow-y: auto;overflow-x:hidden;">
|
|
|
+ <div class="row">
|
|
|
+ <div v-for="handout in handoutsList" class="col-md-4 mb-2 handout" :class="selectedHandoutUid == handout.uid ? 'selected':''" @click="selectedHandoutUid = handout.uid">
|
|
|
+ <div class="d-flex flex-column h-100 border rounded p-2 handout-detail">
|
|
|
+ <i v-if="selectedHandoutUid == handout.uid" class="fas fa-check-circle"></i>
|
|
|
+ <img :src="'/api/handout/download-thumbnail/'+handout.uid" :alt="handout.display_name" onerror="if (this.src != '/img/pdf.png') this.src = '/img/pdf.png';">
|
|
|
+ <h6 class="mt-2 mb-0 text-center">@{{ handout.display_name }}</h6>
|
|
|
+
|
|
|
+ <a class="c-pointer preview pdf-viewer-trigger" native target="_blank" :href="'/api/handout/download/'+handout.uid" title="View">Preview PDF</a>
|
|
|
+
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
</div>
|
|
|
<div class="d-flex align-items-center">
|
|
|
<button class="btn btn-sm btn-primary mr-2" submit>Save</button>
|
|
@@ -40,28 +46,26 @@
|
|
|
</div>
|
|
|
<table class="table table-striped table-sm table-bordered m-0">
|
|
|
<thead class="bg-light">
|
|
|
- <tr>
|
|
|
- <th></th>
|
|
|
- <th class="border-0 text-secondary">Internal Name</th>
|
|
|
- <th class="border-0 text-secondary">Display Name</th>
|
|
|
- <th class="border-0 text-secondary">View</th>
|
|
|
- <th class="border-0 text-secondary w-50">Shareable Link</th>
|
|
|
- <th class="border-0 text-secondary"></th>
|
|
|
- </tr>
|
|
|
+ <tr>
|
|
|
+ <th></th>
|
|
|
+ <th class="border-0 text-secondary">Internal Name</th>
|
|
|
+ <th class="border-0 text-secondary">Display Name</th>
|
|
|
+ <th class="border-0 text-secondary">View</th>
|
|
|
+ <th class="border-0 text-secondary w-50">Shareable Link</th>
|
|
|
+ <th class="border-0 text-secondary"></th>
|
|
|
+ </tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
- @foreach($clientHandouts as $clientHandout)
|
|
|
- <?php $downloadLink = config('app.url') . "/guest/handout/".$clientHandout->uid; ?>
|
|
|
+ @foreach($clientHandouts as $clientHandout)
|
|
|
+ <?php $downloadLink = config('app.url') . "/guest/handout/" . $clientHandout->uid; ?>
|
|
|
<tr>
|
|
|
<td>
|
|
|
- <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';">
|
|
|
+ <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>{{$clientHandout->handout->internal_name}}</td>
|
|
|
<td>{{$clientHandout->handout->display_name}}</td>
|
|
|
<td>
|
|
|
- <a class="pdf-viewer-trigger" native target="_blank"
|
|
|
- href="/api/handout/download/{{ $clientHandout->handout->uid }}"
|
|
|
- title="View">View</a>
|
|
|
+ <a class="pdf-viewer-trigger" native target="_blank" href="/api/handout/download/{{ $clientHandout->handout->uid }}" title="View">View</a>
|
|
|
</td>
|
|
|
<td><b class="click-to-copy">{{ $downloadLink }}</b></td>
|
|
|
<td>
|
|
@@ -87,49 +91,57 @@
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
- @endforeach
|
|
|
+ @endforeach
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
<script>
|
|
|
- var handoutSelectComponent = new Vue({
|
|
|
- el:'#handoutSelectComponent',
|
|
|
- data:{
|
|
|
- handouts:<?= json_encode($handouts) ?>,
|
|
|
- handoutsList: [],
|
|
|
- selectedHandoutUid: null,
|
|
|
- search: null
|
|
|
+ var handoutSelectComponent = new Vue({
|
|
|
+ el: '#handoutSelectComponent',
|
|
|
+ data: {
|
|
|
+ handouts: <?= json_encode($handouts) ?>,
|
|
|
+ handoutsList: [],
|
|
|
+ selectedHandoutUid: null,
|
|
|
+ search: null,
|
|
|
+ preview: null,
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ togglePreview: function(handoutUid) {
|
|
|
+ this.preview = handoutUid;
|
|
|
+ if (!handoutUid) {
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
- methods:{
|
|
|
- filterHandouts: function(evt){
|
|
|
- var self = this;
|
|
|
- self.search = evt.target.value;
|
|
|
+ filterHandouts: function(evt) {
|
|
|
+ var self = this;
|
|
|
+ self.search = evt.target.value;
|
|
|
|
|
|
- var obj = $.extend({}, {handouts:self.handouts});
|
|
|
- var handoutsList = obj.handouts;
|
|
|
-
|
|
|
- if(!self.search.length){
|
|
|
- self.handoutsList = handoutsList;
|
|
|
- return;
|
|
|
- }
|
|
|
+ var obj = $.extend({}, {
|
|
|
+ handouts: self.handouts
|
|
|
+ });
|
|
|
+ var handoutsList = obj.handouts;
|
|
|
|
|
|
- var data = [];
|
|
|
- for(var i = 0; i < handoutsList.length; i++){
|
|
|
- var handout = handoutsList[i];
|
|
|
- if( handout.display_name.toLowerCase().includes(self.search.toLowerCase())){
|
|
|
- data.push(handout);
|
|
|
- }
|
|
|
- }
|
|
|
- self.handoutsList = data;
|
|
|
+ if (!self.search.length) {
|
|
|
+ self.handoutsList = handoutsList;
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- },
|
|
|
- init: function(){
|
|
|
- this.handoutsList = this.handouts;
|
|
|
+ var data = [];
|
|
|
+ for (var i = 0; i < handoutsList.length; i++) {
|
|
|
+ var handout = handoutsList[i];
|
|
|
+ if (handout.display_name.toLowerCase().includes(self.search.toLowerCase())) {
|
|
|
+ data.push(handout);
|
|
|
+ }
|
|
|
}
|
|
|
+ self.handoutsList = data;
|
|
|
+
|
|
|
},
|
|
|
- mounted: function(){
|
|
|
- this.init();
|
|
|
+ init: function() {
|
|
|
+ this.handoutsList = this.handouts;
|
|
|
}
|
|
|
- });
|
|
|
-
|
|
|
+ },
|
|
|
+ mounted: function() {
|
|
|
+ this.init();
|
|
|
+ }
|
|
|
+ });
|
|
|
</script>
|