From c1895175e95103941ddaf55902a1d535def53b6b Mon Sep 17 00:00:00 2001 From: wilfried Date: Thu, 19 Jan 2023 09:30:09 -0500 Subject: [PATCH 1/4] New layout proposal --- .../gravity_mailbox/mailbox/index.html.erb | 128 +++++++++++++----- .../templates/layouts/application.html.erb | 10 +- 2 files changed, 99 insertions(+), 39 deletions(-) diff --git a/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/index.html.erb b/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/index.html.erb index 7af33e9..6181013 100644 --- a/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/index.html.erb +++ b/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/index.html.erb @@ -1,5 +1,5 @@ <% content_for :style do %> - body, iframe { + body, iframe { height: 100vh; } @@ -8,6 +8,14 @@ width: 100%; } + .navbar { + margin-bottom: 2px; + } + + .navbar-brand > h1 { + font-family: 'Righteous', cursive !important; + } + .mail-list-column { height: 100vh; overflow: scroll; @@ -21,14 +29,38 @@ font-family: arial, sans-serif; color: #000; cursor: pointer; + width: 100%; + text-align: left; } - .selected-mail { + .mail-list-item { + background-color: #fff!important; + box-shadow: inset 0 -1px 0 0 rgb(100 121 143 / 12%) !important; + } + + .mail-list-item.selected-mail { background-color: #ffffff!important; + border-left: 8px solid #ed900c; + border-top-left-radius: 7px; + border-bottom-left-radius: 7px; } - .mail-list-item { - background-color: hsl(206deg 27% 96%); + .mail-list-item:hover { + cursor: pointer !important; + box-shadow: 1px 1px 6px darkgray !important; + margin-bottom: 5px; + } + + #iframe-mail-container { + background-color: whitesmoke !important; + } + + .dropdown-trigger:hover { + cursor: pointer !important; + } + + .dropdown-item:hover { + background-color: whitesmoke !important; } <% end %> @@ -67,45 +99,71 @@ - <% @mails.each_with_index do |mail, index| %> - <%= render partial: 'mail', locals: { mail: mail, index: index } %> - <% end %> + <% @mails.each_with_index do |mail, index| %> + <%= render partial: 'mail', locals: { mail: mail, index: index } %> + <% end %>
- +
diff --git a/lib/gravity_mailbox/templates/layouts/application.html.erb b/lib/gravity_mailbox/templates/layouts/application.html.erb index 95f2037..9fc4583 100644 --- a/lib/gravity_mailbox/templates/layouts/application.html.erb +++ b/lib/gravity_mailbox/templates/layouts/application.html.erb @@ -3,14 +3,16 @@ - + + + - <%= yield %> - - +<%= yield %> + + From e4a9dacbdf4965339961767c577ad77fe48d0a45 Mon Sep 17 00:00:00 2001 From: Jean-Francis Bastien Date: Fri, 20 Jan 2023 15:04:53 -0500 Subject: [PATCH 2/4] Change primary color, update changelog and readme with "logo" --- CHANGELOG.md | 2 ++ README.md | 4 +++- .../gravity_mailbox/mailbox/_mail.html.erb | 2 +- .../gravity_mailbox/mailbox/index.html.erb | 14 +++++++++----- .../templates/layouts/application.html.erb | 2 ++ 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01eb0e6..dfb4948 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## main (unreleased) +* New layout and style ([#12](https://github.com/petalmd/gravity_mailbox/pull/12)) + ## v0.2.0 (2022-12-15) * New look ([#7](https://github.com/petalmd/gravity_mailbox/pull/7)) diff --git a/README.md b/README.md index c5cadf7..13649c9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ [![Gem Version](https://badge.fury.io/rb/gravity_mailbox.svg)](https://badge.fury.io/rb/gravity_mailbox) [![Ruby](https://github.com/petalmd/gravity_mailbox/actions/workflows/main.yml/badge.svg)](https://github.com/petalmd/gravity_mailbox/actions/workflows/main.yml) -# GravityMailbox +

+ +

Development tools that aim to make it simple to visualize mail sent by your Rails app directly through your Rails app. It works in development and also in a staging environment by using the `Rails.cache` to store the mails. diff --git a/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/_mail.html.erb b/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/_mail.html.erb index 9edc7a6..a8109b4 100644 --- a/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/_mail.html.erb +++ b/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/_mail.html.erb @@ -1,5 +1,5 @@ -
+
<%= mail.subject %> diff --git a/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/index.html.erb b/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/index.html.erb index 6181013..9df9161 100644 --- a/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/index.html.erb +++ b/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/index.html.erb @@ -9,7 +9,7 @@ } .navbar { - margin-bottom: 2px; + background-color: #007bff !important; } .navbar-brand > h1 { @@ -35,20 +35,24 @@ .mail-list-item { background-color: #fff!important; + padding: 1rem; box-shadow: inset 0 -1px 0 0 rgb(100 121 143 / 12%) !important; } .mail-list-item.selected-mail { background-color: #ffffff!important; border-left: 8px solid #ed900c; - border-top-left-radius: 7px; - border-bottom-left-radius: 7px; + padding-left: calc(1rem - 8px); } .mail-list-item:hover { cursor: pointer !important; - box-shadow: 1px 1px 6px darkgray !important; - margin-bottom: 5px; + border-left: 8px solid lightgrey; + padding-left: calc(1rem - 8px); + } + + .mail-list-item.selected-mail:hover { + border-left: 8px solid #ed900c; } #iframe-mail-container { diff --git a/lib/gravity_mailbox/templates/layouts/application.html.erb b/lib/gravity_mailbox/templates/layouts/application.html.erb index 9fc4583..46da590 100644 --- a/lib/gravity_mailbox/templates/layouts/application.html.erb +++ b/lib/gravity_mailbox/templates/layouts/application.html.erb @@ -6,11 +6,13 @@ + <%#= favicon_link_tag 'images/favicon.ico' %> +<%= image_tag('favicon2.ico') %> <%= yield %> From e62e7deb220e9934fd36a73959ab5de7dec2bf8a Mon Sep 17 00:00:00 2001 From: Jean-Francis Bastien Date: Fri, 20 Jan 2023 15:07:48 -0500 Subject: [PATCH 3/4] Update preview and tmp code --- README.md | 5 +++-- lib/gravity_mailbox/templates/layouts/application.html.erb | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 13649c9..7fa384e 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,9 @@ config.action_mailer.perform_deliveries = true * Send mails * Go to http://localhost:3000/gravity_mailbox to see the mails. -image - +

+ image +

## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. diff --git a/lib/gravity_mailbox/templates/layouts/application.html.erb b/lib/gravity_mailbox/templates/layouts/application.html.erb index 46da590..9fc4583 100644 --- a/lib/gravity_mailbox/templates/layouts/application.html.erb +++ b/lib/gravity_mailbox/templates/layouts/application.html.erb @@ -6,13 +6,11 @@ - <%#= favicon_link_tag 'images/favicon.ico' %> -<%= image_tag('favicon2.ico') %> <%= yield %> From 099f762258060650679f3d1b49646d70e17ec558 Mon Sep 17 00:00:00 2001 From: Jean-Francis Bastien Date: Fri, 20 Jan 2023 15:08:02 -0500 Subject: [PATCH 4/4] Spacing --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7fa384e..1c8f862 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ config.action_mailer.perform_deliveries = true

image

+ ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.