refinerycms-llama_widgets 0.3.1 → 0.3.2

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: 12a086de20f385987fff68af989ab4eca27ecaf3
4
- data.tar.gz: 4e8c07283a9f5476fda3f96a8865afd881306671
3
+ metadata.gz: 1ff06218d50dde16d6c646b890412b19c00c1b42
4
+ data.tar.gz: c103695c6a508ffa3c73c871907387318731bd80
5
5
  SHA512:
6
- metadata.gz: ab052408908c66cda65ded8cce7621d8af63bb6749fb7b62dae5b448520a5f27c8b90a0aa6f9a6995dfafa67c5a2c598749e7e5eb24fec69564b2f15afde770a
7
- data.tar.gz: fd0158531119b7759f9ba844e9db4b3f58a220c09b5a74b6c15e844edd496e48744298eb6102970a0e7de3371dab42a6d6434e69f19bea43d1227daed8c24a09
6
+ metadata.gz: 42b7846356fe8a6d555318e00bab5466ae3ce0052443e7d6957576b13fac1667c30835446ee0f4107a15385e6df2821732cda717ede6229686eb3a2bf30f4bf4
7
+ data.tar.gz: 779b2d7df2f2ddb86a5067a4cf04748e5b96f6d542f454a3c8cbcb221a72b7aecc25a5e186adc8114fc73aae74d7499729fe4bdd2b4c8799c56f87f8a3cfd183
@@ -0,0 +1,11 @@
1
+ module Refinery
2
+ module Widgets
3
+ class AdvertWidget < ActiveRecord::Base
4
+
5
+ acts_as_widget
6
+
7
+ belongs_to :image, class_name: '::Refinery::Image'
8
+
9
+ end
10
+ end
11
+ end
@@ -97,7 +97,7 @@ module Refinery
97
97
  private
98
98
 
99
99
  def update_widget
100
- widget.attributes = @widget_attributes if widget
100
+ widget.attributes = @widget_attributes if widget && @widget_attributes
101
101
  end
102
102
 
103
103
  def validate_widget
@@ -0,0 +1,2 @@
1
+ .widget.advert_widget
2
+ = link_to image_tag(widget.sub_type_instance.image.image.url), widget.sub_type_instance.url
@@ -0,0 +1,8 @@
1
+ .field
2
+ = f.label :name
3
+ = f.text_field :name, :class => 'widest'
4
+ .field
5
+ = f.label :url
6
+ = f.text_field :url, :class => 'widest'
7
+ = render partial: 'refinery/admin/image_picker',
8
+ locals: { f: f, field: :image_id, image: f.object.image }
@@ -0,0 +1,6 @@
1
+ .field
2
+ = f.label :name
3
+ = raw f.object.name
4
+ .field
5
+ = f.label :url
6
+ = raw f.object.url
@@ -0,0 +1,18 @@
1
+ class CreateWidgetsAdvertWidgets < ActiveRecord::Migration
2
+
3
+ def up
4
+ create_table :refinery_widgets_advert_widgets do |t|
5
+ t.integer :widget_id
6
+ t.integer :image_id
7
+ t.string :name
8
+ t.text :url
9
+ end
10
+
11
+ end
12
+
13
+ def down
14
+ drop_table :refinery_widgets_advert_widgets
15
+
16
+ end
17
+
18
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-llama_widgets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Bolt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-22 00:00:00.000000000 Z
12
+ date: 2014-07-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: refinerycms-core
@@ -101,6 +101,7 @@ files:
101
101
  - app/decorators/models/refinery/page.rb
102
102
  - app/decorators/models/refinery/page_part.rb
103
103
  - app/helpers/refinery/widgets/widgets_helper.rb
104
+ - app/models/refinery/widgets/advert_widget.rb
104
105
  - app/models/refinery/widgets/content_block_widget.rb
105
106
  - app/models/refinery/widgets/template.rb
106
107
  - app/models/refinery/widgets/template_part.rb
@@ -116,6 +117,7 @@ files:
116
117
  - app/views/refinery/admin/pages/_page_part.slim
117
118
  - app/views/refinery/admin/pages/_template_changer.html.erb
118
119
  - app/views/refinery/admin/pages/_widget_fields.slim
120
+ - app/views/refinery/widgets/_advert_widget.html.slim
119
121
  - app/views/refinery/widgets/_content_block_widget.slim
120
122
  - app/views/refinery/widgets/_widget.slim
121
123
  - app/views/refinery/widgets/admin/templates/_actions.html.erb
@@ -135,6 +137,8 @@ files:
135
137
  - app/views/refinery/widgets/admin/widget_types/new_for_template.slim
136
138
  - app/views/refinery/widgets/admin/widget_types/show_for_page.slim
137
139
  - app/views/refinery/widgets/admin/widget_types/show_for_template.slim
140
+ - app/views/refinery/widgets/admin/widgets/_advert_widget.html.slim
141
+ - app/views/refinery/widgets/admin/widgets/_advert_widget_preview.slim
138
142
  - app/views/refinery/widgets/admin/widgets/_content_block_widget.slim
139
143
  - app/views/refinery/widgets/admin/widgets/_content_block_widget_preview.slim
140
144
  - app/views/refinery/widgets/admin/widgets/_widget.slim
@@ -158,6 +162,7 @@ files:
158
162
  - db/migrate/5_add_template_id_to_refinery_pages.rb
159
163
  - db/migrate/6_add_locked_to_refinery_page_parts.rb
160
164
  - db/migrate/7_add_reuse_to_refinery_widgets.rb
165
+ - db/migrate/8_create_widgets_advert_widgets.rb
161
166
  - db/seeds.rb
162
167
  - lib/generators/refinery/templates/config/initializers/refinery/widgets.rb.erb
163
168
  - lib/generators/refinery/widgets_generator.rb