Notes about error handling and GWA changes.

git-svn-id: 3ebd8a4fd9006ff03462623fffc479a1d4750d42@115 7a65b82a-1d14-0410-b525-e2835e71a0b4

<% @title = 'News' %>

<%= @title %>

This page lists the latest changes to and news about the Mushroom Observer website.

Sunday April 29, 2007

Substantially improved error handling.

Fixed problem with Google Web Accelerator.

Sunday April 22, 2007

Reorganized and simplified observation editing and creation.

Completed unit testing for existing pages.

Friday February 23, 2007

Adjusted the size of some of the notes widgets to fill more of the screen.

Monday February 19, 2007

Added note snippet and comment count to Show Image page for easier review.

Adjusted options available for the number of rows in list displays.

Fixed database migration scripts.

Internal data simplification (removed observations.what field).

Tuesday February 13, 2007

Added multiple upload option for Add Images.

Changed some of the links in the left hand panel based on user feedback.

Saturday February 10, 2007

Added image and location search within the site.

Thursday February 8, 2007

Added Google image search links to Observation and Name pages.

Wednesday February 7, 2007

Added checklists.  Items in the checklist are the results of the
                latest search or viewed species list.  Viewing large lists like
                'Latest Changes' or 'Name Index' will reset the checklist to all
                names.

Moved loading species lists from files to a separate page off of
                Edit Species List to avoid an interaction between the checklist
                and file loading.

Saturday January 27, 2007

Name edits now appear in the RSS feed.

Sunday January 21, 2007

Added How To Use page.

Changed 'New' links to 'Create'.

Fixed a bug with the search box.

Fixed a couple of bugs with the next/prev links.

Thursday January 11, 2007

Fixed a bug with creating new species.

Fixed many bugs with page titles, some of which were preventing pages from loading.

Tuesday January 9, 2007

Names are now database objects rather than just strings.  They have a
                rank, a text name an author and notes.

A show_name page shows this information as well as a list of all
        observations that use that Name.  The show_pages can be accessed from
        each show_observation page as well as the name_index page that is
        available in the left-side panel.

Names can be edited on the edit_name pages that are accessible from
        the show_name pages.  Anyone is allowed to edit any name, but
        following the Wikipedia model,
        a record is kept of every version.  The previous versions are stored as
        'past names'.  A show_past_name page shows the name information for a
        previous version of a name and is accessible from each show_name page.

Names are associated with observations through the 'what' field of the
        observation.  When the 'what' field is changed, the names are searched
        for a match.  The 'what' field can either be the text_name or the
        text_name and the author for a name.  No match is found for a 'what'
        value, then the user is given the option to create the new name.  If a
        'what' value matches more than one name (due to different authors
        publishing the same name), then the user is given a choice between the
        options.  The options list how many observations use each version of
        the name.  If you add an author to a 'what' field for a name that does
        not have an author already, it will ask you if you want to create the
        new name, but it will actually update the existing name.

Names given in species lists are treated in the exact same manner,
        except that all the new names and all of the multiple matches are
        dealt with on the same page.  There is also an option on the
        new_species_list and edit_species_list pages to 'Just Create New
        Names'.  This adds the names without updating the species list or
        creating the corresponding observations.

The search box is now available on every page.

Removed the Observation Index in favor of the Name Index.

Fixed some of the list ordering to make it more intuitive.

A filter was added to the account creation process that should reduce the
        number of bot created users.

Fixed a bug with bouncing between observations and images and using the
        next/prev links.

Monday December 18, 2006

Added prev/next links that follow the RSS feed.

Improved prev/next functionality throughout the site.

RSS feed descriptions now have appropriate line breaks.

Monday December 4, 2006

Species lists can now be uploaded from files.

Separated note for species list from note that applies to member observations.

Fixed use of multiple tabs by switching from session data to hidden fields.

mushroomobserver.org/# == mushroomobserver.org/observer/show_observation/#

Monday October 26, 2006

Switched Observations->By Name to include thumbnails and follow layout.

Maintained old By Name behavior as Observations->Index.

Added simple search box to Activity Log (Latest Changes) and Observation list pages.

Monday October 23, 2006

Changed default page to the RSS feed.

Changed page layout for observation and image list pages.

Added layout controls to user preferences.  Set to 10 rows x 1 column
			and turn off 'Put text below images' to get old layout.

Changed thumbnail image size from 100px to 160px with lower quality (jpeg 50 vs. 75).

Provided Prev/Next buttons for images.

Added link to ask the webmaster a question about the site.

Split up 'Manage Images' into 'Add Image', 'Reuse Image' and 'Remove Images' and made
			them more visible.

'Reuse Image' allows you to look at the images.

Added links for viewing the log for observations and species lists.

Made database lookup for all observations much more efficient.

Rearranged left-hand panel.

Images no longer have titles.  They are derived from the observation(s) they are
			connected to.

Removed Edit and Destroy links from view pages.

Add mini-icon for webpages.

Sunday September 9, 2006

Links to email the creator of observations or images with questions or commerical inquiries.  The creator receives an email with the address of the user who wants to contact them.  It is up to the creator whether they want to respond.

User preferences added to disable the above email feature and to stop receiving emails like this letting you know about new features.

RSS feed has been overhauled to reduce the number of entries and make them more relevant.

Copyright holder now has an option to be something other than a registered user.  The user who uploads the image is the default, but it can now be changed on a per image basis.

Monday August 21, 2006

	Added RSS feed for all interesting events that happen on the site.

	Added 'Create Account' link on login page to make it more obvious.

	Tweaked page titles to make the site easier to index.

Sunday August 13, 2006

	Added this news page.

	List pages now have a better interface for paging than just next/previous,
	and its at the top and bottom of each page.

Saturday August 12, 2006

	Added email verification system to user signup.

<% @title = 'News' %>

<%= @title %>

This page lists the latest changes to and news about the Mushroom Observer website.

Sunday April 22, 2007

Reorganized and simplified observation editing and creation.

Completed unit testing for existing pages.

Friday February 23, 2007

Adjusted the size of some of the notes widgets to fill more of the screen.

Monday February 19, 2007

Added note snippet and comment count to Show Image page for easier review.

Adjusted options available for the number of rows in list displays.

Fixed database migration scripts.

Internal data simplification (removed observations.what field).

Tuesday February 13, 2007

Added multiple upload option for Add Images.

Changed some of the links in the left hand panel based on user feedback.

Saturday February 10, 2007

Added image and location search within the site.

Thursday February 8, 2007

Added Google image search links to Observation and Name pages.

Wednesday February 7, 2007

Added checklists.  Items in the checklist are the results of the
                latest search or viewed species list.  Viewing large lists like
                'Latest Changes' or 'Name Index' will reset the checklist to all
                names.

Moved loading species lists from files to a separate page off of
                Edit Species List to avoid an interaction between the checklist
                and file loading.

Saturday January 27, 2007

Name edits now appear in the RSS feed.

Sunday January 21, 2007

Added How To Use page.

Changed 'New' links to 'Create'.

Fixed a bug with the search box.

Fixed a couple of bugs with the next/prev links.

Thursday January 11, 2007

Fixed a bug with creating new species.

Fixed many bugs with page titles, some of which were preventing pages from loading.

Tuesday January 9, 2007

Names are now database objects rather than just strings.  They have a
                rank, a text name an author and notes.

A show_name page shows this information as well as a list of all
        observations that use that Name.  The show_pages can be accessed from
        each show_observation page as well as the name_index page that is
        available in the left-side panel.

Names can be edited on the edit_name pages that are accessible from
        the show_name pages.  Anyone is allowed to edit any name, but
        following the Wikipedia model,
        a record is kept of every version.  The previous versions are stored as
        'past names'.  A show_past_name page shows the name information for a
        previous version of a name and is accessible from each show_name page.

Names are associated with observations through the 'what' field of the
        observation.  When the 'what' field is changed, the names are searched
        for a match.  The 'what' field can either be the text_name or the
        text_name and the author for a name.  No match is found for a 'what'
        value, then the user is given the option to create the new name.  If a
        'what' value matches more than one name (due to different authors
        publishing the same name), then the user is given a choice between the
        options.  The options list how many observations use each version of
        the name.  If you add an author to a 'what' field for a name that does
        not have an author already, it will ask you if you want to create the
        new name, but it will actually update the existing name.

Names given in species lists are treated in the exact same manner,
        except that all the new names and all of the multiple matches are
        dealt with on the same page.  There is also an option on the
        new_species_list and edit_species_list pages to 'Just Create New
        Names'.  This adds the names without updating the species list or
        creating the corresponding observations.

The search box is now available on every page.

Removed the Observation Index in favor of the Name Index.

Fixed some of the list ordering to make it more intuitive.

A filter was added to the account creation process that should reduce the
        number of bot created users.

Fixed a bug with bouncing between observations and images and using the
        next/prev links.

Monday December 18, 2006

Added prev/next links that follow the RSS feed.

Improved prev/next functionality throughout the site.

RSS feed descriptions now have appropriate line breaks.

Monday December 4, 2006

Species lists can now be uploaded from files.

Separated note for species list from note that applies to member observations.

Fixed use of multiple tabs by switching from session data to hidden fields.

mushroomobserver.org/# == mushroomobserver.org/observer/show_observation/#

Monday October 26, 2006

Switched Observations->By Name to include thumbnails and follow layout.

Maintained old By Name behavior as Observations->Index.

Added simple search box to Activity Log (Latest Changes) and Observation list pages.

Monday October 23, 2006

Changed default page to the RSS feed.

Changed page layout for observation and image list pages.

Added layout controls to user preferences.  Set to 10 rows x 1 column
			and turn off 'Put text below images' to get old layout.

Changed thumbnail image size from 100px to 160px with lower quality (jpeg 50 vs. 75).

Provided Prev/Next buttons for images.

Added link to ask the webmaster a question about the site.

Split up 'Manage Images' into 'Add Image', 'Reuse Image' and 'Remove Images' and made
			them more visible.

'Reuse Image' allows you to look at the images.

Added links for viewing the log for observations and species lists.

Made database lookup for all observations much more efficient.

Rearranged left-hand panel.

Images no longer have titles.  They are derived from the observation(s) they are
			connected to.

Removed Edit and Destroy links from view pages.

Add mini-icon for webpages.

Sunday September 9, 2006

Links to email the creator of observations or images with questions or commerical inquiries.  The creator receives an email with the address of the user who wants to contact them.  It is up to the creator whether they want to respond.

User preferences added to disable the above email feature and to stop receiving emails like this letting you know about new features.

RSS feed has been overhauled to reduce the number of entries and make them more relevant.

Copyright holder now has an option to be something other than a registered user.  The user who uploads the image is the default, but it can now be changed on a per image basis.

Monday August 21, 2006

	Added RSS feed for all interesting events that happen on the site.

	Added 'Create Account' link on login page to make it more obvious.

	Tweaked page titles to make the site easier to index.

Sunday August 13, 2006

	Added this news page.

	List pages now have a better interface for paging than just next/previous,
	and its at the top and bottom of each page.

