|
| 1 | +@extends('layouts.admin') |
| 2 | + |
| 3 | +@section('title') |
| 4 | + New Account |
| 5 | +@endsection |
| 6 | + |
| 7 | +@section('content') |
| 8 | +<div class="col-md-9"> |
| 9 | + <ul class="breadcrumb"> |
| 10 | + <li><a href="/admin">Admin Controls</a></li> |
| 11 | + <li><a href="/admin/accounts">Accounts</a></li> |
| 12 | + <li class="active">Add New Account</li> |
| 13 | + </ul> |
| 14 | + @if (count($errors) > 0) |
| 15 | + <div class="alert alert-danger"> |
| 16 | + <strong>{{ trans('strings.whoops') }}!</strong> {{ trans('auth.errorencountered') }}<br><br> |
| 17 | + <ul> |
| 18 | + @foreach ($errors->all() as $error) |
| 19 | + <li>{{ $error }}</li> |
| 20 | + @endforeach |
| 21 | + </ul> |
| 22 | + </div> |
| 23 | + @endif |
| 24 | + <h3>Create New Account</h3><hr /> |
| 25 | + <form action="new" method="post"> |
| 26 | + <fieldset> |
| 27 | + <div class="form-group"> |
| 28 | + <label for="username" class="control-label">Username</label> |
| 29 | + <div> |
| 30 | + <input type="text" autocomplete="off" name="username" class="form-control" /> |
| 31 | + </div> |
| 32 | + </div> |
| 33 | + <div class="form-group"> |
| 34 | + <label for="email" class="control-label">Email</label> |
| 35 | + <div> |
| 36 | + <input type="text" autocomplete="off" name="email" class="form-control" /> |
| 37 | + </div> |
| 38 | + </div> |
| 39 | + <div class="row"> |
| 40 | + <div class="col-md-12"> |
| 41 | + <div id="gen_pass" class=" alert alert-success" style="display:none;margin-bottom: 10px;"></div> |
| 42 | + </div> |
| 43 | + <div class="form-group col-md-6"> |
| 44 | + <label for="pass" class="control-label">Password</label> |
| 45 | + <div> |
| 46 | + <input type="password" name="password" class="form-control" /> |
| 47 | + </div> |
| 48 | + </div> |
| 49 | + <div class="form-group col-md-6"> |
| 50 | + <label for="pass_2" class="control-label">Password Again</label> |
| 51 | + <div> |
| 52 | + <input type="password" name="password_confirmation" class="form-control" /> |
| 53 | + </div> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + <div class="form-group"> |
| 57 | + <div> |
| 58 | + {!! csrf_field() !!} |
| 59 | + <button class="btn btn-primary btn-sm" type="submit">Create Account</button> |
| 60 | + <button class="btn btn-default btn-sm" id="gen_pass_bttn" type="button">Generate Password</button> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + </fieldset> |
| 64 | + </form> |
| 65 | +</div> |
| 66 | +<script> |
| 67 | +$(document).ready(function(){ |
| 68 | + $("#sidebar_links").find("a[href='/admin/account/new']").addClass('active'); |
| 69 | + $("#gen_pass_bttn").click(function(e){ |
| 70 | + e.preventDefault(); |
| 71 | + $.ajax({ |
| 72 | + type: "GET", |
| 73 | + url: "/password-gen/12", |
| 74 | + headers: { |
| 75 | + 'X-CSRF-TOKEN': '{{ csrf_token() }}' |
| 76 | + }, |
| 77 | + success: function(data) { |
| 78 | + $("#gen_pass").html('<strong>Generated Password:</strong> ' + data).slideDown(); |
| 79 | + $('input[name="password"], input[name="password_confirmation"]').val(data); |
| 80 | + return false; |
| 81 | + } |
| 82 | + }); |
| 83 | + return false; |
| 84 | + }); |
| 85 | +}); |
| 86 | +$(document).ready(function () { |
| 87 | + $('#sidebar_links').find("a[href='/admin/accounts']").addClass('active'); |
| 88 | +}); |
| 89 | +</script> |
| 90 | +@endsection |
0 commit comments