diff --git a/static/css/style.css b/static/css/style.css index 268f6f7f9d010987cbcaf2fe4eadebac91d2996f..aa044d734c601d02cf6a9748a261c968c8160d27 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -9,6 +9,18 @@ html, body { table.event th {padding:3px;border:none;text-align:center;vertical-align:bottom;} table.event {border-bottom:1px solid gray;} +/* Branson added */ +table.event {width:100%} + +table.analysis_specific {width:100%} + +.content-area { + margin-top: 10px; + margin-bottom: 30px; + margin-left: 15px; + margin-right: 15px; +} +/* End Branson */ td, th {padding:3px;border:none;} tr th {text-align:left;background-color:#f0f0f0;color:#333;} diff --git a/templates/base.html b/templates/base.html index f9eec575d1aba079a5c7d27d8730603ecf10cb99..dd0b46c33bbb695399ebaa2467ecbf2c5ae88b13 100644 --- a/templates/base.html +++ b/templates/base.html @@ -2,7 +2,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> - <link rel="stylesheet" href="/gracedb-static/css/style.css" /> + <link rel="stylesheet" href="/branson-static/css/style.css" /> <title>GraceDb | {% block title %}{% endblock %}</title> <!-- START TESTING --> <script type="text/javascript"> diff --git a/templates/gracedb/event_detail.html b/templates/gracedb/event_detail.html index aa948a79a168fe73d48dd8b6cf076b6596e425c4..d330a586937b55a99385c43f76555552fac64fcf 100644 --- a/templates/gracedb/event_detail.html +++ b/templates/gracedb/event_detail.html @@ -2,7 +2,7 @@ {% load timeutil %} {% load scientific %} {% load sanitize_html %} -{% load slot %} +{% load logtags %} {% block title %}View {{ object.graceid }}{% endblock %} {% block heading %}{% endblock %} @@ -23,6 +23,7 @@ "dojox/editor/plugins/Save", "dojox/editor/plugins/Preview", "dijit/form/Button", + "dijit/TitlePane", "dojox/image/LightboxNano", "dijit/_editor/plugins/TextColor", "dijit/_editor/plugins/LinkDialog", @@ -30,7 +31,7 @@ "dijit/_editor/plugins/NewPage", "dijit/_editor/plugins/FullScreen", "dojo/parser", - "dojo/domReady!"], function (Editor, Save, Preview, Button) { + "dojo/domReady!"], function (Editor, Save, Preview, Button, TitlePane) { dojo.parser.parse(); @@ -112,6 +113,32 @@ 'insertImage','fullscreen','viewsource','newpage', '|', previewbutton, savebutton] }, editor_div); + // Branson: Working on TitlePanes here. +{% if object.getAvailableTags %} + var pane_holder = dojo.byId("pane_holder"); + var panes = new Array(); + var titles = new Array(); + {% for tag in object.getAvailableTags %} + panes.push(dojo.byId("{{tag.name}}")); + titles.push("{{tag|tagUnicode}}"); + {% endfor %} + + for (var i = 0; i<panes.length; i++) { + tp = new dijit.TitlePane({title:titles[i], + content:panes[i].innerHTML, + open:true}); + pane_holder.appendChild(tp.domNode); + dojo.destroy(panes[i]); + }; + + // Handle event log seperately. It will be closed by default. + var event_log = dojo.byId("event_log"); + tp = new dijit.TitlePane({title:"Full Event Log", + content:event_log.innerHTML, + open:false}); + pane_holder.appendChild(tp.domNode); + dojo.destroy(event_log); +{% endif %} }); </script> @@ -157,9 +184,9 @@ {% block content %} <p>{{ message }}</p> -<table> -<tr><td valign="top"> +<!-- Branson: Wrapping everything in a content area div so that I can put some space around it. --> +<div class="content-area"> <h3> Basic Info </h3> <table class="event"> @@ -208,14 +235,17 @@ </tr> </table> +</div> +<div class="content-area"> {# Analysis-specific attributes #} {% block analysis_specific %} {# This block is empty in the base event_detail template #} {% endblock %} +</div> {% if nearby %} - <p/> + <div id="neighbors" class="content-area"> <h3>Neighbors</h3> <table class="event"> <tr> @@ -255,6 +285,51 @@ </tr> {% endfor %} </table> + </div> +{% endif %} + +<div id="pane_holder" class="content-area"> + {# XXX Hacky #} + {# With the title here, people will know that all of the things in the #} + {# panes are log messages #} +{% if object.getAvailableTags %} + <h3 id="logmessagetitle">Event Log Messages</h3> + <div id="previewer"></div> + <div id="editor"></div> +{% endif %} + +<!-- Branson. Loop over the available tags. --> +{% if object.getAvailableTags %} + {% for tag in object.getAvailableTags %} + <div id="{{tag.name}}"> + <table class="event"> + <tr> + <th>No.</th> + <th>{{ "logtime"|timeselect:"utc" }} Log Entry Created</th> + <th>Submitter</th> + <th>Comment</th> + <th> </th> + </tr> + {% for log in object|getLogsForTag:tag.name %} + <tr class="{% cycle 'odd' 'even'%}"> + <td>{{log.getN}}</td> + <td>{{log.created|multiTime:"logtime"}}</td> + <td>{{log.issuer}}</td> + <td>{{log.comment|sanitize}} + {% if log.fileurl %} + <a href="{{log.fileurl}}">{{log.filename}}</a> + {% endif %} + </td> + <td> + {% if log.hasImage %} + <a href="{{ log.fileurl }}" dojoType="dojox.image.LightboxNano"><img height="60" src="{{ log.fileurl }}"></a> + {% endif %} + </td> + </tr> + {% endfor %} + </table> + </div> + {% endfor %} {% endif %} <noscript> @@ -266,15 +341,18 @@ </noscript> - <p/> - <h3 id="logmessagetitle">Event Log Messages</h3> - + <div id="event_log"> + {# XXX Hacky. We don't want the title here if we're doing panes. #} +{% if not object.getAvailableTags %} + <h3 id="logmessagetitle">Event Log Messages</h3> <div id="previewer"></div> <div id="editor"></div> +{% endif %} {% if object.eventlog_set.count %} <table class="event"> <tr> + <th>No.</th> <th>{{ "logtime"|timeselect:"utc" }} Log Entry Created</th> <th>Submitter</th> <th>Comment</th> @@ -282,6 +360,7 @@ </tr> {% for log in object.eventlog_set.iterator %} <tr class="{% cycle 'odd' 'even'%}"> + <td>{{log.getN}} <td>{{log.created|multiTime:"logtime"}}</td> <td>{{log.issuer}}</td> <td>{{log.comment|sanitize}} @@ -298,32 +377,7 @@ {% endfor %} </table> {% endif %} + </div> -</td> -<td rowspan="2" valign="top"> - -{% if eventdesc %} -<h3>Event Log File</h3> - {{ eventdesc }} - <br/> -{% endif %} - -{% if userdesc %} - <br/> -<h3>User Info</h3> - {{ userdesc }} - <br/> -{% endif %} - -<p/> -<h3>Available Slots</h3> -{% if not object|slot %} - None. -{% else %} - {% for slot in object|slot %} - <a href="{{slot.fileurl}}">{{ slot.name }}</a> <br/> - {% endfor %} -{% endif %} - -</td></tr></table> +</div> <!-- End of pane_holder div --> {% endblock %} diff --git a/templates/gracedb/event_detail_CWB.html b/templates/gracedb/event_detail_CWB.html index e91ae26ad951849a519617374f223b5a543d31ee..de184254918e290919a0d69ea6fdde66fff6ed64 100644 --- a/templates/gracedb/event_detail_CWB.html +++ b/templates/gracedb/event_detail_CWB.html @@ -4,10 +4,9 @@ {# Analysis-specific attributes for a cWB event#} {% block analysis_specific %} -<p/> <h3>Analysis-Specific Attributes</h3> -<table> <tbody> +<table class="analysis_specific"> <tbody> <tr> <td> <table class="event"> <tbody> <!-- Note: commenting out ifos so that we'll have a multiple of three --> diff --git a/templates/gracedb/event_detail_HM.html b/templates/gracedb/event_detail_HM.html index 735c28dbfddfa175ac660ea6cb8204d642bd3fec..d1f0f693c88452194a4ec483d96f7d5782f5243b 100644 --- a/templates/gracedb/event_detail_HM.html +++ b/templates/gracedb/event_detail_HM.html @@ -1,10 +1,32 @@ {% extends "gracedb/event_detail.html" %} -{# Analysis-specific attributes for a LowMass event#} -{% block analysis_specific %} - <p/> -<h3>Analysis-specific attributes</h3> +{% load scientific %} +{# Analysis-specific attributes for an LM event#} +{% block analysis_specific %} +<h3>Analysis-Specific Attributes</h3> +<table class="analysis_specific"> <tbody> + <tr> + <td> <table class="event"> <tbody> + <tr> <th> ifos </th> <td> {{object.ifos}} </td> </tr> + <tr> <th> end_time </th> <td> {{object.end_time}} </td> </tr> + <tr> <th> end_time_ns </th> <td> {{object.end_time_ns}} </td> </tr> + </tbody></table> + </td> + <td> <table class="event"> <tbody> + <tr> <th> mass </th> <td> {{object.mass|floatformat:"-4"}} </td> </tr> + <tr> <th> mchirp </th> <td> {{object.mchirp|floatformat:"-4"}} </td> </tr> + <tr> <th> minimum_duration </th> <td> {{object.minimum_duration|scientific}} </td> </tr> + </tbody></table> + </td> + <td> <table class="event"> <tbody> + <tr> <th> snr </th> <td> {{object.snr|floatformat:"-4"}} </td> </tr> + <tr> <th> false_alarm_rate </th> <td> {{object.false_alarm_rate|floatformat:"-4"}} </td> </tr> + <tr> <th> combined_far </th> <td> {{object.combined_far|scientific}} </td> </tr> + </tbody></table> + </td> + </tr> +</tbody> </table> {% endblock %} diff --git a/templates/gracedb/event_detail_LM.html b/templates/gracedb/event_detail_LM.html index 3a1e4dfeb5f7e217b731968383b5563e42ce6fc5..d1f0f693c88452194a4ec483d96f7d5782f5243b 100644 --- a/templates/gracedb/event_detail_LM.html +++ b/templates/gracedb/event_detail_LM.html @@ -4,10 +4,9 @@ {# Analysis-specific attributes for an LM event#} {% block analysis_specific %} -<p/> <h3>Analysis-Specific Attributes</h3> -<table> <tbody> +<table class="analysis_specific"> <tbody> <tr> <td> <table class="event"> <tbody> <tr> <th> ifos </th> <td> {{object.ifos}} </td> </tr> @@ -30,5 +29,4 @@ </tr> </tbody> </table> - {% endblock %} diff --git a/templates/gracedb/event_detail_MBTA.html b/templates/gracedb/event_detail_MBTA.html index 735c28dbfddfa175ac660ea6cb8204d642bd3fec..81ba7576fa013ec7644aa556f4ce01c85cb5dd3b 100644 --- a/templates/gracedb/event_detail_MBTA.html +++ b/templates/gracedb/event_detail_MBTA.html @@ -3,8 +3,7 @@ {# Analysis-specific attributes for a LowMass event#} {% block analysis_specific %} <p/> -<h3>Analysis-specific attributes</h3> - - +<h3>Event Log File</h3> +{{eventdesc}} {% endblock %}