From 450099579b87e24496cd74853ff7a77dafafed4a Mon Sep 17 00:00:00 2001 From: Will Gearty Date: Tue, 10 Aug 2021 20:40:03 -0500 Subject: [PATCH] Add "Return to main program management page" links to manage modules (#3389) * Add "Return to main program management page" links to manage modules * Add/fix return link * Add return link and module name like #3289 --- esp/esp/program/modules/handlers/programprintables.py | 2 +- esp/esp/users/controllers/usersearch.py | 8 ++++---- .../program/modules/accountingmodule/accounting.html | 1 + esp/templates/program/modules/admincore/deadlines.html | 2 ++ .../program/modules/admincore/lunch_constraints.html | 5 +++-- .../modules/admincore/registrationtype_management.html | 2 ++ .../program/modules/adminmaterials/listmaterials.html | 4 ++-- .../modules/availabilitymodule/availability_form.html | 4 ++++ .../program/modules/bigboardmodule/bigboard.html | 2 ++ .../program/modules/classsearchmodule/class_search.html | 1 + .../program/modules/commmodule/commpanel_new.html | 2 ++ .../program/modules/creditcardviewer/viewpay.html | 1 + .../program/modules/finaidapprovemodule/finaid.html | 1 + .../program/modules/lineitemsmodule/lineitems.html | 4 +--- .../program/modules/mailinglabels/mailinglabel_index.html | 2 ++ .../program/modules/programprintables/catalog_order.html | 4 +--- .../program/modules/resourcemodule/resource_main.html | 4 +--- .../program/modules/studentregphasezero/status.html | 1 + .../modules/teachereventsmodule/teacher_events.html | 1 + esp/templates/program/modules/volunteermanage/main.html | 2 +- esp/templates/users/usersearch/usersearch_default.html | 4 ++++ 21 files changed, 38 insertions(+), 19 deletions(-) diff --git a/esp/esp/program/modules/handlers/programprintables.py b/esp/esp/program/modules/handlers/programprintables.py index d5d33c614e..9fbe91781f 100644 --- a/esp/esp/program/modules/handlers/programprintables.py +++ b/esp/esp/program/modules/handlers/programprintables.py @@ -1157,7 +1157,7 @@ def studentschedules(self, request, tl, one, two, module, extra, prog, onsite=Fa if onsite: students = [ESPUser.objects.get(id=request.GET['userid'])] else: - filterObj, found = UserSearchController().create_filter(request, self.program) + filterObj, found = UserSearchController().create_filter(request, self.program, add_to_context = {'module': "Get Student Schedules"}) if not found: return filterObj diff --git a/esp/esp/users/controllers/usersearch.py b/esp/esp/users/controllers/usersearch.py index 5f6c66ea22..14dec8ad89 100644 --- a/esp/esp/users/controllers/usersearch.py +++ b/esp/esp/users/controllers/usersearch.py @@ -404,8 +404,8 @@ def sendto_fn_from_postdata(self, data): else: return MessageRequest.SEND_TO_SELF_REAL - def prepare_context(self, program, target_path=None): - context = {} + def prepare_context(self, program, target_path=None, add_to_context={}): + context = add_to_context context['program'] = program context['student_search_form'] = StudentSearchForm() context['combo_form'] = True @@ -448,7 +448,7 @@ def prepare_context(self, program, target_path=None): return context - def create_filter(self, request, program, template=None, target_path=None): + def create_filter(self, request, program, template=None, target_path=None, add_to_context={}): from esp.program.modules.handlers.listgenmodule import ListGenModule """ Function to obtain a list of users, possibly requiring multiple requests. Similar to the old get_user_list function. @@ -468,7 +468,7 @@ def create_filter(self, request, program, template=None, target_path=None): if target_path is None: target_path = request.path - return (render_to_response(template, request, self.prepare_context(program, target_path)), False) + return (render_to_response(template, request, self.prepare_context(program, target_path, add_to_context = add_to_context)), False) def selected_list_from_postdata(self, data): selected = [] diff --git a/esp/templates/program/modules/accountingmodule/accounting.html b/esp/templates/program/modules/accountingmodule/accounting.html index cd191f9bdf..a1e1c102cb 100644 --- a/esp/templates/program/modules/accountingmodule/accounting.html +++ b/esp/templates/program/modules/accountingmodule/accounting.html @@ -92,4 +92,5 @@

Summary

Owed${{ due|floatformat:"-2" }} {% endif %} +{% include "program/modules/admincore/returnlink.html" %} {% endblock %} diff --git a/esp/templates/program/modules/admincore/deadlines.html b/esp/templates/program/modules/admincore/deadlines.html index 59668ecb93..b31783dfff 100644 --- a/esp/templates/program/modules/admincore/deadlines.html +++ b/esp/templates/program/modules/admincore/deadlines.html @@ -142,6 +142,8 @@

Please proceed to edit existing deadlines or create a new deadline if necessary.

+{% include "program/modules/admincore/returnlink.html" %} +

Existing Deadlines

diff --git a/esp/templates/program/modules/admincore/lunch_constraints.html b/esp/templates/program/modules/admincore/lunch_constraints.html index 5d8aea3fde..626708d3a5 100644 --- a/esp/templates/program/modules/admincore/lunch_constraints.html +++ b/esp/templates/program/modules/admincore/lunch_constraints.html @@ -13,8 +13,6 @@

{{program.niceName}} Lunch Constraints

Please select the timeslots you would like to be used for lunch.

You can also use this page to setup lunch scheduling constraints, which will enforce that each student have at least one lunch block per day.

-{% include "program/modules/admincore/returnlink.html" %} -
@@ -31,4 +29,7 @@

Settings successfully saved.



There was an error with saving your settings. Please try again.



{% endif %} + +{% include "program/modules/admincore/returnlink.html" %} + {% endblock %} diff --git a/esp/templates/program/modules/admincore/registrationtype_management.html b/esp/templates/program/modules/admincore/registrationtype_management.html index 85a753f5dd..a846eb050d 100644 --- a/esp/templates/program/modules/admincore/registrationtype_management.html +++ b/esp/templates/program/modules/admincore/registrationtype_management.html @@ -26,4 +26,6 @@

Settings successfully saved.



There was an error with saving your settings. Please try again.



{% endif %}

If you know what you're doing and you have reason to do so, you may manually manipulate RegistrationTypes in the admin panel.

+ + {% include "program/modules/admincore/returnlink.html" %} {% endblock %} diff --git a/esp/templates/program/modules/adminmaterials/listmaterials.html b/esp/templates/program/modules/adminmaterials/listmaterials.html index 28d6d7ec3d..37b75b85b5 100644 --- a/esp/templates/program/modules/adminmaterials/listmaterials.html +++ b/esp/templates/program/modules/adminmaterials/listmaterials.html @@ -31,8 +31,6 @@

View Materials Submitted for {{ prog.niceName }}

From this page, you can view documents related to the program (in the first section of the table below). Teachers of your classes have also provided materials, which you can review and delete if necessary (in the second section of the table below). Finally, you may upload new documents using the form at the bottom of the page.

-{% include "program/modules/admincore/returnlink.html" %} -
@@ -129,4 +127,6 @@

View Materials Submitted for {{ prog.niceName }}

+{% include "program/modules/admincore/returnlink.html" %} + {% endblock %} diff --git a/esp/templates/program/modules/availabilitymodule/availability_form.html b/esp/templates/program/modules/availabilitymodule/availability_form.html index 1f3120e391..e11391b3c5 100644 --- a/esp/templates/program/modules/availabilitymodule/availability_form.html +++ b/esp/templates/program/modules/availabilitymodule/availability_form.html @@ -111,4 +111,8 @@

Unscheduled classes

{% endif %} +{% if isAdmin %} +{% include "program/modules/admincore/returnlink.html" %} +{% endif %} + {% endblock %} diff --git a/esp/templates/program/modules/bigboardmodule/bigboard.html b/esp/templates/program/modules/bigboardmodule/bigboard.html index 03784a2c57..3ea92e9e95 100644 --- a/esp/templates/program/modules/bigboardmodule/bigboard.html +++ b/esp/templates/program/modules/bigboardmodule/bigboard.html @@ -147,4 +147,6 @@ {% endif %} +{% include "program/modules/admincore/returnlink.html" %} + {% endblock %} diff --git a/esp/templates/program/modules/classsearchmodule/class_search.html b/esp/templates/program/modules/classsearchmodule/class_search.html index 6b9c18aca8..9abb8c1652 100644 --- a/esp/templates/program/modules/classsearchmodule/class_search.html +++ b/esp/templates/program/modules/classsearchmodule/class_search.html @@ -161,4 +161,5 @@

Search Classes for {{ program.niceName }}

{% elif query %} No classes were found. {% endif %} +{% include "program/modules/admincore/returnlink.html" %} {% endblock %} diff --git a/esp/templates/program/modules/commmodule/commpanel_new.html b/esp/templates/program/modules/commmodule/commpanel_new.html index d43f5a79e5..680f7da64b 100644 --- a/esp/templates/program/modules/commmodule/commpanel_new.html +++ b/esp/templates/program/modules/commmodule/commpanel_new.html @@ -17,5 +17,7 @@

Email a list of users

{% include "users/usersearch/list_selector.html" %} {% endwith %} +{% include "program/modules/admincore/returnlink.html" %} + {% endblock %} diff --git a/esp/templates/program/modules/creditcardviewer/viewpay.html b/esp/templates/program/modules/creditcardviewer/viewpay.html index 88d7e37101..7e757f232f 100644 --- a/esp/templates/program/modules/creditcardviewer/viewpay.html +++ b/esp/templates/program/modules/creditcardviewer/viewpay.html @@ -65,5 +65,6 @@

Credit Card Payments

+{% include "program/modules/admincore/returnlink.html" %} {% endblock %} diff --git a/esp/templates/program/modules/finaidapprovemodule/finaid.html b/esp/templates/program/modules/finaidapprovemodule/finaid.html index f746bd07c4..1fa5a5af95 100644 --- a/esp/templates/program/modules/finaidapprovemodule/finaid.html +++ b/esp/templates/program/modules/finaidapprovemodule/finaid.html @@ -111,4 +111,5 @@

{% endif %} +{% include "program/modules/admincore/returnlink.html" %} {% endblock %} diff --git a/esp/templates/program/modules/lineitemsmodule/lineitems.html b/esp/templates/program/modules/lineitemsmodule/lineitems.html index ab84590169..06c1b78d5b 100644 --- a/esp/templates/program/modules/lineitemsmodule/lineitems.html +++ b/esp/templates/program/modules/lineitemsmodule/lineitems.html @@ -114,7 +114,5 @@

Manage Line Items for {{ prog.niceName }}

-

- -

+{% include "program/modules/admincore/returnlink.html" %} {% endblock %} diff --git a/esp/templates/program/modules/mailinglabels/mailinglabel_index.html b/esp/templates/program/modules/mailinglabels/mailinglabel_index.html index a74789e988..a49bc19b55 100644 --- a/esp/templates/program/modules/mailinglabels/mailinglabel_index.html +++ b/esp/templates/program/modules/mailinglabels/mailinglabel_index.html @@ -43,4 +43,6 @@

Mailing Labels for {{program.niceName}}

  • Good luck!
  • +{% include "program/modules/admincore/returnlink.html" %} + {% endblock %} diff --git a/esp/templates/program/modules/programprintables/catalog_order.html b/esp/templates/program/modules/programprintables/catalog_order.html index c507e558fc..764614324e 100644 --- a/esp/templates/program/modules/programprintables/catalog_order.html +++ b/esp/templates/program/modules/programprintables/catalog_order.html @@ -13,10 +13,7 @@ border: 1px solid black; border-collapse: collapse; } -
    -
    -

    Catalog order for {{program.niceName}}

    @@ -133,5 +130,6 @@

    Catalog order for {{program.niceName}}

    log)

    +{% include "program/modules/admincore/returnlink.html" %} {% endblock %} diff --git a/esp/templates/program/modules/resourcemodule/resource_main.html b/esp/templates/program/modules/resourcemodule/resource_main.html index 64385a24ae..f4d35b8f61 100644 --- a/esp/templates/program/modules/resourcemodule/resource_main.html +++ b/esp/templates/program/modules/resourcemodule/resource_main.html @@ -35,7 +35,5 @@

    Manage Resources for {{ prog.niceName }}

    -

    - -

    +{% include "program/modules/admincore/returnlink.html" %} {% endblock %} diff --git a/esp/templates/program/modules/studentregphasezero/status.html b/esp/templates/program/modules/studentregphasezero/status.html index 00edc67ee6..86a89ce52b 100644 --- a/esp/templates/program/modules/studentregphasezero/status.html +++ b/esp/templates/program/modules/studentregphasezero/status.html @@ -162,5 +162,6 @@

    Manage Phase Zero (Student Lottery) for {{program.niceName}}

    {% endfor %} {% endif %} +{% include "program/modules/admincore/returnlink.html" %} {% endblock %} diff --git a/esp/templates/program/modules/teachereventsmodule/teacher_events.html b/esp/templates/program/modules/teachereventsmodule/teacher_events.html index 34770e9834..41030d01de 100644 --- a/esp/templates/program/modules/teachereventsmodule/teacher_events.html +++ b/esp/templates/program/modules/teachereventsmodule/teacher_events.html @@ -50,4 +50,5 @@

    Manage Teacher Events for {{ prog.niceName }}

    +{% include "program/modules/admincore/returnlink.html" %} {% endblock %} diff --git a/esp/templates/program/modules/volunteermanage/main.html b/esp/templates/program/modules/volunteermanage/main.html index 40788468b4..9bee988871 100644 --- a/esp/templates/program/modules/volunteermanage/main.html +++ b/esp/templates/program/modules/volunteermanage/main.html @@ -82,5 +82,5 @@

    Manage Volunteers for {{ program.niceName }}

    - +{% include "program/modules/admincore/returnlink.html" %} {% endblock %} diff --git a/esp/templates/users/usersearch/usersearch_default.html b/esp/templates/users/usersearch/usersearch_default.html index 11e195e9c4..6a7efc85b1 100644 --- a/esp/templates/users/usersearch/usersearch_default.html +++ b/esp/templates/users/usersearch/usersearch_default.html @@ -4,6 +4,8 @@ {% block content %} +

    {% if module %}{{ module }}{% else %}Select Users{% endif %}

    +

    Select a list of users

    This page requires that you select set of users in your database, with filtering options specific to {{ program.niceName }}. Choose from three different approaches to select your users: