Skip to content

Commit e224c6a

Browse files
committed
initial commit
0 parents  commit e224c6a

File tree

15 files changed

+394
-0
lines changed

15 files changed

+394
-0
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.pydevproject
2+
*.project
3+
*.egg-info
4+
*.class
5+
*.pyo
6+
*.pyc
7+
*.db
8+
*.sqlite
9+
*.DS_Store
10+
.idea/
11+
services.yml

install.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file should be committed to your app code.
2+
version: 1.1
3+
# This should be greater or equal to your tethys-platform in your environment
4+
tethys_version: ">=4.0.0"
5+
# This should match the app - package name in your setup.py
6+
name: map_layout_tutorial
7+
8+
requirements:
9+
# Putting in a skip true param will skip the entire section. Ignoring the option will assume it be set to False
10+
skip: false
11+
conda:
12+
channels:
13+
packages:
14+
15+
pip:
16+
17+
npm:
18+
19+
post:

setup.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from setuptools import setup, find_namespace_packages
2+
from tethys_apps.app_installation import find_all_resource_files
3+
from tethys_apps.base.app_base import TethysAppBase
4+
5+
# -- Apps Definition -- #
6+
app_package = 'map_layout_tutorial'
7+
release_package = f'{TethysAppBase.package_namespace}-{app_package}'
8+
9+
# -- Python Dependencies -- #
10+
dependencies = []
11+
12+
# -- Get Resource File -- #
13+
resource_files = find_all_resource_files(app_package, TethysAppBase.package_namespace)
14+
15+
16+
setup(
17+
name=release_package,
18+
version='0.0.1',
19+
description='',
20+
long_description='',
21+
keywords='',
22+
author='',
23+
author_email='',
24+
url='',
25+
license='',
26+
packages=find_namespace_packages(),
27+
package_data={'': resource_files},
28+
include_package_data=True,
29+
zip_safe=False,
30+
install_requires=dependencies,
31+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Included for native namespace package support
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from tethys_sdk.base import TethysAppBase
2+
3+
4+
class MapLayoutTutorial(TethysAppBase):
5+
"""
6+
Tethys app class for Map Layout Tutorial.
7+
"""
8+
9+
name = 'Map Layout Tutorial'
10+
description = ''
11+
package = 'map_layout_tutorial' # WARNING: Do not change this value
12+
index = 'home'
13+
icon = f'{package}/images/icon.gif'
14+
root_url = 'map-layout-tutorial'
15+
color = '#f39c12'
16+
tags = ''
17+
enable_feedback = False
18+
feedback_emails = []
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
from django.shortcuts import render
2+
from tethys_sdk.routing import controller
3+
from tethys_sdk.gizmos import Button
4+
5+
@controller
6+
def home(request):
7+
"""
8+
Controller for the app home page.
9+
"""
10+
save_button = Button(
11+
display_text='',
12+
name='save-button',
13+
icon='save',
14+
style='success',
15+
attributes={
16+
'data-bs-toggle':'tooltip',
17+
'data-bs-placement':'top',
18+
'title':'Save'
19+
}
20+
)
21+
22+
edit_button = Button(
23+
display_text='',
24+
name='edit-button',
25+
icon='pen',
26+
style='warning',
27+
attributes={
28+
'data-bs-toggle':'tooltip',
29+
'data-bs-placement':'top',
30+
'title':'Edit'
31+
}
32+
)
33+
34+
remove_button = Button(
35+
display_text='',
36+
name='remove-button',
37+
icon='trash',
38+
style='danger',
39+
attributes={
40+
'data-bs-toggle':'tooltip',
41+
'data-bs-placement':'top',
42+
'title':'Remove'
43+
}
44+
)
45+
46+
previous_button = Button(
47+
display_text='Previous',
48+
name='previous-button',
49+
attributes={
50+
'data-bs-toggle':'tooltip',
51+
'data-bs-placement':'top',
52+
'title':'Previous'
53+
}
54+
)
55+
56+
next_button = Button(
57+
display_text='Next',
58+
name='next-button',
59+
attributes={
60+
'data-bs-toggle':'tooltip',
61+
'data-bs-placement':'top',
62+
'title':'Next'
63+
}
64+
)
65+
66+
context = {
67+
'save_button': save_button,
68+
'edit_button': edit_button,
69+
'remove_button': remove_button,
70+
'previous_button': previous_button,
71+
'next_button': next_button
72+
}
73+
74+
return render(request, 'map_layout_tutorial/home.html', context)

tethysapp/map_layout_tutorial/public/css/main.css

Whitespace-only changes.
13.8 KB
Loading

tethysapp/map_layout_tutorial/public/js/main.js

Whitespace-only changes.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{% extends "tethys_apps/app_base.html" %}
2+
3+
{% load static %}
4+
5+
{% block title %}{{ tethys_app.name }}{% endblock %}
6+
7+
{% block app_icon %}
8+
{# The path you provided in your app.py is accessible through the tethys_app.icon context variable #}
9+
<img src="{% if 'http' in tethys_app.icon %}{{ tethys_app.icon }}{% else %}{% static tethys_app.icon %}{% endif %}" />
10+
{% endblock %}
11+
12+
{# The name you provided in your app.py is accessible through the tethys_app.name context variable #}
13+
{% block app_title %}{{ tethys_app.name }}{% endblock %}
14+
15+
{% block app_navigation_items %}
16+
<li class="nav-item title">App Navigation</li>
17+
<li class="nav-item active"><a class="nav-link" href="">Home</a></li>
18+
<li class="nav-item"><a class="nav-link" href="">Jobs</a></li>
19+
<li class="nav-item"><a class="nav-link" href="">Results</a></li>
20+
<li class="nav-item title">Steps</li>
21+
<li class="nav-item"><a class="nav-link" href="">1. The First Step</a></li>
22+
<li class="nav-item"><a class="nav-link" href="">2. The Second Step</a></li>
23+
<li class="nav-item"><a class="nav-link" href="">3. The Third Step</a></li>
24+
<li class="nav-item separator"></li>
25+
<li class="nav-item"><a class="nav-link" href="">Get Started</a></li>
26+
{% endblock %}
27+
28+
{% block app_content %}
29+
{% endblock %}
30+
31+
{% block app_actions %}
32+
{% endblock %}
33+
34+
{% block content_dependent_styles %}
35+
{{ block.super }}
36+
<link href="{% static 'map_layout_tutorial/css/main.css' %}" rel="stylesheet"/>
37+
{% endblock %}
38+
39+
{% block scripts %}
40+
{{ block.super }}
41+
<script src="{% static 'map_layout_tutorial/js/main.js' %}" type="text/javascript"></script>
42+
{% endblock %}

0 commit comments

Comments
 (0)