open_porch 0.5.0 → 0.5.1
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/VERSION +1 -1
- data/app/controllers/admin/areas_controller.rb +1 -3
- data/app/helpers/open_porch_helper.rb +0 -9
- data/app/models/area.rb +23 -0
- data/app/views/areas/issues/index.html.haml +1 -2
- data/app/views/areas/issues/show.html.haml +1 -1
- data/app/views/areas/posts/index.html.haml +2 -2
- data/app/views/areas/show.html.haml +1 -1
- data/app/views/user_mailer/new_issue.html.erb +3 -1
- data/app/views/user_mailer/new_issue.text.erb +9 -8
- data/config/open_porch_example.yml +2 -1
- data/open_porch.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
@@ -15,9 +15,7 @@ class Admin::AreasController < Admin::BaseController
|
|
15
15
|
start_date = Time.parse(params[:activity_start_date]).to_date rescue 30.days.ago.to_date
|
16
16
|
end_date = Time.parse(params[:activity_end_date]).to_date rescue Date.today
|
17
17
|
|
18
|
-
@activities = AreaActivity.grouped_by_day
|
19
|
-
.search(:day_between => [start_date, end_date])
|
20
|
-
.where(:area_id => @search.all.collect(&:id))
|
18
|
+
@activities = AreaActivity.grouped_by_day.search(:day_between => [start_date, end_date]).where(:area_id => @search.all.collect(&:id))
|
21
19
|
end
|
22
20
|
|
23
21
|
def new
|
@@ -11,14 +11,5 @@ module OpenPorchHelper
|
|
11
11
|
raw %{update_user_activity('#{current_user.full_name}', '#{url}', '#{(UserActivity::EXPIRES-2) * 1000}');}
|
12
12
|
end
|
13
13
|
end
|
14
|
-
|
15
|
-
def show_ad_for(zone_name, area)
|
16
|
-
return unless defined?(OPEN_PORCH_ZONES)
|
17
|
-
time = Time.now.to_i
|
18
|
-
|
19
|
-
link_to("http://d1.openx.org/ck.php?cb=#{time}&n=a8417ca6", :class => "ad #{zone_name}", :target => '_blank') do
|
20
|
-
image_tag("http://d1.openx.org/avw.php?zoneid=#{OPEN_PORCH_ZONES[zone_name.to_s]}®ion=#{@area.slug}&cb=#{time}&n=a8417ca6")
|
21
|
-
end
|
22
|
-
end
|
23
14
|
end
|
24
15
|
|
data/app/models/area.rb
CHANGED
@@ -141,6 +141,29 @@ class Area < ActiveRecord::Base
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
+
# afr.php returns HTML code
|
145
|
+
def openx_ad(zone_name)
|
146
|
+
return unless defined?(OPEN_PORCH_ZONES)
|
147
|
+
time = Time.now.to_i
|
148
|
+
openx_url = "http://d1.openx.org"
|
149
|
+
|
150
|
+
case zone_name.to_sym
|
151
|
+
when :newsletter_text
|
152
|
+
url = URI.parse(openx_url)
|
153
|
+
res = Net::HTTP.start(url.host, url.port) {|http|
|
154
|
+
http.get("/afr.php?zoneid=#{OPEN_PORCH_ZONES[zone_name.to_s]}®ion=#{self.slug}&cb=#{time}&n=a8417ca6")
|
155
|
+
}
|
156
|
+
res.body.gsub("\n", '').gsub(/.*<body>(.*)<div id='beacon.*/, '\1').html_safe
|
157
|
+
else
|
158
|
+
%{
|
159
|
+
<a href="#{openx_url}/ck.php?cb=#{time}&n=a8417ca6", class="ad #{zone_name}" target="_blank">
|
160
|
+
<img src="http://d1.openx.org/avw.php?zoneid=#{OPEN_PORCH_ZONES[zone_name.to_s]}®ion=#{self.slug}&cb=#{time}&n=a8417ca6" />
|
161
|
+
</a>
|
162
|
+
}.html_safe
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
|
144
167
|
protected
|
145
168
|
def initialize_issue_numbers
|
146
169
|
self.create_issue_number(:sequence_number => 0)
|
@@ -27,5 +27,4 @@
|
|
27
27
|
= link_to "#{next_month.strftime('%b %Y')} »".html_safe, archive_area_issues_path(@area, next_month.year, next_month.month)
|
28
28
|
= render :partial => 'areas/posts/posts_search_form', :locals => {:advanced => true}
|
29
29
|
|
30
|
-
=
|
31
|
-
|
30
|
+
= @area.openx_ad(:current_issue)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
To POST your message, email to <%=
|
1
|
+
To POST your message, email to <%= @issue.area.email %>
|
2
2
|
|
3
3
|
<%= "#{@issue.area.name} NEIGHBORHOOD FORUM NO.#{@issue.number}".upcase %>
|
4
4
|
|
@@ -10,17 +10,18 @@ To POST your message, email to <%= mail_to(@issue.area.email) %>
|
|
10
10
|
<% end %>
|
11
11
|
|
12
12
|
|
13
|
+
----------------------------------------------------------------------------
|
14
|
+
<%= @issue.area.openx_ad(:newsletter_text) %>
|
15
|
+
----------------------------------------------------------------------------
|
13
16
|
|
14
|
-
|
15
|
-
|
17
|
+
|
18
|
+
<% @issue.posts.order(:position).each_with_index do |post, i| %>
|
16
19
|
|
17
20
|
|
18
|
-
<%= post.title.upcase %>
|
19
|
-
By <%= post.user_first_name%> <%= post.user_last_name%>, <%=post.user_address %>, <%=post.user_email %>
|
20
|
-
<%= post.created_at.to_date.to_s(:long) %>
|
21
|
-
Post your note to neighbors: <%= mail_to(@issue.area.email) %>
|
21
|
+
<%= "#{i+1}) #{post.title.upcase}" %>
|
22
|
+
By <%= post.user_first_name%> <%= post.user_last_name%>, <%=post.user_address %>, <%=post.user_email %> on <%= post.created_at.to_date.to_s(:long) %>
|
22
23
|
|
23
|
-
<%= post.content %>
|
24
|
+
<%= post.content.html_safe %>
|
24
25
|
|
25
26
|
<% end %>
|
26
27
|
|
data/open_porch.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{open_porch}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["The Working Group Inc"]
|
12
|
-
s.date = %q{2011-03-
|
12
|
+
s.date = %q{2011-03-24}
|
13
13
|
s.default_executable = %q{open_porch_engine}
|
14
14
|
s.description = %q{}
|
15
15
|
s.email = %q{jack@theworkinggroup.ca}
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: open_porch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.5.
|
5
|
+
version: 0.5.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- The Working Group Inc
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-24 00:00:00 -06:00
|
14
14
|
default_executable: open_porch_engine
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -401,7 +401,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
401
401
|
requirements:
|
402
402
|
- - ">="
|
403
403
|
- !ruby/object:Gem::Version
|
404
|
-
hash:
|
404
|
+
hash: 1285707146431313998
|
405
405
|
segments:
|
406
406
|
- 0
|
407
407
|
version: "0"
|