From f96bfbf34a4cc743d6a11c5f70101bf34f093da9 Mon Sep 17 00:00:00 2001 From: nswain Date: Thu, 7 May 2020 08:39:32 -0600 Subject: [PATCH] Initial About Page Solution --- tethysapp/earth_engine/app.py | 5 ++ tethysapp/earth_engine/controllers.py | 9 +++ tethysapp/earth_engine/public/css/about.css | 24 ++++++++ .../public/css/disclaimer_modal.css | 20 +++++++ .../templates/earth_engine/about.html | 57 +++++++++++++++++++ .../templates/earth_engine/base.html | 54 +++++++++++++++++- .../templates/earth_engine/viewer.html | 7 +-- 7 files changed, 169 insertions(+), 7 deletions(-) create mode 100644 tethysapp/earth_engine/public/css/about.css create mode 100644 tethysapp/earth_engine/public/css/disclaimer_modal.css create mode 100644 tethysapp/earth_engine/templates/earth_engine/about.html diff --git a/tethysapp/earth_engine/app.py b/tethysapp/earth_engine/app.py index 83f5e4f..23889dc 100644 --- a/tethysapp/earth_engine/app.py +++ b/tethysapp/earth_engine/app.py @@ -44,6 +44,11 @@ def url_maps(self): url='earth-engine/viewer/get-time-series-plot', controller='earth_engine.controllers.get_time_series_plot' ), + UrlMap( + name='about', + url='earth-engine/about', + controller='earth_engine.controllers.about' + ) ) return url_maps diff --git a/tethysapp/earth_engine/controllers.py b/tethysapp/earth_engine/controllers.py index a4437e4..6e59a25 100644 --- a/tethysapp/earth_engine/controllers.py +++ b/tethysapp/earth_engine/controllers.py @@ -22,6 +22,15 @@ def home(request): return render(request, 'earth_engine/home.html', context) +@login_required() +def about(request): + """ + Controller for the app about page. + """ + context = {} + return render(request, 'earth_engine/about.html', context) + + @login_required() def viewer(request): """ diff --git a/tethysapp/earth_engine/public/css/about.css b/tethysapp/earth_engine/public/css/about.css new file mode 100644 index 0000000..2674735 --- /dev/null +++ b/tethysapp/earth_engine/public/css/about.css @@ -0,0 +1,24 @@ +.page-header h1 { + text-align: center; + font-size: 48pt; + color: black; +} + +.about-img { + width: 100%; + max-width: 360px; + margin-bottom: 20px; +} + +.about-footer-content { + text-align: center; + margin: 50px 0 100px 0; +} + +.about-footer-content h3 { + margin-bottom: 26px; +} + +.about-footer-content img { + margin: 0 5px; +} \ No newline at end of file diff --git a/tethysapp/earth_engine/public/css/disclaimer_modal.css b/tethysapp/earth_engine/public/css/disclaimer_modal.css new file mode 100644 index 0000000..f5d3ff7 --- /dev/null +++ b/tethysapp/earth_engine/public/css/disclaimer_modal.css @@ -0,0 +1,20 @@ +#disclaimer-container { + height: 400px; + overflow-y: auto; +} + +#sponsors-container { + text-align: left; +} + +#sponsors-container img { + height: 50px; + width: 50px; + margin-right: 10px; + border-radius: 5px; +} + +#sponsors-container h6 { + display: inline-block; + margin-right: 10px; +} diff --git a/tethysapp/earth_engine/templates/earth_engine/about.html b/tethysapp/earth_engine/templates/earth_engine/about.html new file mode 100644 index 0000000..41c383a --- /dev/null +++ b/tethysapp/earth_engine/templates/earth_engine/about.html @@ -0,0 +1,57 @@ +{% extends "earth_engine/base.html" %} +{% load static %} + +{% block styles %} + {{ block.super }} + + +{% endblock %} + +{% block app_navigation_override %} +{% endblock %} + +{% block app_content %} +
+ +
+ +
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Euismod nisi porta lorem mollis. Congue quisque egestas diam in arcu cursus euismod. Auctor neque vitae tempus quam pellentesque nec nam. Erat imperdiet sed euismod nisi porta lorem. Nunc eget lorem dolor sed viverra ipsum nunc aliquet bibendum. Sed blandit libero volutpat sed cras ornare. Convallis tellus id interdum velit laoreet id. Amet mauris commodo quis imperdiet massa tincidunt. Mi bibendum neque egestas congue quisque egestas diam in. Enim nec dui nunc mattis enim ut tellus elementum sagittis. Cursus mattis molestie a iaculis at erat pellentesque. Ut tellus elementum sagittis vitae et leo.

+
Eu Consequat ac Felis
+

Eu consequat ac felis donec et odio. Eget arcu dictum varius duis at consectetur lorem. Lorem ipsum dolor sit amet consectetur. Turpis egestas integer eget aliquet nibh praesent. Mattis rhoncus urna neque viverra justo nec. Iaculis urna id volutpat lacus laoreet non curabitur gravida arcu. Convallis posuere morbi leo urna molestie at elementum eu. Fermentum et sollicitudin ac orci phasellus egestas tellus. Convallis aenean et tortor at risus. Morbi tristique senectus et netus et malesuada fames ac. Sed vulputate mi sit amet mauris commodo quis. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl. Id venenatis a condimentum vitae sapien pellentesque habitant morbi tristique. Id cursus metus aliquam eleifend mi in nulla. Proin fermentum leo vel orci porta non pulvinar neque laoreet. Lobortis mattis aliquam faucibus purus in massa tempor. Varius vel pharetra vel turpis nunc.

+

Mauris rhoncus aenean vel elit: Blandit aliquam etiam erat velit. Auctor neque vitae tempus quam pellentesque nec nam. Augue mauris augue neque gravida in fermentum et. Tempus urna et pharetra pharetra. Vel turpis nunc eget lorem. Vitae nunc sed velit dignissim. Enim tortor at auctor urna nunc id. Pellentesque habitant morbi tristique senectus et netus et. Tellus integer feugiat scelerisque varius morbi enim nunc faucibus.

+

Blandit turpis cursus in hac habitasse platea: Tellus elementum sagittis vitae et leo duis ut diam quam. Amet nisl purus in mollis nunc sed. Ac feugiat sed lectus vestibulum. Suscipit adipiscing bibendum est ultricies integer quis. Tortor pretium viverra suspendisse potenti nullam ac tortor. Blandit turpis cursus in hac. Id porta nibh venenatis cras sed felis eget velit. Fermentum posuere urna nec tincidunt praesent semper feugiat nibh sed. Pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at. Sapien et ligula ullamcorper malesuada proin libero nunc consequat. Aliquet enim tortor at auctor urna nunc id. Fringilla ut morbi tincidunt augue interdum velit euismod in. In arcu cursus euismod quis viverra nibh. Vulputate ut pharetra sit amet. Purus in massa tempor nec. Pellentesque massa placerat duis ultricies lacus sed. Integer feugiat scelerisque varius morbi enim. Vitae tempus quam pellentesque nec nam.

+

Sed cras ornare arcu dui vivamus arcu: Pellentesque adipiscing commodo elit at. Fusce id velit ut tortor pretium viverra. Nunc vel risus commodo viverra. Dui faucibus in ornare quam viverra orci sagittis eu volutpat. Aliquet nibh praesent tristique magna. Purus sit amet volutpat consequat. Gravida neque convallis a cras. Aenean euismod elementum nisi quis eleifend. At tellus at urna condimentum mattis pellentesque id nibh tortor. Sit amet massa vitae tortor. Volutpat lacus laoreet non curabitur gravida arcu ac. Vulputate dignissim suspendisse in est ante. Tempor commodo ullamcorper a lacus vestibulum. Quis vel eros donec ac odio tempor. Lacus sed turpis tincidunt id aliquet risus feugiat in ante. Metus aliquam eleifend mi in.

' +
+
+ + +
+
+ + + +
+
+ +
+
+
+ +
+
+
+{% endblock %} diff --git a/tethysapp/earth_engine/templates/earth_engine/base.html b/tethysapp/earth_engine/templates/earth_engine/base.html index 5dc873e..3bf2e2b 100644 --- a/tethysapp/earth_engine/templates/earth_engine/base.html +++ b/tethysapp/earth_engine/templates/earth_engine/base.html @@ -12,6 +12,19 @@ {# The name you provided in your app.py is accessible through the tethys_app.name context variable #} {% block app_title %}{{ tethys_app.name }}{% endblock %} +{% block header_buttons %} + {{ block.super }} +
+ +
+
+ +
+
+ +
+{% endblock %} + {% block app_navigation_items %}
  • App Navigation
  • Home
  • @@ -34,9 +47,48 @@ {% block content_dependent_styles %} {{ block.super }} + {% endblock %} {% block scripts %} {{ block.super }} -{% endblock %} \ No newline at end of file +{% endblock %} + +{# Use the after_app_content block for modals #} +{% block after_app_content %} + {{ block.super }} + + + +{% endblock %} diff --git a/tethysapp/earth_engine/templates/earth_engine/viewer.html b/tethysapp/earth_engine/templates/earth_engine/viewer.html index 2a14e1a..8905164 100644 --- a/tethysapp/earth_engine/templates/earth_engine/viewer.html +++ b/tethysapp/earth_engine/templates/earth_engine/viewer.html @@ -12,12 +12,6 @@ {% import_gizmo_dependency plotly_view %} {% endblock %} -{% block header_buttons %} -
    - -
    -{% endblock %} - {% block app_navigation_items %}
  • Select Dataset
  • {% gizmo platform_select %} @@ -39,6 +33,7 @@ {# Use the after_app_content block for modals #} {% block after_app_content %} + {{ block.super }}