Skip to content

Commit

Permalink
large template reorganization into folders
Browse files Browse the repository at this point in the history
  • Loading branch information
ericoc committed Dec 15, 2022
1 parent cbf81e6 commit 2d8e63e
Show file tree
Hide file tree
Showing 40 changed files with 53 additions and 53 deletions.
24 changes: 12 additions & 12 deletions admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def news():

# Show the form to manage news in the administration portal
return render_template(
'admin/news.html.j2',
'admin/news/news.html.j2',
all_news=News.query.order_by(-News.created_at).all(),
news_add_form=news_add_form
)
Expand Down Expand Up @@ -102,7 +102,7 @@ def edit_news(edit_news_id=None):
)

return render_template(
'admin/edit_news.html.j2',
'admin/news/edit_news.html.j2',
edit_news=news_post,
edit_news_form=edit_news_form
)
Expand All @@ -129,7 +129,7 @@ def delete_news(delete_news_id=None):

# Show the form to manage news in the administration portal
return render_template(
'admin/news.html.j2',
'admin/news/news.html.j2',
all_news=News.query.order_by(-News.created_at).all(),
news_add_form=NewsAddForm()
)
Expand All @@ -147,7 +147,7 @@ def manage_account(manage_account_id=None):
abort(400)

return render_template(
'admin/manage_account.html.j2',
'admin/account/manage_account.html.j2',
manage_account=account
)

Expand Down Expand Up @@ -209,7 +209,7 @@ def edit_account(edit_account_id=None):
)

return render_template(
'admin/edit_account.html.j2',
'admin/account/edit_account.html.j2',
edit_account=account,
edit_account_form=edit_account_form
)
Expand All @@ -221,7 +221,7 @@ def accounts():
"""Administration portal to allow Gods to view accounts
/admin/accounts"""
return render_template(
'admin/accounts.html.j2',
'admin/account/accounts.html.j2',
accounts=Account.query.order_by(
Account.account_id
).all()
Expand Down Expand Up @@ -259,7 +259,7 @@ def edit_player(edit_player_id=None):
)

