Skip to content

Commit

Permalink
✨ : add a vue component to display user badge
Browse files Browse the repository at this point in the history
  • Loading branch information
cdubuisson committed Aug 9, 2019
1 parent 862652c commit 0cfe94f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/main/resources/templates/vue_templates/user-badge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template id="user-badge-template">
<span class="user_badge" :class="cssClass">
<a href="#">{{user.username}}</a>
<i v-if="user.admin" class="fas fa-user-shield"></i>
</span>
</template>

<script>
Vue.component('user-badge', {
template: '#user-badge-template',
props: ['user', 'cssClass'],
});
</script>

<style scoped>
.user_badge a {
color: #3273dc !important;
text-decoration: none !important;
}
.user_badge .fa-user-shield {
color: #ff9900;
}
</style>

0 comments on commit 0cfe94f

Please sign in to comment.