concerto_simple_rss 0.0.2 → 0.0.3
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/models/simple_rss.rb
CHANGED
@@ -2,6 +2,8 @@ class SimpleRss < DynamicContent
|
|
2
2
|
|
3
3
|
DISPLAY_NAME = 'RSS Feed'
|
4
4
|
|
5
|
+
validate :validate_config
|
6
|
+
|
5
7
|
def build_content
|
6
8
|
require 'rss'
|
7
9
|
require 'net/http'
|
@@ -47,4 +49,13 @@ class SimpleRss < DynamicContent
|
|
47
49
|
attributes = super()
|
48
50
|
attributes.concat([:config => [:url, :output_format]])
|
49
51
|
end
|
52
|
+
|
53
|
+
def validate_config
|
54
|
+
if self.config['url'].blank?
|
55
|
+
errors.add(:config_url, "can't be blank")
|
56
|
+
end
|
57
|
+
if !['headlines', 'detailed'].include?(self.config['output_format'])
|
58
|
+
errors.add(:config_output_format, "must be Headlines or Articles")
|
59
|
+
end
|
60
|
+
end
|
50
61
|
end
|
@@ -4,13 +4,13 @@
|
|
4
4
|
<div class="clearfix">
|
5
5
|
<%= config.label :url %>
|
6
6
|
<div class="input">
|
7
|
-
<%= config.
|
7
|
+
<%= config.url_field :url, :placeholder => 'http://feeds.bbci.co.uk/news/rss.xml', :class => "input-xxlarge", :value => @content.config['url'] %>
|
8
8
|
</div>
|
9
9
|
</div>
|
10
10
|
<div class="clearfix">
|
11
11
|
<%= config.label :output_format, 'Display Format' %>
|
12
12
|
<div class="input">
|
13
|
-
<%= config.select :output_format, [["Headlines", "headlines"], ["Articles", "detailed"]] %>
|
13
|
+
<%= config.select :output_format, [["Headlines", "headlines"], ["Articles", "detailed"]], :selected => @content.config['output_format'] %>
|
14
14
|
</div>
|
15
15
|
</div>
|
16
16
|
<% end %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concerto_simple_rss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-30 00:00:00.000000000 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
|
-
requirement: &
|
17
|
+
requirement: &70276077747540 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 3.2.11
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70276077747540
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: sqlite3
|
28
|
-
requirement: &
|
28
|
+
requirement: &70276077745540 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70276077745540
|
37
37
|
description: Simple support to render RSS content in Concerto 2.
|
38
38
|
email:
|
39
39
|
- bmichalski@gmail.com
|
@@ -45,6 +45,7 @@ files:
|
|
45
45
|
- app/models/simple_rss.rb
|
46
46
|
- app/views/contents/simple_rss/_form_top.html
|
47
47
|
- app/views/contents/simple_rss/_render_default.html
|
48
|
+
- app/views/contents/simple_rss/_render_tile.html
|
48
49
|
- config/routes.rb
|
49
50
|
- lib/concerto_simple_rss/engine.rb
|
50
51
|
- lib/concerto_simple_rss/version.rb
|