From bda07cf93ea940764f43b18b1aaf82cc308237ec Mon Sep 17 00:00:00 2001
From: Jonah Kanner <jonah.kanner@ligo.org>
Date: Thu, 30 May 2019 12:03:47 -0500
Subject: [PATCH] better mobile view

---
 gracedb/static/css/public.css             |  7 +++
 gracedb/templates/navbar_min.html         | 26 +++++++++++
 gracedb/templates/superevents/public.html | 56 +++++++----------------
 3 files changed, 49 insertions(+), 40 deletions(-)
 create mode 100644 gracedb/static/css/public.css
 create mode 100644 gracedb/templates/navbar_min.html

diff --git a/gracedb/static/css/public.css b/gracedb/static/css/public.css
new file mode 100644
index 000000000..bc72994be
--- /dev/null
+++ b/gracedb/static/css/public.css
@@ -0,0 +1,7 @@
+
+@media screen and (max-device-width: 480px){
+    body{
+	-webkit-text-size-adjust: none;
+    }
+}
+
diff --git a/gracedb/templates/navbar_min.html b/gracedb/templates/navbar_min.html
new file mode 100644
index 000000000..1e430f461
--- /dev/null
+++ b/gracedb/templates/navbar_min.html
@@ -0,0 +1,26 @@
+<div style="padding-bottom: 30px;">
+<ul id="nav">
+    <li id="nav-home"><a href="{% url "home" %}">Home</a></li>
+    {% if user.is_authenticated %}
+        <li id="nav-logout"><a href="{% url "logout" %}">Logout</a></li>
+        <li id="nav-user">Authenticated as:
+        {% if user.first_name %}
+            {{ user.get_full_name }}
+        {% else %}
+            {{ user.username }}
+        {% endif %}
+        </li>
+    {% else %}
+        <li id="nav-login"><a href="{% url "login" %}">Login</a></li>
+    {% endif %}
+</ul>
+
+{% if 'lvem_view' in request.path %}
+<div id="lvem_view_message">
+<b>IMPORTANT:</b> You are viewing this page as a member of the LV-EM Observers group.
+At the end of your session, please remove the 'lvem_view/' string from the URL to 
+return to the regular GraceDB site. This will ensure that your group memberships 
+are correct the next time you log in. 
+</div>
+{% endif %}
+</div>
diff --git a/gracedb/templates/superevents/public.html b/gracedb/templates/superevents/public.html
index a4e63c2f1..0d6e2a161 100644
--- a/gracedb/templates/superevents/public.html
+++ b/gracedb/templates/superevents/public.html
@@ -3,56 +3,31 @@
 {% load logtags %}
 {% load static %}
 
-{% comment %}
-{% block csslink %}<link rel="stylesheet" href="{% static "css/public.css" %}" />{% endblock %}
-{% endcomment %}
 
-{% block heading %}{% endblock %}
-
-
-
-{% block bodyattrs %}class="tundra eventDetail"{% endblock %}
+{% block csslink %}
+<link rel="stylesheet" href="{% static "css/style.css" %}" />
+<link rel="stylesheet" href="{% static "css/public.css" %}" />
+<meta name="viewport" content="width=device-width, initial-scale=1">
+{% endblock %}
 
+{% block heading %}{% endblock %}
 
 {% block jscript %}
-
-
 <link rel="stylesheet" type="text/css" href="{% static "tablesaw/dist/tablesaw.css" %}" />
 <script language="javascript" type="text/javascript" src="{% static "tablesaw/dist/tablesaw.js" %}"></script>
 <script language="javascript" type="text/javascript" src="{% static "tablesaw/dist/tablesaw-init.js" %}"></script>
-<!-- <script src="//filamentgroup.github.io/demo-head/loadfont.js"></script> -->
-
-<!-- Styles for dgrid -->
-<!-- <link rel="stylesheet" href="{% static "dgrid/css/dgrid.css" %}" /> -->
-<!-- Styles for the editor components -->
-
-<!--
-<link rel="stylesheet" href="{% static "dojox/editor/plugins/resources/css/PageBreak.css" %}" />
-<link rel="stylesheet" href="{% static "dojox/editor/plugins/resources/css/ShowBlockNodes.css" %}" />
-<link rel="stylesheet" href="{% static "dojox/editor/plugins/resources/css/Preview.css" %}" />
-<link rel="stylesheet" href="{% static "dojox/editor/plugins/resources/css/Save.css" %}" />
-<link rel="stylesheet" href="{% static "dojox/editor/plugins/resources/css/Breadcrumb.css" %}" />
-<link rel="stylesheet" href="{% static "dojox/editor/plugins/resources/css/FindReplace.css" %}" />
-<link rel="stylesheet" href="{% static "dojox/editor/plugins/resources/css/PasteFromWord.css" %}" />
-<link rel="stylesheet" href="{% static "dojox/editor/plugins/resources/css/InsertAnchor.css" %}" />
-<link rel="stylesheet" href="{% static "dojox/editor/plugins/resources/css/CollapsibleToolbar.css" %}" />
-<link rel="stylesheet" href="{% static "dojox/editor/plugins/resources/css/Blockquote.css" %}" />
-<link rel="stylesheet" href="{% static "dojox/editor/plugins/resources/css/Smiley.css" %}" />
-
-<link rel="stylesheet" href="{% static "dojox/image/resources/LightboxNano.css" %}" />
-
-<link rel="stylesheet" href="{% static "dijit/themes/tundra/tundra.css" %}" />
--->
-
-
-<!-- the main JavaScript block is pulled in with an include -->
+{% endblock %}
 
+{% block nav %}
+<!-- This nav bar only has links for HOME and LOGIN to fit on mobile -->
+{% include "navbar_min.html" %}
 {% endblock %}
 
 {% block content %}
+<br/>
 <h1>LIGO/Virgo Public Alerts</h1> 
 
-<h3>O3 detection candidates: {{ candidates }}</h3>
+<h3>Detection candidates: {{ candidates }}</h3>
 <br/><br/>
 
 
@@ -75,17 +50,18 @@
       <th  scope="col" data-tablesaw-col data-tablesaw-priority="0">False Alarm Rate (per year)</th>
       <!-- <th  scope="col" data-tablesaw-sortable-col data-tablesaw-priority="0">UTC Time</th> -->      
     </tr>
-  </thead><tbody>
+  </thead>
+  <tbody>
 
 
 {% for event in object_list %}
 <tr   {% if event.retract %}style='background-color:#EDD' {% endif %}  >
 
-  <td><a href=/superevents/{{ event.superevent_id }}>{{ event.default_superevent_id }}</a></td>
+  <td style='min-width:100px;'><a href=/superevents/{{ event.superevent_id }}>{{ event.default_superevent_id }}</a></td>
 
   <td style='min-width:120px;'>{{ event.sourcetypes }} </td>
 
-  <td style='min-width:120px'>
+  <td style='min-width:140px'>
     <span style='font-size:0px;'>{{ event.t0_iso }}</span>{{ event.t_0_date }}<br/>
     {{ event.t0_utc }} UTC
   </td>
-- 
GitLab