Skip to content

Commit

Permalink
configure-map-layout-solution
Browse files Browse the repository at this point in the history
  • Loading branch information
shawncrawley committed May 12, 2023
1 parent 0d68cd2 commit 6ffe1f8
Showing 1 changed file with 8 additions and 71 deletions.
79 changes: 8 additions & 71 deletions tethysapp/map_layout_tutorial/controllers.py
Original file line number Diff line number Diff line change
@@ -1,74 +1,11 @@
from django.shortcuts import render
from tethys_sdk.layouts import MapLayout
from tethys_sdk.routing import controller
from tethys_sdk.gizmos import Button
from .app import MapLayoutTutorial as app

@controller
def home(request):
"""
Controller for the app home page.
"""
save_button = Button(
display_text='',
name='save-button',
icon='save',
style='success',
attributes={
'data-bs-toggle':'tooltip',
'data-bs-placement':'top',
'title':'Save'
}
)

edit_button = Button(
display_text='',
name='edit-button',
icon='pen',
style='warning',
attributes={
'data-bs-toggle':'tooltip',
'data-bs-placement':'top',
'title':'Edit'
}
)

remove_button = Button(
display_text='',
name='remove-button',
icon='trash',
style='danger',
attributes={
'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'
}
)

next_button = Button(
display_text='Next',
name='next-button',
attributes={
'data-bs-toggle':'tooltip',
'data-bs-placement':'top',
'title':'Next'
}
)

context = {
'save_button': save_button,
'edit_button': edit_button,
'remove_button': remove_button,
'previous_button': previous_button,
'next_button': next_button
}

return render(request, 'map_layout_tutorial/home.html', context)
@controller(name="home", app_workspace=True)
class MapLayoutTutorialMap(MapLayout):
app = app
base_template = 'map_layout_tutorial/base.html'
map_title = 'Map Layout Tutorial'
map_subtitle = 'NOAA-OWP NextGen Model Outputs'

0 comments on commit 6ffe1f8

Please sign in to comment.