From 57e0edbccb309186dcd99ead0c90acdcf8b10d67 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Mon, 13 Sep 2021 18:18:55 +0100 Subject: [PATCH] Log list skeleton --- app/controllers/case_logs_controller.rb | 11 +++++++- app/controllers/form_controller.rb | 3 --- app/views/case_logs/_log_list.html.erb | 27 +++++++++++++++++++ app/views/case_logs/_tasklist.html.erb | 2 +- .../edit.html.erb} | 2 +- app/views/case_logs/index.html.erb | 15 +++++++++++ app/views/case_logs/new.html.erb | 8 ++++++ spec/features/form_spec.rb | 2 +- 8 files changed, 63 insertions(+), 7 deletions(-) delete mode 100644 app/controllers/form_controller.rb create mode 100644 app/views/case_logs/_log_list.html.erb rename app/views/{form/index.html.erb => case_logs/edit.html.erb} (70%) create mode 100644 app/views/case_logs/new.html.erb diff --git a/app/controllers/case_logs_controller.rb b/app/controllers/case_logs_controller.rb index 262fff240..4f90f0ac1 100644 --- a/app/controllers/case_logs_controller.rb +++ b/app/controllers/case_logs_controller.rb @@ -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 diff --git a/app/controllers/form_controller.rb b/app/controllers/form_controller.rb deleted file mode 100644 index e94890a54..000000000 --- a/app/controllers/form_controller.rb +++ /dev/null @@ -1,3 +0,0 @@ -class FormController < ApplicationController - def index; end -end diff --git a/app/views/case_logs/_log_list.html.erb b/app/views/case_logs/_log_list.html.erb new file mode 100644 index 000000000..efc434dd8 --- /dev/null +++ b/app/views/case_logs/_log_list.html.erb @@ -0,0 +1,27 @@ + + + + + + + + + + + + <% case_logs.map do |log| %> + + + + + + + <% end %> + +
<%= title %>
Log referencePostcodeTenant code<%= date_title %>
+ <%= link_to log.id, case_log_path(log) %> + + + + <%= log.updated_at.strftime("%d %b %Y") %> +
diff --git a/app/views/case_logs/_tasklist.html.erb b/app/views/case_logs/_tasklist.html.erb index 02e4cb139..ad0857488 100644 --- a/app/views/case_logs/_tasklist.html.erb +++ b/app/views/case_logs/_tasklist.html.erb @@ -18,7 +18,7 @@