From 69b5e3e542efbca58ebc88f41e1e4eb708c54a33 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Sun, 7 Feb 2021 16:47:06 +0100 Subject: [PATCH] essai avec un pseudo template TailwindCSS --- app/views/emails/_list.html.erb | 21 ++++- app/views/emails/index.html.erb | 6 +- app/views/emails/show.html.erb | 4 + app/views/filters/_filter.html.erb | 33 ++++---- app/views/filters/index.html.erb | 6 +- app/views/filters/show.html.erb | 11 +-- app/views/layouts/application.html.erb | 111 ++++++++++++++++++++++++- 7 files changed, 166 insertions(+), 26 deletions(-) diff --git a/app/views/emails/_list.html.erb b/app/views/emails/_list.html.erb index da47d41..6f06d5f 100644 --- a/app/views/emails/_list.html.erb +++ b/app/views/emails/_list.html.erb @@ -15,4 +15,23 @@ -<%= paginate @emails %> +
+
+ <%= link_to_previous_page @emails, 'Previous page', class: "ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:text-gray-500" %> + <%= link_to_next_page @emails, 'Next Page', class: "relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:text-gray-500" %> +
+ +
diff --git a/app/views/emails/index.html.erb b/app/views/emails/index.html.erb index ec2f1c4..f568ab5 100644 --- a/app/views/emails/index.html.erb +++ b/app/views/emails/index.html.erb @@ -1,6 +1,8 @@ -

<%= notice %>

+<% content_for :main_title do %> + Emails +<% end %> -

Emails

+

<%= notice %>

<%= turbo_frame_tag "emails" do %> <%= render partial: "list", object: @emails, as: :emails %> diff --git a/app/views/emails/show.html.erb b/app/views/emails/show.html.erb index 0087258..2638e49 100644 --- a/app/views/emails/show.html.erb +++ b/app/views/emails/show.html.erb @@ -1,3 +1,7 @@ +<% content_for :main_title do %> + Email # +<% end %> +

<%= notice %>

<%= turbo_stream_from @email %> diff --git a/app/views/filters/_filter.html.erb b/app/views/filters/_filter.html.erb index 8b9dab2..5dfccd1 100644 --- a/app/views/filters/_filter.html.erb +++ b/app/views/filters/_filter.html.erb @@ -1,22 +1,27 @@ -
+
-

+

Description: - <%= filter.description %> -

+ <%= filter.description || "No description" %> +
-

- Enabled: - <%= filter.enabled %> -

- -

+

Operator: <%= filter.operator %> -

+
-

+

Inverted: - <%= filter.inverted %> -

+ <%= filter.inverted? ? 'Yes' : 'No' %> +
+ +
+ <%= link_to 'Edit', edit_filter_path(@filter) %> + <%= button_to 'Delete', @filter, method: :delete, data: { confirm: 'Are you sure?' } %> + <% if filter.enabled? %> + <%= button_to 'Disable', filter_disable_path(@filter), data: { method: :patch } %> + <% else %> + <%= button_to 'Enable', filter_enable_path(@filter), data: { method: :patch } %> + <% end %> +
diff --git a/app/views/filters/index.html.erb b/app/views/filters/index.html.erb index fe58c5f..c50b37c 100644 --- a/app/views/filters/index.html.erb +++ b/app/views/filters/index.html.erb @@ -1,6 +1,8 @@ -

<%= notice %>

+<% content_for :main_title do %> + Filters +<% end %> -

Filters

+

<%= notice %>

diff --git a/app/views/filters/show.html.erb b/app/views/filters/show.html.erb index e0ffd79..a6ee319 100644 --- a/app/views/filters/show.html.erb +++ b/app/views/filters/show.html.erb @@ -1,12 +1,13 @@ +<% content_for :main_title do %> + Filter #<%= @filter.id %> +<% end %> +

<%= notice %>

+<%= link_to 'Back to filters list', filters_path %> + <%= turbo_frame_tag "filter" do %> <%= render @filter %> - -

- <%= link_to 'Edit', edit_filter_path(@filter) %> | - <%= link_to 'Back', filters_path, "data-turbo-frame": "_top" %> -

<% end %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 088188b..4899831 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -12,8 +12,115 @@ -
- <%= yield %> +
+ + +
+
+

+ <%= yield :main_title %> +

+
+
+
+
+ <%= yield %> +
+
+