Skip to content

Commit

Permalink
add alert flash message and move to partial
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwwhiterabbit committed Aug 21, 2024
1 parent fa51d1a commit 1f45d59
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 33 deletions.
4 changes: 1 addition & 3 deletions app/views/assertions/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<%= render 'layouts/flash' %>

<% content_for :title, "Assertions" %>

Expand Down
4 changes: 1 addition & 3 deletions app/views/assertions/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<div class="container px-6 mx-auto mt-10 grid">
<div class="mx-auto">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<%= render 'layouts/flash' %>

<%= render @assertion %>

Expand Down
7 changes: 7 additions & 0 deletions app/views/layouts/_flash.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>

<% if alert.present? %>
<p class="py-2 px-3 bg-red-50 mb-5 text-red-500 font-medium rounded-lg inline-block" id="alert"><%= alert %></p>
<% end %>
4 changes: 1 addition & 3 deletions app/views/model_versions/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<%= render 'layouts/flash' %>

<% content_for :title, "Model versions" %>

Expand Down
4 changes: 1 addition & 3 deletions app/views/model_versions/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<%= render 'layouts/flash' %>

<%= render @model_version %>

Expand Down
4 changes: 1 addition & 3 deletions app/views/models/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<%= render 'layouts/flash' %>

<% content_for :title, "Models" %>

Expand Down
4 changes: 1 addition & 3 deletions app/views/models/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<%= render 'layouts/flash' %>

<%= render @model %>

Expand Down
4 changes: 1 addition & 3 deletions app/views/prompts/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<%= render 'layouts/flash' %>

<% content_for :title, "Prompts" %>

Expand Down
4 changes: 1 addition & 3 deletions app/views/prompts/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<%= render 'layouts/flash' %>

<%= render @prompt %>

Expand Down
4 changes: 1 addition & 3 deletions app/views/test_model_version_runs/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<%= render 'layouts/flash' %>

<%= render @test_model_version_run %>

Expand Down
4 changes: 1 addition & 3 deletions app/views/test_runs/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<%= render 'layouts/flash' %>

<% content_for :title, "Test Runs" %>

Expand Down
4 changes: 1 addition & 3 deletions app/views/test_runs/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<div class="container px-6 mx-auto mt-10 grid">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>
<%= render 'layouts/flash' %>

<%= render @test_run %>

Expand Down

0 comments on commit 1f45d59

Please sign in to comment.