Skip to content

Commit

Permalink
updates for tethys 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeymac committed Aug 17, 2024
1 parent 96bb1f7 commit 454acac
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 34 deletions.
10 changes: 5 additions & 5 deletions install.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,12 +10,12 @@ requirements:
skip: false
conda:
channels:
- conda-forge
- conda-forge
packages:
- earthengine-api
- oauth2client
- earthengine-api
- oauth2client
pip:

npm:

post:
post:
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -28,4 +29,4 @@
include_package_data=True,
zip_safe=False,
install_requires=dependencies,
)
)
7 changes: 3 additions & 4 deletions tethysapp/earth_engine/app.py
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -15,4 +14,4 @@ class EarthEngine(TethysAppBase):
color = '#524745'
tags = ''
enable_feedback = False
feedback_emails = []
feedback_emails = []
35 changes: 18 additions & 17 deletions tethysapp/earth_engine/controllers.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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'
}
)

Expand All @@ -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'
}
)

Expand All @@ -37,29 +38,29 @@ 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'
}
)

previous_button = Button(
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'
}
)

next_button = Button(
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'
}
)

Expand All @@ -71,4 +72,4 @@ def home(request):
'next_button': next_button
}

return render(request, 'earth_engine/home.html', context)
return App.render(request, 'home.html', context)
Binary file added tethysapp/earth_engine/public/images/icon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
6 changes: 3 additions & 3 deletions tethysapp/earth_engine/templates/earth_engine/base.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "tethys_apps/app_base.html" %}

{% load static %}
{% load static tethys %}

{% block title %}{{ tethys_app.name }}{% endblock %}

Expand Down Expand Up @@ -33,10 +33,10 @@

{% block content_dependent_styles %}
{{ block.super }}
<link href="{% static 'earth_engine/css/main.css' %}" rel="stylesheet"/>
<link href="{% static tethys_app|public:'css/main.css' %}" rel="stylesheet"/>
{% endblock %}

{% block scripts %}
{{ block.super }}
<script src="{% static 'earth_engine/js/main.js' %}" type="text/javascript"></script>
<script src="{% static tethys_app|public:'js/main.js' %}" type="text/javascript"></script>
{% endblock %}
4 changes: 2 additions & 2 deletions tethysapp/earth_engine/templates/earth_engine/home.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "earth_engine/base.html" %}
{% load tethys_gizmos %}
{% extends tethys_app.package|add:"/base.html" %}
{% load tethys %}

{% block header_buttons %}
<div class="header-button glyphicon-button" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Help">
Expand Down
Empty file.

0 comments on commit 454acac

Please sign in to comment.