Skip to content

Commit

Permalink
Add "Return to main program management page" links to manage modules (#…
Browse files Browse the repository at this point in the history
…3389)

* Add "Return to main program management page" links to manage modules

* Add/fix return link

* Add return link and module name like #3289
  • Loading branch information
willgearty authored Aug 11, 2021
1 parent 3b7a9ad commit 4500995
Show file tree
Hide file tree
Showing 21 changed files with 38 additions and 19 deletions.
2 changes: 1 addition & 1 deletion esp/esp/program/modules/handlers/programprintables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions esp/esp/users/controllers/usersearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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 = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,5 @@ <h3>Summary</h3>
<tr><td><strong>Owed</strong></td><td><strong>${{ due|floatformat:"-2" }}</strong></td></tr>
</table>
{% endif %}
{% include "program/modules/admincore/returnlink.html" %}
{% endblock %}
2 changes: 2 additions & 0 deletions esp/templates/program/modules/admincore/deadlines.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@

<p>Please proceed to edit <a href="#existing">existing deadlines</a> or <a href="#new">create a new deadline</a> if necessary.</p>

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

<a name="existing"></a>
<h2>Existing Deadlines</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ <h1>{{program.niceName}} Lunch Constraints</h1>
<p>Please select the timeslots you would like to be used for lunch.</p>
<p>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.</p>

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

<div id="program_form">
<form action="/manage/{{ program.getUrlBase }}/lunch_constraints/" method="post">
<table align="center" width="500">
Expand All @@ -31,4 +29,7 @@ <h3 style="font-weight:bold;">Settings successfully saved.</h3><br /><br />
<h3 style="font-weight:bold; color:red;">There was an error with saving your settings. Please try again.</h3><br /><br />
{% endif %}
</div>

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

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ <h3 style="font-weight:bold;">Settings successfully saved.</h3><br /><br />
<h3 style="font-weight:bold; color:red;">There was an error with saving your settings. Please try again.</h3><br /><br />
{% endif %}
<p>If you know what you're doing and you have reason to do so, you may manually manipulate RegistrationTypes in <a href="/admin/program/registrationtype/">the admin panel</a>.</p>

{% include "program/modules/admincore/returnlink.html" %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ <h1>View Materials Submitted for {{ prog.niceName }}</h1>
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.
</p>

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

<table cellpadding="2" cellspacing="0" align="center" width="550">
<tr>
<th colspan="2" style="text-align: center;">
Expand Down Expand Up @@ -129,4 +127,6 @@ <h1>View Materials Submitted for {{ prog.niceName }}</h1>

</div>

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

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,8 @@ <h2>Unscheduled classes</h2>
</form>
{% endif %}

{% if isAdmin %}
{% include "program/modules/admincore/returnlink.html" %}
{% endif %}

{% endblock %}
2 changes: 2 additions & 0 deletions esp/templates/program/modules/bigboardmodule/bigboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,6 @@
</div>
{% endif %}

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

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,5 @@ <h1>Search Classes for {{ program.niceName }}</h1>
{% elif query %}
No classes were found.
{% endif %}
{% include "program/modules/admincore/returnlink.html" %}
{% endblock %}
2 changes: 2 additions & 0 deletions esp/templates/program/modules/commmodule/commpanel_new.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ <h2>Email a list of users</h2>
{% include "users/usersearch/list_selector.html" %}
{% endwith %}

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

{% endblock %}

Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ <h1>Credit Card Payments</h1>
</table>
</div>

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

Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ <h4>
{% endif %}
</div>

{% include "program/modules/admincore/returnlink.html" %}
{% endblock %}
4 changes: 1 addition & 3 deletions esp/templates/program/modules/lineitemsmodule/lineitems.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,5 @@ <h1>Manage Line Items for {{ prog.niceName }}</h1>
<script id="lineitemsscript" src="/media/scripts/program/modules/lineitems.js" data-prog_url="{{ prog.url }}"></script>
<script type="text/javascript" src="/media/scripts/expand_display.js"></script>

<br /><br />
<button type="button" class="btn btn-primary" onclick="location.href = '/manage/{{ prog.url }}/main';">Main Program Management Page</button>
<br /><br />
{% include "program/modules/admincore/returnlink.html" %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ <h1>Mailing Labels for {{program.niceName}}</h1>
<li>Good luck!</li>
</ol>

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

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
border: 1px solid black; border-collapse: collapse;
}
</style>
<br />
<br />

<br /><br />
<h1>Catalog order for {{program.niceName}}</h1>

<p>
Expand Down Expand Up @@ -133,5 +130,6 @@ <h1>Catalog order for {{program.niceName}}</h1>
<a href="/manage/{{program.getUrlBase}}/coursecatalog/log?sort_name_list={{ sort_name_list }}&clsids={{clsids}}">log</a>)
</p>

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

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,5 @@ <h1>Manage Resources for {{ prog.niceName }}</h1>
<script id="resourcesscript" src="/media/scripts/program/modules/resources.js" data-prog_url="{{ prog.url }}"></script>
<script type="text/javascript" src="/media/scripts/expand_display.js"></script>

<br /><br />
<button type="button" class="btn btn-primary" onclick="location.href = '/manage/{{ prog.url }}/main';">Main Program Management Page</button>
<br /><br />
{% include "program/modules/admincore/returnlink.html" %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,6 @@ <h1>Manage Phase Zero (Student Lottery) for {{program.niceName}}</h1>
{% endfor %}
</table>
{% endif %}
{% include "program/modules/admincore/returnlink.html" %}
<script type="text/javascript" src="/media/scripts/expand_display.js"></script>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ <h1>Manage Teacher Events for {{ prog.niceName }}</h1>
</table>
</div>

{% include "program/modules/admincore/returnlink.html" %}
{% endblock %}
2 changes: 1 addition & 1 deletion esp/templates/program/modules/volunteermanage/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ <h1>Manage Volunteers for {{ program.niceName }}</h1>
</form>
</div>


{% include "program/modules/admincore/returnlink.html" %}
{% endblock %}
4 changes: 4 additions & 0 deletions esp/templates/users/usersearch/usersearch_default.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

{% block content %}

<h1>{% if module %}{{ module }}{% else %}Select Users{% endif %}</h1>

<h2>Select a list of users</h2>
<p>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:
<ul>
Expand All @@ -17,5 +19,7 @@ <h2>Select a list of users</h2>

{% include "users/usersearch/list_selector.html" %}

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

{% endblock %}

0 comments on commit 4500995

Please sign in to comment.