diff options
-rw-r--r-- | app/controllers/public_body_controller.rb | 2 | ||||
-rw-r--r-- | app/models/public_body.rb | 2 | ||||
-rw-r--r-- | app/views/admin_public_body/_form.rhtml | 3 | ||||
-rw-r--r-- | app/views/admin_public_body/import_csv.rhtml | 2 | ||||
-rw-r--r-- | app/views/admin_public_body/show.rhtml | 4 | ||||
-rw-r--r-- | app/views/public_body/show.rhtml | 3 | ||||
-rw-r--r-- | db/migrate/20121022031914_add_disclosure_log.rb | 13 | ||||
-rw-r--r-- | spec/fixtures/public_body_translations.yml | 7 | ||||
-rw-r--r-- | spec/views/public_body/show.rhtml_spec.rb | 1 |
9 files changed, 33 insertions, 4 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index b34e89b8d..12d03765b 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -157,6 +157,7 @@ class PublicBodyController < ApplicationController 'Tags', 'Home page', 'Publication scheme', + 'Disclosure log', 'Created at', 'Updated at', 'Version', @@ -171,6 +172,7 @@ class PublicBodyController < ApplicationController public_body.tag_string, public_body.calculated_home_page, public_body.publication_scheme, + public_body.disclosure_log, public_body.created_at, public_body.updated_at, public_body.version, diff --git a/app/models/public_body.rb b/app/models/public_body.rb index c3bc060a4..3bcf0e75d 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -413,7 +413,7 @@ class PublicBody < ActiveRecord::Base next end - field_list = ['name', 'short_name', 'request_email', 'notes', 'publication_scheme', 'home_page', 'tag_string'] + field_list = ['name', 'short_name', 'request_email', 'notes', 'publication_scheme', 'disclosure_log', 'home_page', 'tag_string'] if public_body = bodies_by_name[name] # Existing public body available_locales.each do |locale| diff --git a/app/views/admin_public_body/_form.rhtml b/app/views/admin_public_body/_form.rhtml index d854b53f5..0d6ae51e2 100644 --- a/app/views/admin_public_body/_form.rhtml +++ b/app/views/admin_public_body/_form.rhtml @@ -38,6 +38,9 @@ <p><label for="<%= form_tag_id(t.object_name, :publication_scheme, locale) %>">Publication scheme URL</label><br/> <%= t.text_field :publication_scheme, :size => 60, :id => form_tag_id(t.object_name, :publication_scheme, locale) %></p> + <p><label for="<%= form_tag_id(t.object_name, :disclosure_log, locale) %>">Disclosure log URL</label><br/> + <%= t.text_field :disclosure_log, :size => 60, :id => form_tag_id(t.object_name, :disclosure_log, locale) %></p> + <p><label for="<%= form_tag_id(t.object_name, :notes, locale) %>">Public notes</label> <small>(HTML, for users to consider when making FOI requests to the authority)</small><br/> <%= t.text_area :notes, :rows => 3, :cols => 60, :id => form_tag_id(t.object_name, :notes, locale) %></p> </div> diff --git a/app/views/admin_public_body/import_csv.rhtml b/app/views/admin_public_body/import_csv.rhtml index 4a03d0665..62908ba52 100644 --- a/app/views/admin_public_body/import_csv.rhtml +++ b/app/views/admin_public_body/import_csv.rhtml @@ -51,7 +51,7 @@ </blockquote> <p>Supported fields: name (i18n), short_name (i18n), request_email (i18n), notes (i18n), - publication_scheme (i18n), home_page, tag_string (tags separated by spaces).</p> + publication_scheme (i18n), disclosure_log (i18n), home_page, tag_string (tags separated by spaces).</p> <p><strong>Note:</strong> Choose <strong>dry run</strong> to test, without actually altering the database. Choose <strong>upload</strong> to actually diff --git a/app/views/admin_public_body/show.rhtml b/app/views/admin_public_body/show.rhtml index fa17d4027..094007c02 100644 --- a/app/views/admin_public_body/show.rhtml +++ b/app/views/admin_public_body/show.rhtml @@ -9,9 +9,9 @@ for column in columns %> <b><%= column.human_name %>:</b> - <% if column.name == 'home_page' and !column.name.empty? %> + <% if ['home_page', 'publication_scheme', 'disclosure_log'].include? column.name %> <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name)) %> - <% elsif column.name == 'request_email' and !column.name.empty? %> + <% elsif column.name == 'request_email' %> <%= link_to(h(@public_body.send(column.name)), "mailto:#{@public_body.send(column.name)}") %> <% if !@public_body.is_requestable? %> (not requestable due to: <%=h @public_body.not_requestable_reason %><% if @public_body.is_followupable? %>; but followupable<% end %>) diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml index b56556d5d..e13f9d1c0 100644 --- a/app/views/public_body/show.rhtml +++ b/app/views/public_body/show.rhtml @@ -14,6 +14,9 @@ <% if !@public_body.publication_scheme.empty? %> <%= link_to _('Publication scheme'), @public_body.publication_scheme %><br> <% end %> + <% unless @public_body.disclosure_log.empty? %> + <%= link_to _('Disclosure log'), @public_body.disclosure_log %><br> + <% end %> <% if @public_body.has_tag?("charity") %> <% for tag_value in @public_body.get_tag_values("charity") %> <% if tag_value.match(/^SC/) %> diff --git a/db/migrate/20121022031914_add_disclosure_log.rb b/db/migrate/20121022031914_add_disclosure_log.rb new file mode 100644 index 000000000..82ea7dbcd --- /dev/null +++ b/db/migrate/20121022031914_add_disclosure_log.rb @@ -0,0 +1,13 @@ +class AddDisclosureLog < ActiveRecord::Migration + def self.up + add_column :public_bodies, :disclosure_log, :text, :null => false, :default => "" + add_column :public_body_versions, :disclosure_log, :text, :null => false, :default => "" + add_column :public_body_translations, :disclosure_log, :text + end + + def self.down + remove_column :public_bodies, :disclosure_log + remove_column :public_body_versions, :disclosure_log + remove_column :public_body_translations, :disclosure_log + end +end diff --git a/spec/fixtures/public_body_translations.yml b/spec/fixtures/public_body_translations.yml index f3453e853..24b14c470 100644 --- a/spec/fixtures/public_body_translations.yml +++ b/spec/fixtures/public_body_translations.yml @@ -9,6 +9,7 @@ geraldine_es_public_body_translation: locale: es notes: "" publication_scheme: "" + disclosure_log: "" geraldine_en_public_body_translation: name: Geraldine Quango @@ -21,6 +22,7 @@ geraldine_en_public_body_translation: locale: en notes: "" publication_scheme: "" + disclosure_log: "" humpadink_es_public_body_translation: name: "El Department for Humpadinking" @@ -33,6 +35,7 @@ humpadink_es_public_body_translation: locale: es notes: Baguette publication_scheme: "" + disclosure_log: "" humpadink_en_public_body_translation: name: "Department for Humpadinking" @@ -45,6 +48,7 @@ humpadink_en_public_body_translation: locale: en notes: An albatross told me!!! publication_scheme: "" + disclosure_log: "" forlorn_en_public_body_translation: name: "Department of Loneliness" @@ -57,6 +61,7 @@ forlorn_en_public_body_translation: locale: en notes: A very lonely public body that no one has corresponded with publication_scheme: "" + disclosure_log: "" silly_walks_en_public_body_translation: id: 6 @@ -69,6 +74,7 @@ silly_walks_en_public_body_translation: url_name: msw notes: You know the one. publication_scheme: "" + disclosure_log: "" sensible_walks_en_public_body_translation: id: 7 @@ -81,3 +87,4 @@ sensible_walks_en_public_body_translation: url_name: sensible_walks notes: I bet you’ve never heard of it. publication_scheme: "" + disclosure_log: "" diff --git a/spec/views/public_body/show.rhtml_spec.rb b/spec/views/public_body/show.rhtml_spec.rb index a42516d72..b68b3f43b 100644 --- a/spec/views/public_body/show.rhtml_spec.rb +++ b/spec/views/public_body/show.rhtml_spec.rb @@ -11,6 +11,7 @@ describe "when viewing a body" do :eir_only? => nil, :info_requests => [1, 2, 3, 4], # out of sync with Xapian :publication_scheme => '', + :disclosure_log => '', :calculated_home_page => '') @pb.stub!(:override_request_email).and_return(nil) @pb.stub!(:is_requestable?).and_return(true) |