Skip to content

Commit

Permalink
move button back to hunt settings
Browse files Browse the repository at this point in the history
  • Loading branch information
npinsker committed Jan 10, 2024
1 parent 0dd572b commit 62173ea
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 30 deletions.
3 changes: 3 additions & 0 deletions cardboard/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
{% if message.level == DEFAULT_MESSAGE_LEVELS.WARNING %}
<div class="alert alert-warning" style="white-space: pre-line" role="alert">{{ message }}</div>
{% endif %}
{% if message.level == DEFAULT_MESSAGE_LEVELS.SUCCESS %}
<div class="alert alert-success" style="white-space: pre-line" role="alert">{{ message }}</div>
{% endif %}
{% endfor %}

<div class="container-fluid pb-5">
Expand Down
26 changes: 0 additions & 26 deletions hunts/src/SiteHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,32 +71,6 @@ export const SiteHeader = () => {
Logout
</a>
<div className="nav-link">Logged in as {window.LOGGED_IN_USER}</div>

{window.IS_STAFF ? (
<div className="mt-auto" style={{ marginBottom: "36px" }}>
<span
style={{
borderTop: "1px solid black",
width: "100%",
display: "inline-block",
}}
className="font-weight-bold nav-link"
></span>
<div className="nav-link">
<button
type="submit"
className="btn btn-primary mx-2"
onClick={() => {
syncDiscordAndCardboardTags(hunt.id);
}}
>
Sync Discord & Cardboard roles
</button>
</div>
</div>
) : (
<></>
)}
<span
style={{
borderTop: "1px solid black",
Expand Down
5 changes: 5 additions & 0 deletions hunts/templates/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ <h1>Hunt Settings</h1>
<button type="submit" class="btn btn-primary mx-2">Submit</button>
</div>
</form>

<form action="sync_discord_roles" method="post">
{% csrf_token %}
<button type="submit" class="btn btn-primary mx-2">Sync Discord & Cardboard roles</button>
</form>
</div>
{% endblock %}
5 changes: 1 addition & 4 deletions hunts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,7 @@ def sync_discord_roles(request, hunt_slug):
)

messages.success(request, "Discord roles created.")

return HttpResponse(
status=200,
)
return redirect(f"/hunts/{hunt_slug}/edit")


class LastAccessedHuntRedirectView(LoginRequiredMixin, RedirectView):
Expand Down

0 comments on commit 62173ea

Please sign in to comment.