This commit is contained in:
41
templs/unwanted-update-handler.html.ep
Normal file
41
templs/unwanted-update-handler.html.ep
Normal file
@@ -0,0 +1,41 @@
|
||||
%#
|
||||
%# $Id$
|
||||
%#
|
||||
% layout 'default';
|
||||
% title 'Maacom';
|
||||
|
||||
% use Mojo::Util qw(dumper);
|
||||
|
||||
% my $u = $c->app->user;
|
||||
|
||||
% my $name = $c->req->param('unwanted_name');
|
||||
% my $unwanted_id = $c->req->param('unwanted_id') || 0;
|
||||
% my $profile = $u->unwanted_profile($unwanted_id);
|
||||
|
||||
% if ($profile) {
|
||||
% my $cid = $u->unwanted_exist($name);
|
||||
% if ($cid) {
|
||||
<div class="callout warning">Host <%= $name %> already exists</div>
|
||||
% }
|
||||
|
||||
% unless ($cid) {
|
||||
% my $res = $u->unwanted_update($unwanted_id, name => $name);
|
||||
% if ($res) {
|
||||
<div class="callout success">Host <%= $name %> has been updated.</div>
|
||||
% }
|
||||
|
||||
% unless ($res) {
|
||||
<div class="callout alert">Host <%= $name %> was not updated.</div>
|
||||
% }
|
||||
% }
|
||||
% }
|
||||
|
||||
% unless ($profile) {
|
||||
<div class="callout warning">Host with id <%= $unwanted_id %> not exist</div>
|
||||
% }
|
||||
|
||||
%#EOF
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user