diff --git a/install.yml b/install.yml index e4deb55..ba8a55d 100644 --- a/install.yml +++ b/install.yml @@ -1,5 +1,5 @@ # This file should be committed to your app code. -version: 1.0 +version: 1.1 # This should be greater or equal to your tethys-platform in your environment tethys_version: ">=4.0.0" # This should match the app - package name in your setup.py @@ -10,12 +10,12 @@ requirements: skip: false conda: channels: - - conda-forge + - conda-forge packages: - - earthengine-api - - oauth2client + - earthengine-api + - oauth2client pip: npm: -post: \ No newline at end of file +post: diff --git a/setup.py b/setup.py index 7f32563..b2fc626 100644 --- a/setup.py +++ b/setup.py @@ -10,8 +10,9 @@ dependencies = [] # -- Get Resource File -- # -resource_files = find_all_resource_files(app_package, TethysAppBase.package_namespace) - +resource_files = find_all_resource_files( + app_package, TethysAppBase.package_namespace +) setup( name=release_package, @@ -28,4 +29,4 @@ include_package_data=True, zip_safe=False, install_requires=dependencies, -) \ No newline at end of file +) diff --git a/tethysapp/earth_engine/app.py b/tethysapp/earth_engine/app.py index d368756..003f5b0 100644 --- a/tethysapp/earth_engine/app.py +++ b/tethysapp/earth_engine/app.py @@ -1,12 +1,11 @@ from tethys_sdk.base import TethysAppBase -class EarthEngine(TethysAppBase): +class App(TethysAppBase): """ Tethys app class for Earth Engine. """ - - name = 'Google Earth Engine Tutorial' + name = 'Earth Engine' description = '' package = 'earth_engine' # WARNING: Do not change this value index = 'home' @@ -15,4 +14,4 @@ class EarthEngine(TethysAppBase): color = '#524745' tags = '' enable_feedback = False - feedback_emails = [] \ No newline at end of file + feedback_emails = [] diff --git a/tethysapp/earth_engine/controllers.py b/tethysapp/earth_engine/controllers.py index 23f52d6..85708af 100644 --- a/tethysapp/earth_engine/controllers.py +++ b/tethysapp/earth_engine/controllers.py @@ -1,6 +1,7 @@ -from django.shortcuts import render from tethys_sdk.routing import controller from tethys_sdk.gizmos import Button +from .app import App + @controller def home(request): @@ -13,9 +14,9 @@ def home(request): icon='save', style='success', attributes={ - 'data-bs-toggle':'tooltip', - 'data-bs-placement':'top', - 'title':'Save' + 'data-bs-toggle': 'tooltip', + 'data-bs-placement': 'top', + 'title': 'Save' } ) @@ -25,9 +26,9 @@ def home(request): icon='pen', style='warning', attributes={ - 'data-bs-toggle':'tooltip', - 'data-bs-placement':'top', - 'title':'Edit' + 'data-bs-toggle': 'tooltip', + 'data-bs-placement': 'top', + 'title': 'Edit' } ) @@ -37,9 +38,9 @@ def home(request): icon='trash', style='danger', attributes={ - 'data-bs-toggle':'tooltip', - 'data-bs-placement':'top', - 'title':'Remove' + 'data-bs-toggle': 'tooltip', + 'data-bs-placement': 'top', + 'title': 'Remove' } ) @@ -47,9 +48,9 @@ def home(request): display_text='Previous', name='previous-button', attributes={ - 'data-bs-toggle':'tooltip', - 'data-bs-placement':'top', - 'title':'Previous' + 'data-bs-toggle': 'tooltip', + 'data-bs-placement': 'top', + 'title': 'Previous' } ) @@ -57,9 +58,9 @@ def home(request): display_text='Next', name='next-button', attributes={ - 'data-bs-toggle':'tooltip', - 'data-bs-placement':'top', - 'title':'Next' + 'data-bs-toggle': 'tooltip', + 'data-bs-placement': 'top', + 'title': 'Next' } ) @@ -71,4 +72,4 @@ def home(request): 'next_button': next_button } - return render(request, 'earth_engine/home.html', context) \ No newline at end of file + return App.render(request, 'home.html', context) diff --git a/tethysapp/earth_engine/public/images/icon.gif b/tethysapp/earth_engine/public/images/icon.gif new file mode 100644 index 0000000..5c8236e Binary files /dev/null and b/tethysapp/earth_engine/public/images/icon.gif differ diff --git a/tethysapp/earth_engine/workspaces/app_workspace/.gitkeep b/tethysapp/earth_engine/resources/.gitkeep similarity index 100% rename from tethysapp/earth_engine/workspaces/app_workspace/.gitkeep rename to tethysapp/earth_engine/resources/.gitkeep diff --git a/tethysapp/earth_engine/templates/earth_engine/base.html b/tethysapp/earth_engine/templates/earth_engine/base.html index ee6c7a1..2568bdc 100644 --- a/tethysapp/earth_engine/templates/earth_engine/base.html +++ b/tethysapp/earth_engine/templates/earth_engine/base.html @@ -1,6 +1,6 @@ {% extends "tethys_apps/app_base.html" %} -{% load static %} +{% load static tethys %} {% block title %}{{ tethys_app.name }}{% endblock %} @@ -33,10 +33,10 @@ {% block content_dependent_styles %} {{ block.super }} - + {% endblock %} {% block scripts %} {{ block.super }} - + {% endblock %} \ No newline at end of file diff --git a/tethysapp/earth_engine/templates/earth_engine/home.html b/tethysapp/earth_engine/templates/earth_engine/home.html index 951d6e2..42c196a 100644 --- a/tethysapp/earth_engine/templates/earth_engine/home.html +++ b/tethysapp/earth_engine/templates/earth_engine/home.html @@ -1,5 +1,5 @@ -{% extends "earth_engine/base.html" %} -{% load tethys_gizmos %} +{% extends tethys_app.package|add:"/base.html" %} +{% load tethys %} {% block header_buttons %}
diff --git a/tethysapp/earth_engine/workspaces/user_workspaces/.gitkeep b/tethysapp/earth_engine/workspaces/user_workspaces/.gitkeep deleted file mode 100644 index e69de29..0000000