Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
4 app/models/entry.rb
View
@@ -364,10 +364,6 @@ def regulations_dot_gov_comments_close_on=(date)
end
end
- def regulations_dot_gov_comment_period_open?
- (regulations_dot_gov_comments_close_on && regulations_dot_gov_comments_close_on >= Date.current) || (regulations_dot_gov_comments_close_on.nil? && comment_url && comments_close_on && comments_close_on >= Date.current)
- end
-
def source_url(format)
case format.to_sym
when :mods
13 app/views/entries/show.html.erb
View
@@ -10,18 +10,21 @@
<div id="metadata_content_area">
<%= render :partial => "header", :locals => {:entry => @entry} %>
- <% if (@entry.comments_close_on.present? && @entry.comments_close_on >= Time.current.to_date) || @entry.regulations_dot_gov_comment_period_open? %>
+ <% if (@entry.comments_close_on.present? && @entry.comments_close_on >= Time.current.to_date) || @entry.comment_url.present? %>
+ <% comment_date = @entry.regulations_dot_gov_comments_close_on || @entry.comments_close_on %>
<div id="flash_message" class="comment">
<p>
- <% if @entry.comments_close_on && @entry.regulations_dot_gov_comments_close_on && @entry.regulations_dot_gov_comments_close_on > @entry.comments_close_on %>
+ <% if @entry.comments_close_on && @entry.regulations_dot_gov_comments_close_on && @entry.regulations_dot_gov_comments_close_on > @entry.comments_close_on && @entry.regulations_dot_gov_comments_close_on > Date.current %>
This article's comment period has been extended; it now ends in <%= days_remaining( @entry.regulations_dot_gov_comments_close_on) %>
(<%= @entry.regulations_dot_gov_comments_close_on %>)
+ <% elsif comment_date && comment_date >= Date.current %>
+ This article has a comment period that ends <%= days_remaining( comment_date) %>
+ (<%= comment_date %>)
<% else %>
- This article has a comment period that ends <%= days_remaining( @entry.regulations_dot_gov_comments_close_on || @entry.comments_close_on ) %>
- (<%= @entry.regulations_dot_gov_comments_close_on || @entry.comments_close_on %>)
+ Comments on this article are being accepted at Regulations.gov
<% end %>
- <%= link_to "Submit a formal comment", @entry.regulations_dot_gov_comment_period_open? ? @entry.comment_url : '#addresses', :class => 'button', :target => (@entry.regulations_dot_gov_comment_period_open? ? '_blank' : '') %>
+ <%= link_to "Submit a formal comment", @entry.comment_url.present? ? @entry.comment_url : '#addresses', :class => 'button', :target => (@entry.comment_url.present? ? '_blank' : '') %>
</p>
</div>
<% end -%>
4 app/views/layouts/_navigation.html.erb
View
@@ -25,9 +25,9 @@
<li id='public-inspection-browse'>
<%= link_to 'Public Inspection', public_inspection_documents_path, :class => "public_inspection" %>
</li>
-<!-- <li id='executive-orders-browse'>
+ <li id='executive-orders-browse'>
<%= link_to 'Executive Orders', executive_orders_path, :class => "executive_orders" %>
- </li> -->
+ </li>
</ul>
</li>
<li class="dropdown nav_search">
20 lib/tasks/content_entry_import.rake
View
@@ -77,10 +77,15 @@ namespace :content do
end
namespace :regulations_dot_gov do
- def update_missing_regulationsdotgov_info(date)
- entries = Entry.scoped(:conditions => {:publication_date => date}).
- scoped(:conditions => ["comment_url IS NULL AND (checked_regulationsdotgov_at IS NULL OR checked_regulationsdotgov_at < ?)", 30.minutes.ago])
- entries.each do |entry|
+ def update_missing_regulationsdotgov_info(date = nil)
+ entries = Entry.scoped(:conditions => ["checked_regulationsdotgov_at IS NULL or checked_regulationsdotgov_at < ?", 25.minutes.ago])
+ if date
+ entries = entries.scoped(:conditions => {:publication_date => date})
+ else
+ entries = entries.scoped(:conditions => {:publication_date => (4.months.ago .. Issue.current.publication_date.to_time)}).scoped(:conditions => "comment_url IS NOT NULL")
+ end
+
+ entries.find_each do |entry|
importer = Content::EntryImporter.new(:entry => entry)
importer.update_attributes(:checked_regulationsdotgov_at, :regulationsdotgov_url, :comment_url)
end
@@ -89,13 +94,18 @@ namespace :content do
desc "Import regulations.gov info for entries missing it published today"
task :only_missing => :environment do
puts "importing today's missing regulations.gov data"
- update_missing_regulationsdotgov_info(Time.current.to_date)
+ update_missing_regulationsdotgov_info(Date.current)
end
desc "Import regulations.gov info for entries missing it published in the last 3 weeks"
task :tardy => :environment do
update_missing_regulationsdotgov_info(3.weeks.ago .. Time.now)
end
+
+ desc "Confirm comment periods are still open for comments in the last few months"
+ task :open_comments => :environment do
+ update_missing_regulationsdotgov_info
+ end
end
desc "Assign entries to sections"

No commit comments for this range

Something went wrong with that request. Please try again.