Saturday August 12, 2006

	Added email verification system to user signup.


Add link to view project tasks from edit project page

            <fieldset style="padding-top:0;">
              <legend><%=_ 'Edit Project' %></legend>
              <% form_tag :action => 'update', :id => @project do %>
              <%= render :partial => "form" %>
              <%= submit_tag _("Save"), :class => 'nolabel' %>
              <% end %>

              <% if @project.user_id == current_user.id || current_user.admin > 0%>

<%= link_to( _("Delete Project"), {:controller => 'projects', :action => 'destroy', :id => @project}, :confirm => "Really delete #{@project.name}?") %>

              <% end %>
              <% if current_user.can?( @project, 'grant' ) || current_user.admin > 0 %>

 <%= link_to( _("Complete Project"), {:controller => 'projects', :action => 'complete', :id => @project}, :confirm => "Really complete #{@project.name}?") %> <%= " " if @project.user_id == current_user.id %>

              <% end %>

<%= link_to( _("View Tasks"), {:controller => 'views', :action => 'select_project', :id => @project}) %>
            </fieldset>

          <% if current_user.can?( @project, 'milestone' ) %>

<%= link_to _('New'), :controller => "milestones", :action => 'new', :project_id => @project %>

          <% end %>

<%=_ 'Milestones' %>

              <% unless @project.new_record? %>
              <%= render :partial => "activities/overall_progress", :locals => { :project => @project } %>
              <% for milestone in @project.milestones.find(:all, :conditions => ["completed_at IS NULL"], :order => "due_at, milestones.name", :include => [:user]) %>
              <%= render :partial => "activities/milestone_row", :locals => { :milestone => milestone } %>
              <% end %>
	      <% @completed_milestones = Milestone.count(:conditions => ["project_id = ? AND completed_at IS NOT NULL", @project.id])
	         if @completed_milestones.to_i > 0
               %>

<%= link_to _('%d completed milestone', @completed_milestones), :controller => 'milestones', :action => 'list_completed', :id => @project %>

	      <% end %>
	      <% else %>

              <% end %>

  <% if current_user.can?( @project, 'grant' ) %>

      <fieldset>
        <legend><%=_ 'Access To Project' %></legend>

<%= render :partial => "permission_list" %>

      </fieldset>

  <% end %>

            <fieldset style="padding-top:0;">
              <legend><%=_ 'Edit Project' %></legend>
              <% form_tag :action => 'update', :id => @project do %>
              <%= render :partial => "form" %>
              <%= submit_tag _("Save"), :class => 'nolabel' %>
              <% end %>

              <% if @project.user_id == current_user.id || current_user.admin > 0%>

<%= link_to( _("Delete Project"), {:controller => 'projects', :action => 'destroy', :id => @project}, :confirm => "Really delete #{@project.name}?") %>

              <% end %>
              <% if current_user.can?( @project, 'grant' ) || current_user.admin > 0 %>

 <%= link_to( _("Complete Project"), {:controller => 'projects', :action => 'complete', :id => @project}, :confirm => "Really complete #{@project.name}?") %> <%= " " if @project.user_id == current_user.id %>

              <% end %>
            </fieldset>

          <% if current_user.can?( @project, 'milestone' ) %>

<%= link_to _('New'), :controller => "milestones", :action => 'new', :project_id => @project %>

          <% end %>

<%=_ 'Milestones' %>

              <% unless @project.new_record? %>
              <%= render :partial => "activities/overall_progress", :locals => { :project => @project } %>
              <% for milestone in @project.milestones.find(:all, :conditions => ["completed_at IS NULL"], :order => "due_at, milestones.name", :include => [:user]) %>
              <%= render :partial => "activities/milestone_row", :locals => { :milestone => milestone } %>
              <% end %>
	      <% @completed_milestones = Milestone.count(:conditions => ["project_id = ? AND completed_at IS NOT NULL", @project.id])
	         if @completed_milestones.to_i > 0
               %>

<%= link_to _('%d completed milestone', @completed_milestones), :controller => 'milestones', :action => 'list_completed', :id => @project %>

	      <% end %>
	      <% else %>

              <% end %>

  <% if current_user.can?( @project, 'grant' ) %>

      <fieldset>
        <legend><%=_ 'Access To Project' %></legend>

<%= render :partial => "permission_list" %>

      </fieldset>

  <% end %>


arquivos

arquivos

Arquivos

  <% if archives.length > 0 %>
    <% for entry in archives %>

        <%= entry.date %>
        <a href="<%= entry.path %>"><%= entry.title %>

    <% end %>
  <% end %>

<%= @path %>

  <% if archives.length > 0 %>
    <% for entry in archives %>

        <a href="<%= entry.path %>"><%= entry.title %>

    <% end %>
  <% end %>


Add anchor to products on supplier page

Add anchor to products on supplier page

<% unless supplier.new_record? %>

      <%= profile_image(supplier.profile, :minor) %>

        <%= supplier.dummy? ? _("Supplier with registry managed by the collective") : _("Registered supplier in the network") %>

        <% if supplier.dummy? %>
          <%= supplier.name %>
        <% else %>
          <%= link_to_profile supplier.name, supplier.profile.identifier, :class => 'supplier-name' %>
        <% end %>

      <% if supplier.name_abbreviation %>

<%= _("Abreviated Name") + '  ' %><%= supplier.name_abbreviation %>

      <% end %>

<%= supplier.description %>

<%= _("This supplier has") %>

        <% if supplier.node.products.unarchived.own.distributed.count > 0 %>
          <%= link_to _("#{supplier.node.products.unarchived.own.distributed.count} registered products"),
            {:controller => :distribution_plugin_product, :action => :index, :supplier_id => supplier.id} %><%= _(", among them") %>

          <% msg = supplier.dummy? ? _("#{@node.products.unarchived.distributed.active.from_supplier(supplier).count} products active") :
            _("#{@node.products.unarchived.distributed.from_supplier(supplier).count} products commercialized") %>
          <%= link_to msg, {:controller => :distribution_plugin_product, :action => :index, :supplier_id => supplier.id}, :class => 'supplier-distributed-products-count' %>
        <% else %>
          <%= _('any registered product') %>
        <% end %>

<%= _("Actions") %>

<%= link_to_function _("edit"), '', :class => 'toggle-edit' %>

<%# link_to _("desactivate"), :url => {:controller => :distribution_plugin_supplier, :action => :desactivate, :id => supplier.id} %>

<%= link_to_remote _("remove"), :url => {:controller => :distribution_plugin_supplier, :action => :destroy, :id => supplier.id},
        :confirm => _("By removing this supplier all its products won't be available for future cycles. Please confirm you choice"), :class => 'supplier-remove' %>

<%= link_to _("products"), {:controller => :distribution_plugin_product, :action => :index, :supplier_id => supplier.id, :anchor => 'filter-fields'} %>

<%= link_to _("add products"), {:controller => :distribution_plugin_product, :action => :index, :supplier_id => supplier.id, :anchor => 'our-product-add'} %>

<% end %>

  <%= render :partial => 'edit', :locals => {:supplier => supplier} %>

<% unless supplier.new_record? %>

      <%= profile_image(supplier.profile, :minor) %>

        <%= supplier.dummy? ? _("Supplier with registry managed by the collective") : _("Registered supplier in the network") %>

        <% if supplier.dummy? %>
          <%= supplier.name %>
        <% else %>
          <%= link_to_profile supplier.name, supplier.profile.identifier, :class => 'supplier-name' %>
        <% end %>

      <% if supplier.name_abbreviation %>

<%= _("Abreviated Name") + '  ' %><%= supplier.name_abbreviation %>

      <% end %>

<%= supplier.description %>

<%= _("This supplier has") %>

        <% if supplier.node.products.unarchived.own.distributed.count > 0 %>
          <%= link_to _("#{supplier.node.products.unarchived.own.distributed.count} registered products"),
            {:controller => :distribution_plugin_product, :action => :index, :supplier_id => supplier.id} %><%= _(", among them") %>

          <% msg = supplier.dummy? ? _("#{@node.products.unarchived.distributed.active.from_supplier(supplier).count} products active") :
            _("#{@node.products.unarchived.distributed.from_supplier(supplier).count} products commercialized") %>
          <%= link_to msg, {:controller => :distribution_plugin_product, :action => :index, :supplier_id => supplier.id}, :class => 'supplier-distributed-products-count' %>
        <% else %>
          <%= _('any registered product') %>
        <% end %>

<%= _("Actions") %>

<%= link_to_function _("edit"), '', :class => 'toggle-edit' %>

<%# link_to _("desactivate"), :url => {:controller => :distribution_plugin_supplier, :action => :desactivate, :id => supplier.id} %>

<%= link_to_remote _("remove"), :url => {:controller => :distribution_plugin_supplier, :action => :destroy, :id => supplier.id},
        :confirm => _("By removing this supplier all its products won't be available for future cycles. Please confirm you choice"), :class => 'supplier-remove' %>

<%= link_to _("products"), {:controller => :distribution_plugin_product, :action => :index, :supplier_id => supplier.id} %>

<%= link_to _("add products"), {:controller => :distribution_plugin_product, :action => :index, :supplier_id => supplier.id, :anchor => 'our-product-add'} %>

<% end %>

  <%= render :partial => 'edit', :locals => {:supplier => supplier} %>


Switched to Agaricus color schema as the default.

  <META http-equiv=Content-Type content="text/html; charset=UTF-8"/>
  <title>Mushroom Sightings: <%= controller.action_name %></title>
  <%= stylesheet_link_tag 'agaricus' %>

      <%= @page_title || "Mushroom Sightings" %>

		  <%= link_to 'New Observation', :action => 'new_observation' %>

		  <%= link_to 'List Observations', :action => 'list_observations' %>

		  <%= link_to 'List Images', :action => 'list_images' %>

<%= flash[:notice] %>

            <%= @content_for_layout %>

  <META http-equiv=Content-Type content="text/html; charset=UTF-8"/>
  <title>Mushroom Sightings: <%= controller.action_name %></title>
  <%= stylesheet_link_tag 'scaffold' %>

      <%= @page_title || "Mushroom Sightings" %>

		  <%= link_to 'New Observation', :action => 'new_observation' %>

		  <%= link_to 'List Observations', :action => 'list_observations' %>

		  <%= link_to 'List Images', :action => 'list_images' %>

<%= flash[:notice] %>

            <%= @content_for_layout %>


ActionItem898: fixing wrong unclosed tag

<%= _('There is no such page: %s') % (content_tag('tt', @path)) %>

  <%= _('You may have clicked an expired link or mistyped the address.') %>
  <%= _('If you clicked a link that was in another site, or was given to you by someone else, it would be nice if you tell them that their link is not valid anymore.') %>

<%= link_to _('Go to the site home page'), :controller => 'home' %>

<%= link_to _('Go back'), :back %>


fix bt generate

fix bt generate

