To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 0b4206cc authored by Hermann's avatar Hermann Committed by Sandro Lutz
Browse files

Add Remove Button for Event Signups

parent ac4fbdd5
......@@ -83,16 +83,32 @@ class ParticipantsTable {
});
}
getItemData(data) {
itemRow(data) {
// TODO list should not have hardcoded size outside of stylesheet
const hasPatchRights = data._links.self.methods.indexOf('PATCH') > -1;
return [
m('div', { style: { width: '9em' } }, dateFormatter(data._created)),
m(
'div',
{ style: { width: '18em' } },
{ style: { width: '12em' } },
data.user ? `${data.user.firstname} ${data.user.lastname}` : '',
),
m('div', { style: { width: '9em' } }, data.email),
m('div', { style: { 'flex-grow': '100' } }),
hasPatchRights ? m('div', m(Button, {
// Button to remove this eventsignup
className: 'red-row-button',
borders: false,
label: 'remove',
events: {
onclick: () => {
this.ctrl.handler.delete(data).then(() => {
this.ctrl.refresh();
m.redraw();
});
},
},
})) : '',
];
}
......@@ -107,7 +123,8 @@ class ParticipantsTable {
tableHeight: '275px',
controller: this.ctrl,
keys: signupConfig.tableKeys,
tileContent: this.getItemData,
tileContent: data => this.itemRow(data),
clickOnRows: false,
titles: [
{ text: 'Date of Signup', width: '9em' },
{ text: 'Name', width: '18em' },
......
......@@ -63,8 +63,6 @@ export default class RelationlistController {
query.page = pageNum;
query.where = { ...this.filter, ...this.query.where };
console.log(query.search);
return new Promise((resolve) => {
this.handler.get(query).then((data) => {
// update total number of pages
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment