This commit is contained in:
ziggi
2017-12-11 19:08:29 +00:00
parent 9373c88268
commit 4f18218ece
7 changed files with 0 additions and 292 deletions

View File

@@ -1,30 +0,0 @@
%#
%# $Id$
%#
% layout 'default';
% title 'Maacom';
% use Mojo::Util qw(dumper);
% my $u = $c->app->user;
<div class="grid-container">
<div class="grid-x grid-padding-x">
<div class="medium-6 medium-centered cell">
<form accept-charset="UTF-8" action="/forward/add/handler" method="get" data-abide novalidate>
<h5 class="text-center">Add forwarded domain</h5>
<label>Domain name
<input type="text" name="forward_name" placeholder="domain.org" required pattern="[_.-zA-Z0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{5,42}"/>
<span class="form-error">Mandatory, 5 or more letter</span>
</label>
<div class="text-center">
<button type="submit" class="button">Accept</button>
<a class="button" href="/forward/list">Escape</a>
</div>
</form>
</div>
</div>
</div>
%#EOF

View File

@@ -1,32 +0,0 @@
%#
%# $Id$
%#
% layout 'default';
% title 'Maacom';
% use Mojo::Util qw(dumper);
% my $u = $c->app->user;
% my $name = $c->req->param('forward_name');
% my $id = $u->forward_exist($name);
% if ($id) {
<div class="callout warning">Domain <%= $name %> already exists</div>
% }
% unless ($id) {
% my $res = $u->forward_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>
% }
% }
%#EOF

View File

@@ -1,39 +0,0 @@
%#
%# $Id$
%#
% layout 'default';
% title 'Maacom';
% use Mojo::Util qw(dumper);
% my $u = $c->app->user;
% my $forward_id = $c->req->param('forward_id') || 0;
% my $profile = $u->forward_profile($forward_id);
% if ($profile) {
% my $forward_name = $profile->{name};
<div class="grid-container">
<div class="grid-x grid-padding-x">
<div class="medium-6 medium-centered cell">
<form accept-charset="UTF-8" action="/forward/delete/handler" method="get" data-abide novalidate>
<h5 class="text-center">Delete domain <%= $forward_name %></h5>
<input type="hidden" name="forward_id" value="<%= $forward_id %>"/>
<div class="text-center">
<button type="submit" class="button">Accept</button>
<a class="button" href="/forward/list">Escape</a>
</div>
</form>
</div>
</div>
</div>
% }
% unless ($profile) {
<div class="callout warning">Domain with id <%= $forward_id %> not exist</div>
% }
%#EOF

View File

@@ -1,32 +0,0 @@
%#
%# $Id$
%#
% layout 'default';
% title 'Maacom';
% use Mojo::Util qw(dumper);
% my $u = $c->app->user;
% my $forward_id = $c->req->param('forward_id') || 0;
% my $profile = $u->forward_profile($forward_id);
% if ($profile) {
% my $name = $profile->{name};
% my $res = $u->forward_delete($forward_id);
% if ($res) {
<div class="callout success">Domain <%= $name %> has been deleted</div>
% }
% unless ($res) {
<div class="callout alert">Domain <%= $name %> was not deleted</div>
% }
% }
% unless ($profile) {
<div class="callout warning">Domain with id <%= $forward_id %> not exist</div>
% }
%#EOF

View File

@@ -1,74 +0,0 @@
%#
%# $Id$
%#
% layout 'default';
% title 'Maacom';
% use Mojo::Util qw(dumper);
% my $u = $c->app->user;
<h5 class="text-center">
Domains <a href="/forward/list"><i class="fi-refresh"></i></a>
<a class="float-right button tiny" href="/forward/add/form">
<i class="fi-plus"></i>
</a>
</h5>
% my $list = $u->forward_list;
% unless ($list) {
<div class="callout alert">
Cannot list domains. May be wrong database?
</div>
% }
<table class="hover" id="table">
<thead>
<tr>
<th>#</th>
<th>domain</th>
<th><i class="fi-pencil"></i></th>
<th><i class="fi-trash"></i></th>
</tr>
</thead>
<tbody>
% my $n = 0;
% if ($list) {
% foreach my $row (@$list) {
% $n += 1;
% my $id = $row->{id};
% my $name = $row->{name};
% my $size = $row->{size};
<tr>
<td><%= $n %></td>
<td><%= $name %></td>
<td><a href="/forward/update/form?forward_id=<%= $id %>"><i class="fi-pencil"></i></a></td>
<td><a href="/forward/delete/form?forward_id=<%= $id %>"><i class="fi-trash"></i></a></td>
</tr>
% }
% }
</tbody>
</table>
<script>
$.extend(true, $.fn.dataTable.defaults, {
"searching": true,
"ordering": true,
"language": {
"search": "",
"lengthMenu": "_MENU_",
"info": "_START_-_END_ of _TOTAL_",
"infoEmpty": "",
},
} );
$(document).ready(function() {
$('#table').DataTable();
});
</script>
%# EOF

View File

@@ -1,44 +0,0 @@
%#
%# $Id$
%#
% layout 'default';
% title 'Maacom';
% use Mojo::Util qw(dumper);
% my $u = $c->app->user;
% my $forward_id = $c->req->param('forward_id') || 0;
% my $profile = $u->forward_profile($forward_id);
% if ($profile) {
% my $forward_name = $profile->{name};
<div class="grid-container">
<div class="grid-x grid-padding-x">
<div class="medium-6 medium-centered cell">
<form accept-charset="UTF-8" action="/forward/update/handler" method="get" data-abide novalidate>
<h5 class="text-center">Edit domain</h5>
<input type="hidden" name="forward_id" value="<%= $forward_id %>"/>
<label>Domain name
<input type="text" value="<%= $forward_name %>" name="forward_name" required pattern="[_.-zA-Z0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{5,42}"/>
<span class="form-error">Mandatory, 5 or more letter</span>
</label>
<div class="text-center">
<button type="submit" class="button">Accept</button>
<a class="button" href="/forward/list">Escape</a>
</div>
</form>
</div>
</div>
</div>
% }
% unless ($profile) {
<div class="callout warning">Domain with id <%= $forward_id %> not exist</div>
% }
%#EOF

View File

@@ -1,41 +0,0 @@
%#
%# $Id$
%#
% layout 'default';
% title 'Maacom';
% use Mojo::Util qw(dumper);
% my $u = $c->app->user;
% my $name = $c->req->param('forward_name');
% my $forward_id = $c->req->param('forward_id') || 0;
% my $profile = $u->forward_profile($forward_id);
% if ($profile) {
% my $cid = $u->forward_exist($name);
% if ($cid) {
<div class="callout warning">Domain <%= $name %> already exists</div>
% }
% unless ($cid) {
% my $res = $u->forward_update($forward_id, name => $name);
% if ($res) {
<div class="callout success">Domain <%= $name %> has been updated.</div>
% }
% unless ($res) {
<div class="callout alert">Domain <%= $name %> was not updated.</div>
% }
% }
% }
% unless ($profile) {
<div class="callout warning">Domain with id <%= $forward_id %> not exist</div>
% }
%#EOF