diff --git a/src/pages/panel/mod.rs b/src/pages/panel/mod.rs index 66eb42c3..45cb2f8a 100644 --- a/src/pages/panel/mod.rs +++ b/src/pages/panel/mod.rs @@ -37,6 +37,12 @@ lazy_static! { static ref INDEX: String = IndexPage::default().render_once().unwrap(); } +async fn panel() -> impl Responder { + HttpResponse::Ok() + .content_type("text/html; charset=utf-8") + .body(&*INDEX) +} + pub fn services(cfg: &mut actix_web::web::ServiceConfig) { use crate::define_resource; use crate::PAGES; @@ -45,12 +51,6 @@ pub fn services(cfg: &mut actix_web::web::ServiceConfig) { sitekey::services(cfg); } -async fn panel() -> impl Responder { - HttpResponse::Ok() - .content_type("text/html; charset=utf-8") - .body(&*INDEX) -} - pub mod routes { use super::sitekey::routes::Sitekey; pub struct Panel { diff --git a/src/pages/panel/sitekey/add.rs b/src/pages/panel/sitekey/add.rs index 57665840..7f288507 100644 --- a/src/pages/panel/sitekey/add.rs +++ b/src/pages/panel/sitekey/add.rs @@ -26,7 +26,7 @@ lazy_static! { } #[derive(TemplateOnce, Clone)] -#[template(path = "panel/add-site-key/index.html")] +#[template(path = "panel/sitekey/add/index.html")] pub struct IndexPage<'a> { pub levels: usize, pub form_title: &'a str, diff --git a/src/pages/panel/sitekey/list.rs b/src/pages/panel/sitekey/list.rs index 16c26232..54363407 100644 --- a/src/pages/panel/sitekey/list.rs +++ b/src/pages/panel/sitekey/list.rs @@ -24,7 +24,7 @@ use crate::errors::*; use crate::Data; #[derive(TemplateOnce, Clone)] -#[template(path = "panel/site-keys/index.html")] +#[template(path = "panel/sitekey/list/index.html")] pub struct IndexPage { sitekeys: SiteKeys, } diff --git a/templates/index.ts b/templates/index.ts index fb88885b..e787444f 100644 --- a/templates/index.ts +++ b/templates/index.ts @@ -20,7 +20,7 @@ import {Router} from './router'; import * as login from './auth/login'; import * as register from './auth/register'; import * as panel from './panel/index'; -import * as addSiteKey from './panel/add-site-key/'; +import * as addSiteKey from './panel/sitekey/add/'; import VIEWS from './views/v1/routes'; @@ -29,8 +29,9 @@ 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 './panel/sitekey/add/main.scss'; +import './panel/sitekey/list/main.scss'; + import './errors/main.scss'; const router = new Router(); @@ -41,3 +42,6 @@ router.register(VIEWS.loginUser, login.index); router.register(VIEWS.addSiteKey, addSiteKey.index); router.route(); + + + diff --git a/templates/panel/add-site-key/index.html b/templates/panel/add-site-key/index.html deleted file mode 100644 index b229c2b1..00000000 --- a/templates/panel/add-site-key/index.html +++ /dev/null @@ -1,15 +0,0 @@ -<. include!("../../components/headers.html"); .> <. include!("../header/index.html"); -.> - -
- <. include!("../taskbar/index.html"); .> <. - include!("../help-banner/index.html"); .> - -
- - - <. include!("../add-site-key/form.html"); .> -
- -
-<. include!("../../components/footers.html"); .> diff --git a/templates/panel/icon-trans.png b/templates/panel/icon-trans.png deleted file mode 100644 index db8da876..00000000 Binary files a/templates/panel/icon-trans.png and /dev/null differ diff --git a/templates/panel/add-site-key/add-level.html b/templates/panel/sitekey/add/add-level.html similarity index 100% rename from templates/panel/add-site-key/add-level.html rename to templates/panel/sitekey/add/add-level.html diff --git a/templates/panel/add-site-key/addLevelButton.ts b/templates/panel/sitekey/add/addLevelButton.ts similarity index 100% rename from templates/panel/add-site-key/addLevelButton.ts rename to templates/panel/sitekey/add/addLevelButton.ts diff --git a/templates/panel/add-site-key/const.ts b/templates/panel/sitekey/add/const.ts similarity index 100% rename from templates/panel/add-site-key/const.ts rename to templates/panel/sitekey/add/const.ts diff --git a/templates/panel/add-site-key/existing-level.html b/templates/panel/sitekey/add/existing-level.html similarity index 100% rename from templates/panel/add-site-key/existing-level.html rename to templates/panel/sitekey/add/existing-level.html diff --git a/templates/panel/add-site-key/form.html b/templates/panel/sitekey/add/form.html similarity index 100% rename from templates/panel/add-site-key/form.html rename to templates/panel/sitekey/add/form.html diff --git a/templates/panel/add-site-key/form.ts b/templates/panel/sitekey/add/form.ts similarity index 92% rename from templates/panel/add-site-key/form.ts rename to templates/panel/sitekey/add/form.ts index 4a3b9cee..d20ac83a 100644 --- a/templates/panel/add-site-key/form.ts +++ b/templates/panel/sitekey/add/form.ts @@ -17,12 +17,12 @@ import {LEVELS} from './levels'; -import isBlankString from '../../utils/isBlankString'; -import getFormUrl from '../../utils/getFormUrl'; -import genJsonPayload from '../../utils/genJsonPayload'; -import isNumber from '../../utils/isNumber'; +import isBlankString from '../../../utils/isBlankString'; +import getFormUrl from '../../../utils/getFormUrl'; +import genJsonPayload from '../../../utils/genJsonPayload'; +import isNumber from '../../../utils/isNumber'; -import VIEWS from '../../views/v1/routes'; +import VIEWS from '../../../views/v1/routes'; const SITE_KEY_FORM_CLASS = 'sitekey-form'; const FORM = document.querySelector(`.${SITE_KEY_FORM_CLASS}`); diff --git a/templates/panel/sitekey/add/index.html b/templates/panel/sitekey/add/index.html new file mode 100644 index 00000000..7cfb8c29 --- /dev/null +++ b/templates/panel/sitekey/add/index.html @@ -0,0 +1,15 @@ +<. include!("../../../components/headers.html"); .> <. include!("../../header/index.html"); +.> + +
+ <. include!("../../taskbar/index.html"); .> <. + include!("../../help-banner/index.html"); .> + +
+ + + <. include!("../add/form.html"); .> +
+ +
+<. include!("../../../components/footers.html"); .> diff --git a/templates/panel/add-site-key/index.ts b/templates/panel/sitekey/add/index.ts similarity index 100% rename from templates/panel/add-site-key/index.ts rename to templates/panel/sitekey/add/index.ts diff --git a/templates/panel/add-site-key/levels/getLevelFields.ts b/templates/panel/sitekey/add/levels/getLevelFields.ts similarity index 97% rename from templates/panel/add-site-key/levels/getLevelFields.ts rename to templates/panel/sitekey/add/levels/getLevelFields.ts index a0153005..770b31fc 100644 --- a/templates/panel/add-site-key/levels/getLevelFields.ts +++ b/templates/panel/sitekey/add/levels/getLevelFields.ts @@ -18,7 +18,7 @@ import {Level} from './index'; import CONST from '../const'; -import isNumber from '../../../utils/isNumber'; +import isNumber from '../../../../utils/isNumber'; /** Fetches level from DOM using the ID passesd and validates */ const getLevelFields = (id: number) => { diff --git a/templates/panel/add-site-key/levels/getNumLevels.ts b/templates/panel/sitekey/add/levels/getNumLevels.ts similarity index 100% rename from templates/panel/add-site-key/levels/getNumLevels.ts rename to templates/panel/sitekey/add/levels/getNumLevels.ts diff --git a/templates/panel/add-site-key/levels/index.ts b/templates/panel/sitekey/add/levels/index.ts similarity index 100% rename from templates/panel/add-site-key/levels/index.ts rename to templates/panel/sitekey/add/levels/index.ts diff --git a/templates/panel/add-site-key/levels/updateLevel.ts b/templates/panel/sitekey/add/levels/updateLevel.ts similarity index 100% rename from templates/panel/add-site-key/levels/updateLevel.ts rename to templates/panel/sitekey/add/levels/updateLevel.ts diff --git a/templates/panel/add-site-key/levels/validateLevel.ts b/templates/panel/sitekey/add/levels/validateLevel.ts similarity index 100% rename from templates/panel/add-site-key/levels/validateLevel.ts rename to templates/panel/sitekey/add/levels/validateLevel.ts diff --git a/templates/panel/add-site-key/main.scss b/templates/panel/sitekey/add/main.scss similarity index 94% rename from templates/panel/add-site-key/main.scss rename to templates/panel/sitekey/add/main.scss index e8465820..99499e24 100644 --- a/templates/panel/add-site-key/main.scss +++ b/templates/panel/sitekey/add/main.scss @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -@import '../../reset'; -@import '../../vars'; -@import '../../components/button'; -@import '../../components/forms'; +@import '../../../reset'; +@import '../../../vars'; +@import '../../../components/button'; +@import '../../../components/forms'; .sitekey-form { display: flex; diff --git a/templates/panel/add-site-key/removeLevelButton.ts b/templates/panel/sitekey/add/removeLevelButton.ts similarity index 100% rename from templates/panel/add-site-key/removeLevelButton.ts rename to templates/panel/sitekey/add/removeLevelButton.ts diff --git a/templates/panel/site-keys/index.html b/templates/panel/sitekey/list/index.html similarity index 73% rename from templates/panel/site-keys/index.html rename to templates/panel/sitekey/list/index.html index 9cb77482..1b05a6f5 100644 --- a/templates/panel/site-keys/index.html +++ b/templates/panel/sitekey/list/index.html @@ -1,9 +1,9 @@ -<. include!("../../components/headers.html"); .> <. -include!("../header/index.html"); .> +<. include!("../../../components/headers.html"); .> <. +include!("../../header/index.html"); .>
- <. include!("../taskbar/index.html"); .> <. - include!("../help-banner/index.html"); .> + <. include!("../../taskbar/index.html"); .> <. + include!("../../help-banner/index.html"); .>
@@ -27,4 +27,4 @@ include!("../header/index.html"); .>
-<. include!("../../components/footers.html"); .> +<. include!("../../../components/footers.html"); .> diff --git a/templates/panel/site-keys/index.ts b/templates/panel/sitekey/list/index.ts similarity index 100% rename from templates/panel/site-keys/index.ts rename to templates/panel/sitekey/list/index.ts diff --git a/templates/panel/site-keys/main.scss b/templates/panel/sitekey/list/main.scss similarity index 93% rename from templates/panel/site-keys/main.scss rename to templates/panel/sitekey/list/main.scss index 32f7da35..bfc4594b 100644 --- a/templates/panel/site-keys/main.scss +++ b/templates/panel/sitekey/list/main.scss @@ -15,9 +15,9 @@ * along with this program. If not, see . */ -@import '../../reset'; -@import '../../vars'; -@import '../../components/box'; +@import '../../../reset'; +@import '../../../vars'; +@import '../../../components/box'; .sitekey-list__box { @include box;