Compare commits

...

2 Commits

Author SHA1 Message Date
korenstin 8ec42bcf2b Merge branch 'beta' into 'main'
api errors (fix #113), sortable tables, calendar (fix #95), opener (fix #117), colored linters, inclusif, bug july 31, 403 (fix #65)

Closes #65, #117, #95, and #113

See merge request bde/nk20!260
2024-08-10 11:51:38 +02:00
korenstin 28117c8c61 Add developers, Opener comments 2024-08-10 11:50:27 +02:00
2 changed files with 15 additions and 34 deletions

View File

@ -1,5 +1,5 @@
/** /**
* On form submit, create a new friendship * On form submit, add a new opener
*/ */
function form_create_opener (e) { function form_create_opener (e) {
// Do not submit HTML form // Do not submit HTML form
@ -16,9 +16,9 @@ function form_create_opener (e) {
} }
/** /**
* Create a trust between users * Add an opener between an activity and a user
* @param trusting:Integer trusting note id * @param activity:Integer activity id
* @param trusted:Integer trusted note id * @param opener:Integer user note id
*/ */
function create_opener(activity, opener) { function create_opener(activity, opener) {
$.post('/api/activity/opener/', { $.post('/api/activity/opener/', {
@ -28,36 +28,15 @@ function create_opener(activity, opener) {
}).done(function () { }).done(function () {
// Reload tables // Reload tables
$('#opener_table').load(location.pathname + ' #opener_table') $('#opener_table').load(location.pathname + ' #opener_table')
addMsg(gettext('Friendship successfully added'), 'success') addMsg(gettext('Opener successfully added'), 'success')
}).fail(function (xhr, _textStatus, _error) { }).fail(function (xhr, _textStatus, _error) {
errMsg(xhr.responseJSON) errMsg(xhr.responseJSON)
}) })
} }
/** /**
* On form submit, create a new friendship * On click of "delete", delete the opener
function create_opener (e) { * @param button_id:Integer Opener id to remove
// Do not submit HTML form
e.preventDefault()
// Get data and send to API
const formData = new FormData(e.target)
$.post('/api/activity/opener/', {
csrfmiddlewaretoken: formData.get('csrfmiddlewaretoken'),
activity: formData.get('activity'),
opener: formData.get('opener')
}).done(function () {
// Reload table
$('#opener_table').load(location.pathname + ' #opener_table')
addMsg(gettext('Alias successfully added'), 'success')
}).fail(function (xhr, _textStatus, _error) {
errMsg(xhr.responseJSON)
})
}*/
/**
* On click of "delete", delete the trust
* @param button_id:Integer Trust id to remove
*/ */
function delete_button (button_id) { function delete_button (button_id) {
$.ajax({ $.ajax({
@ -65,7 +44,7 @@ function delete_button (button_id) {
method: 'DELETE', method: 'DELETE',
headers: { 'X-CSRFTOKEN': CSRF_TOKEN } headers: { 'X-CSRFTOKEN': CSRF_TOKEN }
}).done(function () { }).done(function () {
addMsg(gettext('Friendship successfully deleted'), 'success') addMsg(gettext('Opener successfully deleted'), 'success')
$('#opener_table').load(location.pathname + ' #opener_table') $('#opener_table').load(location.pathname + ' #opener_table')
}).fail(function (xhr, _textStatus, _error) { }).fail(function (xhr, _textStatus, _error) {
errMsg(xhr.responseJSON) errMsg(xhr.responseJSON)

View File

@ -177,11 +177,13 @@ Contributeur⋅rices
Liste des contributeur⋅rices majeur⋅es, par ordre alphabétique : Liste des contributeur⋅rices majeur⋅es, par ordre alphabétique :
* Pierre-André « PAC » COMBY * bleizi
* Emmy « ÿnérant » D'ANELLO * erdnaxe
* Benjamin « esum » GRAILLOT * esum
* Alexandre « erdnaxe » IOOSS * korenst1
* Nicolas « nicomarg » MARGULIES * nicomarg
* PAC
* ÿnérant
Hébergement Hébergement