Delete unused Jinja macros and rearrange templates.

Templates and fragments that relate to specific resources (portfolios,
applications, task orders) should reside in directories named for the
relevant resource. This also matches the way the application routes are
distributed among modules named for each resource type.
This commit is contained in:
dandds
2019-09-24 09:55:31 -04:00
parent c8a2e9ee96
commit 4f8cbc2b68
26 changed files with 41 additions and 72 deletions

View File

@@ -23,4 +23,4 @@ def has_portfolio_applications(_user, portfolio=None, **_kwargs):
message="view portfolio applications",
)
def portfolio_applications(portfolio_id):
return render_template("portfolios/applications/index.html")
return render_template("applications/index.html")

View File

@@ -37,7 +37,7 @@ def render_new_application_form(
@user_can(Permissions.CREATE_APPLICATION, message="view create new application form")
def view_new_application_step_1(portfolio_id, application_id=None):
return render_new_application_form(
"portfolios/applications/new/step_1.html",
"applications/new/step_1.html",
NameAndDescriptionForm,
portfolio_id=portfolio_id,
application_id=application_id,
@@ -78,7 +78,7 @@ def create_or_update_new_application_step_1(portfolio_id, application_id=None):
else:
return (
render_new_application_form(
"portfolios/applications/new/step_1.html",
"applications/new/step_1.html",
NameAndDescriptionForm,
portfolio_id,
application_id,
@@ -94,7 +94,7 @@ def create_or_update_new_application_step_1(portfolio_id, application_id=None):
@user_can(Permissions.CREATE_APPLICATION, message="view create new application form")
def view_new_application_step_2(portfolio_id, application_id):
return render_new_application_form(
"portfolios/applications/new/step_2.html",
"applications/new/step_2.html",
EnvironmentsForm,
portfolio_id=portfolio_id,
application_id=application_id,
@@ -122,7 +122,7 @@ def update_new_application_step_2(portfolio_id, application_id):
else:
return (
render_new_application_form(
"portfolios/applications/new/step_2.html",
"applications/new/step_2.html",
EnvironmentsForm,
portfolio_id,
application_id,

View File

@@ -130,7 +130,7 @@ def render_settings_page(application, **kwargs):
)
return render_template(
"portfolios/applications/settings.html",
"applications/settings.html",
application=application,
environments_obj=environments_obj,
new_env_form=new_env_form,

View File

@@ -18,7 +18,7 @@ def review_task_order(task_order_id):
else:
signature_form = SignatureForm()
return render_template(
"portfolios/task_orders/review.html",
"task_orders/review.html",
task_order=task_order,
signature_form=signature_form,
)
@@ -37,7 +37,5 @@ def portfolio_funding(portfolio_id):
TaskOrderStatus.UNSIGNED: "purple",
}
return render_template(
"portfolios/task_orders/index.html",
task_orders=task_orders,
label_colors=label_colors,
"task_orders/index.html", task_orders=task_orders, label_colors=label_colors
)