spina 1.0.0 → 1.0.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 +4 -4
- data/README.md +2 -2
- data/app/assets/javascripts/spina/admin/controllers/image_form_controller.js +21 -0
- data/app/assets/stylesheets/spina/_forms.sass +1 -1
- data/app/controllers/spina/admin/accounts_controller.rb +1 -1
- data/app/controllers/spina/admin/media_picker_controller.rb +1 -1
- data/app/controllers/spina/admin/pages_controller.rb +0 -3
- data/app/models/spina/page.rb +0 -1
- data/app/views/spina/admin/accounts/style.html.haml +0 -7
- data/app/views/spina/admin/media_picker/select.js.erb +1 -0
- data/app/views/spina/admin/partables/images/_form.html.haml +10 -3
- data/config/locales/en.yml +1 -0
- data/config/locales/nl.yml +1 -0
- data/db/migrate/1_create_spina_tables.rb +0 -1
- data/lib/spina/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50253fea48d53beb3fa281b4b1d50b0200f185c0f64bcfa6e5f9d2bb191c6e7e
|
4
|
+
data.tar.gz: ada89edeccdd49639b147a6da870490fc4661c73c530e9340611556281029ac4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdfd4ee732b880604104ba8fc0aa6064e1fe7e9c807b73a9cfc9466ad054e555fdb0e74504baf55989c746f00acd5812b2299c1b224f04748886adfc60e1dd8f
|
7
|
+
data.tar.gz: db3e730dc7ec2dcc252bed01e9eac095b954eb68eb2dff0afca7b971c29c659d3b480b891642e8b8b5b5de4e51c1fe61cb529886adc5a7877889854aa21d1c59
|
data/README.md
CHANGED
@@ -255,7 +255,7 @@ You can define custom pages for your theme that will be generated when bootstrap
|
|
255
255
|
|
256
256
|
Check our [Contributing Guide](CONTRIBUTING.md) for instructions on how to help the project.
|
257
257
|
|
258
|
-
<a href="graphs/contributors"><img src="https://opencollective.com/Spina/contributors.svg?width=890" /></a>
|
258
|
+
<a href="https://github.com/SpinaCMS/Spina/graphs/contributors"><img src="https://opencollective.com/Spina/contributors.svg?width=890" /></a>
|
259
259
|
|
260
260
|
|
261
261
|
# Backers
|
@@ -288,6 +288,6 @@ Spina is released under the [MIT license](LICENSE.md).
|
|
288
288
|
|
289
289
|
# Credits
|
290
290
|
|
291
|
-
Some parts of Spina are heavily influenced by the wonderful Refinery CMS. Credits to [the Refinery team](
|
291
|
+
Some parts of Spina are heavily influenced by the wonderful Refinery CMS. Credits to [the Refinery team](https://www.refinerycms.com/).
|
292
292
|
|
293
293
|
All icons in Spina were made by Brent Jackson [Geomicons](http://jxnblk.com/geomicons-wired/).
|
@@ -0,0 +1,21 @@
|
|
1
|
+
(() => {
|
2
|
+
const application = Stimulus.Application.start()
|
3
|
+
|
4
|
+
application.register("image-form", class extends Stimulus.Controller {
|
5
|
+
static get targets() {
|
6
|
+
return ["image", "field", "button"]
|
7
|
+
}
|
8
|
+
|
9
|
+
remove(e) {
|
10
|
+
// Prevent link
|
11
|
+
e.preventDefault()
|
12
|
+
e.stopPropagation()
|
13
|
+
|
14
|
+
// Remove image and reset field
|
15
|
+
this.imageTarget.remove()
|
16
|
+
this.buttonTarget.remove()
|
17
|
+
this.fieldTarget.value = null
|
18
|
+
}
|
19
|
+
|
20
|
+
})
|
21
|
+
})()
|
@@ -28,7 +28,7 @@ module Spina
|
|
28
28
|
private
|
29
29
|
|
30
30
|
def account_params
|
31
|
-
params.require(:account).permit(:address, :city, :email, :
|
31
|
+
params.require(:account).permit(:address, :city, :email, :name, :phone,
|
32
32
|
:postal_code, :preferences, :google_analytics,
|
33
33
|
:google_site_verification, :facebook, :twitter, :google_plus,
|
34
34
|
:kvk_identifier, :theme, :vat_identifier, :robots_allowed,
|
@@ -53,9 +53,6 @@ module Spina
|
|
53
53
|
format.html { redirect_to spina.edit_admin_page_url(@page, params: {locale: @locale}), flash: {success: t('spina.pages.saved')} }
|
54
54
|
format.js
|
55
55
|
else
|
56
|
-
50.times do
|
57
|
-
Rails.logger.info @page.errors.inspect
|
58
|
-
end
|
59
56
|
format.html do
|
60
57
|
@page_parts = @page.view_template_page_parts(current_theme).map { |part| @page.part(part) }
|
61
58
|
render :edit, layout: 'spina/admin/admin'
|
data/app/models/spina/page.rb
CHANGED
@@ -38,7 +38,6 @@ module Spina
|
|
38
38
|
|
39
39
|
before_validation :set_materialized_path
|
40
40
|
validates :title, presence: true
|
41
|
-
validates :materialized_path, uniqueness: true
|
42
41
|
|
43
42
|
translates :title, :description, :materialized_path
|
44
43
|
translates :menu_title, :seo_title, default: -> { title }
|
@@ -16,13 +16,6 @@
|
|
16
16
|
.select-dropdown.account-theme{data: {layout_parts: current_theme.layout_parts.map{|layout_part| layout_part[:name]}}}
|
17
17
|
- options = options_for_select(::Spina::Theme.all.map { |theme| [theme.name, theme.name, {'data-layout-parts' => theme.layout_parts.map{|layout_part| layout_part[:name] }}] }, current_account.theme)
|
18
18
|
= f.select :theme, options
|
19
|
-
|
20
|
-
.horizontal-form-group
|
21
|
-
.horizontal-form-label
|
22
|
-
= Spina::Account.human_attribute_name(:logo)
|
23
|
-
.horizontal-form-content
|
24
|
-
= image_tag current_account.logo.url if current_account.logo.present?
|
25
|
-
= f.file_field :logo
|
26
19
|
|
27
20
|
= f.fields_for :layout_parts do |ff|
|
28
21
|
.horizontal-form-group.layout-part{data: {name: ff.object.name}}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
let hidden_input = $("input[data-hidden-field-id='<%= j params[:hidden_field_id] %>']");
|
2
2
|
hidden_input.parents('.media_picker').find('.image').remove();
|
3
|
+
hidden_input.val("");
|
3
4
|
|
4
5
|
<% if @image.present? %>
|
5
6
|
hidden_input.parents('.media_picker').append("<%=j render partial: 'spina/admin/images/image', object: @image, locals: {simple: true} %>");
|
@@ -1,14 +1,21 @@
|
|
1
1
|
.horizontal-form-label
|
2
2
|
= f.object.title
|
3
|
-
.horizontal-form-content
|
3
|
+
.horizontal-form-content{data: {controller: "image-form"}}
|
4
4
|
= link_to admin_media_picker_path(selected_ids: [f.object.partable_id], hidden_field_id: "media_picker_#{f.object.object_id}"), remote: true, class: 'media_picker clearfix' do
|
5
5
|
.placeholder
|
6
6
|
%span.button.button-small.button-round
|
7
7
|
%i.icon.icon-dots
|
8
8
|
=t 'spina.images.choose_image'
|
9
9
|
|
10
|
+
- if f.object.partable.file.attached?
|
11
|
+
%br/
|
12
|
+
|
13
|
+
%span.button.button-small.button-round{data: {action: "click->image-form#remove", target: "image-form.button"}}
|
14
|
+
%i.icon.icon-trash
|
15
|
+
=t 'spina.images.remove_image'
|
16
|
+
|
10
17
|
- if f.object.partable.file.attached?
|
11
|
-
.image
|
18
|
+
.image{data: {target: 'image-form.image'}}
|
12
19
|
= image_tag variant(f.object.partable.file, resize: "300x300^", crop: "300x300+0+0")
|
13
20
|
|
14
|
-
= f.hidden_field :partable_id, data: {hidden_field_id: "media_picker_#{f.object.object_id}"}
|
21
|
+
= f.hidden_field :partable_id, data: {hidden_field_id: "media_picker_#{f.object.object_id}", target: 'image-form.field'}
|
data/config/locales/en.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/lib/spina/version.rb
CHANGED
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: 1.0.
|
4
|
+
version: 1.0.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: 2018-
|
11
|
+
date: 2018-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -304,6 +304,7 @@ files:
|
|
304
304
|
- app/assets/javascripts/spina/admin/account.coffee
|
305
305
|
- app/assets/javascripts/spina/admin/application.js
|
306
306
|
- app/assets/javascripts/spina/admin/confirm_delete.coffee.erb
|
307
|
+
- app/assets/javascripts/spina/admin/controllers/image_form_controller.js
|
307
308
|
- app/assets/javascripts/spina/admin/controllers/infinite_scroll_controller.js
|
308
309
|
- app/assets/javascripts/spina/admin/dropdown.coffee
|
309
310
|
- app/assets/javascripts/spina/admin/forms.coffee
|