biola_wcms_components 0.11.0 → 0.12.0

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: 15c3fcc2fbe8a94ac07b1a262c7bdd991774dfcd
4
- data.tar.gz: 36947f8497653fa1e1846a81c2792005f85ee32e
3
+ metadata.gz: b2c32b3a90c9dfe1f3157f18342f6b2a1e291860
4
+ data.tar.gz: c38f5ee1aa19ebdb87691b7a232096e7ab9abc75
5
5
  SHA512:
6
- metadata.gz: cb5a57ce8c2de76f6cce19eaf540ef3d45a331177f9f8de11429d7aecebdfa0a3bf853a7a983b6a305022eeebc873a66aef54b9ee3f7ea9d2eeac51c4551a0d5
7
- data.tar.gz: 80d6a1c9a1c446b3a660d7561b40f597d7a984bbd246d3867ca5000879180ec9883fd8554411c7444822619c255d1d1739b7bcce5243076087367b205e6cda61
6
+ metadata.gz: ad190102285a081bd675f087733b265be3b47d632d89c9282bd995f045e54efa01bb052361f6271cb9e62181c525566dc9298d1622b7154c64b837b4d2c3cf90
7
+ data.tar.gz: 9093d7189d408da34af926b4a7148b09bcf6cc6429a817dff8bc3bc7094913774bec7aacc5d383d0bff813fb37bee19fa614bfb2d06e207c07144637539b3384
@@ -7,6 +7,9 @@
7
7
  #= require handlebars
8
8
  #= require typeahead
9
9
  #
10
+ # Needed for gallery photo sorting component
11
+ #= require jquery-ui/sortable
12
+ #
10
13
  #= require bootstrap-multiselect
11
14
  #= require bootstrap-tagsinput
12
15
  #
@@ -0,0 +1,18 @@
1
+ $(document).ready ->
2
+
3
+ $('.gallery_photos.sortable').sortable
4
+ items: ".gallery_photo"
5
+ containment: "parent"
6
+ start: (e, info) ->
7
+ info.item.siblings(".selected").not(".ui-sortable-placeholder").appendTo info.item
8
+
9
+ stop: (e, info) ->
10
+ info.item.after info.item.find("li")
11
+
12
+ update: ->
13
+ $.ajax
14
+ type: "PUT"
15
+ # url: ROOT_URL + "gallery_photos/sort"
16
+ url: (location.protocol + '//' + location.host + location.pathname).replace(/(\/$|\/edit)/, '') + "/gallery_photos/sort"
17
+ data: $(this).sortable("serialize")
18
+ dataType: "script"
@@ -2,8 +2,6 @@
2
2
  class WcmsApplicationController < ActionController::Base
3
3
  include Pundit
4
4
 
5
- protect_from_forgery with: :exception
6
-
7
5
  before_action :authenticate!
8
6
  after_action :verify_authorized
9
7
  after_action :verify_policy_scoped, only: :index
@@ -10,4 +10,3 @@ ruby:
10
10
 
11
11
  .ace_json_editor
12
12
  = wcms_component("forms/text_area", {form: form, attribute: attribute, html_class: html_class, value: value})
13
-
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency "buweb_content_models", ">= 0.82"
23
23
  spec.add_dependency "coffee-rails", ">= 4.0"
24
24
  spec.add_dependency "chronic_ping", "~> 0.4"
25
+ spec.add_dependency "jquery-ui-rails"
25
26
  spec.add_dependency "pundit", "~> 0.3"
26
27
  spec.add_dependency "sass-rails", ">= 4.0"
27
28
  spec.add_dependency "slim", ">= 2.0"
@@ -3,6 +3,7 @@ require "biola_wcms_components/engine" if defined?(::Rails)
3
3
  require "ace-rails-ap"
4
4
  require "buweb_content_models"
5
5
  require "chronic_ping"
6
+ require "jquery-ui-rails"
6
7
  require "pundit"
7
8
  require "coffee-rails"
8
9
  require "sass-rails"
@@ -22,5 +23,6 @@ end
22
23
 
23
24
 
24
25
  autoload :CasAuthentication, 'components/cas_authentication'
26
+ autoload :GalleryPhotos, 'components/gallery_photos'
25
27
  autoload :MenuBlock, 'components/menu_block'
26
28
  autoload :PresentationDataEditor, 'components/presentation_data_editor'
@@ -1,3 +1,3 @@
1
1
  module BiolaWcmsComponents
2
- VERSION = "0.11.0"
2
+ VERSION = "0.12.0"
3
3
  end
@@ -0,0 +1,15 @@
1
+ class GalleryPhotos
2
+ attr_reader :parent
3
+ attr_reader :params
4
+
5
+ def initialize(parent, params)
6
+ @parent = parent
7
+ @params = params
8
+ end
9
+
10
+ def sort_gallery_photos_for_parent
11
+ params[:gallery_photos].each_with_index do |id, index|
12
+ parent.gallery_photos.find(id).update_attributes(order: index+1)
13
+ end
14
+ end
15
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biola_wcms_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Hall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-04 00:00:00.000000000 Z
11
+ date: 2015-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ace-rails-ap
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: jquery-ui-rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: pundit
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -151,6 +165,7 @@ files:
151
165
  - Rakefile
152
166
  - app/assets/images/.gitkeep
153
167
  - app/assets/javascripts/biola-wcms-components.js.coffee
168
+ - app/assets/javascripts/components/forms/gallery_photo.js.coffee
154
169
  - app/assets/javascripts/components/forms/json_editor.js.coffee
155
170
  - app/assets/javascripts/components/forms/multiselect.js.coffee
156
171
  - app/assets/javascripts/components/forms/person_lookup.js.coffee
@@ -204,6 +219,7 @@ files:
204
219
  - lib/biola_wcms_components/engine.rb
205
220
  - lib/biola_wcms_components/version.rb
206
221
  - lib/components/cas_authentication.rb
222
+ - lib/components/gallery_photos.rb
207
223
  - lib/components/menu_block.rb
208
224
  - lib/components/presentation_data_editor.rb
209
225
  - vendor/assets/javascripts/bootstrap-multiselect.js
@@ -238,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
254
  version: '0'
239
255
  requirements: []
240
256
  rubyforge_project:
241
- rubygems_version: 2.4.6
257
+ rubygems_version: 2.2.2
242
258
  signing_key:
243
259
  specification_version: 4
244
260
  summary: Reusable UX components for use in or WCMS projects