spina 2.9.0 → 2.9.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spina might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3d8217bb30f0c85ecf1680a8f3d951cb2e958d993e51ad467b078ab4fda9670
4
- data.tar.gz: 523554889c7c32b1e966131b377ad6004f8093248a25459fe2ae09810edc2d4b
3
+ metadata.gz: 4ef91e5dd1c106347beca681a8cf055e3dd9ca7753a86305e1fd7a79624b24ac
4
+ data.tar.gz: 63ef08f9333d470b982a23fe33f0c258d7610adbee22fd5d6f59be78d317ac1c
5
5
  SHA512:
6
- metadata.gz: 6b2786876a21c1056a9f7d0dff1e3cf8eb4243b9310cbfa36fde3608a623943e199de1f1505be5bb8c61f53ad663a124dc2a914b8c1172e59d266a6747c906b7
7
- data.tar.gz: ec28bbdf8802db18df4f99fab9343a309e079792fd2c1b99866bcb76db9b034c2f3cbc70aaf0827e0ced5350693aad3be12ea7a330ddcaf82f0537ae59059217
6
+ metadata.gz: 55001a4b71435d2cb16cca6402538e815ce165a74d983164ec35aafdf9866a3d2bea0aefecbc042c0df927f62023de652f5dd0e10040355662dd38a0eb9d7d12
7
+ data.tar.gz: 85032055e23c4545acdbb21ef8dbd49d8517991a88f7270bc3c59917b482f665268ed8ba880533010e68dba4a1a6c1bcea6c69110bd83ec20b3ea296a1872c84
@@ -17,10 +17,12 @@ module Spina
17
17
 
18
18
  def create
19
19
  @attachments = params[:attachment][:files].map do |file|
20
+ next if file.blank? # Skip the blank string posted by the hidden files[] field
21
+
20
22
  attachment = Attachment.create(attachment_params)
21
23
  attachment.file.attach(file)
22
24
  attachment
23
- end
25
+ end.compact
24
26
 
25
27
  respond_to do |format|
26
28
  format.turbo_stream { render turbo_stream: turbo_stream.prepend("attachments", partial: "attachment", collection: @attachments)}
@@ -93,12 +93,11 @@ module Spina
93
93
  end
94
94
 
95
95
  def add_index_breadcrumb
96
- path = spina.admin_pages_path
97
96
  if @page.resource
98
- path = spina.admin_pages_path(resource_id: @page.resource_id)
97
+ add_breadcrumb @page.resource.label, spina.admin_pages_path(resource_id: @page.resource_id), class: 'text-gray-400'
98
+ else
99
+ add_breadcrumb t('spina.website.pages'), spina.admin_pages_path, class: 'text-gray-400'
99
100
  end
100
-
101
- add_breadcrumb t('spina.website.pages'), path, class: 'text-gray-400'
102
101
  end
103
102
 
104
103
  def page_params
@@ -24,6 +24,13 @@ module Spina
24
24
  ResourcePagesUpdateJob.perform_later(id)
25
25
  end
26
26
  end
27
+
28
+ def order_by_options
29
+ [
30
+ [Spina::Page.human_attribute_name(:title), "title"],
31
+ [Spina::Page.human_attribute_name(:created_at), "created_at"]
32
+ ]
33
+ end
27
34
 
28
35
  end
29
36
  end
@@ -20,7 +20,7 @@ module Spina
20
20
  end
21
21
 
22
22
  def render_embeds(html)
23
- doc = Nokogiri::HTML(html)
23
+ doc = Nokogiri::HTML.fragment(html)
24
24
  doc.css(embed_selector).each do |node|
25
25
  node.replace render_embed(node.first_element_child)
26
26
  end
@@ -42,4 +42,4 @@ module Spina
42
42
  end
43
43
 
44
44
  end
45
- end
45
+ end
@@ -52,7 +52,7 @@
52
52
 
53
53
  <div class="mt-5">
54
54
  <%= f.label :order_by, class: 'font-medium text-sm text-gray-700 block' %>
55
- <%= f.select :order_by, [[Spina::Page.human_attribute_name(:title), "title"], [Spina::Page.human_attribute_name(:created_at), "created_at"]], {include_blank: t('spina.resources.manual_sorting')}, class: 'form-select' %>
55
+ <%= f.select :order_by, f.object.order_by_options, {include_blank: t('spina.resources.manual_sorting')}, class: 'form-select' %>
56
56
  </div>
57
57
  </div>
58
58
  </div>
@@ -13,6 +13,12 @@ de:
13
13
  spina/embeds/vimeo:
14
14
  url: vimeo.com/...
15
15
  activerecord:
16
+ errors:
17
+ models:
18
+ spina/page:
19
+ attributes:
20
+ title:
21
+ blank: Titel erforderlich
16
22
  attributes:
17
23
  spina/account:
18
24
  address: Adresse
@@ -277,6 +283,7 @@ de:
277
283
  save_draft: Entwurf speichern
278
284
  saved: Seite gespeichert
279
285
  saving: wird gespeichert...
286
+ couldnt_be_saved: Seite konnte nicht gespeichert werden
280
287
  search_engines: Suchmaschinen
281
288
  show_in_menu: unsichtbar
282
289
  skip_to_first_child: Zur ersten Unterseite weiterleiten
@@ -6,6 +6,12 @@ en:
6
6
  spina/embeds/vimeo:
7
7
  url: vimeo.com/...
8
8
  activerecord:
9
+ errors:
10
+ models:
11
+ spina/page:
12
+ attributes:
13
+ title:
14
+ blank: Title required
9
15
  attributes:
10
16
  spina/account:
11
17
  address: Address
@@ -270,6 +276,7 @@ en:
270
276
  save_draft: Save draft
271
277
  saved: Page saved
272
278
  saving: Saving...
279
+ couldnt_be_saved: Page couldn't be saved
273
280
  search_engines: Search engines
274
281
  show_in_menu: invisible
275
282
  skip_to_first_child: forward to first child page
data/lib/spina/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Spina
2
- VERSION = "2.9.0"
2
+ VERSION = "2.9.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spina
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0
4
+ version: 2.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bram Jetten
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-15 00:00:00.000000000 Z
11
+ date: 2022-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails