Rename public group URLs to halls
This commit is contained in:
+10
-10
@@ -20,16 +20,16 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
document.getElementById('groupform').onsubmit = async function(e) {
|
||||
document.getElementById('hallform').onsubmit = async function(e) {
|
||||
e.preventDefault();
|
||||
clearError();
|
||||
let groupinput = document.getElementById('group')
|
||||
let groupinput = document.getElementById('hall')
|
||||
let button = document.getElementById('submitbutton');
|
||||
|
||||
let group = groupinput.value.trim();
|
||||
if(group === '')
|
||||
return;
|
||||
let url = '/group/' + group + '/';
|
||||
let url = '/hall/' + group + '/';
|
||||
let statusUrl = url + '.status.json';
|
||||
|
||||
try {
|
||||
@@ -78,25 +78,25 @@ function clearError() {
|
||||
}
|
||||
}
|
||||
|
||||
async function listPublicGroups() {
|
||||
let div = document.getElementById('public-groups');
|
||||
let table = document.getElementById('public-groups-table');
|
||||
async function listPublicHalls() {
|
||||
let div = document.getElementById('public-halls');
|
||||
let table = document.getElementById('public-halls-table');
|
||||
|
||||
let l;
|
||||
try {
|
||||
let r = await fetch('/public-groups.json');
|
||||
let r = await fetch('/public-halls.json');
|
||||
if(!r.ok)
|
||||
throw new Error(`${r.status} ${r.statusText}`);
|
||||
l = await r.json();
|
||||
} catch(e) {
|
||||
table.textContent = `Couldn't fetch groups: ${e}`;
|
||||
table.textContent = `Couldn't fetch halls: ${e}`;
|
||||
div.classList.remove('nogroups');
|
||||
div.classList.add('groups');
|
||||
return;
|
||||
}
|
||||
|
||||
if (l.length === 0) {
|
||||
table.textContent = '(No groups found.)';
|
||||
table.textContent = '(No halls found.)';
|
||||
div.classList.remove('groups');
|
||||
div.classList.add('nogroups');
|
||||
return;
|
||||
@@ -131,4 +131,4 @@ async function listPublicGroups() {
|
||||
}
|
||||
|
||||
|
||||
listPublicGroups();
|
||||
listPublicHalls();
|
||||
|
||||
Reference in New Issue
Block a user