Skip to content

Commit

Permalink
trying mouse over actions for tests/overview
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Mar 3, 2015
1 parent 1e016ba commit 6bdcab3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 43 deletions.
14 changes: 0 additions & 14 deletions lib/OpenQA/Controller/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -348,19 +348,5 @@ sub overview {
);
}

sub menu {
my $self = shift;

return $self->reply->not_found unless defined $self->param('testid');

my $job = $self->app->schema->resultset("Jobs")->search({ 'id' => $self->param('testid') })->first;

return $self->reply->not_found unless $job;

$self->stash(state => $job->state);
$self->stash(prio => $job->priority);
$self->stash(jobid => $job->id);
}

1;
# vim: set sw=4 et:
4 changes: 4 additions & 0 deletions public/stylesheets/openqa.css
Original file line number Diff line number Diff line change
Expand Up @@ -530,5 +530,9 @@ table.admintable input[type="text"].value {
width: 10em;
}

table.overview span.action {
display: none;
}


/* vim: set sw=4 et: */
11 changes: 0 additions & 11 deletions templates/test/menu.html.ep

This file was deleted.

39 changes: 21 additions & 18 deletions templates/test/overview.html.ep
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
% stash 'use_prototype' => 1;

% layout 'default';
% title 'Test summary';

Expand All @@ -12,7 +10,7 @@
</p>
<% for my $type (@$types) { %>
<p />
<table id="results_<%= $type %>" class="table-autostripe">
<table id="results_<%= $type %>" class="overview table-autostripe">
<thead>
<tr id="flavors">
<th colspan="3" id="flavor_<%= $type %>"><%= $type %></th>
Expand All @@ -37,24 +35,29 @@
<td id="res_<%= $type %>_<%= $arch %>_<%= $config %>">
<% if ($res) { %>
<%
my $css = "";
$css = "overview_".$res->{overall} if ($state eq "done");
my $css = "status";
$css .= " overview_".$res->{overall} if ($state eq "done");
%>
% if (is_operator) {
<span class="<%=$css%>" id="res-<%= $jobid %>" data-ot="<%= $jobid %>" data-ot-title="Actions (<%= $config %>)" data-ot-ajax="<%= url_for('test_menu', 'testid' => $jobid) %>" data-ot-ajax-error-message="Access denied." data-ot-fixed="true" data-ot-group="scheduler" data-ot-hide-trigger="closeButton" data-ot-cache="false" data-ot-target="true">
<span class="<%=$css%>" id="res-<%= $jobid %>">
% if ($state eq "done") {
%= module_result($res)
% } elsif ($state eq "running") {
running
% } elsif ($state eq "scheduled") {
scheduled@<%= $res->{priority} %>
% } else {
<span class="<%=$css%>" id="res-<%= $jobid %>">
%= $state
% }
<% if ($state eq "done") { %>
<%= module_result($res) %>
<% } elsif ($state eq "running") { %>
running
<% } elsif ($state eq "scheduled") { %>
scheduled@<%= $res->{priority} %>
<% } else { %>
<%= $state %>
<% } %>
</span>
</span>
% if (is_operator) {
<span class="action">
% if ($state eq "done") {
%= link_post "Restart" => url_for('apiv1_restart', 'name' => $jobid) => ('data-remote' => 'true', class => 'restart', 'data-jobid' => $jobid)
% } elsif ($state eq "running" || $state eq "scheduled") {
%= link_post "Cancel" => url_for('apiv1_cancel', 'name' => $jobid) => ('data-remote' => 'true', class => 'cancel', 'data-jobid' => $jobid)
% }
</span>
% }
<% } %>
</td>
<td style="text-align: left; margin: 0px;">
Expand Down

0 comments on commit 6bdcab3

Please sign in to comment.