Commit 2dcba4cb authored by Francesc Guasch's avatar Francesc Guasch Committed by GitHub
Browse files

Merge pull request #345 from UPC/328_imp_public_button

328 imp public button
parents 77a5502a 94fac676
......@@ -30,6 +30,7 @@ my $START = 1;
my $URL_ISOS;
my $USAGE = "$0 "
." [--debug] [--config=$FILE_CONFIG_DEFAULT] [--add-user=name] [--add-user-ldap=name]"
." [--change-password] [--make-admin=username]"
......
......@@ -119,11 +119,6 @@
});
$scope.has_public = false;
$scope.toggle_has_public=function() {
$scope.has_public = true;
};
$scope.only_public = false;
$scope.toggle_only_public=function() {
$scope.only_public = !$scope.only_public;
......
......@@ -8,8 +8,13 @@
$_anonymous=<%= ($_anonymous or 0) %>;
</script>
% my $public_bases = 0;
% my $private_bases = 0;
% for my $machine(@$machines) {
% $public_bases = 1 if $machine->{is_public};
% if ($machine->{is_public}) {
% $public_bases++;
% } else {
% $private_bases++;
% }
% }
......@@ -22,8 +27,8 @@
<div class="panel panel-default">
<div class="panel-heading">
<h2><%=l 'Choose a Machine to Start' %></h2>
% if ($user->is_admin) {
<div ng-show="has_public" ng-cloak>
% if ($user->is_admin && $public_bases && $private_bases) {
<div ng-cloak>
<a ng-click="toggle_only_public()" class="label label-primary"
align="right" ng-show="!only_public">Hide Private</a>
<a ng-click="toggle_only_public()" class="label label-primary"
......@@ -47,9 +52,8 @@
% }
% for my $machine (@$machines) {
% next if !$machine->{is_public} && !$user->is_admin;
<div class="col-sm-4"
<% if (!$machine->{is_public}) { %> ng-show="!only_public" <% } %>
<% if ($machine->{is_public}) { %> ng-init="toggle_has_public()" <% } %> >
<div class="col-sm-4"
ng-hide="<%= !$machine->{is_public} %> && only_public">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title"><a
......
Markdown is supported
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