fc77ee76d6
The primary license of the project is changing to: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later The Additional Permission is designed to permit publicly distributed Javascript code to be relicensed under LGPL-3.0-or-later, but not server-side Javascript code. As such, we've relicensed here static Javscript files under LGPL-3.0-or-later, and those that run as part of build and/or server side under AGPL-3.0-or-later. Note that in future, Javascript files may be updated to be stronger copyleft license with the Additional Permission, particularly if they adapted to run on server side and/or turned into templates. Of course, we'd seek public discussion with the contributor community about such changes. This commit is one of the many steps to relicense the entire codebase. Documentation granting permission for this relicensing (from all past contributors who hold copyrights) is on file with Software Freedom Conservancy, Inc.
32 lines
932 B
JavaScript
32 lines
932 B
JavaScript
// License: LGPL-3.0-or-later
|
|
const R = require('ramda')
|
|
const flyd = require('flyd')
|
|
flyd.flatMap = require('flyd/module/flatmap')
|
|
const request = require('../../common/request')
|
|
const confirmation = require('../../common/confirmation')
|
|
|
|
const stream = flyd.stream()
|
|
|
|
var table = document.querySelector('.js-table')
|
|
table.addEventListener('click', ev=> {
|
|
if(ev.target.hasAttribute('data-remove-ticket')) {
|
|
confirmation('Are you sure you want to remove this attendee?',
|
|
() => stream(ev.target.getAttribute('data-ticket-id'))
|
|
)
|
|
}
|
|
})
|
|
|
|
const pathPrefix = `/nonprofits/${app.nonprofit_id}/events/${appl.event_id}/tickets/`
|
|
|
|
const response = flyd.flatMap(
|
|
ticketID => flyd.map(R.prop('body'), request({method: 'delete', path: pathPrefix + ticketID})).load
|
|
, stream )
|
|
|
|
// XXX remove viewscript here
|
|
flyd.map(
|
|
res => {
|
|
appl.notify('Successfully removed that attendee')
|
|
appl.tickets.index()
|
|
}
|
|
, response )
|
|
|