notification mark read

This commit is contained in:
realaravinth
2021-07-16 21:16:49 +05:30
parent 102ef5b4a1
commit 6f690734c5
14 changed files with 89 additions and 41 deletions

View File

@@ -30,8 +30,7 @@ import createError from '../../../components/error';
import VIEWS from '../../../views/v1/routes';
const BTN = <HTMLElement>document.querySelector('.sitekey-form__submit');
const key = BTN.dataset.sitekey;
const BTN_CLASS = document.querySelector('sitekey-form__submit');
const submit = async (e: Event) => {
e.preventDefault();
@@ -44,6 +43,9 @@ const submit = async (e: Event) => {
const levels = LEVELS.getLevels();
console.debug(`[form submition]: levels: ${levels}`);
const btn = <HTMLElement>document.querySelector(`${BTN_CLASS}`);
const key = btn.dataset.sitekey;
const payload = {
levels,
duration,

View File

@@ -44,6 +44,7 @@ include!("../../navbar/index.html"); .>
</td>
<td class="sitekey-list__key">
<div class="sitekey-list__edit">
<. let key = format!("/sitekey/{}", &sitekey.key); .>
<. include!("../view/__edit-sitekey-icon.html"); .>
</div>
</td>

View File

@@ -1,4 +1,4 @@
<a href="./edit/">
<a href="<.= key .>/edit/">
<img class="sitekey-form__edit" src="<.=
crate::FILES.get("./static/cache/img/svg/edit.svg").unwrap() .>" alt="Edit
sitekey" />

View File

@@ -20,6 +20,7 @@
/>
</a>
<. if READONLY { .>
<. let key = "."; .>
<. include!("./__edit-sitekey-icon.html"); .>
<. } .>
</h1>