refinerycms-page-images 0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
|
|
1
|
+
<div class='wym_skin_refinery page_part' id='page_image_picker'>
|
2
|
+
<div class='wym_area_top'>
|
3
|
+
<ul class='wym_section'>
|
4
|
+
<li>
|
5
|
+
<%= link_to 'Add Image',
|
6
|
+
insert_admin_images_url(
|
7
|
+
:dialog => true,
|
8
|
+
:width => 950,
|
9
|
+
:height => 510,
|
10
|
+
:callback => "image_added"
|
11
|
+
),
|
12
|
+
:id => "add_image_link" %>
|
13
|
+
</li>
|
14
|
+
</ul>
|
15
|
+
</div>
|
16
|
+
<div class='wym_box field images_field'>
|
17
|
+
<ul id='page_images' class='clearfix'>
|
18
|
+
<%= f.fields_for :images do |image_form| %>
|
19
|
+
<li id='image_<%= image_form.object.id %>'>
|
20
|
+
<%= image_form.hidden_field :id %>
|
21
|
+
<%= image_fu image_form.object, '135x135#c' %>
|
22
|
+
</li>
|
23
|
+
<% end %>
|
24
|
+
<li class='empty'>
|
25
|
+
<%= hidden_field_tag "page[images_attributes][#{@page.images.size}][id]" %>
|
26
|
+
</li>
|
27
|
+
</ul>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<% content_for :head do %>
|
32
|
+
<%= javascript_include_tag 'page-image-picker' %>
|
33
|
+
<%= stylesheet_link_tag 'page-image-picker' %>
|
34
|
+
<% end %>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'refinery'
|
2
|
+
|
3
|
+
module Refinery
|
4
|
+
module PageImages
|
5
|
+
class Engine < Rails::Engine
|
6
|
+
initializer "static assets" do |app|
|
7
|
+
app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
|
8
|
+
end
|
9
|
+
|
10
|
+
config.to_prepare do
|
11
|
+
Page.module_eval do
|
12
|
+
|
13
|
+
has_and_belongs_to_many :images
|
14
|
+
accepts_nested_attributes_for :images, :allow_destroy => false
|
15
|
+
|
16
|
+
def images_attributes=(data)
|
17
|
+
self.images.clear
|
18
|
+
self.images += (0..(data.length-1)).collect { |i|
|
19
|
+
(Image.find(data[i.to_s]['id'].to_i) rescue nil)
|
20
|
+
}.compact
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
config.after_initialize do
|
26
|
+
Refinery::Pages::Tab.register do |tab|
|
27
|
+
tab.name = "images"
|
28
|
+
tab.partial = "/admin/pages/tabs/images"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: refinerycms-page-images
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 9
|
9
|
+
version: "0.9"
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Resolve Digital, David Jones
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-10-05 00:00:00 +13:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: Page Images Engine for Refinery CMS
|
22
|
+
email: dave@resolvedigital.com
|
23
|
+
executables: []
|
24
|
+
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files: []
|
28
|
+
|
29
|
+
files:
|
30
|
+
- lib/generators/refinerycms_page_images_generator.rb
|
31
|
+
- lib/refinerycms-page-images.rb
|
32
|
+
- app/models/images_pages.rb
|
33
|
+
- app/views/admin/pages/tabs/_images.html.erb
|
34
|
+
has_rdoc: true
|
35
|
+
homepage: http://github.com/resolve/refinerycms-page-images
|
36
|
+
licenses: []
|
37
|
+
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options: []
|
40
|
+
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
hash: 3
|
49
|
+
segments:
|
50
|
+
- 0
|
51
|
+
version: "0"
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
requirements: []
|
62
|
+
|
63
|
+
rubyforge_project:
|
64
|
+
rubygems_version: 1.3.7
|
65
|
+
signing_key:
|
66
|
+
specification_version: 3
|
67
|
+
summary: Page Images Engine for Refinery CMS
|
68
|
+
test_files: []
|
69
|
+
|