Publish Role

This commit is contained in:
saeid_01
2019-05-13 06:41:02 +04:30
parent fc9dfeaf00
commit 76e18cca1d
77 changed files with 705 additions and 131638 deletions
+8 -5
View File
@@ -6,7 +6,8 @@
text=""
>
<v-layout row wrap >
<v-flex v-for="(Card, Key ) in Cards" :class="[Card.column , 'pa-2']" :key="Key">
<template v-for="(Card, Key ) in Cards">
<v-flex v-if="!Card.role || $hasRole(Card.role)" :class="[Card.column , 'pa-2']" :key="Key">
<router-link :to="Card.route">
<material-cards
:title="Card.title"
@@ -18,6 +19,8 @@
/>
</router-link>
</v-flex>
</template>
</v-layout>
</material-card>
</v-container>
@@ -30,10 +33,10 @@ export default {
Cards :[
{title:'My Info', text:'You can easily edit your registration information',icon:'/img/Static/Dashboard/darkmug.png',color:'WM-OrangeGradient-BG',route:{name: 'MyInfo'},aligntext:'text-md-left',alignimg:'text-md-right', column:'xs12 md6 sm6'},
{title:'All Test Result', text:'You can see all user tests and own tests',icon:'/img/Static/Dashboard/pad.png',color:'WM-GreenGradient-BG',route:{name: 'AllResultTest'},aligntext:'text-md-left',alignimg:'text-md-right',column:'xs12 md6 sm6'},
{title:'Manage Users', text:'You can edit the medical center information',icon:'/img/Static/Dashboard/ipad.png',color:'WM-YellowPinkGradient-BG',route:{name: 'ManageUsers'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12'},
{title:'Manage Medical Center', text:'Managing users very fast by ...',icon:'/img/Static/Dashboard/Macbook.png',color:'WM-MuskGradient-BG',route:{name: 'ManageMedicalCenter'},aligntext:'text-md-left',alignimg:'text-md-right',column:'xs12 md7 sm7'},
{title:'List Test Type', text:'You can simply add your own test type',icon:'/img/Static/Dashboard/Book-and-Pen.png',color:'WM-GreyGradient-BG',route:{name: 'ListTestType'},aligntext:'text-md-left',alignimg:'text-md-right',column:'xs12 md5 sm5'},
{title:'Test to Verify', text:'You can simply add your own test type in this section of website',icon:'/img/Static/Dashboard/notepad-colorful.png',color:'WM-PinkGradient-BG',route:{name: 'NotVerifyTestResult'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12'},
{title:'Manage Users', text:'You can edit the medical center information',icon:'/img/Static/Dashboard/ipad.png',color:'WM-YellowPinkGradient-BG',route:{name: 'ManageUsers'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12', role: 'Admin|Supervisor'},
{title:'Manage Medical Center', text:'Managing users very fast by ...',icon:'/img/Static/Dashboard/Macbook.png',color:'WM-MuskGradient-BG',route:{name: 'ManageMedicalCenter'},aligntext:'text-md-left',alignimg:'text-md-right',column:'xs12 md7 sm7', role: 'Admin'},
{title:'List Test Type', text:'You can simply add your own test type',icon:'/img/Static/Dashboard/Book-and-Pen.png',color:'WM-GreyGradient-BG',route:{name: 'ListTestType'},aligntext:'text-md-left',alignimg:'text-md-right',column:'xs12 md5 sm5', role: 'Admin'},
{title:'Test to Verify', text:'You can simply add your own test type in this section of website',icon:'/img/Static/Dashboard/notepad-colorful.png',color:'WM-PinkGradient-BG',route:{name: 'NotVerifyTestResult'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12', role: 'Admin|Supervisor'},
{title:'Add a Test Result', text:'You can edit the medical center information',icon:'/img/Static/Dashboard/ipad.png',color:'WM-YellowPinkGradient-BG',route:{name: 'SubmitTestResult'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12'},
]
}
+3 -2
View File
@@ -40,7 +40,7 @@
</template>
<template slot="items" slot-scope="{ item }">
<td class="headline font-weight-light">{{ item.autoclave_id }}</td>
<td class="title font-weight-light">{{ item.test_type.name }}</td>
<td class="title font-weight-light">{{ item.test_type ? item.test_type.name : 'Archived Test' }}</td>
<td class="title font-weight-light" >{{ item.user.medical_center.name }}</td>
<td class="title font-weight-light">{{ item.user.name }}</td>
<td class="title font-weight-light">{{ item.result }}</td>
@@ -51,7 +51,7 @@
<v-icon class="white--text mr-1 caption">fas fa-eye</v-icon>
<span>Show</span>
</v-btn>
<router-link
<router-link v-if="$hasRole('Admin') || item.user_id == $store.state.user.id"
:to="{name: 'EditTestResult', params: {testResult: item.id}}"
>
<v-btn color="orange" class="mr-2">
@@ -63,6 +63,7 @@
color="pink"
class="WM-ActionButton"
@click="remove(item.id)"
v-if="$hasRole('Admin') || item.user_id == $store.state.user.id"
>
<v-icon class="white--text mr-2 caption">fas fa-times</v-icon>
<span>Remove</span>
+5 -2
View File
@@ -56,7 +56,8 @@
<template
slot="items"
slot-scope="{ item }">
<td class="headline font-weight-light">{{item.name}}</td>
<td class="headline font-weight-light">{{item.name}}<br />
<span class="WM-Font-14" >{{item.cell_number}}</span></td>
<td class="title font-weight-light">{{item.created_at}}</td>
<td class="title font-weight-light">
<span v-for="(role, key) in item.roles" :key="key">{{ role.name }}</span>
@@ -67,6 +68,7 @@
:color="item.status == 'Active' ? 'red' : 'green'"
@click="changeStatus(item.id)"
class="mr-2 WM-ActionButton"
v-if="$hasRole('Admin|Supervisor')"
>
<template v-if="item.status == 'Active'">
<v-icon class="white--text mr-2 caption">fas fa-user-tag</v-icon>
@@ -81,11 +83,12 @@
color="orange darken-1"
@click="changeRoleModal(item)"
class="mr-2 WM-ActionButton"
v-if="$hasRole('Admin')"
>
<v-icon class="white--text mr-2 caption">fas fa-user-tag</v-icon>
<span>Role</span>
</v-btn>
<v-btn color="pink" class="WM-ActionButton" @click="remove(item.id)">
<v-btn color="pink" v-if="$hasRole('Admin')" class="WM-ActionButton" @click="remove(item.id)">
<v-icon class="white--text mr-2 caption">fas fa-times</v-icon>
<span>Remove</span>
</v-btn>