From 1f45d5946047d0b9eb96b82254d0dbe171ea93e2 Mon Sep 17 00:00:00 2001 From: White Rabbit Date: Wed, 21 Aug 2024 13:13:39 +0400 Subject: [PATCH] add alert flash message and move to partial --- app/views/assertions/index.html.erb | 4 +--- app/views/assertions/show.html.erb | 4 +--- app/views/layouts/_flash.html.erb | 7 +++++++ app/views/model_versions/index.html.erb | 4 +--- app/views/model_versions/show.html.erb | 4 +--- app/views/models/index.html.erb | 4 +--- app/views/models/show.html.erb | 4 +--- app/views/prompts/index.html.erb | 4 +--- app/views/prompts/show.html.erb | 4 +--- app/views/test_model_version_runs/show.html.erb | 4 +--- app/views/test_runs/index.html.erb | 4 +--- app/views/test_runs/show.html.erb | 4 +--- 12 files changed, 18 insertions(+), 33 deletions(-) create mode 100644 app/views/layouts/_flash.html.erb diff --git a/app/views/assertions/index.html.erb b/app/views/assertions/index.html.erb index acf7b5d..c5360fa 100644 --- a/app/views/assertions/index.html.erb +++ b/app/views/assertions/index.html.erb @@ -1,7 +1,5 @@
- <% if notice.present? %> -

<%= notice %>

- <% end %> + <%= render 'layouts/flash' %> <% content_for :title, "Assertions" %> diff --git a/app/views/assertions/show.html.erb b/app/views/assertions/show.html.erb index 0ff13bf..70154a2 100644 --- a/app/views/assertions/show.html.erb +++ b/app/views/assertions/show.html.erb @@ -1,8 +1,6 @@
- <% if notice.present? %> -

<%= notice %>

- <% end %> + <%= render 'layouts/flash' %> <%= render @assertion %> diff --git a/app/views/layouts/_flash.html.erb b/app/views/layouts/_flash.html.erb new file mode 100644 index 0000000..96be419 --- /dev/null +++ b/app/views/layouts/_flash.html.erb @@ -0,0 +1,7 @@ +<% if notice.present? %> +

<%= notice %>

+<% end %> + +<% if alert.present? %> +

<%= alert %>

+<% end %> diff --git a/app/views/model_versions/index.html.erb b/app/views/model_versions/index.html.erb index 7a59952..05d4fc4 100644 --- a/app/views/model_versions/index.html.erb +++ b/app/views/model_versions/index.html.erb @@ -1,7 +1,5 @@
- <% if notice.present? %> -

<%= notice %>

- <% end %> + <%= render 'layouts/flash' %> <% content_for :title, "Model versions" %> diff --git a/app/views/model_versions/show.html.erb b/app/views/model_versions/show.html.erb index 1233dca..fb2964f 100644 --- a/app/views/model_versions/show.html.erb +++ b/app/views/model_versions/show.html.erb @@ -1,7 +1,5 @@
- <% if notice.present? %> -

<%= notice %>

- <% end %> + <%= render 'layouts/flash' %> <%= render @model_version %> diff --git a/app/views/models/index.html.erb b/app/views/models/index.html.erb index e9cc601..bb2d6df 100644 --- a/app/views/models/index.html.erb +++ b/app/views/models/index.html.erb @@ -1,7 +1,5 @@
- <% if notice.present? %> -

<%= notice %>

- <% end %> + <%= render 'layouts/flash' %> <% content_for :title, "Models" %> diff --git a/app/views/models/show.html.erb b/app/views/models/show.html.erb index db88411..d6cbf02 100644 --- a/app/views/models/show.html.erb +++ b/app/views/models/show.html.erb @@ -1,7 +1,5 @@
- <% if notice.present? %> -

<%= notice %>

- <% end %> + <%= render 'layouts/flash' %> <%= render @model %> diff --git a/app/views/prompts/index.html.erb b/app/views/prompts/index.html.erb index 425b82c0..58a238f 100644 --- a/app/views/prompts/index.html.erb +++ b/app/views/prompts/index.html.erb @@ -1,7 +1,5 @@
- <% if notice.present? %> -

<%= notice %>

- <% end %> + <%= render 'layouts/flash' %> <% content_for :title, "Prompts" %> diff --git a/app/views/prompts/show.html.erb b/app/views/prompts/show.html.erb index 1188465..7f04ca2 100644 --- a/app/views/prompts/show.html.erb +++ b/app/views/prompts/show.html.erb @@ -1,7 +1,5 @@
- <% if notice.present? %> -

<%= notice %>

- <% end %> + <%= render 'layouts/flash' %> <%= render @prompt %> diff --git a/app/views/test_model_version_runs/show.html.erb b/app/views/test_model_version_runs/show.html.erb index 2817b98..a11fdd3 100644 --- a/app/views/test_model_version_runs/show.html.erb +++ b/app/views/test_model_version_runs/show.html.erb @@ -1,7 +1,5 @@
- <% if notice.present? %> -

<%= notice %>

- <% end %> + <%= render 'layouts/flash' %> <%= render @test_model_version_run %> diff --git a/app/views/test_runs/index.html.erb b/app/views/test_runs/index.html.erb index 5ab79ef..68892b3 100644 --- a/app/views/test_runs/index.html.erb +++ b/app/views/test_runs/index.html.erb @@ -1,7 +1,5 @@
- <% if notice.present? %> -

<%= notice %>

- <% end %> + <%= render 'layouts/flash' %> <% content_for :title, "Test Runs" %> diff --git a/app/views/test_runs/show.html.erb b/app/views/test_runs/show.html.erb index c29cdbb..efd2e02 100644 --- a/app/views/test_runs/show.html.erb +++ b/app/views/test_runs/show.html.erb @@ -1,7 +1,5 @@
- <% if notice.present? %> -

<%= notice %>

- <% end %> + <%= render 'layouts/flash' %> <%= render @test_run %>