%#
%# $Id$
%#
% layout 'default';
% title 'Maacom';

% use Mojo::Util qw(dumper);

% my $u = $c->app->user;

% my $user_id = $c->req->param('user_id') || 0;
% my $profile = $u->user_profile($user_id);

% if ($profile) {
    % my $user_name = $profile->{name};
    % my $domain_name = $profile->{domain_name};
    % my $domain_id = $profile->{domain_id};
    % my $password = $profile->{password};
    % my $address = $profile->{address};

    <div class="grid-container">
        <div class="grid-x grid-padding-x">
          <div class="medium-6 medium-centered cell">

            <form accept-charset="UTF-8" action="/user/rename/handler" method="post" data-abide novalidate>
                <h5 class="text-center">Rename user <%= $address %></h5>
                <input type="hidden" name="user_id" value="<%= $user_id %>"/>
                <label>Username
                    <input type="text" value="<%= $user_name %>" name="user_name" required pattern="[_\.a-zA-Z0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,42}"/>
                    <span class="form-error">Mandatory, 2 or more letter</span>
                </label>
                <div class="text-center">
                    <button type="submit" class="button">Accept</button>
                    <a class="button" href="/user/list?domain_id=<%= $domain_id %>">Escape</a>
                </div>
            </form>

          </div>
        </div>
    </div>
% }

% unless ($profile) {
        <div class="callout warning">User with id <%= $user_id %> not exist</div>
% }
%#EOF
