Skip to content

Commit

Permalink
Some style and UI tweaks to new historical charting
Browse files Browse the repository at this point in the history
  • Loading branch information
kamens committed Sep 30, 2011
1 parent 963b1a4 commit 1512a62
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 305 deletions.
9 changes: 4 additions & 5 deletions plots.py
Expand Up @@ -13,18 +13,17 @@ def __init__(self, name):
self.snapshots = [] self.snapshots = []


class Timeline(RequestHandler): class Timeline(RequestHandler):

def get(self):
def post(self):


experiment_name = self.request.get("experiment_name") experiment_name = self.request.get("experiment_name")


if not experiment_name: if not experiment_name:
return return


bingo_cache = BingoCache.get() bingo_cache = BingoCache.get()
experiment_model = bingo_cache.get_experiment(experiment_name) experiment = bingo_cache.get_experiment(experiment_name)


query = _GAEBingoSnapshotLog.all().ancestor(experiment_model) query = _GAEBingoSnapshotLog.all().ancestor(experiment)
query.order('-time_recorded') query.order('-time_recorded')
experiment_snapshots = query.fetch(1000) experiment_snapshots = query.fetch(1000)


Expand Down Expand Up @@ -57,7 +56,7 @@ def get_alternative_content_str(alt_num):
path = os.path.join(os.path.dirname(__file__), "templates/timeline.html") path = os.path.join(os.path.dirname(__file__), "templates/timeline.html")
self.response.out.write( self.response.out.write(
template.render(path, { template.render(path, {
"experiment_name": experiment_name, "experiment": experiment,
"experiment_data": experiment_data, "experiment_data": experiment_data,
}) })
) )
Binary file added static/images/chart.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
262 changes: 0 additions & 262 deletions static/js/highcharts_gray_theme.js

This file was deleted.

9 changes: 8 additions & 1 deletion templates/base.html
Expand Up @@ -4,7 +4,7 @@
<link rel="stylesheet" href="/gae_bingo/static/css/base.css" type="text/css" media="screen" /> <link rel="stylesheet" href="/gae_bingo/static/css/base.css" type="text/css" media="screen" />
<link rel="stylesheet" id="current-theme" href="/gae_bingo/static/css/style.css" type="text/css" media="screen" /> <link rel="stylesheet" id="current-theme" href="/gae_bingo/static/css/style.css" type="text/css" media="screen" />


<title>{% block title %}GAE/Bingo{% endblock %}</title> <title>GAE/Bingo Experiments</title>


<style> <style>
body { body {
Expand Down Expand Up @@ -37,6 +37,13 @@
display: inline; display: inline;
margin-right: 0; margin-right: 0;
} }

#main .plot-link-container {
float: right;
text-align: center;
position: relative;
top: 5px;
}
</style> </style>




Expand Down
61 changes: 28 additions & 33 deletions templates/dashboard.html
Expand Up @@ -19,7 +19,7 @@


{% block body %} {% block body %}
<div id="main"> <div id="main">
<div id="header"><h1>GAE/Bingo Experiments</h1></div> <div id="header"><h1><a href="/gae_bingo/dashboard">GAE/Bingo Experiments</a></h1></div>


{% if not experiment_results %} {% if not experiment_results %}
<div class="experiment-container block"> <div class="experiment-container block">
Expand All @@ -30,39 +30,34 @@ <h3>No experiments yet.</h3>


{% for results in experiment_results %} {% for results in experiment_results %}
<div class="experiment-container block"> <div class="experiment-container block">
<div class="plot-link-container">
<nobr>
<a href="/gae_bingo/dashboard/plot_experiment?experiment_name={{ results.0.name|escape|urlencode }}"><img src="/gae_bingo/static/images/chart.png" /></a><br/>
<a href="/gae_bingo/dashboard/plot_experiment?experiment_name={{ results.0.name|escape|urlencode }}">View Plot</a>
</nobr>
</div>

<h2 class="experiment-title">{{ results.0.pretty_name|escape }}</h2>

{% if results.0.live %}
<p>
<strong>Status: </strong>
Running {{ results.0.dt_started|timesince }}
</p>
{% else %}
<form action="/gae_bingo/dashboard/control_experiment" method="POST">
<input type="hidden" name="experiment_name" value="{{ results.0.name|escape }}"/>
<p>
<strong>Status: </strong>
Ended manually.
You can <button type="submit" class="button delete-experiment" value="resume" name="action">resume this experiment</button> or,
if your testing code has been removed,
<button type="submit" class="button delete-experiment" value="delete" name="action">delete this experiment</button>
from the dashboard.
</p>
</form>
{% endif %}



<table class="table"><tbody><tr>
<td>
<h2 class="experiment-title">{{ results.0.pretty_name|escape }}</h2>

{% if results.0.live %}
<p>
<strong>Status: </strong>
Running {{ results.0.dt_started|timesince }}
</p>
{% else %}
<form action="/gae_bingo/dashboard/control_experiment" method="POST">
<input type="hidden" name="experiment_name" value="{{ results.0.name|escape }}"/>
<p>
<strong>Status: </strong>
Ended manually.
You can <button type="submit" class="button delete-experiment" value="resume" name="action">resume this experiment</button> or,
if your testing code has been removed,
<button type="submit" class="button delete-experiment" value="delete" name="action">delete this experiment</button>
from the dashboard.
</p>
</form>
{% endif %}
</td>
<td align="right">
<form action="/gae_bingo/dashboard/plot_experiment" method="POST">
<input type="hidden" name="experiment_name" value="{{ results.0.name|escape }}"/>
<button type="submit" class="button delete-experiment" name="action" value="choose_alternative">Plot this exepriment</button>
</form>
</td>
</tr></tbody></table>

<table class="table"> <table class="table">
<tbody> <tbody>
<tr> <tr>
Expand Down

0 comments on commit 1512a62

Please sign in to comment.