#7: notes for attendees
This commit is contained in:
parent
dc6db6b6b0
commit
4a52f37333
2 changed files with 89 additions and 12 deletions
|
@ -1,12 +1,23 @@
|
||||||
<template>
|
<template>
|
||||||
<md-list-item class="attendee-list-item" :key="attendee._id">
|
<md-list-item class="attendee-list-item md-double-line" :key="attendee._id">
|
||||||
<md-icon>person</md-icon>
|
<md-icon>person</md-icon>
|
||||||
<span v-if="!edit">{{attendee.name}}</span>
|
<div v-if="!edit" class="md-list-text-container">
|
||||||
<md-input-container md-inline v-if="edit">
|
<span>{{ attendee.name }}</span>
|
||||||
<md-input @keyup.enter.native="updateAttendee()" v-model="attendee.name" ref="updateAttendeeName" />
|
<span v-if="attendee.notes" class="attendee-notes">{{ attendee.notes }}</span>
|
||||||
</md-input-container>
|
</div>
|
||||||
|
<div v-if="edit">
|
||||||
|
<md-input-container md-inline>
|
||||||
|
<md-input @keyup.enter.native="updateAttendee()" @keydown.esc.native="edit = false" v-model="attendee.name" ref="updateAttendeeName" />
|
||||||
|
</md-input-container>
|
||||||
|
<div class="notes-editor-list-item">
|
||||||
|
<md-input-container md-inline>
|
||||||
|
<label>notes</label>
|
||||||
|
<md-input class="attendee-notes" @keyup.enter.native="updateAttendee()" @keydown.esc.native="edit = false" v-model="attendee.notes" />
|
||||||
|
</md-input-container>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<md-menu v-if="isAuthorized(attendee.created_by)" md-align-trigger>
|
<md-menu v-if="isAuthorized(attendee.created_by) && !edit" md-align-trigger>
|
||||||
<md-button class="md-icon-button" md-menu-trigger>
|
<md-button class="md-icon-button" md-menu-trigger>
|
||||||
<md-icon>more_vert</md-icon>
|
<md-icon>more_vert</md-icon>
|
||||||
</md-button>
|
</md-button>
|
||||||
|
@ -97,4 +108,31 @@ export default {
|
||||||
min-width: 250px;
|
min-width: 250px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.attendee-notes {
|
||||||
|
font-style: italic !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notes-editor-list-item {
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
padding-left: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notes-editor-list-item ul {
|
||||||
|
padding-top: 0px !important;
|
||||||
|
padding-bottom: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notes-editor-list-item .md-theme-default.md-list {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.notes-editor-list-item button:hover {
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attendee-notes {
|
||||||
|
max-width: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
|
<!-- XXX: too much duplication in this template -->
|
||||||
<md-layout class="group-layout" md-col gutter="120" md-align="start">
|
<md-layout class="group-layout" md-col gutter="120" md-align="start">
|
||||||
<md-card v-if="!addNewGroup" md-with-hover @mouseenter.native="focusToNewAttendee()">
|
<md-card v-if="!addNewGroup" md-with-hover @mouseenter.native="focusToNewAttendee()">
|
||||||
<md-card-header class="group-header">
|
<md-card-header class="group-header">
|
||||||
|
@ -12,11 +13,22 @@
|
||||||
<md-list md-dense>
|
<md-list md-dense>
|
||||||
<attendee v-for="attendee in group.attendees || []" :attendee="attendee" @updated="reload" />
|
<attendee v-for="attendee in group.attendees || []" :attendee="attendee" @updated="reload" />
|
||||||
<md-list-item class="attendee-add">
|
<md-list-item class="attendee-add">
|
||||||
<md-icon>person_add</md-icon>
|
<md-icon @click.native="addAttendee(group.group)">person_add</md-icon>
|
||||||
<md-input-container class="new-attendee">
|
<md-input-container class="new-attendee">
|
||||||
<label>new attendee</label>
|
<label>new attendee</label>
|
||||||
<md-input ref="newAttendeeInput" @keyup.enter.native="addAttendee(group.group, newAttendee)" v-model="newAttendee" class="attendee-add-name" />
|
<md-input ref="newAttendeeInput" @keyup.enter.native="addAttendee(group.group)" v-model="newAttendee" />
|
||||||
</md-input-container>
|
</md-input-container>
|
||||||
|
|
||||||
|
<md-list-expand>
|
||||||
|
<md-list>
|
||||||
|
<md-list-item class="md-inset">
|
||||||
|
<md-input-container>
|
||||||
|
<label>notes</label>
|
||||||
|
<md-input class="new-attendee-notes" @keyup.enter.native="addAttendee(group.group)" v-model="newAttendeeNotes" />
|
||||||
|
</md-input-container>
|
||||||
|
</md-list-item>
|
||||||
|
</md-list>
|
||||||
|
</md-list-expand>
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
</md-list>
|
</md-list>
|
||||||
</md-card-content>
|
</md-card-content>
|
||||||
|
@ -32,11 +44,22 @@
|
||||||
<md-card-content>
|
<md-card-content>
|
||||||
<md-list v-show="newGroup">
|
<md-list v-show="newGroup">
|
||||||
<md-list-item class="attendee-add">
|
<md-list-item class="attendee-add">
|
||||||
<md-icon>person_add</md-icon>
|
<md-icon @click.native="addAttendee(newGroup)">person_add</md-icon>
|
||||||
<md-input-container>
|
<md-input-container>
|
||||||
<label>new attendee</label>
|
<label>new attendee</label>
|
||||||
<md-input ref="newAttendeeInput" @keyup.enter.native="addAttendee(newGroup, newAttendee)" v-model="newAttendee" class="attendee-add-name" />
|
<md-input ref="newAttendeeInput" @keyup.enter.native="addAttendee(newGroup)" v-model="newAttendee" />
|
||||||
</md-input-container>
|
</md-input-container>
|
||||||
|
|
||||||
|
<md-list-expand>
|
||||||
|
<md-list>
|
||||||
|
<md-list-item class="md-inset">
|
||||||
|
<md-input-container>
|
||||||
|
<label>notes</label>
|
||||||
|
<md-input class="new-attendee-notes" @keyup.enter.native="addAttendee(newGroup)" v-model="newAttendeeNotes" />
|
||||||
|
</md-input-container>
|
||||||
|
</md-list-item>
|
||||||
|
</md-list>
|
||||||
|
</md-list-expand>
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
</md-list>
|
</md-list>
|
||||||
</md-card-content>
|
</md-card-content>
|
||||||
|
@ -53,7 +76,11 @@ export default {
|
||||||
props: {group: {}, day: {}, addNewGroup: {default: false}},
|
props: {group: {}, day: {}, addNewGroup: {default: false}},
|
||||||
|
|
||||||
data: function () {
|
data: function () {
|
||||||
return { newAttendee: '', newGroup: '' }
|
return {
|
||||||
|
newAttendee: '',
|
||||||
|
newAttendeeNotes: '',
|
||||||
|
newGroup: ''
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -69,6 +96,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
reset() {
|
reset() {
|
||||||
this.newAttendee = '';
|
this.newAttendee = '';
|
||||||
|
this.newAttendeeNotes = '';
|
||||||
this.newGroup = '';
|
this.newGroup = '';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -86,7 +114,14 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
addAttendee(group, newAttendee) {
|
addAttendee(group, newAttendee) {
|
||||||
this.attendeesUrl.save({day: this.day, group: group, name: newAttendee}).then((response) => {
|
newAttendee = newAttendee || this.newAttendee;
|
||||||
|
var attendee = {
|
||||||
|
day: this.day,
|
||||||
|
group: group,
|
||||||
|
name: newAttendee,
|
||||||
|
notes: this.newAttendeeNotes
|
||||||
|
};
|
||||||
|
this.attendeesUrl.save(attendee).then((response) => {
|
||||||
return response.json();
|
return response.json();
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
this.$refs.dialogObj.show({text: 'unable to add the attendee'});
|
this.$refs.dialogObj.show({text: 'unable to add the attendee'});
|
||||||
|
@ -150,4 +185,8 @@ export default {
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.new-attendee-notes {
|
||||||
|
max-width: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue