mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
break view form into multiple parts
This commit is contained in:
6
templates/panel/sitekey/view/__delete-btn.html
Normal file
6
templates/panel/sitekey/view/__delete-btn.html
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<a href="<.= crate::PAGES.panel.sitekey.get_delete(&key) .>">
|
||||||
|
<img class="sitekey-form__delete"
|
||||||
|
src="<.= crate::FILES.get("./static/cache/img/svg/trash.svg").unwrap() .>"
|
||||||
|
alt="Delete sitekey"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<a href="<.= key .>/edit/">
|
<a href="<.= edit_url .>">
|
||||||
<img class="sitekey-form__edit" src="<.=
|
<img class="sitekey-form__edit" src="<.=
|
||||||
crate::FILES.get("./static/cache/img/svg/edit.svg").unwrap() .>" alt="Edit
|
crate::FILES.get("./static/cache/img/svg/edit.svg").unwrap() .>" alt="Edit
|
||||||
sitekey" />
|
sitekey" />
|
||||||
|
|||||||
32
templates/panel/sitekey/view/__form-body.html
Normal file
32
templates/panel/sitekey/view/__form-body.html
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
</h1>
|
||||||
|
<label class="sitekey-form__label" for="description">
|
||||||
|
Description
|
||||||
|
<input
|
||||||
|
<. if READONLY { .>
|
||||||
|
<.= "readonly='readonly'" .>
|
||||||
|
<. } .>
|
||||||
|
class="sitekey-form__input"
|
||||||
|
type="text"
|
||||||
|
name="description"
|
||||||
|
id="description"
|
||||||
|
required
|
||||||
|
<. if !name.trim().is_empty() { .>
|
||||||
|
value="<.= name .>"
|
||||||
|
<. } .>
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<label class="sitekey-form__label" for="duration">
|
||||||
|
Cooldown Duratoin(in seconds)
|
||||||
|
<input
|
||||||
|
<. if READONLY { .>
|
||||||
|
<.= "readonly='readonly'" .>
|
||||||
|
<. } .>
|
||||||
|
class="sitekey-form__input"
|
||||||
|
type="number"
|
||||||
|
name="duration"
|
||||||
|
id="duration"
|
||||||
|
min=0
|
||||||
|
required
|
||||||
|
value="<.= duration .>"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
11
templates/panel/sitekey/view/__form-container-setup.html
Normal file
11
templates/panel/sitekey/view/__form-container-setup.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<. include!("../../../components/headers/widget-headers.html"); .>
|
||||||
|
<body class="layout">
|
||||||
|
<. include!("../../navbar/index.html"); .>
|
||||||
|
<div class="tmp-layout">
|
||||||
|
<. include!("../../header/index.html"); .>
|
||||||
|
<main class="panel-main">
|
||||||
|
<. include!("../../help-banner/index.html"); .>
|
||||||
|
<!-- Main content container -->
|
||||||
|
<div class="inner-container">
|
||||||
|
<!-- Main menu/ important actions roaster -->
|
||||||
|
<form class="sitekey-form" action="<.= URL .>" method="post">
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
<. include!("../../../components/headers/widget-headers.html"); .>
|
|
||||||
<body class="layout">
|
|
||||||
<. include!("../../navbar/index.html"); .>
|
|
||||||
<div class="tmp-layout">
|
|
||||||
<. include!("../../header/index.html"); .>
|
|
||||||
<main class="panel-main">
|
|
||||||
<. include!("../../help-banner/index.html"); .>
|
|
||||||
<!-- Main content container -->
|
|
||||||
<div class="inner-container">
|
|
||||||
<!-- Main menu/ important actions roaster -->
|
|
||||||
<form class="sitekey-form" action="<.= URL .>" method="post">
|
|
||||||
<h1 class="form__title">Sitekey: <.= name .>
|
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
href="<.= crate::WIDGET_ROUTES.verification_widget .>/?sitekey=<.= key.>"
|
|
||||||
>View deployment
|
|
||||||
<img class="sitekey-form__widget-link"
|
|
||||||
src="<.= crate::FILES.get("./static/cache/img/svg/external-link.svg").unwrap() .>"
|
|
||||||
alt="View widget deployment"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
<. if READONLY { .>
|
|
||||||
<. let key = "."; .>
|
|
||||||
<. include!("./__edit-sitekey-icon.html"); .>
|
|
||||||
<a href="./delete/<.= key .>">
|
|
||||||
<. } else { .>
|
|
||||||
<a href="../delete/<.= key .>">
|
|
||||||
<. } .>
|
|
||||||
<img class="sitekey-form__delete"
|
|
||||||
src="<.= crate::FILES.get("./static/cache/img/svg/trash.svg").unwrap() .>"
|
|
||||||
alt="Delete sitekey"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
</h1>
|
|
||||||
<label class="sitekey-form__label" for="description">
|
|
||||||
Description
|
|
||||||
<input
|
|
||||||
<. if READONLY { .>
|
|
||||||
<.= "readonly='readonly'" .>
|
|
||||||
<. } .>
|
|
||||||
class="sitekey-form__input"
|
|
||||||
type="text"
|
|
||||||
name="description"
|
|
||||||
id="description"
|
|
||||||
required
|
|
||||||
<. if !name.trim().is_empty() { .>
|
|
||||||
value="<.= name .>"
|
|
||||||
<. } .>
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
<label class="sitekey-form__label" for="duration">
|
|
||||||
Cooldown Duratoin(in seconds)
|
|
||||||
<input
|
|
||||||
<. if READONLY { .>
|
|
||||||
<.= "readonly='readonly'" .>
|
|
||||||
<. } .>
|
|
||||||
class="sitekey-form__input"
|
|
||||||
type="number"
|
|
||||||
name="duration"
|
|
||||||
id="duration"
|
|
||||||
min=0
|
|
||||||
required
|
|
||||||
value="<.= duration .>"
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
@@ -1,6 +1,25 @@
|
|||||||
<. const URL: &str = crate::V1_API_ROUTES.captcha.create; .>
|
<. const URL: &str = crate::V1_API_ROUTES.captcha.create; .>
|
||||||
<. const READONLY: bool = true; .>
|
<. const READONLY: bool = true; .>
|
||||||
<. include!("./__form-top.html"); .>
|
<. let edit_url = crate::PAGES.panel.sitekey.get_edit_easy(&key) ;.>
|
||||||
|
<. include!("./__form-container-setup.html"); .>
|
||||||
|
<h1 class="form__title">Sitekey: <.= name .>
|
||||||
|
<a
|
||||||
|
target="_blank"
|
||||||
|
href="<.= crate::WIDGET_ROUTES.verification_widget .>/?sitekey=<.= &key.>"
|
||||||
|
>View deployment
|
||||||
|
<img class="sitekey-form__widget-link"
|
||||||
|
src="<.= crate::FILES.get("./static/cache/img/svg/external-link.svg").unwrap() .>"
|
||||||
|
alt="View widget deployment"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<. if READONLY { .>
|
||||||
|
<. let edit_url = crate::PAGES.panel.sitekey.get_edit_easy(&key) ;.>
|
||||||
|
<. include!("./__edit-sitekey-icon.html"); .>
|
||||||
|
<. } .>
|
||||||
|
<. include!("./__delete-btn.html"); .>
|
||||||
|
|
||||||
|
<. include!("./__form-body.html"); .>
|
||||||
<. for (count, level) in levels.iter().enumerate() { .>
|
<. for (count, level) in levels.iter().enumerate() { .>
|
||||||
<. include!("./existing-level.html"); .>
|
<. include!("./existing-level.html"); .>
|
||||||
<. } .>
|
<. } .>
|
||||||
|
|||||||
Reference in New Issue
Block a user