<%
  file_name = File.join(RAILS_ROOT, "db", "schema.rb")
  if File.exist?(file_name)
    content = File.read(file_name)
		if content.include?('add_foreign_key')
	    foreign_keys = content.split("add_foreign_key")
	    foreign_keys.each do |foreign_key|
	      elements = foreign_key.split(" ")
	      association = elements[0].gsub(/[,"\[\]]/, '')
	      association_column = elements[1].gsub(/[,"\"\[\]]/, '')
	      association_reverse = elements[2].gsub(/[,"\"\[\]]/, '')
	      association_reverse_column = elements[3].gsub(/[,"\"\[\]]/, '')
			  # add_foreign_key "trainings_users", ["user_id"], "users", ["id"], :name => "trainings_users_ibfk_1"
			  # add_foreign_key "trainings_users", ["training_id"], "trainings", ["id"], :name => "trainings_users_ibfk_2"
	      if association == @model_instance.class.table_name
	        %>	belongs_to :<%= association_column[0..-4] %>, :class_name => "<%= association_reverse.singularize.camelize %>", :foreign_key => "<%= association_column %>"
<%
	      end
	      if association_reverse == @model_instance.class.table_name
	      	if association.include?(association_reverse)
						%>	has_and_belongs_to_many :<%= association.gsub(association_reverse, '').gsub(/^\_/, "").gsub(/\_$/, "") %>
<%
					else
					%>	has_many :<%= association %>
<%
					end
	      end
	    end
		else
	    index_methods = content.split("add_index")
	    index_methods.each do |index_method|
	      elements = index_method.split(" ")
	      association = elements[0].gsub(/[,"\[\]]/, '')
	      association_column = elements[1].gsub(/[,"\"\[\]]/, '')
				next unless association_column.include?('_id')
	      association_reverse = association_column[0..-4].pluralize
			  # add_index "organizations_users", ["organization_id", "user_id"], :name => "by_org_user", :unique => true
			  # add_index "products", ["applicant_id"], :name => "index_products_on_applicant_id"
	      if association == @model_instance.class.table_name
	        %>	belongs_to :<%= association_column[0..-4] %>, :class_name => "<%= association_reverse.singularize.camelize %>", :foreign_key => "<%= association_column %>"
<%
	      end
	      if association_reverse == @model_instance.class.table_name
	      	if association.include?(association_reverse)
						%>	has_and_belongs_to_many :<%= association.gsub(association_reverse, '').gsub(/^\_/, "").gsub(/\_$/, "") %>
<%
					else
					%>	has_many :<%= association %>
<%
					end
	      end
	    end
    end
  end
%>
<%
max_size = @model_instance.class.column_names.collect{|name| name.size}.max + 1
@model_instance.class.columns.each do |col|
  next if [:id, :created_at, :updated_at, :lock_version].include?(col.name.to_sym)
	next if col.name.include?('_id') and col.name.last(3) == '_id'
  attrs = []
  attrs << "default(#{quote(col.default)})" if col.default
  attrs << "not null" unless col.null
  attrs << "primary key" if col.name == @model_instance.class.primary_key

  col_type = col.type.to_s
  if col_type == "decimal"
    col_type << "(#{col.precision}, #{col.scale})"
  else
    col_type << "(#{col.limit})" if col.limit
  end %>	attribute :<%= col.name %>, :is => :required  <%#= sprintf("# %s", col_type, attrs.join(", ")) %>
<%
end
%><%
  if @model_instance.class.content_columns.find {|c| [:name, :label, :title].include?(c.name.to_sym)}.nil? -%>
	def to_label
    "#{}" # :name, :label, :title columns not found. Put the Model's label column(s) here for example: first_name + " " + last_name
  end
<% end -%>

  # ===================
  # = Authorize BEGIN =
  # ===================

  def authorized_for_create?
    current_user and current_user.permit?([:root, :super])
  end

  def authorized_for_destroy?
    current_user and current_user.permit?([:root, :super])
  end

  def authorized_for_read?
    current_user and current_user.permit?([:root, :super])
  end

  def authorized_for_update?
    current_user and current_user.permit?([:root, :super])
  end

  # =================
  # = Authorize END =
  # =================

<%
  file_name = File.join(RAILS_ROOT, "db", "schema.rb")
  if File.exist?(file_name)
    content = File.read(file_name)
		if content.include?('add_foreign_key')
	    foreign_keys = content.split("add_foreign_key")
	    foreign_keys.each do |foreign_key|
	      elements = foreign_key.split(" ")
	      association = elements[0].gsub(/[,"\[\]]/, '')
	      association_column = elements[1].gsub(/[,"\"\[\]]/, '')
	      association_reverse = elements[2].gsub(/[,"\"\[\]]/, '')
	      association_reverse_column = elements[3].gsub(/[,"\"\[\]]/, '')
			  # add_foreign_key "trainings_users", ["user_id"], "users", ["id"], :name => "trainings_users_ibfk_1"
			  # add_foreign_key "trainings_users", ["training_id"], "trainings", ["id"], :name => "trainings_users_ibfk_2"
	      if association == @model_instance.class.table_name
	        %>	belongs_to :<%= association_column[0..-4] %>, :class_name => "<%= association_reverse.singularize.camelize %>", :foreign_key => "<%= association_column %>"
<%
	      end
	      if association_reverse == @model_instance.class.table_name
	      	if association.include?(association_reverse)
						%>	has_and_belongs_to_many :<%= association.gsub(association_reverse, '').gsub(/^\_/, "").gsub(/\_$/, "") %>
<%
					else
					%>	has_many :<%= association %>
<%
					end
	      end
	    end
		else
	    index_methods = content.split("add_index")
	    index_methods.each do |index_method|
	      elements = index_method.split(" ")
	      association = elements[0].gsub(/[,"\[\]]/, '')
	      association_column = elements[1].gsub(/[,"\"\[\]]/, '')
				next unless association_column.include?('_id')
	      association_reverse = association_column[0..-4].pluralize
			  # add_index "organizations_users", ["organization_id", "user_id"], :name => "by_org_user", :unique => true
			  # add_index "products", ["applicant_id"], :name => "index_products_on_applicant_id"
	      if association == @model_instance.class.table_name
	        %>	belongs_to :<%= association_column[0..-4] %>, :class_name => "<%= association_reverse.singularize.camelize %>", :index_method => "<%= association_column %>"
<%
	      end
	      if association_reverse == @model_instance.class.table_name
	      	if association.include?(association_reverse)
						%>	has_and_belongs_to_many :<%= association.gsub(association_reverse, '').gsub(/^\_/, "").gsub(/\_$/, "") %>
<%
					else
					%>	has_many :<%= association %>
<%
					end
	      end
	    end
    end
  end
%>
<%
max_size = @model_instance.class.column_names.collect{|name| name.size}.max + 1
@model_instance.class.columns.each do |col|
  next if [:id, :created_at, :updated_at, :lock_version].include?(col.name.to_sym)
	next if col.name.include?('_id') and col.name.last(3) == '_id'
  attrs = []
  attrs << "default(#{quote(col.default)})" if col.default
  attrs << "not null" unless col.null
  attrs << "primary key" if col.name == @model_instance.class.primary_key

  col_type = col.type.to_s
  if col_type == "decimal"
    col_type << "(#{col.precision}, #{col.scale})"
  else
    col_type << "(#{col.limit})" if col.limit
  end %>	attribute :<%= col.name %>, :is => :required  <%#= sprintf("# %s", col_type, attrs.join(", ")) %>
<%
end
%><%
  if @model_instance.class.content_columns.find {|c| [:name, :label, :title].include?(c.name.to_sym)}.nil? -%>
	def to_label
    "#{}" # :name, :label, :title columns not found. Put the Model's label column(s) here for example: first_name + " " + last_name
  end
<% end -%>

  # ===================
  # = Authorize BEGIN =
  # ===================

  def authorized_for_create?
    current_user and current_user.permit?([:root, :super])
  end

  def authorized_for_destroy?
    current_user and current_user.permit?([:root, :super])
  end

  def authorized_for_read?
    current_user and current_user.permit?([:root, :super])
  end

  def authorized_for_update?
    current_user and current_user.permit?([:root, :super])
  end

  # =================
  # = Authorize END =
  # =================


git-svn-id: svn+ssh://ko.meadowy.net/home/svn/inside/kozuchi/trunk@456 c938ebee-df10-0410-95fc-be8c4b0ebdd5

<% change_condition = remote_function(:update => 'settlement_details', :url => {:action => 'change_condition', :clear_selection => true}, :with => 'Form.serialize(\'settlement_conditions\')') %>
<%= start_form_tag ({:action => 'create'}, :id => 'settlement_conditions')%>

      口座
      <%= select_account('settlement', 'account_id', [:credit, :credit_card], true, {}, :onChange => change_condition)%>

      期間

<%= select_date(@start_date, :prefix => 'start_date', :use_month_numbers => true)%> ～ <%= select_date(@end_date, :prefix => 'end_date', :use_month_numbers => true) %> <button onClick="<%= change_condition%>;return false;">表示内容を更新</button>

<% unless @settlement.errors.empty? %>

<%= error_messages_for 'settlement'%>

<% end %>

  <%= render :partial => 'settlement_details' %>

<%= end_form_tag %>

<% change_condition = remote_function(:update => 'settlement_details', :url => {:action => 'change_condition', :clear_selection => true}, :with => 'Form.serialize(\'settlement_conditions\')') %>
<%= start_form_tag ({:action => 'create'}, :id => 'settlement_conditions')%>

      口座
      <%= select_account('settlement', 'account_id', [:credit, :credit_card], true, {}, :onChange => change_condition)%>

      期間

<%= select_date(@start_date, :prefix => 'start_date', :use_month_numbers => true)%> ～ <%= select_date(@end_date, :prefix => 'end_date', :use_month_numbers => true) %> <button onClick="<%= change_condition%>;">表示内容を更新</button>

<% unless @settlement.errors.empty? %>

<%= error_messages_for 'settlement'%>

<% end %>

  <%= render :partial => 'settlement_details' %>

<%= end_form_tag %>


ActionItem1152: fixing & bug on tinymce

ActionItem1152: fixing & bug on tinymce

Links in WYSIWYG don't keep changing & to &amp in each edition

<%= javascript_include_tag 'tinymce/jscripts/tiny_mce/tiny_mce.js' %>
<script type="text/javascript">
  var myplugins = "searchreplace,print,media,table";
  if (tinymce.isIE) {
    // the paste plugin is only useful in Internet Explorer
    myplugins = "paste," + myplugins;
  }
tinyMCE.init({
        mode : "textareas",
        theme : "advanced",
        relative_urls : false,
        remove_script_host : true,
        document_base_url : <%= environment.top_url.to_json %>,
        plugins: myplugins,
        theme_advanced_toolbar_location : "top",
        theme_advanced_layout_manager: 'SimpleLayout',
        theme_advanced_buttons1 : "print,separator,copy,paste,separator,undo,redo,separator,search,replace,separator,fontsizeselect,formatselect",
        theme_advanced_buttons2 : "bold,italic,underline,strikethrough,separator,bullist,numlist,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,link,unlink,image,table,separator,cleanup,code",
        theme_advanced_buttons3 : "",
        theme_advanced_blockformats :"p,address,pre,h2,h3,h4,h5,h6",
        paste_auto_cleanup_on_paste : true,
        paste_insert_word_content_callback : "convertWord",
        paste_use_dialog: false,
        apply_source_formatting : true,
        content_css: '/stylesheets/tinymce.css',
        language: <%= tinymce_language.inspect %>,
        cleanup_callback : "customCleanup"
        });

function convertWord(type, content) {
  switch (type) {
    // Gets executed before the built in logic performes it's cleanups
    case "before":
      //content = content.toLowerCase(); // Some dummy logic
      break;

    // Gets executed after the built in logic performes it's cleanups
    case "after":
      content = content.replace(/<!--\s*-->/, '');
      break;
  }

  return content;
}

function customCleanup(type, value) {
  switch (type) {
    case "get_from_editor":
      value = value.replace(/&amp;/g,"&");
		break;
    case "insert_to_editor":
      value = value.replace(/&amp;/g,"&");
		break;
  }
  return value;
}

</script>

<%= javascript_include_tag 'tinymce/jscripts/tiny_mce/tiny_mce.js' %>
<script type="text/javascript">
  var myplugins = "searchreplace,print,media,table";
  if (tinymce.isIE) {
    // the paste plugin is only useful in Internet Explorer
    myplugins = "paste," + myplugins;
  }
tinyMCE.init({
        mode : "textareas",
        theme : "advanced",
        relative_urls : false,
        remove_script_host : true,
        document_base_url : <%= environment.top_url.to_json %>,
        plugins: myplugins,
        theme_advanced_toolbar_location : "top",
        theme_advanced_layout_manager: 'SimpleLayout',
        theme_advanced_buttons1 : "print,separator,copy,paste,separator,undo,redo,separator,search,replace,separator,fontsizeselect,formatselect",
        theme_advanced_buttons2 : "bold,italic,underline,strikethrough,separator,bullist,numlist,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,link,unlink,image,table,separator,cleanup,code",
        theme_advanced_buttons3 : "",
        theme_advanced_blockformats :"p,address,pre,h2,h3,h4,h5,h6",
        paste_auto_cleanup_on_paste : true,
        paste_insert_word_content_callback : "convertWord",
        paste_use_dialog: false,
        apply_source_formatting : true,
        content_css: '/stylesheets/tinymce.css',
        language: <%= tinymce_language.inspect %>
        });

function convertWord(type, content) {
  switch (type) {
    // Gets executed before the built in logic performes it's cleanups
    case "before":
      //content = content.toLowerCase(); // Some dummy logic
      break;

    // Gets executed after the built in logic performes it's cleanups
    case "after":
      content = content.replace(/<!--\s*-->/, '');
      break;
  }

  return content;
}
</script>


fix typo

fix typo

<!DOCTYPE html>

  <meta content="text/html;charset=utf-8" http-equiv="content-type">
  <title>Free & Open Source Postal Code to Electoral District Web Service</title>

Postal Code to Electoral District API

Examples

A postal code containing a single electoral district:

        http://postal-code-to-edid-webservice.heroku.com/postal_codes/A1A1A1

A postal code containing multiple electoral district:

        http://postal-code-to-edid-webservice.heroku.com/postal_codes/K0A1K0

You can also get the electoral districts in CSV format:

        http://postal-code-to-edid-webservice.heroku.com/postal_codes/K0A1K0/csv

Or as JSONP for cross-domain AJAX requests:

        http://postal-code-to-edid-webservice.heroku.com/postal_codes/K0A1K0/jsonp?callback=success

Documentation

The API returns the IDs used by Elections Canada to represent electoral districts. For more documentation, see here.

<!DOCTYPE html>

  <meta content="text/html;charset=utf-8" http-equiv="content-type">
  <title>Free & Open Source Postal Code to Electoral District Web Service</title>

Postal Code to Electoral District API

Examples

A postal code containing a single electoral district:

        http://postal-code-to-edid-webservice.heroku.com/postal_codes/A1A1A1

A postal code containing a multiple electoral district:

        http://postal-code-to-edid-webservice.heroku.com/postal_codes/K0A1K0

You can also get the electoral districts in CSV format:

        http://postal-code-to-edid-webservice.heroku.com/postal_codes/K0A1K0/csv

Or as JSONP for cross-domain AJAX requests:

        http://postal-code-to-edid-webservice.heroku.com/postal_codes/K0A1K0/jsonp?callback=success

Documentation

The API returns the IDs used by Elections Canada to represent electoral districts. For more documentation, see here.


Fix timeline

Fix timeline

This was just a bug:
> 9) admin timeline (https://secure.mysociety.org/admin/foi/timeline)
> raises exception:
> "NameError in Admin_general#timeline
> Showing vendor/plugins/adminbootstraptheme/lib/views/admin_general/timeline.rhtml
> where line # raised:
> undefined local variable or method `comments' for
> #<ActionView::Base:0x7f436486e710>"

<% @title = "Timeline" %>

    Hour
    Day
    2 days
    Week
    Month
    All time

<%=h @events_title%>

<% last_date = nil %>
<% for event in @events %>
    <% if last_date != event.created_at.to_date %>
        <% if last_date.nil? %>

        <% end %>

<%= simple_date(event.created_at) %>

    <% else %>

    <% end %>
    <% last_date = event.created_at.to_date %>

    <%= simple_time(event.created_at) %>

    <% if event.class.to_s == 'InfoRequestEvent' %>
        <%= link_to(''.html_safe, request_admin_url(event.info_request), :title => "view full details")%>
        <%= link_to(event.info_request.title, request_url(event.info_request), :title => "view request on public website")%>

        <% if event.event_type == 'edit' %>
            was edited by administrator <%=h event.params[:editor] %>.
            <% for p in ['title', 'prominence', 'described_state', 'awaiting_description']
                    if event.params[p.to_sym] != event.params[('old_'+p).to_sym]
                        %> Changed <%=p%> from '<%=h event.params[('old_'+p).to_sym]%>' to '<%=h event.params[p.to_sym] %>'. <%
                    end
               end
            %>
        <% elsif event.event_type == 'edit_outgoing' %>
            <% outgoing_message = OutgoingMessage.find(event.params[:outgoing_message_id].to_i) %>
            had outgoing message edited by administrator <%=h event.params[:editor] %>.
            <% if outgoing_messages.size > 0 %>
                <% outgoing_message = outgoing_messages[0] %>
                <% for p in ['body']
                        if event.params[p.to_sym] != event.params[('old_'+p).to_sym]
                            %> Changed <%=p%> from '<%=h event.params[('old_'+p).to_sym]%>' to '<%=h event.params[p.to_sym] %>'. <%
                        end
                   end
                %>
            <% else %>
                Missing outgoing message, internal error.
            <% end %>
        <% elsif event.event_type == 'edit_comment' %>
            <% comment = Comment.find(event.params[:comment_id].to_i) %>
            had annotation edited by administrator <%=h event.params[:editor] %>.
            <% if comment %>
                <% for p in ['body']
                        if event.params[p.to_sym] != event.params[('old_'+p).to_sym]
                            %> Changed <%=p%> from '<%=h event.params[('old_'+p).to_sym]%>' to '<%=h event.params[p.to_sym] %>'. <%
                        end
                   end
                %>
            <% else %>
                Missing annotation, internal error.
            <% end %>
        <% elsif event.event_type == 'destroy_incoming' %>
            had incoming message deleted by administrator <%=h event.params[:editor] %>.
        <% elsif event.event_type == 'destroy_outgoing' %>
            had outgoing message deleted by administrator <%=h event.params[:editor] %>.
        <% elsif event.event_type == 'redeliver_outgoing' %>
            had incoming message redelivered to another request by administrator <%=h event.params[:editor] %>.
         <% elsif event.event_type == 'response' %>
            <% incoming_message = event.incoming_message %>
            received
            <%= link_to 'a response', main_url(incoming_message_url(incoming_message)) %>
            from <%=h event.info_request.public_body.name %>.
        <% elsif event.event_type == 'sent' %>
            was initially sent to <%=h event.params[:email]%> at <%=h event.info_request.public_body.name %>.
        <% elsif event.event_type == 'resent' %>
            had the request resent to <%=h event.params[:email]%> at <%=h event.info_request.public_body.name %>.
        <% elsif event.event_type == 'followup_sent' %>
            had a follow up message sent to <%=h event.info_request.public_body.name %>.
        <% elsif event.event_type == 'comment' %>
            had an annotation posted by <%=h event.comment.user.name %>.
        <% elsif event.event_type == 'status_update' %>
                had its status updated by <%=h User.find(event.params[:user_id]).name %> from '<%= h event.params[:old_described_state] %>' to '<%= h event.params[:described_state] %>'.
        <% else %>
            had '<%=event.event_type%>' done to it, parameters <%=h event.params_yaml%>.
        <% end %>
    <% else %>
        <%= link_to(''.html_safe, public_body_admin_url(event.public_body), :title => "view full details")%>
        <%= link_to(event.public_body.name, public_body_url(event.public_body), :title => "view authority on public website")%>
        was created/updated by administrator <%=h event.last_edit_editor %>
    <% end %>
<% end %>
<% if not @events.empty? %>

<% end %>

<% @title = "Timeline" %>

    Hour
    Day
    2 days
    Week
    Month
    All time

<%=h @events_title%>

<% last_date = nil %>
<% for event in @events %>
    <% if last_date != event.created_at.to_date %>
        <% if last_date.nil? %>

        <% end %>

<%= simple_date(event.created_at) %>

    <% else %>

    <% end %>
    <% last_date = event.created_at.to_date %>

    <%= simple_time(event.created_at) %>

    <% if event.class.to_s == 'InfoRequestEvent' %>
        <%= link_to(''.html_safe, request_admin_url(event.info_request), :title => "view full details")%>
        <%= link_to(event.info_request.title, request_url(event.info_request), :title => "view request on public website")%>

        <% if event.event_type == 'edit' %>
            was edited by administrator <%=h event.params[:editor] %>.
            <% for p in ['title', 'prominence', 'described_state', 'awaiting_description']
                    if event.params[p.to_sym] != event.params[('old_'+p).to_sym]
                        %> Changed <%=p%> from '<%=h event.params[('old_'+p).to_sym]%>' to '<%=h event.params[p.to_sym] %>'. <%
                    end
               end
            %>
        <% elsif event.event_type == 'edit_outgoing' %>
            <% outgoing_message = OutgoingMessage.find(event.params[:outgoing_message_id].to_i) %>
            had outgoing message edited by administrator <%=h event.params[:editor] %>.
            <% if outgoing_messages.size > 0 %>
                <% outgoing_message = outgoing_messages[0] %>
                <% for p in ['body']
                        if event.params[p.to_sym] != event.params[('old_'+p).to_sym]
                            %> Changed <%=p%> from '<%=h event.params[('old_'+p).to_sym]%>' to '<%=h event.params[p.to_sym] %>'. <%
                        end
                   end
                %>
            <% else %>
                Missing outgoing message, internal error.
            <% end %>
        <% elsif event.event_type == 'edit_comment' %>
            <% comment = Comment.find(event.params[:comment_id].to_i) %>
            had annotation edited by administrator <%=h event.params[:editor] %>.
            <% if comments.size > 0 %>
                <% comment = comments[0] %>
                <% for p in ['body']
                        if event.params[p.to_sym] != event.params[('old_'+p).to_sym]
                            %> Changed <%=p%> from '<%=h event.params[('old_'+p).to_sym]%>' to '<%=h event.params[p.to_sym] %>'. <%
                        end
                   end
                %>
            <% else %>
                Missing annotation, internal error.
            <% end %>
        <% elsif event.event_type == 'destroy_incoming' %>
            had incoming message deleted by administrator <%=h event.params[:editor] %>.
        <% elsif event.event_type == 'destroy_outgoing' %>
            had outgoing message deleted by administrator <%=h event.params[:editor] %>.
        <% elsif event.event_type == 'redeliver_outgoing' %>
            had incoming message redelivered to another request by administrator <%=h event.params[:editor] %>.
         <% elsif event.event_type == 'response' %>
            <% incoming_message = event.incoming_message %>
            received
            <%= link_to 'a response', main_url(incoming_message_url(incoming_message)) %>
            from <%=h event.info_request.public_body.name %>.
        <% elsif event.event_type == 'sent' %>
            was initially sent to <%=h event.params[:email]%> at <%=h event.info_request.public_body.name %>.
        <% elsif event.event_type == 'resent' %>
            had the request resent to <%=h event.params[:email]%> at <%=h event.info_request.public_body.name %>.
        <% elsif event.event_type == 'followup_sent' %>
            had a follow up message sent to <%=h event.info_request.public_body.name %>.
        <% elsif event.event_type == 'comment' %>
            had an annotation posted by <%=h event.comment.user.name %>.
        <% elsif event.event_type == 'status_update' %>
                had its status updated by <%=h User.find(event.params[:user_id]).name %> from '<%= h event.params[:old_described_state] %>' to '<%= h event.params[:described_state] %>'.
        <% else %>
            had '<%=event.event_type%>' done to it, parameters <%=h event.params_yaml%>.
        <% end %>
    <% else %>
        <%= link_to(''.html_safe, public_body_admin_url(event.public_body), :title => "view full details")%>
        <%= link_to(event.public_body.name, public_body_url(event.public_body), :title => "view authority on public website")%>
        was created/updated by administrator <%=h event.last_edit_editor %>
    <% end %>
<% end %>
<% if not @events.empty? %>

<% end %>


Updated news.rhtml with the latest.

Updated news.rhtml with the latest.

<% @title = 'News' %>

<%= @title %>

This page lists the latest changes to and news about the Mushroom Observer website.

Friday August 3, 2007

Added citations to Names.

Search improvements:

            Box is larger.

            Search value stays in all cases.

            Switched from just matching the beginning of the name string (unless there's a %), to searching anywhere in multple fields.

            Removed Location search since that's included in the Observation search now.

Updated the past name page to explicitly show previous statuses and citations.

Thursday August 2, 2007

Added Approve or Deprecate links to Show Name pages based on whether the name is deprecated or not.

Removed 'Deprecated' checkbox from the Edit Name page.

Fixed a bug in Edit Observation where providing a totally new name lost any other changes or edits made on the page.

Fixed some of the handling of 'Unknown'.

Fixed a bug in recording if a Name used to be deprecated.

Friday July 20, 2007

Allowed system to assume that a non-deprecated name is preferred over a deprecated name if there is ambiguity.

Fixed bug in saving author changes when the name can't be changed that was introduced in the July 6 update.

Friday July 6, 2007

Reorganized the links on the observation, image and name pages to hopefully be more intuitive.

Limited the ability to change the name and author of name to avoid changes to other people's observations without
	        their approval.

Fixed a few minor bugs.

Sunday July 1, 2007

Updated the checklist code to give long lists after a visit to either the Observation Index or Name Index pages.

Cleaned up the naming of Observation Index and Name Index.  All Names is still maintained, but is now the same as the Name Index.

Saturday June 30, 2007

Valid names are now in bold.  Deprecated names are not.

Thursday June 28, 2007

Moved to new hosting service.

Sunday June 24, 2007

If there are two names that have exactly the same name and author and at least one of them has no notes, then they will get automatically merged if one of them is edited.

Added a facility for testing the performance of image uploading.

Fixed an omission in the error reporting code that caused alert emails to not get sent.

Monday June 18, 2007

Names can now be marked as deprecated.  The setting can be changed using the Edit Name page.

Synonyms support added.  Synonyms are used to verify names of observations and in species lists.

Synonyms can be changed for one name by selecting 'Change Synonyms' from any Show Name page.

Larger sets of names and synonyms can be added from the Bulk Name Edit page available from any Show
	        Name page, the Name Index page or the All Names page.

The Name Index page only lists names that have observations.

The All Names page lists all names in the database and can be accessed from the Name Index page.

Fixed bug with Creating Observations immediately after creating a new account.

Monday May 21, 2007

One year anniversary!

Added Site Stats, Contributors, Show User, User Observations and Comments for User pages.

Sunday May 13, 2007

Fixed a variety of minor issues.

Added 'sanitize' calls to avoid cross-site scripting vulnerabilities.

Thursday May 10, 2007

Fixed bug in creating new names when creating a species list.

Sunday April 29, 2007

Substantially improved error handling.

Fixed problem with Google Web Accelerator.

Sunday April 22, 2007

Reorganized and simplified observation editing and creation.

Completed unit testing for existing pages.

Friday February 23, 2007

Adjusted the size of some of the notes widgets to fill more of the screen.

Monday February 19, 2007

Added note snippet and comment count to Show Image page for easier review.

Adjusted options available for the number of rows in list displays.

Fixed database migration scripts.

Internal data simplification (removed observations.what field).

Tuesday February 13, 2007

Added multiple upload option for Add Images.

Changed some of the links in the left hand panel based on user feedback.

Saturday February 10, 2007

Added image and location search within the site.

Thursday February 8, 2007

Added Google image search links to Observation and Name pages.

Wednesday February 7, 2007

Added checklists.  Items in the checklist are the results of the
                latest search or viewed species list.  Viewing large lists like
                'Latest Changes' or 'Name Index' will reset the checklist to all
                names.

Moved loading species lists from files to a separate page off of
                Edit Species List to avoid an interaction between the checklist
                and file loading.

Saturday January 27, 2007

Name edits now appear in the RSS feed.

Sunday January 21, 2007

Added How To Use page.

Changed 'New' links to 'Create'.

Fixed a bug with the search box.

Fixed a couple of bugs with the next/prev links.

Thursday January 11, 2007

Fixed a bug with creating new species.

Fixed many bugs with page titles, some of which were preventing pages from loading.

Tuesday January 9, 2007

Names are now database objects rather than just strings.  They have a
                rank, a text name an author and notes.

A show_name page shows this information as well as a list of all
        observations that use that Name.  The show_pages can be accessed from
        each show_observation page as well as the name_index page that is
        available in the left-side panel.

Names can be edited on the edit_name pages that are accessible from
        the show_name pages.  Anyone is allowed to edit any name, but
        following the Wikipedia model,
        a record is kept of every version.  The previous versions are stored as
        'past names'.  A show_past_name page shows the name information for a
        previous version of a name and is accessible from each show_name page.

Names are associated with observations through the 'what' field of the
        observation.  When the 'what' field is changed, the names are searched
        for a match.  The 'what' field can either be the text_name or the
        text_name and the author for a name.  No match is found for a 'what'
        value, then the user is given the option to create the new name.  If a
        'what' value matches more than one name (due to different authors
        publishing the same name), then the user is given a choice between the
        options.  The options list how many observations use each version of
        the name.  If you add an author to a 'what' field for a name that does
        not have an author already, it will ask you if you want to create the
        new name, but it will actually update the existing name.

Names given in species lists are treated in the exact same manner,
        except that all the new names and all of the multiple matches are
        dealt with on the same page.  There is also an option on the
        new_species_list and edit_species_list pages to 'Just Create New
        Names'.  This adds the names without updating the species list or
        creating the corresponding observations.

The search box is now available on every page.

Removed the Observation Index in favor of the Name Index.

Fixed some of the list ordering to make it more intuitive.

A filter was added to the account creation process that should reduce the
        number of bot created users.

Fixed a bug with bouncing between observations and images and using the
        next/prev links.

Monday December 18, 2006

Added prev/next links that follow the RSS feed.

Improved prev/next functionality throughout the site.

RSS feed descriptions now have appropriate line breaks.

Monday December 4, 2006

Species lists can now be uploaded from files.

Separated note for species list from note that applies to member observations.

Fixed use of multiple tabs by switching from session data to hidden fields.

mushroomobserver.org/# == mushroomobserver.org/observer/show_observation/#

Monday October 26, 2006

Switched Observations->By Name to include thumbnails and follow layout.

Maintained old By Name behavior as Observations->Index.

Added simple search box to Activity Log (Latest Changes) and Observation list pages.

Monday October 23, 2006

Changed default page to the RSS feed.

Changed page layout for observation and image list pages.

Added layout controls to user preferences.  Set to 10 rows x 1 column
			and turn off 'Put text below images' to get old layout.

Changed thumbnail image size from 100px to 160px with lower quality (jpeg 50 vs. 75).

Provided Prev/Next buttons for images.

Added link to ask the webmaster a question about the site.

Split up 'Manage Images' into 'Add Image', 'Reuse Image' and 'Remove Images' and made
			them more visible.

'Reuse Image' allows you to look at the images.

Added links for viewing the log for observations and species lists.

Made database lookup for all observations much more efficient.

Rearranged left-hand panel.

Images no longer have titles.  They are derived from the observation(s) they are
			connected to.

Removed Edit and Destroy links from view pages.

Add mini-icon for webpages.

Sunday September 9, 2006

Links to email the creator of observations or images with questions or commerical inquiries.  The creator receives an email with the address of the user who wants to contact them.  It is up to the creator whether they want to respond.

User preferences added to disable the above email feature and to stop receiving emails like this letting you know about new features.

RSS feed has been overhauled to reduce the number of entries and make them more relevant.

Copyright holder now has an option to be something other than a registered user.  The user who uploads the image is the default, but it can now be changed on a per image basis.

Monday August 21, 2006

	Added RSS feed for all interesting events that happen on the site.

	Added 'Create Account' link on login page to make it more obvious.

	Tweaked page titles to make the site easier to index.

Sunday August 13, 2006

	Added this news page.

	List pages now have a better interface for paging than just next/previous,
	and its at the top and bottom of each page.

Saturday August 12, 2006

	Added email verification system to user signup.

<% @title = 'News' %>

<%= @title %>

This page lists the latest changes to and news about the Mushroom Observer website.

Thursday August 2, 2007

Added Approve or Deprecate links to Show Name pages based on whether the name is deprecated or not.

Removed 'Deprecated' checkbox from the Edit Name page.

Fixed a bug in Edit Observation where providing a totally new name lost any other changes or edits made on the page.

Fixed some of the handling of 'Unknown'.

Fixed a bug in recording if a Name used to be deprecated.

Friday July 20, 2007

Allowed system to assume that a non-deprecated name is preferred over a deprecated name if there is ambiguity.

Fixed bug in saving author changes when the name can't be changed that was introduced in the July 6 update.

Friday July 6, 2007

Reorganized the links on the observation, image and name pages to hopefully be more intuitive.

Limited the ability to change the name and author of name to avoid changes to other people's observations without
	        their approval.

Fixed a few minor bugs.

Sunday July 1, 2007

Updated the checklist code to give long lists after a visit to either the Observation Index or Name Index pages.

Cleaned up the naming of Observation Index and Name Index.  All Names is still maintained, but is now the same as the Name Index.

Saturday June 30, 2007

Valid names are now in bold.  Deprecated names are not.

Thursday June 28, 2007

Moved to new hosting service.

Sunday June 24, 2007

If there are two names that have exactly the same name and author and at least one of them has no notes, then they will get automatically merged if one of them is edited.

Added a facility for testing the performance of image uploading.

Fixed an omission in the error reporting code that caused alert emails to not get sent.

Monday June 18, 2007

Names can now be marked as deprecated.  The setting can be changed using the Edit Name page.

Synonyms support added.  Synonyms are used to verify names of observations and in species lists.

Synonyms can be changed for one name by selecting 'Change Synonyms' from any Show Name page.

Larger sets of names and synonyms can be added from the Bulk Name Edit page available from any Show
	        Name page, the Name Index page or the All Names page.

The Name Index page only lists names that have observations.

The All Names page lists all names in the database and can be accessed from the Name Index page.

Fixed bug with Creating Observations immediately after creating a new account.

Monday May 21, 2007

One year anniversary!

Added Site Stats, Contributors, Show User, User Observations and Comments for User pages.

Sunday May 13, 2007

Fixed a variety of minor issues.

Added 'sanitize' calls to avoid cross-site scripting vulnerabilities.

Thursday May 10, 2007

Fixed bug in creating new names when creating a species list.

Sunday April 29, 2007

Substantially improved error handling.

Fixed problem with Google Web Accelerator.

Sunday April 22, 2007

Reorganized and simplified observation editing and creation.

Completed unit testing for existing pages.

Friday February 23, 2007

Adjusted the size of some of the notes widgets to fill more of the screen.

Monday February 19, 2007

Added note snippet and comment count to Show Image page for easier review.

Adjusted options available for the number of rows in list displays.

Fixed database migration scripts.

Internal data simplification (removed observations.what field).

Tuesday February 13, 2007

Added multiple upload option for Add Images.

Changed some of the links in the left hand panel based on user feedback.

Saturday February 10, 2007

Added image and location search within the site.

Thursday February 8, 2007

Added Google image search links to Observation and Name pages.

Wednesday February 7, 2007

Added checklists.  Items in the checklist are the results of the
                latest search or viewed species list.  Viewing large lists like
                'Latest Changes' or 'Name Index' will reset the checklist to all
                names.

Moved loading species lists from files to a separate page off of
                Edit Species List to avoid an interaction between the checklist
                and file loading.

Saturday January 27, 2007

Name edits now appear in the RSS feed.

Sunday January 21, 2007

Added How To Use page.

Changed 'New' links to 'Create'.

Fixed a bug with the search box.

Fixed a couple of bugs with the next/prev links.

Thursday January 11, 2007

Fixed a bug with creating new species.

Fixed many bugs with page titles, some of which were preventing pages from loading.

Tuesday January 9, 2007

Names are now database objects rather than just strings.  They have a
                rank, a text name an author and notes.

A show_name page shows this information as well as a list of all
        observations that use that Name.  The show_pages can be accessed from
        each show_observation page as well as the name_index page that is
        available in the left-side panel.

Names can be edited on the edit_name pages that are accessible from
        the show_name pages.  Anyone is allowed to edit any name, but
        following the Wikipedia model,
        a record is kept of every version.  The previous versions are stored as
        'past names'.  A show_past_name page shows the name information for a
        previous version of a name and is accessible from each show_name page.

Names are associated with observations through the 'what' field of the
        observation.  When the 'what' field is changed, the names are searched
        for a match.  The 'what' field can either be the text_name or the
        text_name and the author for a name.  No match is found for a 'what'
        value, then the user is given the option to create the new name.  If a
        'what' value matches more than one name (due to different authors
        publishing the same name), then the user is given a choice between the
        options.  The options list how many observations use each version of
        the name.  If you add an author to a 'what' field for a name that does
        not have an author already, it will ask you if you want to create the
        new name, but it will actually update the existing name.

Names given in species lists are treated in the exact same manner,
        except that all the new names and all of the multiple matches are
        dealt with on the same page.  There is also an option on the
        new_species_list and edit_species_list pages to 'Just Create New
        Names'.  This adds the names without updating the species list or
        creating the corresponding observations.

The search box is now available on every page.

Removed the Observation Index in favor of the Name Index.

Fixed some of the list ordering to make it more intuitive.

A filter was added to the account creation process that should reduce the
        number of bot created users.

Fixed a bug with bouncing between observations and images and using the
        next/prev links.

Monday December 18, 2006

Added prev/next links that follow the RSS feed.

Improved prev/next functionality throughout the site.

RSS feed descriptions now have appropriate line breaks.

Monday December 4, 2006

Species lists can now be uploaded from files.

Separated note for species list from note that applies to member observations.

Fixed use of multiple tabs by switching from session data to hidden fields.

mushroomobserver.org/# == mushroomobserver.org/observer/show_observation/#

Monday October 26, 2006

Switched Observations->By Name to include thumbnails and follow layout.

Maintained old By Name behavior as Observations->Index.

Added simple search box to Activity Log (Latest Changes) and Observation list pages.

Monday October 23, 2006

Changed default page to the RSS feed.

Changed page layout for observation and image list pages.

Added layout controls to user preferences.  Set to 10 rows x 1 column
			and turn off 'Put text below images' to get old layout.

Changed thumbnail image size from 100px to 160px with lower quality (jpeg 50 vs. 75).

Provided Prev/Next buttons for images.

Added link to ask the webmaster a question about the site.

Split up 'Manage Images' into 'Add Image', 'Reuse Image' and 'Remove Images' and made
			them more visible.

'Reuse Image' allows you to look at the images.

Added links for viewing the log for observations and species lists.

Made database lookup for all observations much more efficient.

Rearranged left-hand panel.

Images no longer have titles.  They are derived from the observation(s) they are
			connected to.

Removed Edit and Destroy links from view pages.

Add mini-icon for webpages.

Sunday September 9, 2006

Links to email the creator of observations or images with questions or commerical inquiries.  The creator receives an email with the address of the user who wants to contact them.  It is up to the creator whether they want to respond.

User preferences added to disable the above email feature and to stop receiving emails like this letting you know about new features.

RSS feed has been overhauled to reduce the number of entries and make them more relevant.

Copyright holder now has an option to be something other than a registered user.  The user who uploads the image is the default, but it can now be changed on a per image basis.

Monday August 21, 2006

	Added RSS feed for all interesting events that happen on the site.

	Added 'Create Account' link on login page to make it more obvious.

	Tweaked page titles to make the site easier to index.

Sunday August 13, 2006

	Added this news page.

	List pages now have a better interface for paging than just next/previous,
	and its at the top and bottom of each page.

Saturday August 12, 2006

	Added email verification system to user signup.


Add comment to the "initial_request" email template to remind developers not to change it without a new Censor rule


Made default results page work properly

Made default results page work properly

git-svn-id: 96bd6241e080dd4199045f7177cf3384e2eaed71@415 2d86388d-c40f-0410-ad6a-a69da6a65d20

<% @page_title = "Results: #{@year}" %>

#{@year} Results

  	<% unless @events.empty? %>
    <%- for event in @events.values.flatten.sort {|x,y| y.date <=> x.date} -%>
  <tr class="<%= cycle('even', 'odd') %>">
    <%= event.short_date %>
	<%= link_to event.name, :action => 'event', :year => @year, :discipline => event.discipline, :id => event.id %>

  <% end %>
  <% else %>

Results will be posted when available

  <%- end -%>

<% @page_title = "Results: #{@year}" %>

Results

  	<% unless @road_events.empty? %>

    <%- for event in @road_events -%>
<%= event.short_date %> <%=
  link_to event.name,
  :action => 'event', :year => @year, :discipline => event.discipline, :id => event.id
%>
      <%- end -%>

  <% else %>

Results will be posted when available

  <% end %>


Replaced subject navigator for collection with direct article links

<span id='<%= "cat_#{category.id}_art_#{article.id}" %>'>
<%= link_to(article.title,
           { :controller => 'article',
				      :action => 'show',
                     :article_id => article.id,
                     :ol => 'cat_nav_alink' }) %>

<span id='<%= "cat_#{category.id}_art_#{article.id}" %>'>
<%= link_to_remote(article.title,
                   :url => { :action => 'expand_article',
                             :category_id => category.id,
                             :article_id => article.id,
                             :ol => 'cat_nav_alink' },
                   :update => "cat_#{category.id}_art_#{article.id}") %>


ActionItem70: don't look for a category when there is not one

git-svn-id: 43659daf80e124e0b603d67096418e58e4f21099@548 3f533792-8f58-4932-b0fe-aaf55b0a4547

  <% @environment.display_categories.each do |item| %>
    <li id='category<%= item.display_color %>' <%= 'class="active"' if (@category && (@category.top_ancestor == item)) %> >
      <%= item.name %>

        <% item.children.each do |child| %>

<%= link_to(content_tag('span', child.name), :controller => 'category', :action => 'view', :path => child.explode_path) %>

        <% end %>

  <% end %>

  <% @environment.display_categories.each do |item| %>
    <li id='category<%= item.display_color %>' <%= 'class="active"' if (@category.top_ancestor == item) %> >
      <%= item.name %>

        <% item.children.each do |child| %>

<%= link_to(content_tag('span', child.name), :controller => 'category', :action => 'view', :path => child.explode_path) %>

        <% end %>

  <% end %>


Modified bootstrap detection code to add 'box-shadow' and 'border-rad' class names when browser supports those properties.

<%
# ==========================================================================
# Project:   SproutCore - JavaScript Application Framework
# Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
#            Portions ©2008-2009 Apple, Inc. All rights reserved.
# License:   Licened under MIT license (see license.js)
# ==========================================================================
#
# This file contains bootstrap code to be included at the top of standard
# SproutCore apps.  This code will autodetect the browser and then adds
# a class name to the 'body' tag.  You can use this class name to customize
# the CSS rules to be applied to your page based on browser.  The class name
# contains the name webkit|mozilla|ie + the major version number
#
-%>
<% content_for('bootstrap') do %>
var SC = SC || {};
SC.browser = (function() {
  var userAgent = navigator.userAgent.toLowerCase();
  var version = (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1] ;

  var browser = {
    version: version,
    safari: (/webkit/).test( userAgent ) ? version : 0,
    opera: (/opera/).test( userAgent ) ? version : 0,
    msie: (/msie/).test( userAgent ) && !(/opera/).test( userAgent ) ? version : 0,
    mozilla: (/mozilla/).test( userAgent ) && !(/(compatible|webkit)/).test( userAgent ) ? version : 0,
    mobileSafari: (/apple.*mobile.*safari/).test(userAgent) ? version : 0,
    windows: !!(/(windows)/).test(userAgent),
    mac: !!((/(macintosh)/).test(userAgent) || (/(mac os x)/).test(userAgent)),
    language: ((navigator.language || navigator.browserLanguage).split('-', 1)[0])
  };

    browser.current = (browser.msie) ? 'msie' : (browser.mozilla) ? 'mozilla' : (browser.safari) ? 'safari' : (browser.opera) ? 'opera' : 'unknown' ;
  return browser ;
})();

SC.setupBodyClassNames = function() {
  var el = document.body ;
  var browser, platform, shadows, borderRad, classNames;
  if (!el) return ;
  browser = SC.browser.current ;
  platform = (SC.browser.windows) ? 'windows' : (SC.browser.mac) ? 'mac' : 'other-platform' ;

  shadows = (document.documentElement.style.MozBoxShadow !== undefined) ||
                (document.documentElement.style.webkitBoxShadow !== undefined) ||
                (document.documentElement.style.oBoxShadow !== undefined) ||
                (document.documentElement.style.boxShadow !== undefined);

  borderRad = (document.documentElement.style.MozBorderRadius !== undefined) ||
              (document.documentElement.style.webkitBorderRadius !== undefined) ||
              (document.documentElement.style.oBorderRadius !== undefined) ||
              (document.documentElement.style.borderRadius !== undefined);

  classNames = (el.className) ? el.className.split(' ') : [] ;
  if(shadows) classNames.push('box-shadow');
  if(borderRad) classNames.push('border-rad');
  classNames.push(browser) ;
  classNames.push(platform) ;
  if (SC.browser.mobileSafari) classNames.push('mobile-safari') ;
  el.className = classNames.join(' ') ;
} ;

<% end %>
<% content_for('setup_body_class_names') do %>
if (SC.setupBodyClassNames) SC.setupBodyClassNames() ;
<% end -%>

<%
# ==========================================================================
# Project:   SproutCore - JavaScript Application Framework
# Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
#            Portions ©2008-2009 Apple, Inc. All rights reserved.
# License:   Licened under MIT license (see license.js)
# ==========================================================================
#
# This file contains bootstrap code to be included at the top of standard
# SproutCore apps.  This code will autodetect the browser and then adds
# a class name to the 'body' tag.  You can use this class name to customize
# the CSS rules to be applied to your page based on browser.  The class name
# contains the name webkit|mozilla|ie + the major version number
#
-%>
<% content_for('bootstrap') do %>
var SC = SC || {};
SC.browser = (function() {
  var userAgent = navigator.userAgent.toLowerCase();
  var version = (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1] ;

  var browser = {
    version: version,
    safari: (/webkit/).test( userAgent ) ? version : 0,
    opera: (/opera/).test( userAgent ) ? version : 0,
    msie: (/msie/).test( userAgent ) && !(/opera/).test( userAgent ) ? version : 0,
    mozilla: (/mozilla/).test( userAgent ) && !(/(compatible|webkit)/).test( userAgent ) ? version : 0,
    mobileSafari: (/apple.*mobile.*safari/).test(userAgent) ? version : 0,
    windows: !!(/(windows)/).test(userAgent),
    mac: !!((/(macintosh)/).test(userAgent) || (/(mac os x)/).test(userAgent)),
    language: ((navigator.language || navigator.browserLanguage).split('-', 1)[0])
  };

    browser.current = (browser.msie) ? 'msie' : (browser.mozilla) ? 'mozilla' : (browser.safari) ? 'safari' : (browser.opera) ? 'opera' : 'unknown' ;
  return browser ;
})();

SC.setupBodyClassNames = function() {
  var el = document.body ;
  if (!el) return ;
  var browser = SC.browser.current ;
  var platform = (SC.browser.windows) ? 'windows' : (SC.browser.mac) ? 'mac' : 'other-platform' ;
  var classNames = (el.className) ? el.className.split(' ') : [] ;
  classNames.push(browser) ;
  classNames.push(platform) ;
  if (SC.browser.mobileSafari) classNames.push('mobile-safari') ;
  el.className = classNames.join(' ') ;
} ;

<% end %>
<% content_for('setup_body_class_names') do %>
if (SC.setupBodyClassNames) SC.setupBodyClassNames() ;
<% end -%>


add link to clear all visible comments

add link to clear all visible comments

git-svn-id: 4158f9403e16ea83fe8a6e07a45f1f3b56a747ab@1300 567b1171-46fb-0310-a4c9-b4bef9110e78

<% content_for :action_nav do %>

        <% unless @article.new_record? -%>

<%= link_to 'Edit this article', :action => :edit, :id => @article %>

        <% end -%>
        <% if @article.draft -%>

<%= link_to 'Edit article draft', :action => :draft, :id => @article.draft %>

        <% end -%>
        <% if @article.comments.any? -%>

<%= link_to "View comments", :controller => 'articles', :action => 'comments', :id => @article %>

        <% end %>
        <% if controller.action_name == 'comments' -%>

<%= link_to_remote 'Clear Comments', :confirm => "Are you sure you wish to clear all visible comments?",
              :url => { :action => 'destroy_comment', :id => @article }, :with => "ArticleForm.getAvailableComments().toQueryString('comment')"
            %>

        <% end -%>

<% end unless @article.new_record? && @article.draft.nil? && @article.comments.empty? -%>

<% content_for :action_nav do %>

        <% unless @article.new_record? -%>

<%= link_to 'Edit this article', :action => :edit, :id => @article %>

        <% end -%>
        <% if @article.draft -%>

<%= link_to 'Edit article draft', :action => :draft, :id => @article.draft %>

        <% end -%>
        <% if @article.comments.any? -%>

<%= link_to "View comments", :controller => 'articles', :action => 'comments', :id => @article %>

        <% end %>

<% end unless @article.new_record? && @article.draft.nil? && @article.comments.empty? -%>


Don't depend on javascript for button to do a post. More semantic

<%= _('Follow this request') %>

    <% follower_count = TrackThing.count(:all, :conditions => ["info_request_id = ?", @info_request.id]) + 1 %>

<%= n_("There is %d person following this request", "There are %d people following this request", follower_count) % follower_count %>

     <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user == @user, :location => 'sidebar' } %>

    <% if @info_request.described_state != "attention_requested" %>

<%= _('Offensive? Unsuitable?') %>

      <% if @info_request.attention_requested %>
        <% if @info_request.prominence == 'hidden' %>
          <%# The eccentric formatting of the following string is in order that it be identical
              to the corresponding string in request/show.rhtml %>

<%= _('This request has prominence \'hidden\'. You can only see it because you are logged
    in as a super user.') %>

        <% elsif @info_request.prominence == 'requester_only' %>
          <%# The eccentric formatting of the following string is in order that it be identical
              to the corresponding string in request/show.rhtml %>

<%= raw(_('This request is hidden, so that only you the requester can see it. Please
    contact us if you are not sure why.') % [help_requesting_path]) %>

        <% else %>

<%= raw(_('This request has been marked for review by the site administrators, who have not hidden it at this time. If you believe it should be hidden, please contact us.') % [help_requesting_path]) %>

        <% end %>
     <% else %>

<%= _('Requests for personal information and vexatious requests are not considered valid for FOI purposes (read more).') %>

<%= _('If you believe this request is not suitable, you can report it for attention by the site administrators') %>

       <%= button_to _("Report this request"), report_path, :class => "link_button_green" %>
      <% end %>
    <% end %>

<%= _("Act on what you've learnt") %>

     <% tweet_link = "https://twitter.com/share?url=#{h(request.url)}&via=#{h(Configuration::twitter_username)}&text='#{h(@info_request.title)}'&related=#{_('alaveteli_foi:The software that runs {{site_name}}', :site_name => h(site_name))}" %>
        <% link_to tweet_link do %>
          <%= image_tag "twitter-16.png", :alt => "twitter icon" %>
        <% end %>
        <%= link_to _("Tweet this request"), tweet_link %>

        <% link_to "http://wordpress.com/" do %>
          <%= image_tag "wordpress.png", :class => "rss" %>
        <% end %>
        <%= link_to _("Start your own blog"), "http://wordpress.com/"%>

    <%= render :partial => 'request/next_actions' %>

    <% # TODO: Cache for 1 day %>
      <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>

<%= _('Similar requests')%>

        <% for result in @xapian_similar.results %>
            <%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
        <% end %>
        <% if @xapian_similar_more %>

<%= link_to _("More similar requests"), request_similar_url(@info_request) %>

        <% end %>

      <% end %>

<%= link_to _('Event history details'), request_details_url(@info_request) %>

<%= raw(_('Are you the owner of
            any commercial copyright on this page?') % [help_officers_path+"#copyright"]) %>

<%= _('Follow this request') %>

    <% follower_count = TrackThing.count(:all, :conditions => ["info_request_id = ?", @info_request.id]) + 1 %>

<%= n_("There is %d person following this request", "There are %d people following this request", follower_count) % follower_count %>

     <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user == @user, :location => 'sidebar' } %>

    <% if @info_request.described_state != "attention_requested" %>

<%= _('Offensive? Unsuitable?') %>

      <% if @info_request.attention_requested %>
        <% if @info_request.prominence == 'hidden' %>
          <%# The eccentric formatting of the following string is in order that it be identical
              to the corresponding string in request/show.rhtml %>

<%= _('This request has prominence \'hidden\'. You can only see it because you are logged
    in as a super user.') %>

        <% elsif @info_request.prominence == 'requester_only' %>
          <%# The eccentric formatting of the following string is in order that it be identical
              to the corresponding string in request/show.rhtml %>

<%= raw(_('This request is hidden, so that only you the requester can see it. Please
    contact us if you are not sure why.') % [help_requesting_path]) %>

        <% else %>

<%= raw(_('This request has been marked for review by the site administrators, who have not hidden it at this time. If you believe it should be hidden, please contact us.') % [help_requesting_path]) %>

        <% end %>
     <% else %>

<%= _('Requests for personal information and vexatious requests are not considered valid for FOI purposes (read more).') %>

<%= _('If you believe this request is not suitable, you can report it for attention by the site administrators') %>

       <%= link_to _("Report this request"), report_path, :class => "link_button_green", :method => "POST" %>
      <% end %>
    <% end %>

<%= _("Act on what you've learnt") %>

     <% tweet_link = "https://twitter.com/share?url=#{h(request.url)}&via=#{h(Configuration::twitter_username)}&text='#{h(@info_request.title)}'&related=#{_('alaveteli_foi:The software that runs {{site_name}}', :site_name => h(site_name))}" %>
        <% link_to tweet_link do %>
          <%= image_tag "twitter-16.png", :alt => "twitter icon" %>
        <% end %>
        <%= link_to _("Tweet this request"), tweet_link %>

        <% link_to "http://wordpress.com/" do %>
          <%= image_tag "wordpress.png", :class => "rss" %>
        <% end %>
        <%= link_to _("Start your own blog"), "http://wordpress.com/"%>

    <%= render :partial => 'request/next_actions' %>

    <% # TODO: Cache for 1 day %>
      <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>

<%= _('Similar requests')%>

        <% for result in @xapian_similar.results %>
            <%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
        <% end %>
        <% if @xapian_similar_more %>

<%= link_to _("More similar requests"), request_similar_url(@info_request) %>

        <% end %>

      <% end %>

<%= link_to _('Event history details'), request_details_url(@info_request) %>

<%= raw(_('Are you the owner of
            any commercial copyright on this page?') % [help_officers_path+"#copyright"]) %>


Name the old stylesheet.

Name the old stylesheet.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

        <%= javascript_include_tag :defaults %>

        <title>
        <% if @title %>
            <%=@title%> - WhatDoTheyKnow
        <% else %>
            WhatDoTheyKnow - file and explore Freedom of Information (FOI) requests
        <% end %>
        </title>
        <%= stylesheet_link_tag 'main', :title => "Yucky green" %>
        <%= stylesheet_link_tag 'alt', :rel => "alternate stylesheet", :title => "Tommy1"  %>

            WhatDoTheyKnow?
            (<%= link_to "in development", about_url %>)

            Lift the lid on the UK public sector!

        <% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "navigation_search_form"}) do %>

               <%= text_field_tag 'query', params[:query], { :size => 25, :id => "navigation_search_query" } %>
               <%= submit_tag "Search" %>

        <% end %>

Make request

<%= link_to "View requests", request_list_url %>

<%= link_to "View authorities", list_public_bodies_url(:tag => 'department') %>

			<% if @user %>

<%=link_to "My requests", user_url(@user) %>

			<% end %>

<%= link_to "About", about_url %>

		<% if not (controller.action_name == 'signin' or controller.action_name == 'signup') %>

			<% if @user %>
				Hello, <%=h(@user.name)%>!
				(<%= link_to "Sign out", signout_url(:r => request.request_uri) %>)
			<% else %>
				Hello! (<%= link_to "Sign in or sign up", signin_url(:r => request.request_uri) %>)
			<% end %>

		<% end %>

    <% if MySociety::Config.getbool("STAGING_SITE", 1) %>

            This is a test version of the site. FOI requests will not be sent to real public bodies.

    <% end %>

            <% if flash[:notice] %>

<%= flash[:notice] %>

            <% end %>
            <% if flash[:error] %>

<%= flash[:error] %>

            <% end %>

            <div id="<%= controller.controller_name + "_" + controller.action_name %>">
            <%= yield :layout %>

        Built by mySociety ... and you.
        Get the source code (is on Rails).
        Dedicated to Chris Lightfoot.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

        <%= javascript_include_tag :defaults %>

        <title>
        <% if @title %>
            <%=@title%> - WhatDoTheyKnow
        <% else %>
            WhatDoTheyKnow - file and explore Freedom of Information (FOI) requests
        <% end %>
        </title>
        <%= stylesheet_link_tag 'main' %>
        <%= stylesheet_link_tag 'alt', :rel => "alternate stylesheet", :title => "Tommy1"  %>

            WhatDoTheyKnow?
            (<%= link_to "in development", about_url %>)

            Lift the lid on the UK public sector!

        <% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "navigation_search_form"}) do %>

               <%= text_field_tag 'query', params[:query], { :size => 25, :id => "navigation_search_query" } %>
               <%= submit_tag "Search" %>

        <% end %>

Make request

<%= link_to "View requests", request_list_url %>

<%= link_to "View authorities", list_public_bodies_url(:tag => 'department') %>

			<% if @user %>

<%=link_to "My requests", user_url(@user) %>

			<% end %>

<%= link_to "About", about_url %>

		<% if not (controller.action_name == 'signin' or controller.action_name == 'signup') %>

			<% if @user %>
				Hello, <%=h(@user.name)%>!
				(<%= link_to "Sign out", signout_url(:r => request.request_uri) %>)
			<% else %>
				Hello! (<%= link_to "Sign in or sign up", signin_url(:r => request.request_uri) %>)
			<% end %>

		<% end %>

    <% if MySociety::Config.getbool("STAGING_SITE", 1) %>

            This is a test version of the site. FOI requests will not be sent to real public bodies.

    <% end %>

            <% if flash[:notice] %>

<%= flash[:notice] %>

            <% end %>
            <% if flash[:error] %>

<%= flash[:error] %>

            <% end %>

            <div id="<%= controller.controller_name + "_" + controller.action_name %>">
            <%= yield :layout %>

        Built by mySociety ... and you.
        Get the source code (is on Rails).
        Dedicated to Chris Lightfoot.


Removing the last reference to url_name

Removing the last reference to url_name

git-svn-id: 50a8ad97cae5d6ab203d2d535a9b32cd3858a8ac@138 c04ce798-636b-4ca8-9149-0f9336831111

<div class="project build_<%= project.last_build_status %>">

        <%= link_to project.name, :action => 'show', :id => project.name %>

      <%= project.builder_state_and_activity %>

      <% if project.last_build %>
        build <%= project.last_build.label %>
        <%= project.last_build_status.to_s.gsub('_', ' ') %>
        <%= format_time(project.last_build.time, :human) %>
      <% else %>
        Never built
      <% end %>

      <% if project.force_build_request_allowed? %>

          <% form_tag({:action => 'force_build', :id => project.name}, :class => 'force_build_form') do %>
            <%= submit_tag 'Build now' %>
          <% end %>

      <% end %>

    Latest builds:
    <% project.last_five_builds.each do |build| %>

        <%= link_to_build(project, build) %>

    <% end %>

<div class="project build_<%= project.last_build_status %>">

        <%= link_to project.name, :action => 'show', :id => project.name %>

      <%= project.builder_state_and_activity %>

      <% if project.last_build %>
        build <%= project.last_build.label %>
        <%= project.last_build_status.to_s.gsub('_', ' ') %>
        <%= format_time(project.last_build.time, :human) %>
      <% else %>
        Never built
      <% end %>

      <% if project.force_build_request_allowed? %>

          <% form_tag({:action => 'force_build', :id => project.url_name}, :class => 'force_build_form') do %>
            <%= submit_tag 'Build now' %>
          <% end %>

      <% end %>

    Latest builds:
    <% project.last_five_builds.each do |build| %>

        <%= link_to_build(project, build) %>

    <% end %>


Fixed categories sidebar ticket #115

Fixed categories sidebar ticket #115

<% unless sidebar.categories.blank? -%>

<%= _("Categories")%>

<% for category in sidebar.categories -%>
  <% unless sidebar.empty.blank? and category.article_counter == 0 %>

<%= link_to h(category.name), category_url(category)  %> <% if sidebar.count %>(<%= category.article_counter %>)<% end %>

  <% end %>
<% end -%>

<% end %>

<% unless sidebar.categories.blank? -%>

<%= _("Categories")%>

<% for category in sidebar.categories -%>
  <% unless empty.blank? and category.article_counter == 0 %>

<%= link_to h(category.name), category_url(category)  %> <% unless count.blank? %>(<%= category.article_counter %>)<% end %>

  <% end %>
<% end -%>

<% end %>


 Merge branch 'AI2924-add_verb_users_wall' into 'master'

AI2924 Add verb for the activities on user's wall

ActionItem: http://noosfero.org/Development/ActionItem2924

  <%= link_to(profile_image(activity.user, :minor), activity.user.url) %>

<div class='profile-activity-description profile-activity-article-<%= activity.target.class.icon_name %>'>

    <%= link_to activity.user.short_name(20), activity.user.url %>
    <%= _("has published on community %s") % link_to(activity.target.profile.short_name(20), activity.target.profile.url) if activity.target.profile.is_a?(Community) %>

<%= link_to(activity.params['name'], activity.params['url']) %>

    <span title='<%= activity.target.class.short_description %>' class='profile-activity-icon icon-new icon-new<%= activity.target.class.icon_name %>'>
    <%= image_tag(activity.params['first_image']) unless activity.params['first_image'].blank? %><%= strip_tags(truncate(activity.params['lead'], :length => 1000, :ommision => '...')).gsub(/(\xC2\xA0|\s)+/, ' ').gsub(/^\s+/, '') %> <%= link_to(_('See more'), activity.params['url']) unless activity.get_lead.blank? %>

  <%= content_tag(:p, link_to(_('See complete forum'), activity.get_url), :class => 'see-forum') if activity.target.is_a?(Forum) %>

<%= time_ago_as_sentence(activity.created_at) %>

    <%= link_to s_('profile|Comment'), '#', { :class => 'focus-on-comment'} %>
    <%= link_to_function(_('Remove'), 'remove_item_wall(this, %s, %s, %s); return false ;' % ["'.profile-activity-item'", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :only_hide => true, :view => params[:view]).to_json, _('Are you sure you want to remove this activity and all its replies?').to_json]) if logged_in? && current_person == @profile %>

<%= render :partial => 'profile_comments', :locals => { :activity => activity, :tab_action => tab_action } %>

  <%= link_to(profile_image(activity.user, :minor), activity.user.url) %>

<div class='profile-activity-description profile-activity-article-<%= activity.target.class.icon_name %>'>

    <%= link_to activity.user.short_name(20), activity.user.url %>
    <%= _("on community %s") % link_to(activity.target.profile.short_name(20), activity.target.profile.url) if activity.target.profile.is_a?(Community) %>

<%= link_to(activity.params['name'], activity.params['url']) %>

    <span title='<%= activity.target.class.short_description %>' class='profile-activity-icon icon-new icon-new<%= activity.target.class.icon_name %>'>
    <%= image_tag(activity.params['first_image']) unless activity.params['first_image'].blank? %><%= strip_tags(truncate(activity.params['lead'], :length => 1000, :ommision => '...')).gsub(/(\xC2\xA0|\s)+/, ' ').gsub(/^\s+/, '') %> <%= link_to(_('See more'), activity.params['url']) unless activity.get_lead.blank? %>

  <%= content_tag(:p, link_to(_('See complete forum'), activity.get_url), :class => 'see-forum') if activity.target.is_a?(Forum) %>

<%= time_ago_as_sentence(activity.created_at) %>

    <%= link_to s_('profile|Comment'), '#', { :class => 'focus-on-comment'} %>
    <%= link_to_function(_('Remove'), 'remove_item_wall(this, %s, %s, %s); return false ;' % ["'.profile-activity-item'", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :only_hide => true, :view => params[:view]).to_json, _('Are you sure you want to remove this activity and all its replies?').to_json]) if logged_in? && current_person == @profile %>

<%= render :partial => 'profile_comments', :locals => { :activity => activity, :tab_action => tab_action } %>