editing cws as admin
This commit is contained in:
parent
b8c0824bda
commit
ddbd3134d6
5 changed files with 37 additions and 20 deletions
|
@ -18,7 +18,10 @@ if ($_GET["pw"] === $adminPassword) {
|
||||||
|
|
||||||
echo("
|
echo("
|
||||||
<h2 class=\"sect\">enter password</h2>
|
<h2 class=\"sect\">enter password</h2>
|
||||||
<form class=\"frm\" action=\"index.php\"><input id=\"passinput\" name=\"pw\" required=\"\"><br><button class=\"submitbutton\" type=\"submit\">login</button></form>
|
<form class=\"frm\" action=\"index.php\">
|
||||||
|
<input name=\"pw\" required=\"\"><br>
|
||||||
|
<input type=\"submit\" value=\"login\">
|
||||||
|
</form>
|
||||||
");
|
");
|
||||||
|
|
||||||
include "../boilerplate/pageEnd.php";
|
include "../boilerplate/pageEnd.php";
|
||||||
|
|
|
@ -16,8 +16,19 @@ if ($_GET["text"] !== null) {
|
||||||
WHERE id = {$id};
|
WHERE id = {$id};
|
||||||
";
|
";
|
||||||
|
|
||||||
|
$cw = $_GET["cw"];
|
||||||
|
$cwEnabled = strlen($cw) !== 0;
|
||||||
|
|
||||||
pg_query($db, $query);
|
pg_query($db, $query);
|
||||||
pg_update($db, "data", array("responsetext" => $text), array("id" => $id));
|
pg_update(
|
||||||
|
$db, "data",
|
||||||
|
array(
|
||||||
|
"responsetext" => $text,
|
||||||
|
"iscwed" => $cwEnabled,
|
||||||
|
"cw" => $cw
|
||||||
|
),
|
||||||
|
array("id" => $id)
|
||||||
|
);
|
||||||
|
|
||||||
if ($fediEnabled) {
|
if ($fediEnabled) {
|
||||||
include "fedi.php";
|
include "fedi.php";
|
||||||
|
|
|
@ -70,15 +70,20 @@ function getQuestion(
|
||||||
$q .= "<h3>enter a response</h3>";
|
$q .= "<h3>enter a response</h3>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$q .= "
|
$q .= "<form class=\"frm\" action=\"index.php\">
|
||||||
<form class=\"frm\" action=\"index.php\">
|
<input hidden name=\"id\" value=\"{$question['id']}\">
|
||||||
<input hidden name=\"id\" value=\"{$question['id']}\">
|
<input hidden name=\"page\" value=\"respond\">
|
||||||
<input hidden name=\"page\" value=\"respond\">
|
<input hidden name=\"pw\" value=\"{$adminPassword}\">
|
||||||
<input hidden name=\"pw\" value=\"{$adminPassword}\">
|
<input name=\"text\" value=\"{$question['responsetext']}\" autofocus required><br>
|
||||||
<input id=\"passinput\" name=\"text\" value=\"{$question['responsetext']}\" autofocus required><br>
|
|
||||||
<button class=\"submitbutton\" type=\"submit\">send</button>
|
|
||||||
</form>
|
|
||||||
";
|
";
|
||||||
|
|
||||||
|
if ($question["iscwed"] === "t") {
|
||||||
|
$q .= "cw: <input name=\"cw\" value=\"{$question['cw']}\"><br>";
|
||||||
|
} else {
|
||||||
|
$q .= "cw: <input name=\"cw\"><br>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$q .= "<input type=\"submit\" value=\"send\"></form>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($includePermalink === 1) {
|
if ($includePermalink === 1) {
|
||||||
|
|
16
css/base.css
16
css/base.css
|
@ -102,24 +102,22 @@ img.emoji {
|
||||||
padding: .7em;
|
padding: .7em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#passinput,
|
input:not(
|
||||||
#questioninput,
|
[type="checkbox"]
|
||||||
#cwinput,
|
) {
|
||||||
.submitbutton {
|
|
||||||
background-color: var(--input-background);
|
background-color: var(--input-background);
|
||||||
color: var(--input-text);
|
color: var(--input-text);
|
||||||
margin-bottom: .3em;
|
margin-bottom: .3em;
|
||||||
border: var(--input-border);
|
border: var(--input-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
#passinput:focus,
|
input:not(
|
||||||
#questioninput:focus,
|
[type="checkbox"]
|
||||||
#cwinput:focus,
|
):focus {
|
||||||
.submitbutton:focus {
|
|
||||||
outline: var(--input-focus-outline);
|
outline: var(--input-focus-outline);
|
||||||
}
|
}
|
||||||
|
|
||||||
.submitbutton {
|
input[type="submit"] {
|
||||||
font-size: 1.17em;
|
font-size: 1.17em;
|
||||||
margin-top: .3em;
|
margin-top: .3em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ if ($_GET["sent"] == 1) {
|
||||||
<input id="cwinput" name="cw"><br>
|
<input id="cwinput" name="cw"><br>
|
||||||
<input type="checkbox" id="pubbox" name="public" value="1" checked>
|
<input type="checkbox" id="pubbox" name="public" value="1" checked>
|
||||||
<label for="pubbox">if this is checked, your message will be available publicly</label><br>
|
<label for="pubbox">if this is checked, your message will be available publicly</label><br>
|
||||||
<button class="submitbutton" type="submit">send!</button>
|
<input type="submit" value="send">
|
||||||
</form>
|
</form>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue