-
Notifications
You must be signed in to change notification settings - Fork 289
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
💻 Unsubmit program #5304
💻 Unsubmit program #5304
Conversation
…to unsubmit-program
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…to unsubmit-program
…to unsubmit-program
for more information, see https://pre-commit.ci
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.
Great thanks:) Only these two tiny things, and we're good to roll!
@@ -7,6 +7,11 @@ | |||
<h2>{{_('submitted_header')}}</h2> | |||
<h3 class="inline-block mt-0">{{_('submission_time')}}: {{program_timestamp}}</h3> | |||
</div> | |||
{% if is_teacher %} | |||
<div class="text-center"> | |||
<button class="green-btn" data-cy="unsubmit-btn" onclick="hedyApp.modal.confirm ('{{_('unsubmit_warning')}}', function () {hedyApp.unsubmit_program ('{{initial_adventure.id}}', {{ loop_index }})})">{{_('unsubmit_program')}}</button> |
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.
<button class="green-btn" data-cy="unsubmit-btn" onclick="hedyApp.modal.confirm ('{{_('unsubmit_warning')}}', function () {hedyApp.unsubmit_program ('{{initial_adventure.id}}', {{ loop_index }})})">{{_('unsubmit_program')}}</button> | |
<button class="green-btn" data-cy="unsubmit-btn" onclick="hedyApp.unsubmit_program ('{{initial_adventure.id}}', '{{_('unsubmit_warning')}}'))">{{_('unsubmit_program')}}</button> |
Either do this and handle the model in the backend, or convert it to htmx as we usually do!
@@ -292,12 +292,12 @@ def set_program_public_by_id(self, id, public): | |||
""" | |||
return PROGRAMS.update({"id": id}, {"public": 1 if public else 0}) | |||
|
|||
def submit_program_by_id(self, id): | |||
def submit_program_by_id(self, id, submit): |
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.
Perhaps change the name of the fuction to reflect what it's really doing?
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
Fixes #4634
How to test:
Screen.Recording.2024-03-25.at.12.24.39.mov