udongo 5.1.0 → 5.2.0
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 +4 -4
- data/app/assets/javascripts/backend/application.js +1 -1
- data/app/controllers/backend/assets_controller.rb +52 -0
- data/app/models/asset.rb +37 -0
- data/app/models/asset_image.rb +172 -0
- data/app/models/concerns/imageable.rb +13 -0
- data/app/models/image.rb +11 -0
- data/app/uploaders/asset_uploader.rb +36 -0
- data/app/views/backend/assets/_filter.html.erb +17 -0
- data/app/views/backend/assets/_form.html.erb +28 -0
- data/app/views/backend/assets/edit.html.erb +5 -0
- data/app/views/backend/assets/index.html.erb +48 -0
- data/app/views/backend/assets/new.html.erb +4 -0
- data/app/views/backend/snippets/edit.html.erb +1 -1
- data/app/views/backend/users/index.html.erb +2 -2
- data/app/views/layouts/backend/_top_navigation.html.erb +1 -0
- data/changelog.md +9 -0
- data/config/locales/en.yml +2 -1
- data/config/locales/en_backend.yml +6 -0
- data/config/locales/en_general.yml +1 -0
- data/config/locales/fr.yml +1 -1
- data/config/locales/nl.yml +2 -1
- data/config/locales/nl_backend.yml +5 -0
- data/config/locales/nl_general.yml +1 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20170225144523_create_assets.rb +14 -0
- data/db/migrate/20170228183831_create_images.rb +18 -0
- data/lib/udongo/configs/assets.rb +10 -0
- data/lib/udongo/version.rb +1 -1
- data/readme.md +11 -0
- data/spec/factories/addresses.rb +6 -0
- data/spec/factories/admins.rb +10 -0
- data/spec/factories/assets.rb +5 -0
- data/spec/factories/comments.rb +9 -0
- data/spec/factories/content_columns.rb +10 -0
- data/spec/factories/content_images.rb +9 -0
- data/spec/factories/content_rows.rb +5 -0
- data/spec/factories/content_texts.rb +4 -0
- data/spec/factories/email_templates.rb +8 -0
- data/spec/factories/emails.rb +11 -0
- data/spec/factories/images.rb +5 -0
- data/spec/factories/logs.rb +4 -0
- data/spec/factories/meta.rb +7 -0
- data/spec/factories/navigation_items.rb +5 -0
- data/spec/factories/navigations.rb +6 -0
- data/spec/factories/notes.rb +6 -0
- data/spec/factories/pages.rb +5 -0
- data/spec/factories/queued_tasks.rb +5 -0
- data/spec/factories/redirects.rb +7 -0
- data/spec/factories/search_indices.rb +6 -0
- data/spec/factories/search_modules.rb +5 -0
- data/spec/factories/search_synonyms.rb +7 -0
- data/spec/factories/settings.rb +7 -0
- data/spec/factories/snippets.rb +6 -0
- data/spec/factories/stores.rb +6 -0
- data/spec/factories/tagged_items.rb +5 -0
- data/spec/factories/tags.rb +7 -0
- data/spec/factories/users.rb +9 -0
- data/spec/support/concerns/cacheable.rb +10 -0
- data/spec/support/concerns/commentable.rb +10 -0
- data/spec/support/concerns/content_type.rb +20 -0
- data/spec/support/concerns/deletable.rb +33 -0
- data/spec/support/concerns/draggable.rb +29 -0
- data/spec/support/concerns/emailable.rb +7 -0
- data/spec/support/concerns/flexible_content.rb +22 -0
- data/spec/support/concerns/imageable.rb +15 -0
- data/spec/support/concerns/locale.rb +21 -0
- data/spec/support/concerns/loggable.rb +19 -0
- data/spec/support/concerns/notable.rb +10 -0
- data/spec/support/concerns/parentable.rb +73 -0
- data/spec/support/concerns/person.rb +15 -0
- data/spec/support/concerns/publishable.rb +41 -0
- data/spec/support/concerns/searchable.rb +130 -0
- data/spec/support/concerns/seo.rb +54 -0
- data/spec/support/concerns/sortable.rb +67 -0
- data/spec/support/concerns/spammable.rb +53 -0
- data/spec/support/concerns/storable.rb +18 -0
- data/spec/support/concerns/taggable.rb +51 -0
- data/spec/support/concerns/translatable.rb +71 -0
- data/spec/support/concerns/visible.rb +64 -0
- metadata +66 -2
@@ -23,8 +23,8 @@
|
|
23
23
|
<td><%= mail_to u.email %></td>
|
24
24
|
<td><%= t u.active?.to_s %></td>
|
25
25
|
<td class="text-xs-right">
|
26
|
-
<%=
|
27
|
-
<%=
|
26
|
+
<%= link_to_edit [:backend, u] %>
|
27
|
+
<%= link_to_delete [:backend, u] %>
|
28
28
|
</td>
|
29
29
|
</tr>
|
30
30
|
<% end %>
|
@@ -4,6 +4,7 @@
|
|
4
4
|
<div class="dropdown-menu">
|
5
5
|
<%= link_to t('b.pages'), backend_pages_path, class: 'dropdown-item' %>
|
6
6
|
<%= link_to t('b.snippets'), backend_snippets_path, class: 'dropdown-item' %>
|
7
|
+
<%= link_to t('b.files'), backend_assets_path, class: 'dropdown-item' %>
|
7
8
|
</div>
|
8
9
|
</li>
|
9
10
|
|
data/changelog.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
5.2.0 - 2017-03-02
|
2
|
+
--
|
3
|
+
* Add an assets module to manage all kinds of files.
|
4
|
+
* Backend now loads jQuery 3 by default.
|
5
|
+
* You can now mark a model as 'Imageable', which makes it possible to link one
|
6
|
+
or more images (assets) to it. These assets can be reused for other modules
|
7
|
+
as well.
|
8
|
+
|
9
|
+
|
1
10
|
5.1.0 - 2017-02-15
|
2
11
|
--
|
3
12
|
* The users module now orders by last/first name.
|
data/config/locales/en.yml
CHANGED
@@ -106,6 +106,7 @@ en:
|
|
106
106
|
equal_to: must be equal to %{count}
|
107
107
|
even: must be even
|
108
108
|
exclusion: is reserved
|
109
|
+
extension_white_list_error: 'You are not allowed to upload %{extension} files, allowed types: %{allowed_types}'
|
109
110
|
greater_than: must be greater than %{count}
|
110
111
|
greater_than_or_equal_to: must be greater than or equal to %{count}
|
111
112
|
inclusion: is not included in the list
|
@@ -198,7 +199,7 @@ en:
|
|
198
199
|
time:
|
199
200
|
am: am
|
200
201
|
formats:
|
201
|
-
default: ! '%B
|
202
|
+
default: ! '%B %-d, %Y at %Hh%M'
|
202
203
|
timeless: ! '%d %B %Y'
|
203
204
|
short: ! '%d %b at %Hh%M'
|
204
205
|
time_attr: ! '%G-W%V-%uT%R%:z'
|
@@ -1,6 +1,7 @@
|
|
1
1
|
en:
|
2
2
|
b:
|
3
3
|
actions: Actions
|
4
|
+
active: Active
|
4
5
|
add: Add
|
5
6
|
admin: Admin
|
6
7
|
admins: Admins
|
@@ -14,6 +15,7 @@ en:
|
|
14
15
|
description: Description
|
15
16
|
destination: Destination
|
16
17
|
down: Down
|
18
|
+
download: Download
|
17
19
|
edit: Edit
|
18
20
|
email: E-mail
|
19
21
|
emails: E-mails
|
@@ -21,6 +23,8 @@ en:
|
|
21
23
|
email_templates: E-mail templates
|
22
24
|
enabled?: Enabled?
|
23
25
|
extra: Extra
|
26
|
+
file: File
|
27
|
+
files: Files
|
24
28
|
filter: Filter
|
25
29
|
first_name: First name
|
26
30
|
flexible_content: Flexible content
|
@@ -28,6 +32,7 @@ en:
|
|
28
32
|
general: General
|
29
33
|
house_number: House number
|
30
34
|
html_content: HTML content
|
35
|
+
last_changed_at: Last changed at
|
31
36
|
last_name: Last name
|
32
37
|
locale: Locale
|
33
38
|
login: Login
|
@@ -54,6 +59,7 @@ en:
|
|
54
59
|
sender: Sender
|
55
60
|
sent_at: Sent at
|
56
61
|
settings: Settings
|
62
|
+
size: Size
|
57
63
|
snippet: Snippet
|
58
64
|
snippets: Snippets
|
59
65
|
source: Source
|
data/config/locales/fr.yml
CHANGED
data/config/locales/nl.yml
CHANGED
@@ -112,6 +112,7 @@ nl:
|
|
112
112
|
equal_to: moet gelijk zijn aan %{count}
|
113
113
|
even: moet even zijn
|
114
114
|
exclusion: is niet beschikbaar
|
115
|
+
extension_white_list_error: 'Bestanden met de extensie %{extension} zijn niet toegestaan. Wel toegestaan zijn: %{allowed_types}'
|
115
116
|
greater_than: moet groter zijn dan %{count}
|
116
117
|
greater_than_or_equal_to: moet groter dan of gelijk zijn aan %{count}
|
117
118
|
inclusion: is niet in de lijst opgenomen
|
@@ -204,7 +205,7 @@ nl:
|
|
204
205
|
time:
|
205
206
|
am: ! '''s ochtends'
|
206
207
|
formats:
|
207
|
-
default: ! '
|
208
|
+
default: ! '%-d %B %Y om %Hu%M'
|
208
209
|
timeless: ! '%d %B %Y'
|
209
210
|
short: ! '%d %b om %Hu%M'
|
210
211
|
time_attr: ! '%FT%R%:z'
|
@@ -15,6 +15,7 @@ nl:
|
|
15
15
|
description: Beschrijving
|
16
16
|
destination: Bestemming
|
17
17
|
down: Omlaag
|
18
|
+
download: Download
|
18
19
|
edit: Bewerk
|
19
20
|
email: E-mail
|
20
21
|
emails: E-mails
|
@@ -22,6 +23,8 @@ nl:
|
|
22
23
|
email_templates: E-mail templates
|
23
24
|
enabled?: Ingeschakeld?
|
24
25
|
extra: Extra
|
26
|
+
file: Bestand
|
27
|
+
files: Bestanden
|
25
28
|
filter: Filter
|
26
29
|
first_name: Voornaam
|
27
30
|
flexible_content: Flexibele inhoud
|
@@ -29,6 +32,7 @@ nl:
|
|
29
32
|
general: Algemeen
|
30
33
|
house_number: Huisnummer
|
31
34
|
html_content: HTML inhoud
|
35
|
+
last_changed_at: Laatst gewijzigd op
|
32
36
|
last_name: Achternaam
|
33
37
|
locale: Taal
|
34
38
|
login: Inloggen
|
@@ -55,6 +59,7 @@ nl:
|
|
55
59
|
sender: Afzender
|
56
60
|
sent_at: Verzonden op
|
57
61
|
settings: Instellingen
|
62
|
+
size: Grootte
|
58
63
|
snippet: Snippet
|
59
64
|
snippets: Snippets
|
60
65
|
source: Bron
|
data/config/routes.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateAssets < ActiveRecord::Migration[5.0]
|
2
|
+
def change
|
3
|
+
create_table :assets do |t|
|
4
|
+
t.string :filename
|
5
|
+
t.string :content_type
|
6
|
+
t.integer :filesize
|
7
|
+
t.text :description
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
|
12
|
+
add_index :assets, :content_type
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateImages < ActiveRecord::Migration[5.0]
|
2
|
+
def change
|
3
|
+
create_table :images do |t|
|
4
|
+
t.integer :imageable_id
|
5
|
+
t.string :imageable_type
|
6
|
+
t.references :asset
|
7
|
+
t.integer :position
|
8
|
+
t.boolean :visible
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
|
13
|
+
add_index :images, :imageable_id
|
14
|
+
add_index :images, :imageable_type
|
15
|
+
add_index :images, :position
|
16
|
+
add_index :images, :visible
|
17
|
+
end
|
18
|
+
end
|
data/lib/udongo/version.rb
CHANGED
data/readme.md
CHANGED
@@ -61,6 +61,17 @@ Udongo.config.flexible_content.types = %w(text image)
|
|
61
61
|
Udongo.config.flexible_content.allowed_breakpoints = %w(xs sm md lg xl)
|
62
62
|
```
|
63
63
|
|
64
|
+
## Assets
|
65
|
+
### image_white_list
|
66
|
+
```ruby
|
67
|
+
Udongo.config.image_white_list = %w(gif jpeg jpg png)
|
68
|
+
```
|
69
|
+
|
70
|
+
### file_white_list
|
71
|
+
```ruby
|
72
|
+
Udongo.config.file_white_list = %w(doc docx pdf txt xls xlsx)
|
73
|
+
```
|
74
|
+
|
64
75
|
# Concerns
|
65
76
|
## Storable concern
|
66
77
|
### Possible field types
|