mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2025-03-29 04:38:59 +03:00
demo user banner
This commit is contained in:
parent
147f563ec8
commit
02b62fb1d0
8 changed files with 35 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
debug = true
|
debug = true
|
||||||
source_code = "https://github.com/mCaptcha/mCaptcha"
|
source_code = "https://github.com/mCaptcha/mCaptcha"
|
||||||
commercial = false
|
commercial = false
|
||||||
allow_demo = false
|
allow_demo = true
|
||||||
allow_registration = true
|
allow_registration = true
|
||||||
|
|
||||||
[server]
|
[server]
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* 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/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use actix::clock::sleep;
|
use actix::clock::sleep;
|
||||||
|
@ -55,6 +54,7 @@ async fn delete_demo_user(data: &AppData) -> ServiceResult<()> {
|
||||||
|
|
||||||
pub async fn run(data: AppData, duration: Duration) -> ServiceResult<()> {
|
pub async fn run(data: AppData, duration: Duration) -> ServiceResult<()> {
|
||||||
register_demo_user(&data).await?;
|
register_demo_user(&data).await?;
|
||||||
|
|
||||||
let fut = async move {
|
let fut = async move {
|
||||||
loop {
|
loop {
|
||||||
sleep(duration).await;
|
sleep(duration).await;
|
||||||
|
|
|
@ -47,14 +47,24 @@ body {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.auth__secondary-action__banner {
|
@mixin auth__secondary-action__banner-base {
|
||||||
display: block;
|
display: block;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auth__secondary-action__banner {
|
||||||
|
@include auth__secondary-action__banner-base;
|
||||||
margin: 20px auto auto auto;
|
margin: 20px auto auto auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.auth__demo-user__banner {
|
||||||
|
@include auth__secondary-action__banner-base;
|
||||||
|
margin: 5px auto auto auto;
|
||||||
|
font-size: 0.7rem;
|
||||||
|
}
|
||||||
|
|
||||||
.auth__secondary-action__link {
|
.auth__secondary-action__link {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: $blue-link;
|
color: $blue-link;
|
||||||
|
|
|
@ -42,3 +42,7 @@ body {
|
||||||
.auth__logo {
|
.auth__logo {
|
||||||
width: 120px;
|
width: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.auth__demo-user__cred{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
12
templates/auth/demo-user-banner.html
Normal file
12
templates/auth/demo-user-banner.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<. if crate::SETTINGS.allow_demo && crate::SETTINGS.allow_registration { .>
|
||||||
|
<p class="auth__demo-user__banner">
|
||||||
|
Try mCaptcha without joining
|
||||||
|
<br />
|
||||||
|
<span class="auth__demo-user__cred">
|
||||||
|
user: <.= crate::demo::DEMO_USER .>
|
||||||
|
</span>
|
||||||
|
<span class="auth__demo-user__cred">
|
||||||
|
password: <.= crate::demo::DEMO_PASSWORD .>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
<. } .>
|
|
@ -46,5 +46,6 @@
|
||||||
Create an account
|
Create an account
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
<. include!("../demo-user-banner.html"); .>
|
||||||
</div>
|
</div>
|
||||||
<. include!("../../components/footers.html"); .>
|
<. include!("../../components/footers.html"); .>
|
||||||
|
|
|
@ -72,5 +72,6 @@
|
||||||
Already have an account?
|
Already have an account?
|
||||||
<a href="<.= crate::PAGES.auth.login .>" class="auth__secondary-action__link">Log in</a>
|
<a href="<.= crate::PAGES.auth.login .>" class="auth__secondary-action__link">Log in</a>
|
||||||
</p>
|
</p>
|
||||||
|
<. include!("../demo-user-banner.html"); .>
|
||||||
</div>
|
</div>
|
||||||
<. include!("../../components/footers.html"); .>
|
<. include!("../../components/footers.html"); .>
|
||||||
|
|
|
@ -27,3 +27,7 @@ $footer-font-size: 14px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.details {
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue