mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-12 23:27:22 +00:00
VC/Zoom: Confirm making yourself alternative host (#149)
This commit is contained in:
parent
e37eff0f93
commit
a9ccd18b3d
@ -7,6 +7,12 @@ source_file = vc_zoom/indico_vc_zoom/translations/messages.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[indico.vc-zoom-messages-js]
|
||||
file_filter = vc_zoom/indico_vc_zoom/translations/<lang>/LC_MESSAGES/messages-js.po
|
||||
source_file = vc_zoom/indico_vc_zoom/translations/messages-js.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[indico.piwik-messages]
|
||||
file_filter = piwik/indico_piwik/translations/<lang>/LC_MESSAGES/messages.po
|
||||
source_file = piwik/indico_piwik/translations/messages.pot
|
||||
|
||||
@ -5,8 +5,12 @@
|
||||
// them and/or modify them under the terms of the MIT License;
|
||||
// see the LICENSE file for more details.
|
||||
|
||||
/* global confirmPrompt:false, $T:false */
|
||||
|
||||
import {handleAxiosError, indicoAxios} from 'indico/utils/axios';
|
||||
|
||||
const $t = $T.domain('vc_zoom');
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
$('.vc-toolbar').dropdown({
|
||||
positioning: {
|
||||
@ -15,15 +19,20 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
});
|
||||
|
||||
document.querySelectorAll('.vc-toolbar .action-make-host').forEach(elem => {
|
||||
elem.addEventListener('click', async () => {
|
||||
const killProgress = IndicoUI.Dialogs.Util.progress();
|
||||
try {
|
||||
await indicoAxios.post(elem.dataset.href);
|
||||
window.location.reload();
|
||||
} catch (error) {
|
||||
handleAxiosError(error);
|
||||
killProgress();
|
||||
}
|
||||
elem.addEventListener('click', () => {
|
||||
confirmPrompt(
|
||||
$t.gettext('Are you sure you want to be added as an alternative host?'),
|
||||
$t.gettext('Make me an alternative host')
|
||||
).then(async () => {
|
||||
const killProgress = IndicoUI.Dialogs.Util.progress();
|
||||
try {
|
||||
await indicoAxios.post(elem.dataset.href);
|
||||
window.location.reload();
|
||||
} catch (error) {
|
||||
handleAxiosError(error);
|
||||
killProgress();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<li>
|
||||
<a href="#"
|
||||
title="{% trans %}You will become an alternative host of this Zoom meeting{% endtrans %}"
|
||||
class="action-make-host"}}"
|
||||
class="action-make-host"
|
||||
data-href="{{ url_for_plugin('vc_zoom.make_me_alt_host', event_vc_room) }}">
|
||||
{% trans %}Make me alternative host{% endtrans %}
|
||||
</a>
|
||||
|
||||
27
vc_zoom/indico_vc_zoom/translations/messages-js.pot
Normal file
27
vc_zoom/indico_vc_zoom/translations/messages-js.pot
Normal file
@ -0,0 +1,27 @@
|
||||
# Translations template for PROJECT.
|
||||
# Copyright (C) 2021 ORGANIZATION
|
||||
# This file is distributed under the same license as the PROJECT project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2021.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2021-06-25 18:04+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.9.1\n"
|
||||
|
||||
#: indico_vc_zoom/client/index.js:24
|
||||
msgid "Are you sure you want to be added as an alternative host?"
|
||||
msgstr ""
|
||||
|
||||
#: indico_vc_zoom/client/index.js:25
|
||||
msgid "Make me an alternative host"
|
||||
msgstr ""
|
||||
|
||||
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2021-05-26 17:54+0200\n"
|
||||
"POT-Creation-Date: 2021-06-25 18:04+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user