add sitekey helper in list sitekey page

This commit is contained in:
realaravinth 2021-08-12 08:38:09 +05:30
parent 78ebc46c64
commit 751a1046fb
No known key found for this signature in database
GPG key ID: AD9F0F08E855ED88
6 changed files with 74 additions and 76 deletions

View file

@ -1,19 +1,19 @@
/*
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use actix_identity::Identity;
use actix_web::{HttpResponse, Responder};

View file

@ -1,14 +1,7 @@
<ul class="taskbar">
<!--
<li class="taskbar__action">Brand Name</li>
-->
<li class="taskbar__spacer"></li>
<li class="taskbar__action">
<a class="taskbar__link" href="<.= crate::PAGES.panel.sitekey.add .>">
<button class="taskbar__add-site">
+ New Site
</button>
</a>
<. include!("./new-sitekey-btn.html"); .>
</li>
<li class="taskbar__action">
<img class="taskbar__icon" src="<.=
@ -23,7 +16,6 @@
alt="Notifications" />
</a>
</li>
<li class="taskbar__action">
<a href="<.= crate::V1_API_ROUTES.auth.logout .>">
<img class="taskbar__icon" src="<.=

View file

@ -0,0 +1,5 @@
<a class="taskbar__link" href="<.= crate::PAGES.panel.sitekey.add .>">
<button class="taskbar__add-site">
+ New Site
</button>
</a>

View file

@ -11,16 +11,8 @@ include!("./navbar/index.html"); .>
<. include!("./help-banner/index.html"); .>
<div class="inner-container">
<. if sitekeys.is_empty() { .>
<ul class="sitekey-list__box">
<p>
It looks like you don't have any sitekeys. Click
<a href="<.= crate::PAGES.panel.sitekey.add .>">here</a> to add new
sitekey.
</p>
</ul>
<. include!("./sitekey/list/empty-sitekey.html"); .>
<.} else {.>
<table class="sitekey__table">
<thead class="sitekey__table-heading">
<tr>
@ -53,16 +45,15 @@ include!("./navbar/index.html"); .>
</div>
</td>
<td class="sitekey-list__key">
<div class="sitekey-list__edit">
<. let key = format!("/sitekey/{}", &sitekey.key); .>
<. include!("./sitekey/view/__edit-sitekey-icon.html"); .>
</div>
<div class="sitekey-list__edit">
<. let key = format!("/sitekey/{}", &sitekey.key); .>
<. include!("./sitekey/view/__edit-sitekey-icon.html"); .>
</div>
</td>
</tr>
<. } .>
</tbody>
</table>
<.}.>
</div>
<. include!("../components/footers.html"); .>

View file

@ -0,0 +1,6 @@
<ul class="sitekey-list__box">
<p>
It looks like you don't have any sitekeys. Click <.
include!("../../header/taskbar/new-sitekey-btn.html"); .> to add new sitekey.
</p>
</ul>

View file

@ -12,47 +12,51 @@ include!("../../navbar/index.html"); .>
<!-- Main content container -->
<div class="inner-container">
<!-- Main menu/ important actions roaster -->
<table class="sitekey__table">
<thead class="sitekey__table-heading">
<tr>
<th colspan="4" class="sitekey__table-title-text">
Your Sitekeys
</th>
</tr>
</thead>
<tbody class="sitekey__body">
<. for sitekey in sitekeys.iter() { .>
<tr class="sitekey__item">
<td class="sitekey-list__name">
<a
href="/sitekey/<.= sitekey.key .>/"
class="sitekey-list__sitekey-link"
>
<.= sitekey.name .>
</a>
</td>
<td class="sitekey-list__key">
<div class="sitekey__key-container">
<. let clipboard_data = ("sitekey", &sitekey.key); .>
<. include!("../../../components/clipboard/index.html"); .>
<. if sitekeys.is_empty() { .>
<. include!("./empty-sitekey.html"); .>
<.} else {.>
<table class="sitekey__table">
<thead class="sitekey__table-heading">
<tr>
<th colspan="4" class="sitekey__table-title-text">
Your Sitekeys
</th>
</tr>
</thead>
<tbody class="sitekey__body">
<. for sitekey in sitekeys.iter() { .>
<tr class="sitekey__item">
<td class="sitekey-list__name">
<a
class="sitekey__widget-link"
href="<.= crate::WIDGET_ROUTES.verification_widget .>/?sitekey=<.= sitekey.key .>"
href="/sitekey/<.= sitekey.key .>/"
class="sitekey-list__sitekey-link"
>
<.= &sitekey.key[0..5] .>
<.= sitekey.name .>
</a>
</div>
</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>
</tr>
<. } .>
</tbody>
</table>
</td>
<td class="sitekey-list__key">
<div class="sitekey__key-container">
<. let clipboard_data = ("sitekey", &sitekey.key); .>
<. include!("../../../components/clipboard/index.html"); .>
<a
class="sitekey__widget-link"
href="<.= crate::WIDGET_ROUTES.verification_widget .>/?sitekey=<.= sitekey.key .>"
>
<.= &sitekey.key[0..5] .>
</a>
</div>
</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>
</tr>
<. } .>
</tbody>
</table>
<.}.>
</div>
<!-- end of container -->
<. include!("../../../components/footers.html"); .>