Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
perf(captcha): simple captcha input
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Jul 22, 2019
1 parent b49d529 commit 9119bf7
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 68 deletions.
15 changes: 1 addition & 14 deletions apps/views/auth/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,7 @@
<div class="help-block">Your 2FA code, leave it blank if you haven't enable 2FA.</div>
</div>

<div class="form-group">
<label for="captcha">Captcha</label>
<div class="row">
<div class="col-md-4">
<div class="input-group">
<span class="input-group-addon"><span class="fas fa-sync-alt fa-fw"></span></span>
<input type="text" class="form-control" id="captcha" name="captcha" maxlength="6" required
placeholder="" autocomplete="off">
</div>
<div class="help-block">Case insensitive.</div>
</div>
<?= $this->insert('layout/captcha') ?>
</div>
</div>
<?= $this->insert('layout/captcha') ?>

<fieldset>
<legend><a href="#adv_option" data-toggle="collapse" class="btn btn-link">Advanced Options</a></legend>
Expand Down
15 changes: 1 addition & 14 deletions apps/views/auth/recover.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,7 @@
<div class="help-block">The Email when your sign account.</div>
</div>

<div class="form-group">
<label for="captcha">Captcha</label>
<div class="row">
<div class="col-md-4">
<div class="input-group">
<span class="input-group-addon"><span class="fas fa-sync-alt fa-fw"></span></span>
<input type="text" class="form-control" id="captcha" name="captcha" maxlength="6"
required autocomplete="off">
</div>
<div class="help-block">Case insensitive.</div>
</div>
<?= $this->insert('layout/captcha') ?>
</div>
</div>
<?= $this->insert('layout/captcha') ?>

<div class="text-center">
<button type="submit" value="Register" class="btn btn-primary">Recover it !!</button>
Expand Down
30 changes: 7 additions & 23 deletions apps/views/auth/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,34 +107,18 @@
</div>
<?php endif; ?>

<div class="form-group">
<label for="captcha">Captcha</label>
<div class="row">
<div class="col-md-4">
<div class="input-group">
<span class="input-group-addon"><span class="fas fa-sync-alt fa-fw"></span></span>
<input type="text" class="form-control" id="captcha" name="captcha" maxlength="6"
required autocomplete="off">
</div>
<div class="help-block">Case insensitive.</div>
</div>
<?= $this->insert('layout/captcha') ?>
</div>
</div>
<?= $this->insert('layout/captcha') ?>

<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="verify_tos" id="verify_tos" value="yes" title=""> Accept Our TOS and AOP
</label>
<div class="switch">
<input type="checkbox" name="verify_tos" id="verify_tos" value="1" title="">
<label for="verify_tos">Accept Our TOS and AOP</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="verify_age" id="verify_age" value="yes" title=""> I am at least 13 years old.
</label>
<div class="switch">
<input type="checkbox" name="verify_age" id="verify_age" value="1" title="">
<label for="verify_age">I am at least 13 years old.</label>
</div>
</div>

<div class="text-center">
<button type="submit" value="Register" class="btn btn-primary">Register</button>
</div>
Expand Down
24 changes: 21 additions & 3 deletions apps/views/layout/captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,27 @@
* User: Rhilip
* Date: 2019/3/9
* Time: 16:49
*
*
*/

$inline = $inline ?? false;
?>
<div class="col captcha_img_load">
<img class="captcha_img" src="/static/pic/captcha_dummy.png" alt="Captcha Image"
data-toggle="tooltip" data-placement="right" title="Click to Refresh">

<div class="form-group">
<label for="captcha" class="<?= $inline ? 'col-sm-2 ' : '' ?>required">Captcha</label>
<div class="row">
<div class="col-xs-6 col-md-4">
<div class="input-group">
<span class="input-group-addon"><span class="fas fa-sync-alt fa-fw"></span></span>
<input type="text" class="form-control" id="captcha" name="captcha" maxlength="6"
required autocomplete="off">
</div>
<div class="help-block">Case insensitive.</div>
</div>
<div class="col captcha_img_load">
<img class="captcha_img" src="/static/pic/captcha_dummy.png" alt="Captcha Image"
data-toggle="tooltip" data-placement="right" title="Click to Refresh">
</div>
</div>
</div>
15 changes: 1 addition & 14 deletions apps/views/links/apply.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,7 @@
</div>
</div>

<div class="form-group">
<label for="captcha" class="col-sm-2 required">Captcha</label>
<div class="row">
<div class="col-md-4">
<div class="input-group">
<span class="input-group-addon"><span class="fas fa-sync-alt fa-fw"></span></span>
<input type="text" class="form-control" id="captcha" name="captcha" maxlength="6" required
placeholder="" autocomplete="off">
</div>
<div class="help-block">Case insensitive.</div>
</div>
<?= $this->insert('layout/captcha') ?>
</div>
</div>
<?= $this->insert('layout/captcha', ['inline' => true]) ?>

<div class="text-center">
<button type="submit" class="btn btn-primary">Submit</button>
Expand Down

0 comments on commit 9119bf7

Please sign in to comment.