refinerycms-page-images 1.0.1 → 1.0.2
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.
- data/app/views/admin/pages/tabs/_images_field.html.erb +4 -2
- data/features/attach_page_images.feature +17 -0
- data/lib/gemspec.rb +1 -1
- data/lib/refinerycms-page-images.rb +5 -1
- data/public/javascripts/page-image-picker.js +7 -3
- data/public/stylesheets/page-image-picker.css +3 -0
- data/readme.md +1 -1
- metadata +2 -1
@@ -10,7 +10,8 @@
|
|
10
10
|
<%= text_area_tag "#{f.object_name}[images_attributes][#{index}][caption]",
|
11
11
|
f.object.caption_for_image_index(index),
|
12
12
|
:style => 'display: none',
|
13
|
-
:id => "page_captions_#{index}"
|
13
|
+
:id => "page_captions_#{index}",
|
14
|
+
:class => 'page_caption' %>
|
14
15
|
</div>
|
15
16
|
<% end %>
|
16
17
|
</li>
|
@@ -22,7 +23,8 @@
|
|
22
23
|
<%= text_area_tag "#{f.object_name}[images_attributes][#{f.object.images.size}][caption]",
|
23
24
|
'',
|
24
25
|
:style => 'display: none',
|
25
|
-
:id => "page_captions_#{f.object.images.size}"
|
26
|
+
:id => "page_captions_#{f.object.images.size}",
|
27
|
+
:class => 'page_caption' %>
|
26
28
|
</div>
|
27
29
|
<% end %>
|
28
30
|
</li>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
@refinerycms @pages @pages-manage @page-images
|
2
|
+
Feature: Attach Page Images
|
3
|
+
In order to control the content on my website
|
4
|
+
As an administrator
|
5
|
+
I want to create and manage page images
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given I am a logged in refinery user
|
9
|
+
And I have pages titled Home, About
|
10
|
+
When I go to the list of pages
|
11
|
+
And I follow "Edit this page"
|
12
|
+
|
13
|
+
Scenario: Page Edit Shows Images Tab
|
14
|
+
Then I should see "Images" within "#custom_images_tab"
|
15
|
+
|
16
|
+
Scenario: Add Image Button appears
|
17
|
+
Then I should see "Add Image"
|
data/lib/gemspec.rb
CHANGED
@@ -37,10 +37,14 @@ module Refinery
|
|
37
37
|
end
|
38
38
|
|
39
39
|
config.after_initialize do
|
40
|
-
Refinery::Pages::Tab.register do |tab|
|
40
|
+
::Refinery::Pages::Tab.register do |tab|
|
41
41
|
tab.name = "images"
|
42
42
|
tab.partial = "/admin/pages/tabs/images"
|
43
43
|
end
|
44
|
+
::Refinery::Plugin.register do |plugin|
|
45
|
+
plugin.name = "refinerycms_page_images"
|
46
|
+
plugin.hide_from_menu = true
|
47
|
+
end
|
44
48
|
end
|
45
49
|
end
|
46
50
|
end
|
@@ -45,9 +45,13 @@ reset_functionality = function() {
|
|
45
45
|
reindex_images();
|
46
46
|
});
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
if ($(this).find('textarea.page_caption').length > 0) {
|
49
|
+
img_caption = $("<img src='/images/refinery/icons/user_comment.png' width='16' height='16' class='caption' />");
|
50
|
+
img_caption.appendTo(image_actions);
|
51
|
+
img_caption.click(open_image_caption);
|
52
|
+
} else {
|
53
|
+
image_actions.addClass('no_captions');
|
54
|
+
}
|
51
55
|
|
52
56
|
image_actions.appendTo($(this));
|
53
57
|
}
|
data/readme.md
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: refinerycms-page-images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Resolve Digital
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- app/views/admin/pages/tabs/_images_field.html.erb
|
43
43
|
- db/migrate/20101014230041_create_page_images.rb
|
44
44
|
- db/migrate/20101014230042_add_caption_to_image_pages.rb
|
45
|
+
- features/attach_page_images.feature
|
45
46
|
- lib/gemspec.rb
|
46
47
|
- lib/generators/refinerycms_page_images_generator.rb
|
47
48
|
- lib/refinerycms-page-images.rb
|