return render_template(
'admin/edit_player.html.j2',
'admin/account/edit_player.html.j2',
edit_player=player,
edit_player_form=edit_player_form
)
Expand All @@ -271,7 +271,7 @@ def season():
"""Administration portal to allow Gods to view/manage seasons
/admin/season"""
return render_template(
'admin/season.html.j2',
'admin/season/season.html.j2',
seasons=Season.query.order_by(
-Season.is_active,
-Season.season_id
Expand Down Expand Up @@ -489,7 +489,7 @@ def season_cycle():

# Show the form to cycle a season in the administration portal
return render_template(
'admin/season_cycle.html.j2',
'admin/season/season_cycle.html.j2',
season_cycle_form=season_cycle_form
)

Expand Down Expand Up @@ -529,7 +529,7 @@ def global_events():

# Show the form to manage global events in the administration portal
return render_template(
'admin/global_events.html.j2',
'admin/events/global_events.html.j2',
all_events=GlobalEvent.query.all(),
event_add_form=event_add_form
)
Expand All @@ -556,7 +556,7 @@ def delete_global_event(delete_event_type=None):

# Show the form to add global events in the administration portal
return render_template(
'admin/global_events.html.j2',
'admin/events/global_events.html.j2',
all_events=GlobalEvent.query.all(),
event_add_form=EventAddForm()
)
Expand Down Expand Up @@ -590,7 +590,7 @@ def edit_global_event(edit_event_type=None):
flash('The global event was saved.', 'success')

return render_template(
'admin/edit_event.html.j2',
'admin/events/edit_event.html.j2',
edit_event=event,
edit_event_form=edit_event_form
)
2 changes: 1 addition & 1 deletion error_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def error(
):
"""Error template"""
return render_template(
'error.html.j2',
'base/error.html.j2',
title=title,
message=message
), code
Expand Down
2 changes: 1 addition & 1 deletion login.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def index():

# Show the log-in form with 401 response
return render_template(
'login.html.j2',
'portal/login.html.j2',
login_form=login_form
), 401

Expand Down
8 changes: 4 additions & 4 deletions portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def before_request():
@portal.route('/portal', methods=['GET'])
def index():
"""Main portal page for logged-in players"""
return render_template('portal.html.j2')
return render_template('portal/portal.html.j2')


@portal.route('/essence/', methods=['GET'])
Expand All @@ -31,7 +31,7 @@ def index():
@portal.route('/account', methods=['GET'])
def account():
"""Allow users to view/manage their accounts"""
return render_template('account.html.j2')
return render_template('portal/account.html.j2')


@portal.route('/change_password/', methods=['GET', 'POST'])
Expand Down Expand Up @@ -71,7 +71,7 @@ def change_password():

# Show the change password form
return render_template(
'change_password.html.j2',
'portal/change_password.html.j2',
change_password_form=change_password_form
)

Expand Down Expand Up @@ -124,7 +124,7 @@ def player(player_name=None):
)

return render_template(
'player.html.j2',
'portal/player.html.j2',
player=find,
player_search_form=player_search_form
), code
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'admin' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Accounts / Administration Portal{% endblock meta_title %}
{% block meta_description %}Administration portal page to view accounts{% endblock meta_description %}
{% block meta_url %}{{ url_for('admin.accounts', _external=True) }}{% endblock meta_url %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'admin' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{%- block meta_title %}Edit Account: {{ edit_account.display_name | safe }} / Administration Portal{%- endblock meta_title %}
{%- block meta_description %}Administration portal to edit a user account{%- endblock meta_description %}
{%- block meta_url %}{{ url_for('admin.edit_account', edit_account_id=edit_account.account_id, _external=True) }}{%- endblock meta_url %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'admin' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{%- block meta_title %}Edit Player: {{ edit_player.name | title | safe }} / Administration Portal{%- endblock meta_title %}
{%- block meta_description %}Administration portal to edit a player character{%- endblock meta_description %}
{%- block meta_url -%}{{- url_for('admin.edit_player', edit_player_id=edit_player.id, _external=True) -}}{%- endblock meta_url %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'admin' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{%- block meta_title %}Accounts / Administration Portal{%- endblock meta_title %}
{%- block meta_description %}Administration portal page to view accounts{%- endblock meta_description %}
{%- block meta_url %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'admin' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{%- block meta_title %}Edit Event: {{ edit_event.display_name | safe }} / Administration Portal{%- endblock meta_title %}
{%- block meta_description %}Administration portal to edit a global event{%- endblock meta_description %}
{%- block meta_url %}{{ url_for('admin.edit_global_event', edit_event_type=edit_event.event_type, _external=True) }}{%- endblock meta_url %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'admin' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Global Events / Administration Portal{% endblock meta_title %}
{% block meta_description %}Administration portal to manage global events{% endblock meta_description %}
{% block meta_url %}{{ url_for('admin.global_events', _external=True) }}{% endblock meta_url %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'admin' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{%- block meta_title %}Edit News: {{ edit_news.subject | title | safe }} / Administration Portal{%- endblock meta_title %}
{%- block meta_description %}Administration portal to edit a news post{%- endblock meta_description %}
{%- block meta_url %}{{ url_for('admin.edit_news', edit_news_id=edit_news.news_id, _external=True) }}{%- endblock meta_url %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'admin' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}News / Administration Portal{% endblock meta_title %}
{% block meta_description %}Administration portal to post news updates to the front page{% endblock meta_description %}
{% block meta_url %}{{ url_for('admin.news', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/patches.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'admin' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Patches / Administration Portal{% endblock meta_title %}
{% block meta_description %}Administration portal to upload patch notes{% endblock meta_description %}
{% block meta_url %}{{ url_for('admin.patches', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/portal.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'admin' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Administration Portal{% endblock meta_title %}
{% block meta_description %}Administration portal for Gods of Ishar MUD{% endblock meta_description %}
{% block meta_url %}{{ url_for('admin.index', _external=True) }}{% endblock meta_url %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'admin' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Seasons / Administration Portal{% endblock meta_title %}
{% block meta_description %}Administration portal page to manage seasons{% endblock meta_description %}
{% block meta_url %}{{ url_for('admin.season', _external=True) }}{% endblock meta_url %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'admin' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Cycle Seasons / Administration Portal{% endblock meta_title %}
{% block meta_description %}Administration portal page to cycle seasons{% endblock meta_description %}
{% block meta_url %}{{ url_for('admin.season_cycle', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/error.html.j2 → templates/base/error.html.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Error{% endblock meta_title %}
{% block meta_description %}Error: {{ message | default('Hmmm... the page you are looking for can not be found.') }}{% endblock meta_description %}
{% block meta_url %}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/layout.html.j2 → templates/base/layout.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</header>
<nav>
{%- block navigation %}
{% include('navigation.html.j2') %}
{% include('base/navigation.html.j2') %}
{%- endblock navigation %}
</nav>
<div id="content">
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Welcome{% endblock meta_title %}
{% block meta_description %}Welcome to Ishar MUD{% endblock meta_description %}
{% block meta_url %}{{ url_for('welcome.index', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/challenges.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'challenges' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{%- set challenges_pre = 'Challenges' -%}
{%- if challenges is defined and challenges is iterable and challenges | length > 0 %}
{%- set challenges_completed = challenges | selectattr('winner_desc', '!=', '') | list | length %}
Expand Down
2 changes: 1 addition & 1 deletion templates/faqs.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'faqs' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Frequently Asked Questions{% endblock meta_title %}
{% block meta_description %}Frequently Asked Questions by new players of the game{% endblock meta_description %}
{% block meta_url %}{{ url_for('faqs.index', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/get_started.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'get_started' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Get Started{% endblock meta_title %}
{% block meta_description %}Get Started with these tips and background information about the game{% endblock meta_description %}
{% block meta_url %}{{ url_for('welcome.getstarted', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/global_events.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'global_events' %}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{%- set events_pre = 'Global Events' -%}
{%- if global_events %}
{%- set events_title = events_pre + ' (' + global_events | length | string + ')' %}
Expand Down
2 changes: 1 addition & 1 deletion templates/help_page.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'help' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{%- if topic is defined and topic is iterable and topic['name'] is defined %}
{%- set topic_name = topic['name'] | safe | trim %}
{%- endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/history.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'history' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}History{% endblock meta_title %}
{% block meta_description %}History of the development and creation of the game{% endblock meta_description %}
{% block meta_url %}{{ url_for('welcome.history', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/leaders.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'leaders' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Leaders{% endblock meta_title %}
{% block meta_description %}Leader board of top players of the game and their achievements{% endblock meta_description %}
{% block meta_url %}{{ url_for('leaders.index', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/mud_clients.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'mud_clients' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}MUD Clients{% endblock meta_title %}
{% block meta_description %}MUD Clients that are freely available to use and try to play Ishar MUD{% endblock meta_description %}
{% block meta_url %}{{ url_for('mud_clients.index', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/patches.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'patches' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Patches{% endblock meta_title %}
{% block meta_description %}The latest patches to Ishar MUD{% endblock meta_description %}
{% block meta_url %}{{ url_for('patches.index', _external=True) }}{% endblock meta_url %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'account' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Account ({{ current_user.display_name | safe }}){% endblock meta_title %}
{% block meta_description %}Your Ishar MUD Account{% endblock meta_description %}
{% block meta_url %}{{ url_for('portal.account', _external=True) }}{% endblock meta_url %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'account' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Change Password{% endblock meta_title %}
{% block meta_description %}Change password for your Ishar MUD account{% endblock meta_description %}
{% block meta_url %}{{ url_for('portal.change_password', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/login.html.j2 → templates/portal/login.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'portal' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Player Log In{% endblock meta_title %}
{% block meta_description %}Player Log In to Ishar MUD to view the player portal, player profiles, and more{% endblock meta_description %}
{% block meta_url %}{{ url_for('login.index', _external=True) }}{% endblock meta_url %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'portal' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{%- macro render_field(field) -%}
{{ field(**kwargs) | safe }}
{%- if field.errors %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'portal' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Portal{% endblock meta_title %}
{% block meta_description %}Portal for players to see information about their account and characters{% endblock meta_description %}
{% block meta_url %}{{ url_for('portal.index', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/season.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'season' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Season {{ current_season.season_id }}{% endblock meta_title %}
{% block meta_description %}Information about season {{ current_season.season_id }} of Ishar MUD{% endblock meta_description %}
{% block meta_url %}{{ url_for('welcome.season', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/support.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'support' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Support{% endblock meta_title %}
{% block meta_description %}Support Ishar MUD with a contribution as a way to say thank you{% endblock meta_description %}
{% block meta_url %}{{ url_for('welcome.support', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/sysinfo.html.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}System Information{% endblock meta_title %}
{% block meta_description %}System information about the Ishar MUD server and process{% endblock meta_description %}
{% block meta_url %}{{ url_for('welcome.wizlist', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/wizlist.html.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{% block meta_title %}Wiz List{% endblock meta_title %}
{% block meta_description %}A list of the current Immortals through Gods{% endblock meta_description %}
{% block meta_url %}{{ url_for('welcome.wizlist', _external=True) }}{% endblock meta_url %}
Expand Down
2 changes: 1 addition & 1 deletion templates/world.html.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set page = 'world' -%}
{% extends "layout.html.j2" %}
{% extends "base/layout.html.j2" %}
{%- block meta_title -%}World{%- endblock meta_title -%}
{% block meta_description %}The World of Ishar is vast and very detailed with many areas{% endblock meta_description %}
{% block meta_url %}{{ url_for('help_page.world', _external=True) }}{% endblock meta_url %}
Expand Down
Loading

0 comments on commit 2d8e63e

Please sign in to comment.