2017-04-18 18:03:03 +00:00
|
|
|
% layout 'admin';
|
|
|
|
% title 'Users';
|
|
|
|
% content_for javascript => begin
|
|
|
|
% end
|
|
|
|
% if ( my $error = flash 'error' ) {
|
|
|
|
<div class="alert alert-danger" role="alert">
|
|
|
|
<strong>Error!</strong> <%= $error %>
|
|
|
|
</div>
|
|
|
|
% } elsif ( my $success = flash 'success' ) {
|
|
|
|
<div class="alert alert-success" role="alert">
|
|
|
|
<strong>Success!</strong> <%= $success %>
|
|
|
|
</div>
|
|
|
|
% }
|
2017-08-24 12:01:11 +00:00
|
|
|
<form action="<%= url_for . '/edit' %>" method="post" autocomplete="off">
|
2017-08-24 11:37:53 +00:00
|
|
|
<h3 class="card-header">
|
|
|
|
User Details
|
|
|
|
</h3>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="email">Email Address</label>
|
2017-08-24 12:01:11 +00:00
|
|
|
<input id="email" type="text" autocomplete="off" class="form-control" placeholder="Email" name="email" value="<%= $user->email %>">
|
2017-08-24 11:37:53 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="joindate">Join Date</label>
|
2017-08-24 12:01:11 +00:00
|
|
|
<input id="joindate" type="datetime" class="form-control" placeholder="Date" name="joindate" value="<%= $user->join_date %>" disabled>
|
2017-08-24 11:37:53 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="type">Account Type</label>
|
2017-08-24 12:01:11 +00:00
|
|
|
<input id="type" type="text" class="form-control" value="<%= defined $user->customer_id ? 'Customer' : 'Organisation' %>" disabled>
|
2017-08-24 11:37:53 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="new_password">New Password</label>
|
2017-08-24 12:01:11 +00:00
|
|
|
<input id="new_password" type="password" autocomplete="off" class="form-control" placeholder="New Password" name="new_password">
|
|
|
|
<p class="help-block">Leave blank unless you want to change their password</p>
|
2017-08-24 11:37:53 +00:00
|
|
|
</div>
|
|
|
|
% if ( my $customer_rs = $user->customer ) {
|
|
|
|
<h3 class="card-header">
|
|
|
|
Customer Details
|
|
|
|
</h3>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="postcode">Customer Postcode</label>
|
|
|
|
<input id="postcode" type="text" class="form-control" placeholder="Postcode" name="postcode" value="<%= $customer_rs->postcode %>">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="full_name">Full Name</label>
|
|
|
|
<input id="full_name" type="text" class="form-control" placeholder="Full Name" name="full_name" value="<%= $customer_rs->full_name %>">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="display_name">Display Name</label>
|
|
|
|
<input id="display_name" type="text" class="form-control" placeholder="Display Name" name="display_name" value="<%= $customer_rs->display_name %>">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="year_of_birth">Year of Birth</label>
|
2017-08-24 11:48:32 +00:00
|
|
|
<input id="year_of_birth" type="number" class="form-control" placeholder="Year of Birth" name="year_of_birth" value="<%= $customer_rs->year_of_birth %>" disabled>
|
2017-08-24 11:37:53 +00:00
|
|
|
</div>
|
|
|
|
% } elsif ( my $org_rs = $user->organisation ) {
|
|
|
|
<h3 class="card-header">
|
|
|
|
Organisation Details
|
|
|
|
</h3>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="postcode">Organisation Postcode</label>
|
|
|
|
<input id="postcode" type="text" class="form-control" placeholder="Postcode" name="postcode" value="<%= $org_rs->postcode %>">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="name">Organisation Name</label>
|
|
|
|
<input id="name" type="text" class="form-control" placeholder="Organisation Name" name="name" value="<%= $org_rs->name %>">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="street_name">Street Name</label>
|
|
|
|
<input id="street_name" type="text" class="form-control" placeholder="Street Name" name="street_name" value="<%= $org_rs->street_name %>">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="town">Town</label>
|
|
|
|
<input id="town" type="text" class="form-control" placeholder="Town" name="town" value="<%= $org_rs->town %>">
|
|
|
|
</div>
|
|
|
|
% } else {
|
|
|
|
<h3 class="card-header">
|
|
|
|
User is not a customer or an organisation
|
|
|
|
</h3>
|
|
|
|
% }
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<button class="btn btn-primary form-control" type="submit">Edit Account</button>
|
|
|
|
</div>
|
2017-04-18 18:03:03 +00:00
|
|
|
</form>
|