Skip to content

Commit

Permalink
Merge pull request #86 from co-cddo/add-system-update-time-to-footer
Browse files Browse the repository at this point in the history
Add system update date to foots
  • Loading branch information
RobNicholsGDS authored May 30, 2024
2 parents 3853a24 + 2326784 commit 0578fdc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def az_content(first_letter, &block)
render "shared/az_content", content:, first_letter:
end

def latest_update
@latest_update ||= UpdateLog.order(:updated_at).last
end

private

def button_sort_direction(field)
Expand Down
10 changes: 9 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
</div>
</main>
</div>
<%= govuk_footer %>
<%= render GovukComponent::FooterComponent.new do |footer| %>
<%= footer.with_meta_html do %>
<% if latest_update %>
<p class="govuk-!-padding-top-2">
System last update <%= latest_update.updated_on.strftime("%d %B %Y") %>
</p>
<% end %>
<% end %>
<% end %>
</body>
</html>

0 comments on commit 0578fdc

Please sign in to comment.