baarkerlounger
3 years ago
8 changed files with 63 additions and 7 deletions
@ -1,7 +1,16 @@
|
||||
class CaseLogsController < ApplicationController |
||||
def index; end |
||||
def index |
||||
@submitted_case_logs = CaseLog.where(status: 1) |
||||
@in_progress_case_logs = CaseLog.where(status: 0) |
||||
end |
||||
|
||||
def show |
||||
@case_log = CaseLog.find(params[:id]) |
||||
end |
||||
|
||||
def edit |
||||
end |
||||
|
||||
def new |
||||
end |
||||
end |
||||
|
@ -1,3 +0,0 @@
|
||||
class FormController < ApplicationController |
||||
def index; end |
||||
end |
@ -0,0 +1,27 @@
|
||||
<table class="govuk-table"> |
||||
<caption class="govuk-table__caption govuk-table__caption--m"><%= title %></caption> |
||||
<thead class="govuk-table__head"> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="col" class="govuk-table__header">Log reference</th> |
||||
<th scope="col" class="govuk-table__header">Postcode</th> |
||||
<th scope="col" class="govuk-table__header">Tenant code</th> |
||||
<th scope="col" class="govuk-table__header"><%= date_title %></th> |
||||
</tr> |
||||
</thead> |
||||
<tbody class="govuk-table__body"> |
||||
<% case_logs.map do |log| %> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="row" class="govuk-table__header"> |
||||
<%= link_to log.id, case_log_path(log) %> |
||||
</th> |
||||
<td class="govuk-table__cell govuk-table__cell"> |
||||
</td> |
||||
<td class="govuk-table__cell govuk-table__cell"> |
||||
</td> |
||||
<td id="last-changed" class="govuk-table__cell"> |
||||
<%= log.updated_at.strftime("%d %b %Y") %> |
||||
</td> |
||||
</tr> |
||||
<% end %> |
||||
</tbody> |
||||
</table> |
@ -1,4 +1,4 @@
|
||||
<%= form_with builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> |
||||
<%= form_with model: @case_log, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> |
||||
<%= f.govuk_number_field :age, |
||||
hint: { text: "More detail" }, |
||||
label: { text: "What is the tenant's age?", size: "l"}, |
@ -0,0 +1,15 @@
|
||||
<div class="govuk-grid-row"> |
||||
<div class="govuk-grid-column-full"> |
||||
<h1 class="govuk-heading-xl">Your logs</h1> |
||||
</div> |
||||
<div class="govuk-grid-column-two-thirds"> |
||||
|
||||
<a href="tasklist" class="govuk-button">Create new Log</a> |
||||
|
||||
<%= render partial: "log_list", locals: { case_logs: @in_progress_case_logs, title: "Logs you need to complete", date_title: "Last Changed" } %> |
||||
|
||||
<%= render partial: "log_list", locals: { case_logs: @submitted_case_logs, title: "Logs you've submitted", date_title: "Date Submitted" } %> |
||||
|
||||
<p><a href="#" class="govuk-link">See all completed logs (<%= @submitted_case_logs.count %>)</a></p> |
||||
</div> |
||||
</div> |
@ -0,0 +1,8 @@
|
||||
<%= form_with model: @case_log, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> |
||||
<%= f.govuk_number_field :age, |
||||
hint: { text: "More detail" }, |
||||
label: { text: "What is the tenant's age?", size: "l"}, |
||||
min: 0, max: 150, step: 1, width: 20 |
||||
%> |
||||
<%= f.govuk_submit %> |
||||
<% end %> |
Loading…
Reference in new issue