Commit 8ef6fdcb authored by joelalju's avatar joelalju
Browse files

[#328] Button hides when there's no private bases

parent ec86f0f2
......@@ -119,9 +119,14 @@
});
$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;
$scope.only_public = !$scope.only_public;
};
};
......
......@@ -12,22 +12,25 @@
% $public_bases = 1 if $machine->{is_public};
% }
<div id="page-wrapper">
<!--MACHINES SELECTION-->
<div class="page-header" ng-controller="bases">
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
% if ($user->is_admin) {
<div class="panel panel-default">
<div class="panel-heading">
<h2><%=l 'Choose a Machine to Start' %></h2>
<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"
align="right" ng-show="only_public">Show All</a>
% if ($user->is_admin) {
<div ng-show="has_public" 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"
align="right" ng-show="only_public">Show All</a>
% }
</div>
</div>
% }
<div class="panel-body">
% if (! $public_bases ) {
<div class="panel panel-warning">
......@@ -43,8 +46,10 @@
% }
% 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" <% } %> >
<div class="panel panel-success">
<div class="col-sm-4"
<% if (!$machine->{is_public}) { %> ng-show="!only_public" <% } %>
<% if ($machine->{is_public}) { %> ng-init="toggle_has_public()" <% } %> >
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title"><a
href="/machine/clone/<%= $machine->{id} %>.html"><%= $machine->{name} %></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