draft_box 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df1480e5f5f34ba3e74ca9d1da1126ffe5de868a99c1e85dbfc50ef78489446f
4
- data.tar.gz: 566c5480ab8a6367deee4090e30e908b9abe0b6116290e77469c17315874be67
3
+ metadata.gz: a778ef43eef09aecc617ba3b15d394f8069c67f7e2f43a2820755b0fb41b784e
4
+ data.tar.gz: 7f88cf7adbc1f19e4e8f73639e3d883317da6cb2e5f34248a93fb770004ed3d6
5
5
  SHA512:
6
- metadata.gz: ba24288561491471a5baf1d346a5033c50515479b08a496195c9eaaf40245ca318268f0854200e406a3943af06438b16c970d8dea2ea794757de1fd1e1344536
7
- data.tar.gz: caf7c0b06cdc1a2dfdfa6adac128981b27b54954cbeebbc6f5715ec1f65528ac9393acacbd44545b7d8db56d98e698dbc6ff36f2d83a9496f70b082812494b44
6
+ metadata.gz: b1d7bdbf517abb97fa9aaca66fc155453b67f50a8715c64ba1cb04a09e822814d828c32eb909892ec3ab931d45ec40e3f27c2034fc65905f9362d74d03e52b99
7
+ data.tar.gz: 8a78ce5701a95373ac46da4937d2abd64c2e77d7cbc6dfed331671700f7ec6cd5f5d8cc46afaff764b88c82d2fdb54cf6081980188424a07ef1e3a1735afa228
@@ -0,0 +1,23 @@
1
+ <div style="width: 300px; height: 100vh; overflow-y: auto; border-right: 1px solid #ddd; padding: 20px; background: #f5f5f5;">
2
+ <% if emails.any? %>
3
+ <%= button_to "Delete All", draft_box.emails_path, method: :delete,
4
+ style: "background: #dc3545; color: white; border: none; padding: 8px 15px; border-radius: 3px; cursor: pointer; width: 100%; margin-bottom: 15px;" %>
5
+ <ul style="list-style: none; padding: 0; margin: 0;">
6
+ <% emails.each do |email| %>
7
+ <li style="padding: 15px; border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: flex-start;">
8
+ <%= link_to draft_box.email_path(email), style: "text-decoration: none; color: inherit; flex: 1;" do %>
9
+ <div style="font-weight: bold; margin-bottom: 5px;"><%= email.subject %></div>
10
+ <div style="color: #666; font-size: 0.9em;">
11
+ To: <%= email.recipients.join(", ") %><br>
12
+ <%= email.created_at.strftime("%B %d, %Y %H:%M") %>
13
+ </div>
14
+ <% end %>
15
+ <%= button_to "Delete", draft_box.email_path(email), method: :delete,
16
+ style: "background: #dc3545; color: white; border: none; padding: 5px 10px; border-radius: 3px; cursor: pointer;" %>
17
+ </li>
18
+ <% end %>
19
+ </ul>
20
+ <% else %>
21
+ <p style="color: #666; text-align: center;">No emails found</p>
22
+ <% end %>
23
+ </div>
@@ -0,0 +1,10 @@
1
+ <div style="display: flex; height: 100vh;">
2
+ <%= render "draft_box/emails/sidebar", emails: @emails %>
3
+
4
+ <div style="flex: 1; padding: 20px; display: flex; align-items: center; justify-content: center;">
5
+ <div style="text-align: center; color: #666;">
6
+ <h3>Select an email from the sidebar to view details</h3>
7
+ <p>Click on any email in the list to see its full content</p>
8
+ </div>
9
+ </div>
10
+ </div>
@@ -0,0 +1,49 @@
1
+ <div style="display: flex; height: 100vh;">
2
+ <%= render "draft_box/emails/sidebar", emails: @emails %>
3
+
4
+ <div style="flex: 1; padding: 20px;">
5
+ <div style="max-width: 800px; margin: 0 auto;">
6
+ <h2 style="margin-bottom: 20px;"><%= @email.subject %></h2>
7
+
8
+ <div style="background: #f5f5f5; padding: 15px; border-radius: 5px; margin-bottom: 20px;">
9
+ <div style="margin-bottom: 10px;">
10
+ <strong>From:</strong> <%= @email.from %>
11
+ </div>
12
+ <div style="margin-bottom: 10px;">
13
+ <strong>To:</strong> <%= @email.recipients.join(", ") %>
14
+ </div>
15
+ <% if Array.wrap(@email.carbon_copies).any? %>
16
+ <div style="margin-bottom: 10px;">
17
+ <strong>CC:</strong> <%= Array.wrap(@email.carbon_copies).join(", ") %>
18
+ </div>
19
+ <% end %>
20
+ <% if Array.wrap(@email.blind_copies).any? %>
21
+ <div style="margin-bottom: 10px;">
22
+ <strong>BCC:</strong> <%= Array.wrap(@email.blind_copies).join(", ") %>
23
+ </div>
24
+ <% end %>
25
+ <div>
26
+ <strong>Date:</strong> <%= @email.created_at.strftime("%B %d, %Y %H:%M") %>
27
+ </div>
28
+ </div>
29
+
30
+ <% if @email.attachments.any? %>
31
+ <div style="background: #f5f5f5; padding: 15px; border-radius: 5px; margin-bottom: 20px;">
32
+ <strong>Attachments:</strong>
33
+ <ul style="list-style: none; padding: 0; margin: 10px 0 0 0;">
34
+ <% @email.attachments.each do |attachment| %>
35
+ <li style="margin-bottom: 5px;">
36
+ <%= link_to attachment.filename, draft_box.attachment_path(@email, attachment),
37
+ style: "color: #0066cc; text-decoration: none;" %>
38
+ </li>
39
+ <% end %>
40
+ </ul>
41
+ </div>
42
+ <% end %>
43
+
44
+ <div style="background: white; padding: 20px; border: 1px solid #ddd; border-radius: 5px;">
45
+ <%= @email.body.html_safe %>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ </div>
@@ -3,7 +3,7 @@ module DraftBox
3
3
  module_function
4
4
 
5
5
  def to_s
6
- '0.0.4'
6
+ '0.0.5'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: draft_box
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paweł Dąbrowski
@@ -22,6 +22,9 @@ files:
22
22
  - app/controllers/draft_box/emails_controller.rb
23
23
  - app/models/draft_box/attachment.rb
24
24
  - app/models/draft_box/email.rb
25
+ - app/views/draft_box/emails/_sidebar.html.erb
26
+ - app/views/draft_box/emails/index.html.erb
27
+ - app/views/draft_box/emails/show.html.erb
25
28
  - config/routes.rb
26
29
  - lib/draft_box.rb
27
30
  - lib/draft_box/delivery_method.rb