-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete campaign #762
Delete campaign #762
Conversation
ab7bd03
to
b13737c
Compare
@russbiggs this looks more like you can't see half of it! I've added screenshot in the PR description. |
const popup = document.getElementById("delete-pop"); | ||
const background = document.getElementById("delete-background"); | ||
if (popup.style.display == "none" && background.style.display == "none") { | ||
popup.style.display = "inline-table"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the screenshot @russbiggs posted was because of this line. Would setting display: block
work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!! Yes, It'll work (with more styling)!
<button class="btn btn-primary btn-xs"> | ||
|
||
<div id="delete-background" style="display:none;"></div> | ||
<div id="delete-pop" style="display:none;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use the Bootstrap modal here, since the project already has the CSS and JS for it. Here's an example: https://getbootstrap.com/docs/3.4/javascript/#modals-examples
We're currently using this for other modals in the app, like the warning when someone tries to click "Create" before logging in, and the modal when a user adds types during campaign creation.
We'll have to write some CSS overrides to make the modal match the new design. I think those overrides could go in flask_project/campaign_manager/styles/components/_modal.scss
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks! I'll change to using a modal for the popup! 👌
This looks pretty much complete. We just need to hide the delete button in the jinja template in the header in the case where the user is not a manager of the campaign. Although not necessarily secure it would be good to do a check on the delete handler server side as well. |
Sure! I hadn't realised it was to be done on my end. |
2f2c8de
to
f78c5ed
Compare
…ct managers and viewers
debea41
to
4a237eb
Compare
Changes after review:
campaign.json
file to testCloses issue #669