mirror of
https://github.com/GCMatters/hermes.git
synced 2026-02-04 21:50:12 +01:00
fix: front-end improvements
makes some fields visible and other hidden depending on the result of some API calls, e.g. visitor is logged in -> show "Log out" button
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
@@ -8,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
console.log("TypeScript działa!");
|
||||
import { getMyAccount, unhideElementById } from './generalUseHelpers.js';
|
||||
function createEvent() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// Pobieranie danych z formularza
|
||||
@@ -49,6 +48,17 @@ function createEvent() {
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const saveBtn = document.getElementById("saveBtn");
|
||||
var user = yield getMyAccount();
|
||||
if (user) {
|
||||
if (user.isOrganisation) {
|
||||
unhideElementById(document, "mainContainer");
|
||||
}
|
||||
unhideElementById(document, "logout-btn");
|
||||
}
|
||||
else {
|
||||
unhideElementById(document, "joinnow-btn");
|
||||
unhideElementById(document, "signin-btn");
|
||||
}
|
||||
if (saveBtn) {
|
||||
saveBtn.addEventListener("click", (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user