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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf8e1acf502fbd64b327828a28af4ec8452a22e2e81c103ad853636ccde3eea1
4
- data.tar.gz: f46e38dcc0c9a6e88abde1bee9f1d0ecfc9395926985450cd31206eea5ea5847
3
+ metadata.gz: 50253fea48d53beb3fa281b4b1d50b0200f185c0f64bcfa6e5f9d2bb191c6e7e
4
+ data.tar.gz: ada89edeccdd49639b147a6da870490fc4661c73c530e9340611556281029ac4
5
5
  SHA512:
6
- metadata.gz: da8787b13f4fafd83d1b33d7069254c9c1a0cd214fb11fca79c28d7592ae6536e912d497dff829b5ef9a0eba53d14ce30a9b2ceceb52564d04c7ac0e7dc11fff
7
- data.tar.gz: 9771f950a95113c250d8c44ab7ccf0e41369b9d56644a4f4b9cb1f25cb956a33152682e6fb4749c04ae1bf67f382f4d5ce6f5f16c798f63c4c4423cc078c3747
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](http://www.refinerycms.com/about).
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
+ })()
@@ -852,7 +852,7 @@ input.datepicker
852
852
  &:hover .button
853
853
  background: tint(#efefef, 20%)
854
854
 
855
- &:active .button
855
+ .button:active
856
856
  background: shade(#efefef, 10%)
857
857
 
858
858
  .placeholder
@@ -28,7 +28,7 @@ module Spina
28
28
  private
29
29
 
30
30
  def account_params
31
- params.require(:account).permit(:address, :city, :email, :logo, :name, :phone,
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,
@@ -17,7 +17,7 @@ module Spina
17
17
 
18
18
  def select
19
19
  if params[:multiple]
20
- @images = Image.find(params[:image_ids])
20
+ @images = Image.where(id: params[:image_ids])
21
21
  else
22
22
  @image = Image.find(params[:image_id])
23
23
  end
@@ -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'
@@ -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'}
@@ -101,6 +101,7 @@ en:
101
101
  upload: Upload images
102
102
  choose_images: Choose images
103
103
  choose_image: Choose image
104
+ remove_image: Remove image
104
105
 
105
106
  wysiwyg:
106
107
  paragraph: Paragraph
@@ -47,6 +47,7 @@ nl:
47
47
  delete: Verwijderen
48
48
  upload: kies een bestand
49
49
  choose_image: Kies afbeelding
50
+ remove_image: Verwijder afbeelding
50
51
 
51
52
  forgot_password:
52
53
  new: Wachtwoord vergeten
@@ -8,7 +8,6 @@ class CreateSpinaTables < ActiveRecord::Migration[4.2]
8
8
  t.string "phone"
9
9
  t.string "email"
10
10
  t.text "preferences"
11
- t.string "logo"
12
11
  t.datetime "created_at", null: false
13
12
  t.datetime "updated_at", null: false
14
13
  t.boolean "robots_allowed", default: false
@@ -1,3 +1,3 @@
1
1
  module Spina
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.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: 1.0.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-05-26 00:00:00.000000000 Z
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