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

Commit

Permalink
feat(Form Validator): Add library bootstrap-validator library
Browse files Browse the repository at this point in the history
Signed-off-by: Rhilip <rhilipruan@gmail.com>
  • Loading branch information
Rhilip committed Jun 7, 2019
1 parent c3e329d commit 2476921
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
### Fix
- **Admin Panel:** Fix index num in Redis Keys Page
- **Auth:** Fix Broken Auth page after frontend framework change
- **DATABASE:** Fix CURRENT_TIMESTAMP Extra error
- **Error:** Fix Error Handler
- **Register:** Add captcha checker
- **Tracker:** Add miss port check for field ipv6_port
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ Or you can join our chat group on Telegram -- [@ridpt](https://t.me/ridpt)
| [FortAwesome](https://github.com/FortAwesome/Font-Awesome): The iconic SVG, font, and CSS toolkit | <https://fontawesome.com/icons?d=gallery> |
| [flag-css](https://github.com/7kfpun/flag-css): CSS for SVG country flags respecting the original ratio. | <https://kfpun.com/flag-css/> |
| [zxcvbn](https://github.com/dropbox/zxcvbn): Low-Budget Password Strength Estimation | <https://lowe.github.io/tryzxcvbn/> |
| [bootstrap-validator](https://github.com/1000hz/bootstrap-validator): A user-friendly HTML5 form validation jQuery plugin for Bootstrap 3 | <http://1000hz.github.io/bootstrap-validator> |

### Backend Library

Expand Down
1 change: 1 addition & 0 deletions apps/views/auth/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
<!-- Javascript of Library -->
<script src="/lib/jquery/dist/jquery.min.js"></script>
<script src="/lib/zui/dist/js/zui.min.js"></script>
<script src="/lib/bootstrap-validator/dist/validator.min.js"></script>

<!-- Custom Javascript of this template -->
<script src="/static/js/main.js?<?= $css_tag ?>"></script>
Expand Down
2 changes: 1 addition & 1 deletion apps/views/auth/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
Login failed: <strong class="text-center"><?= $error_msg ?></strong>
</div>
<?php endif; ?>
<form class="auth-form" method="post">
<form class="auth-form" method="post" data-toggle="validator" role="form">
<div class="form-group">
<label for="username">Username / Email address</label>
<div class="input-group">
Expand Down
7 changes: 4 additions & 3 deletions apps/views/auth/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@
want an invite and you know someone who have one it's up to them to give you an invite.
</p>
<?php else: ?>
<form class="auth-form" method="post">
<form class="auth-form" method="post" data-toggle="validator" role="form">
<label for="type"></label><input name="type" id="type" value="<?= $register_type ?>" style="display: none">

<div class="form-group">
<label for="username">Username</label>
<div class="input-group">
<span class="input-group-addon"><span class="fas fa-user-alt fa-fw"></span></span>
<input type="text" class="form-control" id="username" name="username" required
pattern="^[A-Za-z0-9_]*$" maxlength="12"
value="<?= $username ?? '' ?>">
</div>
<div class="help-block">
Expand All @@ -57,7 +58,7 @@
</div>
</div>

<div class="form-group">
<div class="form-group has-feedback">
<label for="email">Email</label>
<div class="input-group">
<span class="input-group-addon"><span class="fas fa-envelope fa-fw"></span></span>
Expand Down Expand Up @@ -86,7 +87,7 @@
<div class="input-group">
<span class="input-group-addon"><span class="fas fa-key fa-fw"></span></span>
<input type="password" class="form-control" id="password_again" name="password_again" required
onpaste="return false;"
onpaste="return false;" data-match="#password"
>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"html5shiv": "^3.7.3",
"respond": "^1.4.2",
"flag-css": "^0.0.12",
"zxcvbn": "^4.4.2"
"zxcvbn": "^4.4.2",
"bootstrap-validator": "^0.11.9"
}
}

0 comments on commit 2476921

Please sign in to comment.