Fix landing page directions for not-logged-in users
authorSawyer Bergeron <sawyerbergeron@gmail.com>
Fri, 4 Jan 2019 14:38:43 +0000 (09:38 -0500)
committerSawyer Bergeron <sawyerbergeron@gmail.com>
Fri, 4 Jan 2019 14:38:43 +0000 (09:38 -0500)
Users will see a more informative landing page that directs them to log
in if they have not yet done so, rather than displaying actions they can
not yet take and having a required login get triggered later

Change-Id: I9812367930665614933551f780f4c6726ff3049c
Signed-off-by: Sawyer Bergeron <sawyerbergeron@gmail.com>
src/templates/dashboard/landing.html

index 867477a..71d2706 100644 (file)
@@ -3,12 +3,16 @@
 
 {% block content %}
     <div class="">
+        {% if not request.user.is_anonymous %}
         {% if not request.user.userprofile.ssh_public_key %}
         <h4 style="text-align: center; background: #AA0000; color: #FFFFFF; padding: 10px; border-radius: 3px; height: 40px;">
             Warning: you need to upload an ssh key under <a href="/accounts/settings">account settings</a> if you wish to log into the servers you book
         </h4>
         {% endif %}
-        <p style="text-align:center;">Welcome to the Pharos Dashboard! To get started, select one of the options below:</p>
+            <p style="text-align:center;">Welcome to the Pharos Dashboard! To get started, select one of the options below:</p>
+        {% else %}
+            <p style="text-align:center;">Welcome to the Pharos Dashboard! To get started, please log in with your <a href="/accounts/login">Linux Foundation Jira account</a></p>
+        {% endif %}
     </div>
 {% csrf_token %}
 
@@ -33,6 +37,7 @@
         grid-template-columns: 33% 34% 33%;
     }
 </style>
+{% if not request.user.is_anonymous %}
 <div class='wf_create_div'>
 <button class="wf_create btn btn-primary" onclick="cwf(0)">Create a Booking</button>
 <button class="wf_create btn btn-primary" onclick="cwf(1)">Create a Pod</button>
@@ -41,6 +46,7 @@
 {% if manager == True %}
 <button class="wf_continue btn btn-primary" onclick="continue_wf()">Finish Unfinished Business</button>
 {% endif %}
+{% endif %}
 </div>
 
 <script type="text/javascript">
@@ -66,8 +72,6 @@
         window.location.replace("/wf/");
     }
 
-    //success: window.location.replace("/wf/")
-
 </script>
 
 <div class="hidden_form" id="form_div">