Skip to content

Commit

Permalink
Add basic navigation to question set pages
Browse files Browse the repository at this point in the history
  • Loading branch information
colmjude committed May 22, 2024
1 parent 4743d87 commit f5eb5f6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion application/blueprints/questions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
TextareaForm,
)
from application.forms import DeleteForm
from application.models import Answer, Consideration, Question, QuestionType
from application.models import Answer, Consideration, Question, QuestionType, Stage
from application.utils import login_required, true_false_to_bool

questions = Blueprint(
Expand Down Expand Up @@ -86,6 +86,7 @@ def index(consideration_slug, stage):
return render_template(
"questions/set.html",
stage=stage,
stages=Stage,
consideration=consideration,
questions=questions_to_display,
starting_question=start_question,
Expand Down
6 changes: 6 additions & 0 deletions application/templates/partials/question-set-navigation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<p class="govuk-body">Stages</p>
<ul class="govuk-list">
<li><a href="{{ url_for('questions.index', stage=stages.BACKLOG, consideration_slug=consideration.slug )}}" class="govuk-link">Backlog</a></li>
<li><a href="{{ url_for('questions.index', stage=stages.SCREEN, consideration_slug=consideration.slug )}}" class="govuk-link">Screen</a></li>
<li><a href="{{ url_for('questions.index', stage=stages.RESEARCH, consideration_slug=consideration.slug )}}" class="govuk-link">Research</a></li>
</ul>
11 changes: 10 additions & 1 deletion application/templates/questions/set.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ <h1 class="govuk-heading-xl">{{ stage.value }}</h1>
</div>

<div class='govuk-grid-row'>
<div class='govuk-grid-column-two-thirds'>

<div class="govuk-grid-column-one-quarter">
{% include 'partials/question-set-navigation.html' %}
<hr class="govuk-section-break-m">
<a href="{{ url_for('planning_consideration.consideration', slug=consideration.slug) }}" class="govuk-back-link"><span class="govuk-visually-hidden">Go back to </span>{{ consideration.name }} summary</a>
</div>

<div class='govuk-grid-column-three-quarters'>
<p class="govuk-body-l">These are the questions we answer during the {{stage.value}} stage.</p>
<p class="govuk-body">Answering them wil help us learn more about the {{ consideration.name }} consideration, determine if a data standard is required and whether we know enough to move on to the next stage.</p>
{%- if not config.AUTHENTICATION_ON or session["user"] %}
<p class="govuk-body">
<a href="{{ url_for('questions.question', consideration_slug=consideration.slug, question_slug=starting_question.slug, stage=stage, next=True) }}" class="govuk-link">Answer all</a>
Expand Down

0 comments on commit f5eb5f6

Please sign in to comment.