|
@@ -38,7 +38,10 @@ if($patient->rtm_msk_protocol_detail_json) {
|
|
|
<div class="d-flex align-items-baseline">
|
|
|
<img v-if="exercise.image" :src="exercise.image" :alt="exercise.name" class="image-w90px mr-2 align-self-start">
|
|
|
<div>
|
|
|
- <div class="font-weight-bold">@{{exercise.name}}</div>
|
|
|
+ <div class="d-flex align-items-baseline">
|
|
|
+ <div class="font-weight-bold">@{{exercise.name}}</div>
|
|
|
+ <div class="text-success text-sm ml-2" v-if="isAdded(exercise.name)"><i class="fa fa-check"></i> Added</div>
|
|
|
+ </div>
|
|
|
<div class="text-secondary text-sm">@{{exercise.description}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -238,6 +241,7 @@ if($patient->rtm_msk_protocol_detail_json) {
|
|
|
this.showCustomAdd = !this.showCustomAdd;
|
|
|
},
|
|
|
addActivity: function(_exercise) {
|
|
|
+ if(this.isAdded(_exercise.name)) return false;
|
|
|
let activity = {
|
|
|
name: _exercise.name,
|
|
|
description: _exercise.description,
|
|
@@ -253,7 +257,9 @@ if($patient->rtm_msk_protocol_detail_json) {
|
|
|
});
|
|
|
}
|
|
|
this.protocol.activities.push(activity);
|
|
|
- this.showLibrary = false;
|
|
|
+ },
|
|
|
+ isAdded: function(_name) {
|
|
|
+ return this.protocol.activities.filter(_x => _x.name === _name).length > 0;
|
|
|
},
|
|
|
saveProtocol: function() {
|
|
|
$.post('/api/clientRtm/updateRtmMskProtocolDetailJson', {
|