Skip to content

Commit

Permalink
Add view for Pybot to hit for surveys
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric Wille committed Oct 1, 2020
1 parent 05895b0 commit b2f349c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/frontend/static/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ footer {
bottom: 0;
width: 100%;
text-align: center;
}

#survey {
margin: 40px;
}
6 changes: 6 additions & 0 deletions src/frontend/templates/frontend/survey.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% extends 'frontend/base.html' %}
{% block content %}
<div id="survey">
<h3><a href="{{ link }}" target="_blank">This is your unique survey link! This can only be used once. We appreciate you taking the time to fill out our survey.</a></h3>
</div>
{% endblock %}
1 change: 1 addition & 0 deletions src/frontend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
path(
"forms/codeschool", views.CodeschoolFormView.as_view(), name="codeschool_form"
),
path("survey", views.SurveyView.as_view(), name="survey_view"),
]
5 changes: 5 additions & 0 deletions src/frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

class IndexView(TemplateView):
template_name = "frontend/index.html"
link = "" # placeholder for unique link


class CodeschoolFormView(FormView):
Expand Down Expand Up @@ -61,3 +62,7 @@ def handle_submission(form: dict) -> None:
params = {"title": f"New Code School Request: {form['name']}", "body": body}
res = requests.post(url, headers=headers, data=json.dumps(params))
logger.info(f"response from github API call {res}")


class SurveyView(TemplateView):
template_name = "frontend/survey.html"

0 comments on commit b2f349c

Please sign in to comment.