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

% use Mojo::Util qw(dumper);

% my $u = $c->app->user;
% my $name = $c->req->param('forwarded_name');
% my $id = $u->forwarded_exist($name);

% if ($id) {
    <div class="callout warning">Domain <%= $name %> already exists</div>
% }

% unless ($id) {
    % my $res = $u->forwarded_add($name);
    % if ($res) {
        <div class="callout success">Domain <%= $name %> has been added.</div>
    % }

    % unless ($res) {
        <div class="callout alert">Domain <%= $name %> was not added.</div>
    % }
% }

<a class="float-left button tiny" href="/forwarded/list">
    <i class="fi-arrow-left"></i>
</a>
%#EOF




