use id as condition for menu, add owner name
This commit is contained in:
parent
cdd31516cf
commit
f9f1b6819c
|
|
@ -4,9 +4,9 @@
|
|||
<h3 class="project-widget__title">{{title}}</h3>
|
||||
|
||||
<entry-count-widget entry-count="4"></entry-count-widget>
|
||||
<owner-widget name="Hans Muster"></owner-widget>
|
||||
<owner-widget :name="owner"></owner-widget>
|
||||
</router-link>
|
||||
<widget-footer v-if="!isTeacher">
|
||||
<widget-footer v-if="isOwner">
|
||||
<template slot-scope="scope">
|
||||
<li class="popover-links__link"><a @click="$emit('delete', id)">Projekt löschen</a></li>
|
||||
<li class="popover-links__link"><a @click="$emit('edit', id)">Projekt bearbeiten</a></li>
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
import WidgetFooter from '@/components/WidgetFooter';
|
||||
|
||||
export default {
|
||||
props: ['title', 'appearance', 'slug', 'id', 'final', 'isTeacher'],
|
||||
props: ['title', 'appearance', 'slug', 'id', 'final', 'student', 'userId'],
|
||||
|
||||
components: {
|
||||
WidgetFooter,
|
||||
|
|
@ -34,6 +34,12 @@
|
|||
computed: {
|
||||
widgetClass () {
|
||||
return `project-widget--${this.appearance}`;
|
||||
},
|
||||
isOwner () {
|
||||
return this.student.id === this.userId;
|
||||
},
|
||||
owner () {
|
||||
return `${this.student.firstName} ${this.student.lastName}`
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -6,4 +6,9 @@ fragment ProjectParts on ProjectNode {
|
|||
slug
|
||||
objectives
|
||||
final
|
||||
student {
|
||||
firstName
|
||||
lastName
|
||||
id
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<project-widget
|
||||
v-for="project in projects"
|
||||
v-bind="project"
|
||||
:isTeacher="canManageContent"
|
||||
:userId="userId"
|
||||
@delete="deleteProject"
|
||||
@updateShare="updateShareState"
|
||||
@edit="editProject"
|
||||
|
|
@ -52,8 +52,8 @@
|
|||
},
|
||||
|
||||
computed: {
|
||||
canManageContent () {
|
||||
return this.me.permissions.includes('users.can_manage_school_class_content');
|
||||
userId () {
|
||||
return this.me.id;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue