mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 01:55:40 +00:00
sitekey list
This commit is contained in:
@@ -24,3 +24,4 @@ $secondary-backdrop: #2b2c30;
|
||||
$light-grey: rgba(0, 0, 0, 0.125);
|
||||
$white: #fff;
|
||||
$form-content-width: 90%;
|
||||
$black-text: #000;
|
||||
|
||||
40
templates/components/_box.scss
Normal file
40
templates/components/_box.scss
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
@import '../vars';
|
||||
|
||||
@mixin box-title {
|
||||
padding-left: 10px;
|
||||
font-size: 1rem;
|
||||
padding: 0.75rem 1.25rem;
|
||||
box-sizing: border-box;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
border-bottom: 0.1px solid $light-grey;
|
||||
}
|
||||
|
||||
@mixin box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 90%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
box-sizing: content-box;
|
||||
background-color: $white;
|
||||
margin: auto;
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
@@ -1,12 +1,9 @@
|
||||
<. include!("../components/headers.html"); .>
|
||||
<main>
|
||||
<div class="inner-container">
|
||||
<div class="error-box">
|
||||
<h1 class="error-title"><.= title .></h1>
|
||||
<p class="error-message"><.= message .></p>
|
||||
</div>
|
||||
<div class="inner-container">
|
||||
<div class="error-box">
|
||||
<h1 class="error-title"><.= title .></h1>
|
||||
<p class="error-message"><.= message .></p>
|
||||
</div>
|
||||
<!-- end of container -->
|
||||
</main>
|
||||
|
||||
</div>
|
||||
<!-- end of container -->
|
||||
<. include!("../components/footers.html"); .>
|
||||
|
||||
@@ -17,27 +17,14 @@
|
||||
|
||||
@import '../reset';
|
||||
@import '../vars';
|
||||
@import '../components/box';
|
||||
|
||||
.error-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 90%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
box-sizing: content-box;
|
||||
background-color: $white;
|
||||
margin: auto;
|
||||
padding-bottom: 30px;
|
||||
@include box;
|
||||
}
|
||||
|
||||
.error-title {
|
||||
padding-left: 10px;
|
||||
font-size: 1rem;
|
||||
padding: 0.75rem 1.25rem;
|
||||
box-sizing: border-box;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
border-bottom: 0.1px solid $light-grey;
|
||||
@include box-title;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
|
||||
@@ -24,14 +24,14 @@ import * as addSiteKey from './panel/add-site-key/';
|
||||
|
||||
import VIEWS from './views/v1/routes';
|
||||
|
||||
|
||||
import './auth/forms.scss';
|
||||
import './panel/main.scss';
|
||||
import './panel/header/sidebar/main.scss';
|
||||
import './panel/taskbar/main.scss';
|
||||
import './panel/help-banner/main.scss';
|
||||
import './panel/add-site-key/main.scss';
|
||||
|
||||
import './panel/site-keys/main.scss';
|
||||
import './errors/main.scss';
|
||||
|
||||
const router = new Router();
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ const validateDescription = (e: Event) => {
|
||||
const val = inputElement.value;
|
||||
const filed = 'Description';
|
||||
isBlankString(val, filed, e);
|
||||
return val;
|
||||
};
|
||||
|
||||
const validateDuration = (e: Event) => {
|
||||
@@ -71,7 +72,7 @@ const validateDuration = (e: Event) => {
|
||||
const submit = async (e: Event) => {
|
||||
e.preventDefault();
|
||||
|
||||
validateDescription(e);
|
||||
const description = validateDescription(e);
|
||||
const duration = validateDuration(e);
|
||||
|
||||
const formUrl = getFormUrl(FORM);
|
||||
@@ -82,6 +83,7 @@ const submit = async (e: Event) => {
|
||||
const payload = {
|
||||
levels: levels,
|
||||
duration,
|
||||
description,
|
||||
};
|
||||
|
||||
console.debug(`[form submition] json payload: ${JSON.stringify(payload)}`);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<. include!("../../components/headers.html"); .> <. include!("../header/index.html");
|
||||
.>
|
||||
<. include!("../../components/headers.html"); .> <.
|
||||
include!("../header/index.html"); .>
|
||||
|
||||
<main>
|
||||
<. include!("../taskbar/index.html"); .> <.
|
||||
@@ -7,7 +7,23 @@
|
||||
<!-- Main content container -->
|
||||
<div class="inner-container">
|
||||
<!-- Main menu/ important actions roaster -->
|
||||
<ul class="sitekey-list__box">
|
||||
<h1 class="sitekey-list__title">Your Sitekeys</h1>
|
||||
<. for sitekey in sitekeys.iter() { .>
|
||||
<a href="/sitekey/<.= sitekey.key .>/view" class="sitekey-list__item-container">
|
||||
<li class="sitekey-list__item">
|
||||
|
||||
<span class="sitekey-list__name">
|
||||
<.= sitekey.name .>
|
||||
</span>
|
||||
<span class="sitekey-list__key">
|
||||
<.= sitekey.key .>
|
||||
</span>
|
||||
</li>
|
||||
</a>
|
||||
|
||||
<. } .>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- end of container -->
|
||||
</main>
|
||||
|
||||
55
templates/panel/site-keys/main.scss
Normal file
55
templates/panel/site-keys/main.scss
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
@import '../../reset';
|
||||
@import '../../vars';
|
||||
@import '../../components/box';
|
||||
|
||||
.sitekey-list__box {
|
||||
@include box;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
.sitekey-list__title {
|
||||
@include box-title;
|
||||
}
|
||||
|
||||
.sitekey-list__item-container {
|
||||
display: block;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 0.1px solid $light-grey;
|
||||
padding: 20px;
|
||||
color: $black-text;
|
||||
}
|
||||
|
||||
.sitekey-list__item {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.sitekey-list__item-container:hover {
|
||||
background-color: $light-grey;
|
||||
}
|
||||
|
||||
.sitekey-list__name {
|
||||
flex: 3;
|
||||
}
|
||||
|
||||
.sitekey-list__key {
|
||||
flex: 1;
|
||||
}
|
||||
Reference in New Issue
Block a user