1
0
Fork 1

Add instructions page

pull/9/head
gravel 1 year ago
parent 16d70f3c6b
commit 83a80590f7
Signed by: gravel
SSH Key Fingerprint: SHA256:p4HP49CCk4YQMkJpWJ09L8peEPQWjERtdCRAFxPfbOY

@ -0,0 +1,20 @@
header {
text-align: center;
}
#instructions {
padding: 1em;
}
.instructions {
display: none;
/* Inconsistent with rest of content */
font-family: sans-serif;
font-weight: bold;
font-size: 1.25em;
line-height: 1.5;
padding: 2em;
background-color: silver;
border: 2px solid black;
border-radius: 1em;
}

@ -1,4 +1,14 @@
#headline { text-align: center; }
header {
display: flex;
direction: row;
/* Push items as far apart as possible */
justify-content: space-between;
}
#headline {
text-align: center;
flex-grow: 1;
}
#tbl_communities { width:100%; }

@ -0,0 +1,13 @@
On mobile:
- Click the Copy button to copy the Join URL.
- Open Session, tap the plus button and choose "Join Community".
- Tap the "Enter Community URL" field, paste your URL and tap "Join".
On mobile, with this site open on your PC:
- Click the QR Code button for your chosen community on your PC.
- Open Session, tap the plus button and choose "Join Community".
- Choose "Scan QR Code" at the top and point your phone camera at the QR code.

@ -0,0 +1,5 @@
Ĉe poŝtelefono:
- Klaki sur la butono "Copy" por kopii la kuniĝa ligilo.
- Malfermi Session-on, frapeti sur la plus-a butono kaj elekti "Kuniĝi komunumon".
- Frapeti sur "Entajpi komunuma liĝilo", elpoŝigi via ligilo kaj frapeti sur "Kuniĝi".

@ -18,13 +18,23 @@
<title>Self-updating list of active Session communities</title>
</head>
<body onload="onLoad(<?php echo $timestamp ?>)">
<h1 id="headline">Session Communities</h1>
<header>
<div id="header-start"></div>
<div id="header-end">
<a
id="link-instructions"
target="_blank"
href="instructions.html"
>Instructions</a>
</div>
</header>
<h1 id="headline">Session Communities</h1>
<?php include "+components/qr_modals.php" ?>
<?php include "+components/tbl_communities.php" ?>
<hr>
<footer>
<p id="server_summary">
<?=count($rooms_assoc)?> unique Session Communities

@ -0,0 +1,63 @@
<?php
include_once "+getenv.php";
$instruction_files = glob("+instructions/*.txt");
?>
<!DOCTYPE html>
<html>
<head>
<?php include "+components/page-head.php" ?>
<link rel="stylesheet" href="css/instructions.css">
<style type="text/css">
<?php foreach ($instruction_files as $i => $file): ?>
#language-selection-<?=$i?>:checked ~
#instructions #instructions-<?=$i?> {
display: block;
}
<?php endforeach; ?>
</style>
</head>
<body>
<header>
<h1>Instructions for joining Session Communities</h1>
</header>
<main>
Choose your language:
<?php foreach ($instruction_files as $i => $file): ?>
<br>
<input
id="language-selection-<?=$i?>"
class="language-selection"
name="language"
type="radio"
>
<label for="language-selection-<?=$i?>">
<?=
// Name of the language
// Can be later parsed from i.e. first line of file
pathinfo($file)['filename']
?>
</label>
<?php endforeach; ?>
<article id="instructions">
<?php foreach ($instruction_files as $i => $file): ?>
<section id="instructions-<?=$i?>" class="instructions"><?php
// Sanitization as second layer of protection
// for user-submitted instruction files.
// Should not ever have to be used.
$content = trim(file_get_contents($file));
$content = htmlentities($content);
// Minimal formatting so that contributions are easier
$content = str_replace("\n-", "\n\n•", $content);
$content = str_replace("\n\n\n", "<br><br>", $content);
$content = str_replace("\n\n", "<br>", $content);
echo $content;
?>
</section>
<?php endforeach; ?>
</article>
</main>
</body>
</html>