Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions static/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
{% endif %}
{% endwith %}
{% if staff_invite and request.endpoint != "staff_invite" %}
<div class="invite-banner">
<div class="notice">
<span><strong>{{ staff_invite.invited_by.name if staff_invite.invited_by else "An admin" }}</strong> invited you to work the security desk.</span>
<a class="primary-btn compact" href="{{ url_for('staff_invite', token=staff_invite.token) }}">See the invitation</a>
</div>
Expand Down
2 changes: 2 additions & 0 deletions templates/staff_invite.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ <h1>Work the security desk?</h1>
</div>
<form class="report-form form-section" method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<p class="invite-question"><strong>Do you want to join the security desk?</strong>
Accept to start receiving items and handling claims at the desk. If you decline, nothing changes, and the admin can invite you again later. Desk access can be removed by the admin at any time.</p>
<div class="form-actions">
<button class="secondary-btn" type="submit" name="answer" value="decline">Decline</button>
<button class="primary-btn" type="submit" name="answer" value="accept">Accept <span>→</span></button>
Expand Down
2 changes: 2 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,8 @@ def test_desk_access_is_given_by_invitation_and_accepted(self):
self.logout()
self.login("student@example.com")
self.assertIn(b"invited you to work the security desk", self.client.get("/").data)
page = self.client.get(f"/staff/invite/{token}").data
self.assertIn(b"Do you want to join the security desk?", page)
self.post(f"/staff/invite/{token}", data={"answer": "accept"}, follow_redirects=True)
with app.app_context():
self.assertTrue(db.session.get(User, student_id).is_staff)
Expand Down
Loading