Skip to content

Commit

Permalink
Add Label to Detail View
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpiesse committed Sep 30, 2018
1 parent d37bf9d commit 27e3f0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions resources/js/components/DetailField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class="inline-block rounded-full w-2 h-2 mr-1"
:class="{'bg-success': field.value, 'bg-danger': !field.value}"
/>
<span>{{ label }}</span>
<span v-if="label != null">{{ label }}</span>
</p>
</panel-item>
</template>
Expand All @@ -15,8 +15,16 @@ export default {
props: ['resource', 'resourceName', 'resourceId', 'field'],
computed: {
trueLabel(){
return (this.field.true_label != undefined) ? this.field.true_label : null
},
falseLabel(){
return (this.field.false_label != undefined) ? this.field.false_label : null
},
label() {
return this.field.value == true ? 'True' : 'False'
return this.field.value == true ? this.trueLabel : this.falseLabel
},
},
}
Expand Down

0 comments on commit 27e3f0b

Please sign in to comment.