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 +4 -4
- data/app/assets/javascripts/biola-wcms-components.js.coffee +3 -0
- data/app/assets/javascripts/components/forms/gallery_photo.js.coffee +18 -0
- data/app/controllers/wcms_application_controller.rb +0 -2
- data/app/views/wcms_components/forms/_json_editor.html.slim +0 -1
- data/biola_wcms_components.gemspec +1 -0
- data/lib/biola_wcms_components.rb +2 -0
- data/lib/biola_wcms_components/version.rb +1 -1
- data/lib/components/gallery_photos.rb +15 -0
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2c32b3a90c9dfe1f3157f18342f6b2a1e291860
|
4
|
+
data.tar.gz: c38f5ee1aa19ebdb87691b7a232096e7ab9abc75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad190102285a081bd675f087733b265be3b47d632d89c9282bd995f045e54efa01bb052361f6271cb9e62181c525566dc9298d1622b7154c64b837b4d2c3cf90
|
7
|
+
data.tar.gz: 9093d7189d408da34af926b4a7148b09bcf6cc6429a817dff8bc3bc7094913774bec7aacc5d383d0bff813fb37bee19fa614bfb2d06e207c07144637539b3384
|
@@ -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"
|
@@ -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'
|
@@ -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.
|
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-
|
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.
|
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
|