Commit 06eb4de7 authored by fv3rdugo's avatar fv3rdugo
Browse files

Fix list networks

Polish requires_password column, now show icons
parent ddb1242c
......@@ -50,13 +50,15 @@ sub BUILD {
my $description = $_[0]->{description};
my $all_domains = $_[0]->{all_domains} ? 1 : 0; #when checkbox is not checked is NULL, change to 0
my $no_domains = $_[0]->{no_domains} ? 1: 0;
my $n_order = $_[0]->{n_order};
my $requires_password = $_[0]->{requires_password} ? 1: 0;
$name = "" unless defined $name;
_init_connector();
if ( $name ne '' ) {
my $row = $self -> _select_net_db( $name, $address, $description, $all_domains, $no_domains );
my $row = $self -> _select_net_db( $name, $address, $description, $all_domains, $no_domains, $n_order, $requires_password );
};
}
=head2 allowed
......@@ -197,13 +199,15 @@ sub _insert_net_db {
my $description = shift;
my $all_domains = shift;
my $no_domains = shift;
my $n_order = shift;
my $requires_password = shift;
my $sth = $$CONNECTOR->dbh->prepare(
"INSERT INTO networks (name, address, description, all_domains, no_domains) "
." VALUES(?,?,?,?,?)"
"INSERT INTO networks (name, address, description, all_domains, no_domains, n_order, requires_password) "
." VALUES(?,?,?,?,?,?,?)"
);
$sth->execute($name,$address,$description,$all_domains,$no_domains);
$sth->execute($name,$address,$description,$all_domains,$no_domains,$n_order,$requires_password);
$sth->finish;
return $self->_do_select_net_db( $name); ;
}
......
......@@ -210,7 +210,9 @@ sub networks {
address => $c->param('address'),
description => $c->param('description'),
all_domains => $c->param('all_domains'),
no_domains => $c->param('no_domains') )
no_domains => $c->param('no_domains'),
n_order => $c->param('n_order'),
requires_password => $c->param('requires_password') )
}
push @{$c->stash->{js}}, '/js/admin.js';
$c->render(template => 'main/new_networks');
......
......@@ -30,6 +30,7 @@
<th><%=l 'Description' %></th>
<th><%=l 'All Domains' %></th>
<th><%=l 'No Domains' %></th>
<th><%=l 'Requires Passwd' %></th>
</tr>
</thead>
<tbody>
......@@ -39,6 +40,8 @@
<td>{{ network.description }}</td>
<td>{{ network.all_domains }}</td>
<td>{{ network.no_domains }}</td>
<td><p ng-show="{{network.requires_password}}" class="fa fa-lock" aria-hidden="true" title="User needed a password to connect">
<p ng-show="{{network.requires_password!=1}}" class="fa fa-unlock" aria-hidden="true" title="Password not required"></td>
</tr>
</tbody>
</table>
......
......@@ -51,6 +51,13 @@
</label>
</div>
<div class="pure-control-group">
<label class="pure-checkbox">
<input name="requires_password" id='requires_password' type="checkbox" value="1" >
Requires password
</label>
</div>
<div class="pure-controls">
<input type="submit" class="pure-button pure-button-primary" value="Submit"
ng-disabled="frm.$invalid" ></input>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment