Commit 69976415 authored by Aedin Hunter A. Clay's avatar Aedin Hunter A. Clay

When a questboard is created, redirects to new questboard. You can also copy questboard links now

parent be289f52
...@@ -17,5 +17,5 @@ def add_questboard(request): ...@@ -17,5 +17,5 @@ def add_questboard(request):
if request.method == "POST": if request.method == "POST":
filled_form = QuestboardForm(request.POST) filled_form = QuestboardForm(request.POST)
if filled_form.is_valid(): if filled_form.is_valid():
filled_form.save() new_questboard = filled_form.save()
return redirect(request.META.get('HTTP_REFERER', '/')) return redirect('/questboard/edit/' + str(new_questboard.id))
\ No newline at end of file \ No newline at end of file
...@@ -13,6 +13,19 @@ ...@@ -13,6 +13,19 @@
Required Stars: {{questboard.required_stars}}<br/> Required Stars: {{questboard.required_stars}}<br/>
{{questboard.description}}<br/> {{questboard.description}}<br/>
<!-- Copy questboard link -->
<button onclick = "copyQuestboardLink()">Copy Questboard Link</button><br/>
<script>
function copyQuestboardLink(){
var link_area = document.createElement("textarea")
document.body.appendChild(link_area);
link_area.value = window.location.href;
link_area.select();
document.execCommand("copy");
document.body.removeChild(link_area);
}
</script>
{% block extra_content %}{% endblock %} {% block extra_content %}{% endblock %}
......
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
{% endblock %} {% endblock %}
{% block extra_content %} {% block extra_content %}
<!-- Display current URL so it can be copied and sent to students -->
<p>
Share this course by copying this link! :
</p>
<dialog id = "quest_signup"> <dialog id = "quest_signup">
Please enter your name to sign up for this quest. Please enter your name to sign up for this quest.
<form action = "/questboard/view/student_signup/" method = "post"> <form action = "/questboard/view/student_signup/" method = "post">
...@@ -44,5 +48,6 @@ function selectQuestToSignupFor(pk){ ...@@ -44,5 +48,6 @@ function selectQuestToSignupFor(pk){
} }
</script> </script>
{% endblock %} {% endblock %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment