udongo 7.2.1 → 7.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8eaee8d0e21a4230b6ff30ddb12e326eabf44c57
4
- data.tar.gz: 85c0126f69452570001f8cb3afccfe699a86c886
3
+ metadata.gz: 8bccd2a5bcab0646de1ca2051091b223106c0277
4
+ data.tar.gz: 26b8e222f21dd5c458121cabb8f43d3c003a5a30
5
5
  SHA512:
6
- metadata.gz: 73ac0a17e9d99ea1f411bfef8a186e92dbba16bbd934b0fa05ec4834be56b84edf0233e2a9c9a97b312909df79f4b32e24af6863fd58602f4044a4659431b5f4
7
- data.tar.gz: b2a5aaddf31719628b22c80f95f51e718ad3d86c0a792575ac3ee0d8e364278145ddef61f4972b45d88196ad1ad398c65fb97eebe0fd9ba8ad3e976de5078252
6
+ metadata.gz: 96e306e0c15c3f4cca4e31569196b18447a962742e9b1818adf1e8e6e87fbe85b5acdfaee2d0eb06c96899289bfc9f4d06d59deb3a96f9ca851fbc7d0f126c0e
7
+ data.tar.gz: 2c285c4d370a2bacd1cf5bc4e1c07aa9443cba6970a7ac9d2447dba0c98aaea1e7c6ba034b99c56d0ef71d069cf76f609f1f6ae6e6630e31e862493e00af85ec
data/app/models/email.rb CHANGED
@@ -1,4 +1,8 @@
1
1
  class Email < ApplicationRecord
2
+ # Expected format
3
+ # [{ name: 'foo.pdf', filename: '1..256/[random-id]-[name]-[current_time].[extension]' }]
4
+ serialize :attachments, Array
5
+
2
6
  validates :from_name, :to_name, :subject, :plain_content, :html_content,
3
7
  presence: true
4
8
  validates :from_email, :to_email, email: true
@@ -66,3 +66,28 @@
66
66
  </div>
67
67
  </div>
68
68
  </div>
69
+
70
+ <div class="row">
71
+ <div class="col-12">
72
+ <div class="card">
73
+ <div class="card-header">
74
+ <%= t 'b.attachments' %>
75
+ </div>
76
+
77
+ <div class="card-block">
78
+ <% if @email.attachments.any? %>
79
+ <ul>
80
+ <% @email.attachments.each do |a| %>
81
+ <li>
82
+ <%= link_to a[:name], "/uploads/mail_attachments/#{a[:filename]}"%>
83
+ </li>
84
+ <% end %>
85
+ </ul>
86
+
87
+ <% else %>
88
+ <%= t 'b.msg.no_items' %>
89
+ <% end %>
90
+ </div>
91
+ </div>
92
+ </div>
93
+ </div>
data/changelog.md CHANGED
@@ -1,3 +1,14 @@
1
+ 7.3.1 - 2018-02-28
2
+ --
3
+ * Republish gem because of an issue with rubygems.
4
+
5
+
6
+ 7.3.0 - 2018-02-28
7
+ --
8
+ * Make it possible for emails to have attachments. You can also see the them in
9
+ the backend.
10
+
11
+
1
12
  7.2.1 - 2018-02-22
2
13
  --
3
14
  * Add the 'box' to the address email vars #to_hash method.
@@ -10,6 +10,7 @@ en:
10
10
  articles: Articles
11
11
  asset: Asset
12
12
  assets: Assets
13
+ attachments: Attachments
13
14
  author: Author
14
15
  cancel: Cancel
15
16
  choose_an_existing_image: Choose an existing image
@@ -10,6 +10,7 @@ nl:
10
10
  articles: Artikels
11
11
  asset: Bestand
12
12
  assets: Bestanden
13
+ attachments: Bijlagen
13
14
  author: Auteur
14
15
  cancel: Annuleren
15
16
  choose_an_existing_image: Kies bestaande afbeelding
@@ -0,0 +1,5 @@
1
+ class AddAttachmentsToEmails < ActiveRecord::Migration[5.0]
2
+ def change
3
+ add_column :emails, :attachments, :text, after: 'locale'
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Udongo
2
- VERSION = '7.2.1'
2
+ VERSION = '7.3.1'
3
3
  end
data/readme.md CHANGED
@@ -308,6 +308,20 @@ validates :email, email: true
308
308
  validates :url, url: true
309
309
  ```
310
310
 
311
+ # E-mails
312
+ ## Attachments
313
+ There's a serialized field ```attachments``` in the emails table. This expects
314
+ the following format.
315
+
316
+ ```[{ name: 'foo.pdf', filename: '1..256/[random-id]-[name]-[current_time].[extension]' }]```
317
+
318
+ The name is what will be shown in the e-mail, the filename is the location of the
319
+ actual file that is attached to this e-mail. The file is assumed to be stored in
320
+ the following dir.
321
+
322
+ ```public/uploads/mail_attachments/[filename]```
323
+
324
+
311
325
  # Search engine
312
326
  4.0 introduced a rough structure to build a search autocomplete upon through ```Concerns::Searchable```.
313
327
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: udongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.1
4
+ version: 7.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davy Hellemans
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-02-22 00:00:00.000000000 Z
12
+ date: 2018-02-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -860,6 +860,7 @@ files:
860
860
  - db/migrate/20170919135942_add_external_reference_to_content_column.rb
861
861
  - db/migrate/20171119182643_larger_email_plain_html_storage.rb
862
862
  - db/migrate/20171217163339_add_disallow_resizeto_content_picture.rb
863
+ - db/migrate/20180228071957_add_attachments_to_emails.rb
863
864
  - lib/tasks/task_extras.rb
864
865
  - lib/tasks/udongo_tasks.rake
865
866
  - lib/udongo.rb