Sam Collard
2 years ago
9 changed files with 114 additions and 9 deletions
@ -0,0 +1,8 @@
|
||||
class UpdateLogsController < ApplicationController |
||||
before_action :authenticate_user! |
||||
|
||||
def show |
||||
@logs = LettingsLog.where(created_by: current_user, impacted_by_scheme_deactivation: true) |
||||
render "logs/update_logs" |
||||
end |
||||
end |
@ -0,0 +1,38 @@
|
||||
<% content_for :title, "Update logs" %> |
||||
|
||||
<div class="govuk-grid-row govuk-!-margin-bottom-8"> |
||||
<h1 class="govuk-heading-xl">You need to update <%= @logs.count %> logs</h1> |
||||
|
||||
<p class="govuk-body"> |
||||
Some scheme details have changed, and now the following <%= @logs.count %> logs need updating. |
||||
</p> |
||||
<p class="govuk-body"> |
||||
You'll have to answer a few questions for each log. |
||||
</p> |
||||
</div> |
||||
|
||||
<div class="govuk-grid-row"> |
||||
<%= govuk_table do |table| |
||||
table.head do |head| |
||||
head.row do |row| |
||||
row.cell(header: true, text: "Log ID") |
||||
row.cell(header: true, text: "Tenancy code") |
||||
row.cell(header: true, text: "Property reference") |
||||
row.cell(header: true, text: "Status") |
||||
row.cell # "Update now" column has no heading |
||||
end |
||||
end |
||||
|
||||
table.body do |body| |
||||
@logs.each do |log| |
||||
body.row do |row| |
||||
row.cell(header: true, text: log.id) |
||||
row.cell(text: log.tenancycode) |
||||
row.cell(text: log.propcode) |
||||
row.cell { status_tag(log.status) } |
||||
row.cell(numeric: true) { govuk_link_to("Update now", "#") } # "numeric" to right-align |
||||
end |
||||
end |
||||
end |
||||
end %> |
||||
</div> |
@ -0,0 +1,13 @@
|
||||
class AddImpactedBySchemeDeactivation < ActiveRecord::Migration[7.0] |
||||
def up |
||||
change_table :lettings_logs, bulk: true do |t| |
||||
t.column :impacted_by_scheme_deactivation, :boolean |
||||
end |
||||
end |
||||
|
||||
def down |
||||
change_table :lettings_logs, bulk: true do |t| |
||||
t.remove :impacted_by_scheme_deactivation |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue