Add what Alex found about postal address.

<% @title = "About" %>

<%= render :partial => 'help/alpha_notice' %>

Contact Us

If your question isn't answered here, or you just wanted to let us know
something about the site, contact us.

Introduction to WhatDoTheyKnow

What is WhatDoTheyKnow for?

To help you find out inside information about what the UK government
is doing.

How does the site work?

You choose the public authority that you would like information from, then
write a brief note describing what you want to know. We then send your request
to the public authority. Any response they make is automatically published on the
website for you and anyone else to find and read.

Why would I bother to do this?

You pay taxes, and then government does things with the money. All sorts of
things that affect your life, from healthcare through to national defence. Some
it does badly, some it does well. The more we find out about how government
works, the better able we are to make suggestions to improve the things that
are done badly, and to celebrate the things that are done well.

Why would the public authority bother to reply?

Under Freedom of Information (FOI) law, they have to respond.

Who makes it?

WhatDoTheyKnow is made by mySociety,
and was initially funded by the JRSST Charitable Trust. mySociety is a project of the
registered charity UK Citizens Online Democracy.
If you like what we're doing, then you can
make a donation.

Making requests

You're missing the public authority that I want to request from!

Please contact us with the name of the public authority and,
if you can find it, their contact email address for Freedom of Information requests.
If you'd like to help add a whole category of public authority to the site, for example all
primary care trusts or all schools, then please
edit this shared spreadsheet (Google account required).

How quickly will I get a response?

By law public authorities must respond within 20 days, excluding weekends and
any UK bank holidays. The date that the response is due by is shown on the
page for your request. You will be emailed if this date goes by without
a response, so you can send the public authority another note to hurry them up.
Note: If you had to clarify your request, the clock starts from that date,
instead of the date they received your initial request.

What if I'm not satisfied with the response?

If you didn't get the information you asked for, or you didn't get it in time,
then read our page 'Unhappy about the response you got?'.

Can you tell me more of the nitty gritty about the process of making requests?

Have a look at the
access to official information
pages on the Information Commisioner's website.

Can I request information about myself?

Not using this site. Requests made using WhatDoTheyKnow are public, made under the
Freedom of Information Act, and cannot help you find information about a
private individual. If you would like to know what information a public
authority holds about yourself, you should make a "Subject Access Request" in
private using Data Protection law.  The leaflet Subject
Access - A guide for data subjects (on the Information Commisioner's
website) explains how to do this.

I'd like to keep my request secret! (At least until I publish my story)

WhatDoTheyKnow is currently only designed for public requests. All
responses that we receive are automatically published on the website for anyone
to read.  You should contact the public authority directly if you would like to
make a request in private.  If you're interested in buying a system which helps
you manage FOI requests in secret, then contact us.

Privacy policy

Who gets to see my email address?

We will not disclose your email address to anyone, including the public
authority you are sending a request to, unless we are obliged to by law,
or you ask us to. If you send a message to another user on the site, then
it will reveal your email address to them. You will be told that this
is going to happen.

Will you send nasty, brutish spam to my email address?

Nope. After you sign up to WhatDoTheyKnow we will only send you emails
relating to a request you made, an email alert that you have signed up for,
or for other reasons that you specifically authorise. We will never give or
sell your email addresses to anyone else, unless we are obliged to by law, or
you ask us to.

Why will my name appear publically on the site?

It means that someone researching the same area can get in touch with you,
and maybe give you more information or ideas relating to your request.  Also,
we're going to publish the response with the name of the civil servant who
wrote it, so it seems only fair that your name should be public too!
Therefore, we encourage you to use your real name, but you may use a pseudonym
if you would like to be anonymous.

So I can make an FOI request using a pseudonym?

Yes, you can. It is good practice for the public authority to reply to such
a request, except in special circumstances such as if they suspect you of
making vexatious requests. See Freedom of Information Good Practice Guidance No 6 for details. You
should refer to this if a public authority attempts to refuse a request because you used a pseudonym.
Saying that, you can avoid the problem by simply making your pseudonym look like a real person's name,
as there is no general obligation to prove your identity.

They've asked for my postal address!

If a public authority asks you for your full address, reply to them saying
that section 8.1.b of the FOI Act asks for an "address for correspondence",
and that the email address you are using is sufficient. The Department for
Constitutional Affairs has guidance on
this –
"Return address:  There is no obligation to comply with a
request for information if it does not give a return address. If a request is
received by email and, although no postal address is given, the email
address of the sender is included, then this should be treated as the
return address."

Why does the list of things that I'm tracking appear publically on the site?

This helps you find others who are researching the same area of government,
so you can form groups to investigate or campaign together. It also helps us
show requests which are related to other requests. If you've ever used a
"social bookmarking" website such as Delicious, Digg or reddit, think of it like
that.

Credit where credit is due

Which people made WhatDoTheyKnow?

Oh, nearly everyone (and maybe you too)!

    Heather Brooke
    (vampy!) has
    been pushing the idea of a UK FOI archive for years now.

    Both Phil Rodgers and Francis Irving
    entered it in a mySociety competition for ideas for public interest websites to build.

    It won,
    and then Chris Lightfoot (RIP :()
    thought up the wheeze of intercepting email responses to requests and
    automatically publishing them.

    Tom Steinberg got the cash to pay for the site from
    a dead chocolate mogul (thank you!) ...

    ... so that Francis Irving, Angie Ahl, Tommy Martin, Louise Crow, Matthew Somerville
    and Tom Steinberg could do the complex mixture of design and coding to build
    what you see today.

    Thanks particularly to Julian Todd (great blog!),
    Francis Davey, and Etienne Pollard for using the site early on and giving
    feedback (and/or legal advice!), and also to all our other users and
    testers.

    Lots of people have been looking up FOI email addresses, and a few
    volunteering to run the site - most especially Adam McGreggor, Alex
    Skene and John Cross.

Finally we couldn't do any of this without those
crazy people who volunteer,
amongst many other things, to do the accounts and fill in our VAT return.

You're all stars.

<% @title = "About" %>

<%= render :partial => 'help/alpha_notice' %>

Contact Us

If your question isn't answered here, or you just wanted to let us know
something about the site, contact us.

Introduction to WhatDoTheyKnow

What is WhatDoTheyKnow for?

To help you find out inside information about what the UK government
is doing.

How does the site work?

You choose the public authority that you would like information from, then
write a brief note describing what you want to know. We then send your request
to the public authority. Any response they make is automatically published on the
website for you and anyone else to find and read.

Why would I bother to do this?

You pay taxes, and then government does things with the money. All sorts of
things that affect your life, from healthcare through to national defence. Some
it does badly, some it does well. The more we find out about how government
works, the better able we are to make suggestions to improve the things that
are done badly, and to celebrate the things that are done well.

Why would the public authority bother to reply?

Under Freedom of Information (FOI) law, they have to respond.

Who makes it?

WhatDoTheyKnow is made by mySociety,
and was initially funded by the JRSST Charitable Trust. mySociety is a project of the
registered charity UK Citizens Online Democracy.
If you like what we're doing, then you can
make a donation.

Making requests

You're missing the public authority that I want to request from!

Please contact us with the name of the public authority and,
if you can find it, their contact email address for Freedom of Information requests.
If you'd like to help add a whole category of public authority to the site, for example all
primary care trusts or all schools, then please
edit this shared spreadsheet (Google account required).

How quickly will I get a response?

By law public authorities must respond within 20 days, excluding weekends and
any UK bank holidays. The date that the response is due by is shown on the
page for your request. You will be emailed if this date goes by without
a response, so you can send the public authority another note to hurry them up.
Note: If you had to clarify your request, the clock starts from that date,
instead of the date they received your initial request.

What if I'm not satisfied with the response?

If you didn't get the information you asked for, or you didn't get it in time,
then read our page 'Unhappy about the response you got?'.

Can you tell me more of the nitty gritty about the process of making requests?

Have a look at the
access to official information
pages on the Information Commisioner's website.

Can I request information about myself?

Not using this site. Requests made using WhatDoTheyKnow are public, made under the
Freedom of Information Act, and cannot help you find information about a
private individual. If you would like to know what information a public
authority holds about yourself, you should make a "Subject Access Request" in
private using Data Protection law.  The leaflet Subject
Access - A guide for data subjects (on the Information Commisioner's
website) explains how to do this.

I'd like to keep my request secret! (At least until I publish my story)

WhatDoTheyKnow is currently only designed for public requests. All
responses that we receive are automatically published on the website for anyone
to read.  You should contact the public authority directly if you would like to
make a request in private.  If you're interested in buying a system which helps
you manage FOI requests in secret, then contact us.

Privacy policy

Who gets to see my email address?

We will not disclose your email address to anyone, including the public
authority you are sending a request to, unless we are obliged to by law,
or you ask us to. If you send a message to another user on the site, then
it will reveal your email address to them. You will be told that this
is going to happen.

Will you send nasty, brutish spam to my email address?

Nope. After you sign up to WhatDoTheyKnow we will only send you emails
relating to a request you made, an email alert that you have signed up for,
or for other reasons that you specifically authorise. We will never give or
sell your email addresses to anyone else, unless we are obliged to by law, or
you ask us to.

Why will my name appear publically on the site?

It means that someone researching the same area can get in touch with you,
and maybe give you more information or ideas relating to your request.  Also,
we're going to publish the response with the name of the civil servant who
wrote it, so it seems only fair that your name should be public too!
Therefore, we encourage you to use your real name, but you may use a pseudonym
if you would like to be anonymous.

So I can make an FOI request using a pseudonym?

Yes, you can. It is good practice for the public authority to reply to such
a request, except in special circumstances such as if they suspect you of
making vexatious requests. See Freedom of Information Good Practice Guidance No 6 for details. You
should refer to this if a public authority attempts to refuse a request because you used a pseudonym.
Saying that, you can avoid the problem by simply making your pseudonym look like a real person's name,
as there is no general obligation to prove your identity.

Why does the list of things that I'm tracking appear publically on the site?

This helps you find others who are researching the same area of government,
so you can form groups to investigate or campaign together. It also helps us
show requests which are related to other requests. If you've ever used a
"social bookmarking" website such as Delicious, Digg or reddit, think of it like
that.

Credit where credit is due

Which people made WhatDoTheyKnow?

Oh, nearly everyone (and maybe you too)!

    Heather Brooke
    (vampy!) has
    been pushing the idea of a UK FOI archive for years now.

    Both Phil Rodgers and Francis Irving
    entered it in a mySociety competition for ideas for public interest websites to build.

    It won,
    and then Chris Lightfoot (RIP :()
    thought up the wheeze of intercepting email responses to requests and
    automatically publishing them.

    Tom Steinberg got the cash to pay for the site from
    a dead chocolate mogul (thank you!) ...

    ... so that Francis Irving, Angie Ahl, Tommy Martin, Louise Crow, Matthew Somerville
    and Tom Steinberg could do the complex mixture of design and coding to build
    what you see today.

    Thanks particularly to Julian Todd (great blog!),
    Francis Davey, and Etienne Pollard for using the site early on and giving
    feedback (and/or legal advice!), and also to all our other users and
    testers.

    Lots of people have been looking up FOI email addresses, and a few
    volunteering to run the site - most especially Adam McGreggor, Alex
    Skene and John Cross.

Finally we couldn't do any of this without those
crazy people who volunteer,
amongst many other things, to do the accounts and fill in our VAT return.

You're all stars.


ActionItem1084: folders should not be added in an article block

<% articles = @block.box.owner.articles.select {|article| !article.folder? } %>
<%= select('block', 'article_id', articles.map {|item| [ item.path, item.id]}) %>

<%= select('block', 'article_id', @block.box.owner.articles.map {|item| [ item.path, item.id]}) %>


Set all variables

Set all variables

<% @show_tips = @xapian_requests.nil? || (@total_hits == 0) %>

<% # XXX should call find_tracking_people in controller, not here / in partial
   if @track_thing and TrackThing.find_tracking_people(@track_thing).size > 0 %>

People tracking this search

    <%= render :partial => 'track/tracking_people_and_link', :locals => { :track_thing => @track_thing, :list_people => true, :own_request => false } %>

<% end %>

<% if @query.nil? %>
    <% @title = "Search Freedom of Information requests, public authorities and users" %>

<%=@title%>

<% elsif @total_hits == 0 %>
    <% @title = "Nothing found for '" + h(@query) + "'" %>
<% else %>
    <% @title = "Results page " + @page.to_s %>
<% end%>

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

       <%= text_field_tag 'query', @query, { :size => 40 } %>
       <%= hidden_field_tag 'sortby', params[:sortby] %>
       <%= submit_tag "Search" %>
       <% if not @show_tips %>
             Advanced tips
       <% end %>

<% end %>

<% if not @query.nil? %>
    <%=link_to_unless @sortby.nil?, "Show most relevant results first", search_url(@query, nil) %>
    |
    <%=link_to_unless @sortby == 'newest', "Newest results first", search_url(@query, 'newest') %>
    <% if @sortby == 'described' %>
    | Recently described results first
    <% end %>
<% end %>

<% if @total_hits == 0 %>

<%=@title %>

<% end %>

<% if not @query.nil? %>
    <% if @spelling_correction %>

Did you mean: <%= link_to @spelling_correction, search_url(@spelling_correction, @sortby) %>

    <% end %>

    <% if @track_thing %>
        <%= render :partial => 'track/tracking_people_and_link', :locals => { :track_thing => @track_thing, :list_people => false, :own_request => false } %>
    <% end %>

    <% if @xapian_bodies.results.size > 0 %>

<%= "Public authorities " + ((@page-1)*@bodies_per_page+1).to_s + "-" + [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s + " of " + @xapian_bodies.matches_estimated.to_s + " for '" + h(@query) + "'" %>

        <% for result in @xapian_bodies.results %>
            <%= render :partial => 'body/body_listing_single', :locals => { :public_body => result[:model] }  %>
        <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %>
    <% end %>

    <% if @xapian_users.results.size > 0 %>

<%= "People " + ((@page-1)*@users_per_page+1).to_s + "-" + [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s + " of " + @xapian_users.matches_estimated.to_s + " for '" + h(@query) + "'" %>

        <% for result in @xapian_users.results %>
            <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
        <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %>
    <% end %>

    <% if @xapian_requests.results.size > 0 %>

<%= "FOI requests " + ((@page-1)*@requests_per_page+1).to_s + "-" + [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s + " of " + @xapian_requests.matches_estimated.to_s + " for '" + h(@query) + "'" %>

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

        <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %>
        <% if @track_thing %>
            <%= render :partial => 'track/tracking_people_and_link', :locals => { :track_thing => @track_thing, :own_request => false, :list_people => false } %>
        <% end %>
    <% end %>
<% end %>

<% if @show_tips %>

Search tips

Enter words that you want to find separated by spaces, e.g. climbing lane

Use OR (in capital letters) where you don't mind which word,  e.g. commons OR lords

Use quotes when you want to find an exact phrase, e.g. "Liverpool City Council"

variety: with value sent, followup_sent, response, authority or user to select type of thing to search for.

Type status: to select based on the status or historical status of the request, see table below.

requested_from:home_office to restrict to requests from the <%= link_to "Home Office", show_public_body_url(:url_name => 'home_office') %>, typing the name as in the URL.

requested_by:julian_todd to restrict to requests made by <%= link_to "Julian Todd", show_user_url(:url_name => 'julian_todd') %>, typing the name as in the URL.

request: to restrict to a specific request, typing the title as in the URL.

Type 01/01/2008..14/01/2008 to only show things that happened in the first two weeks of January.

Read about advanced search operators, such as proximity and wildcards.

status:waiting_response	 Waiting for the public authority to reply

status:not_held	 The public authority does not have the information requested

status:rejected	 The request was rejected by the public authority

status:partially_successful	 Some of the information requested has been received

status:successful	 All of the information requested has been received

status:waiting_clarification	 The public authority would like part of the request explained

status:waiting_classification	 A new response has arrived, but it hasn't been categorised yet

status:requires_admin	 A strange reponse, required attention by the WhatDoTheyKnow team

<% end %>

<% @show_tips = @xapian_requests.nil? || (@total_hits == 0) %>

<% # XXX should call find_tracking_people in controller, not here / in partial
   if @track_thing and TrackThing.find_tracking_people(@track_thing).size > 0 %>

People tracking this search

    <%= render :partial => 'track/tracking_people_and_link', :locals => { :track_thing => @track_thing, :list_people => true } %>

<% end %>

<% if @query.nil? %>
    <% @title = "Search Freedom of Information requests, public authorities and users" %>

<%=@title%>

<% elsif @total_hits == 0 %>
    <% @title = "Nothing found for '" + h(@query) + "'" %>
<% else %>
    <% @title = "Results page " + @page.to_s %>
<% end%>

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

       <%= text_field_tag 'query', @query, { :size => 40 } %>
       <%= hidden_field_tag 'sortby', params[:sortby] %>
       <%= submit_tag "Search" %>
       <% if not @show_tips %>
             Advanced tips
       <% end %>

<% end %>

<% if not @query.nil? %>
    <%=link_to_unless @sortby.nil?, "Show most relevant results first", search_url(@query, nil) %>
    |
    <%=link_to_unless @sortby == 'newest', "Newest results first", search_url(@query, 'newest') %>
    <% if @sortby == 'described' %>
    | Recently described results first
    <% end %>
<% end %>

<% if @total_hits == 0 %>

<%=@title %>

<% end %>

<% if not @query.nil? %>
    <% if @spelling_correction %>

Did you mean: <%= link_to @spelling_correction, search_url(@spelling_correction, @sortby) %>

    <% end %>

    <% if @track_thing %>
        <%= render :partial => 'track/tracking_people_and_link', :locals => { :track_thing => @track_thing, :list_people => false } %>
    <% end %>

    <% if @xapian_bodies.results.size > 0 %>

<%= "Public authorities " + ((@page-1)*@bodies_per_page+1).to_s + "-" + [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s + " of " + @xapian_bodies.matches_estimated.to_s + " for '" + h(@query) + "'" %>

        <% for result in @xapian_bodies.results %>
            <%= render :partial => 'body/body_listing_single', :locals => { :public_body => result[:model] }  %>
        <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %>
    <% end %>

    <% if @xapian_users.results.size > 0 %>

<%= "People " + ((@page-1)*@users_per_page+1).to_s + "-" + [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s + " of " + @xapian_users.matches_estimated.to_s + " for '" + h(@query) + "'" %>

        <% for result in @xapian_users.results %>
            <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
        <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %>
    <% end %>

    <% if @xapian_requests.results.size > 0 %>

<%= "FOI requests " + ((@page-1)*@requests_per_page+1).to_s + "-" + [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s + " of " + @xapian_requests.matches_estimated.to_s + " for '" + h(@query) + "'" %>

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

        <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %>
        <% if @track_thing %>
            <%= render :partial => 'track/tracking_people_and_link', :locals => { :track_thing => @track_thing, :own_request => false, :list_people => false } %>
        <% end %>
    <% end %>
<% end %>

<% if @show_tips %>

Search tips

Enter words that you want to find separated by spaces, e.g. climbing lane

Use OR (in capital letters) where you don't mind which word,  e.g. commons OR lords

Use quotes when you want to find an exact phrase, e.g. "Liverpool City Council"

variety: with value sent, followup_sent, response, authority or user to select type of thing to search for.

Type status: to select based on the status or historical status of the request, see table below.

requested_from:home_office to restrict to requests from the <%= link_to "Home Office", show_public_body_url(:url_name => 'home_office') %>, typing the name as in the URL.

requested_by:julian_todd to restrict to requests made by <%= link_to "Julian Todd", show_user_url(:url_name => 'julian_todd') %>, typing the name as in the URL.

request: to restrict to a specific request, typing the title as in the URL.

Type 01/01/2008..14/01/2008 to only show things that happened in the first two weeks of January.

Read about advanced search operators, such as proximity and wildcards.

status:waiting_response	 Waiting for the public authority to reply

status:not_held	 The public authority does not have the information requested

status:rejected	 The request was rejected by the public authority

status:partially_successful	 Some of the information requested has been received

status:successful	 All of the information requested has been received

status:waiting_clarification	 The public authority would like part of the request explained

status:waiting_classification	 A new response has arrived, but it hasn't been categorised yet

status:requires_admin	 A strange reponse, required attention by the WhatDoTheyKnow team

<% end %>


showname: pagination links now top and bottom, and code much cleaned up. -JPH 20080326

<% @title = 'Name: ' + h(@name.text_name) %>

# Google Images | Distribution Map
<%= sprintf('Google Images' % @name.text_name) %>
<% if @data != [] %>
    | <%= link_to(:show_name_distribution_map.l, :action => 'map', :id => @name.id) %>
<% end %>

# Edit Name | Bulk Name Edit | Change Synonyms | Approve/Deprecate
<%= link_to 'Edit Name', :action => 'edit_name', :id => @name %>
  | <%= link_to 'Bulk Name Edit', :action => 'bulk_name_edit' %>
  | <%= link_to('Change Synonyms', :action => 'change_synonyms', :id => @name)%>
<% if @name.deprecated %>
  | <%= link_to('Approve', :action => 'approve_name', :id => @name)%>
<% else %>
  | <%= link_to('Deprecate', :action => 'deprecate_name', :id => @name)%>
<% end %>

<%= 'About: ' + textilize_without_paragraph(h(@name.display_name)) %>

	<%= :show_name_rank.l %>: <%= rank_as_string(@name.rank) %>

	<%= :show_name_status.l %>: <%= @name.status == "Valid" ? :show_name_valid.l : :show_name_deprecated.l %>

	<%= :show_name_name.l %>: <%= @name.text_name %>

	<%= :show_name_author.l %>: <%= @name.author %>

	<%= :show_name_citation.l %>: <%= textilize_without_paragraph(sanitize(@name.citation || '')) %>

	<%
	approved_synonyms, deprecated_synonyms = @name.sort_synonyms
	if approved_synonyms != []
	    links = approved_synonyms.map{|n| link_to(textilize_without_paragraph(h(n.display_name)), :action => "show_name", :id => n)}
        %>
        <%= @name.deprecated ? :show_name_preferred_synonyms.l : :show_name_synonyms.l %>: <%= links.join(', ') %>

	<%
	end
    if deprecated_synonyms != []
        links = deprecated_synonyms.map{|n| link_to(textilize_without_paragraph(h(n.display_name)), :action => "show_name", :id => n)}
        %>
        <%= :show_name_deprecated_synonyms.l %>: <%= links.join(', ') %>

    <% end %>
	<%= :show_name_version.l %>: <%= @name.version %>

	<% if @past_name %>
	    <%= link_to("#{:show_name_previous_version.l}: %s" % @past_name.version, :action => 'show_past_name', :id => @past_name.id) %>
	<% end %>

<% if @name.notes.to_s != "" %>

<%= :show_name_notes_and_comments.l %>:

        <%= textilize(sanitize(@name.notes.to_s)) %>

<% end %>

<% if @children != [] %>

<%= rank_as_plural_string(@children[0].rank) %>:

        <% i = 0
           max = 25
           for child in @children
            i += 1
            break if i > max %>
            <%= link_to(textilize_without_paragraph(h(child.display_name)),
                :action => 'show_name', :id => child) %>

        <% end %>
        <%= "And #{@children.length - i + 1} more...
" if i > max %>

<% end %>

<%
# -----------------------------------------
#  Draw the three groups of observations.
# -----------------------------------------
num_sects = 0
for sect in ["consensus", "synonym", "other"]

  if sect == "consensus"
    head  = :show_name_observations.l + ":"   # Header string to display above group.
    data  = @consensus_data                   # Data returned by sql query.
    page  = @consensus_page                   # Page number.
    pages = @consensus_pages                  # Pagination object.
    arg   = :consensus_page                   # Parameter used in pagination.
  elsif sect == "synonym"
    head  = :show_name_synonym_observations.l + ":"
    data  = @synonym_data
    page  = @synonym_page
    pages = @synonym_pages
    arg   = :synonym_page
  else
    head  = :show_name_other_observations.l + ":
" +
            "" +
              (:show_name_other_observations_notes.l %
                textilize_without_paragraph(h(@name.display_name)))
            ""
    data  = @other_data
    page  = @other_page
    pages = @other_pages
    arg   = :other_page
  end

  # Skip completely if group is empty.
  if data && data.length > 0

    # These are tacked on to the pagination links' urls.
    args = {}
    args[:consensus_page] = @consensus_page if @consensus_data != []
    args[:synonym_page] = @synonym_page     if @synonym_data != []
    args[:other_page] = @other_page         if @other_data != []
    args.delete arg

    # Add line break between groups.
    if num_sects > 0 %>

    <% end
    num_sects += 1

    # Wow this is ugly, but I can't find an option to pass to pagination_links
    # to have it tack the "#section" thing on the end of the urls for me.
    plinks = pagination_links(pages, :name => arg, :params => args).to_s
    plinks.gsub!(/<a href="([^<>]*)">/, '')
    %>

<a id="<%=sect%>"><%= head %>

<%= plinks %>

      <% odd_or_even = 0
      for datum in data
        odd_or_even = 1 - odd_or_even
        id = datum["id"] %>
        <tr valign="top" class="ListLine<%= odd_or_even %>">

            <%=
            image_id = datum["thumb_image_id"]
            if image_id
              link_to(image_tag(sprintf("thumb/%d.jpg", image_id), :border => 0),
                :controller => 'observer', :action => 'show_observation', :id => id)
            end
            %>

            <%= link_to(textilize_without_paragraph(h(datum["observation_name"] + " (#{id})")),
              :controller => 'observer', :action => 'show_observation', :id => id) %>

            <%= location_link(datum["where"], datum["location_id"]) %>:
            <%= user_link(datum["user_id"], "#{datum['name']} (#{datum['login']})") %>

            Observation made: <%= datum["when"]%>

            Community confidence:
              <%= v = datum["vote_cache"]
                v.nil? || v == "" ? "no votes" : (v.to_f*100/3).round.to_s + "%" %>

      <% end %>

<%= plinks %>

  <% end # if data.length > 0 %>
<% end # for section %>

  <%= :show_name_name_created.l %>: <%= @name.created %>

  <%= :show_name_last_modified.l %>: <%= @name.modified %> by <%= user_link(@name.user) %>

  <% rss_log = @name.rss_log
     if rss_log %>
  	<%= link_to :show_name_show_log.l, :controller => 'observer', :action => 'show_rss_log', :id => rss_log.id %>
  <% end %>

<% @title = 'Name: ' + h(@name.text_name) %>
<%= sprintf('Google Images' % @name.text_name) %>
<% if @data != [] %>
    | <%= link_to(:show_name_distribution_map.l, :action => 'map', :id => @name.id) %>
<% end %>

<%= link_to 'Edit Name', :action => 'edit_name', :id => @name %>
| <%= link_to 'Bulk Name Edit', :action => 'bulk_name_edit' %>
| <%= link_to('Change Synonyms', :action => 'change_synonyms', :id => @name)%>
<% if @name.deprecated %>
    | <%= link_to('Approve', :action => 'approve_name', :id => @name)%>
<% else %>
    | <%= link_to('Deprecate', :action => 'deprecate_name', :id => @name)%>
<% end %>

<%= 'About: ' + textilize_without_paragraph(h(@name.display_name)) %>

	<%= :show_name_rank.l %>: <%= rank_as_string(@name.rank) %>

	<%= :show_name_status.l %>: <%= @name.status == "Valid" ? :show_name_valid.l : :show_name_deprecated.l %>

	<%= :show_name_name.l %>: <%= @name.text_name %>

	<%= :show_name_author.l %>: <%= @name.author %>

	<%= :show_name_citation.l %>: <%= textilize_without_paragraph(sanitize(@name.citation || '')) %>

	<%
	approved_synonyms, deprecated_synonyms = @name.sort_synonyms
	if approved_synonyms != []
	    links = approved_synonyms.map{|n| link_to(textilize_without_paragraph(h(n.display_name)), :action => "show_name", :id => n)}
        %>
        <%= @name.deprecated ? :show_name_preferred_synonyms.l : :show_name_synonyms.l %>: <%= links.join(', ') %>

	<%
	end
    if deprecated_synonyms != []
        links = deprecated_synonyms.map{|n| link_to(textilize_without_paragraph(h(n.display_name)), :action => "show_name", :id => n)}
        %>
        <%= :show_name_deprecated_synonyms.l %>: <%= links.join(', ') %>

    <% end %>
	<%= :show_name_version.l %>: <%= @name.version %>

	<% if @past_name %>
	    <%= link_to("#{:show_name_previous_version.l}: %s" % @past_name.version, :action => 'show_past_name', :id => @past_name.id) %>
	<% end %>

<% if @name.notes.to_s != "" %>

<%= :show_name_notes_and_comments.l %>:

        <%= textilize(sanitize(@name.notes.to_s)) %>

<% end %>

<% if @children != [] %>

<%= rank_as_plural_string(@children[0].rank) %>:

        <% i = 0
           max = 25
           for child in @children
            i += 1
            break if i > max %>
            <%= link_to(textilize_without_paragraph(h(child.display_name)),
                :action => 'show_name', :id => child) %>

        <% end %>
        <%= "And #{@children.length - i + 1} more...
" if i > max %>

<% end %>

<% num_sects = 0 %>
<% for sect in ["consensus", "synonym", "other"]
  args = {}
  args[:consensus_page] = @consensus_page if @consensus_data != []
  args[:synonym_page] = @synonym_page     if @synonym_data != []
  args[:other_page] = @other_page         if @other_data != []
  if sect == "consensus"
    head  = :show_name_observations.l + ":"
    data  = @consensus_data
    page  = @consensus_page
    pages = @consensus_pages
    arg   = :consensus_page
    args.delete arg
  elsif sect == "synonym"
    head  = :show_name_synonym_observations.l + ":"
    data  = @synonym_data
    page  = @synonym_page
    pages = @synonym_pages
    arg   = :synonym_page
    args.delete arg
  else
    head  = :show_name_other_observations.l + ":
" +
            "" +
              (:show_name_other_observations_notes.l %
                textilize_without_paragraph(h(@name.display_name)))
            ""
    data  = @other_data
    page  = @other_page
    pages = @other_pages
    arg   = :other_page
    args.delete arg
  end
  if data && data.length > 0 %>
    <% if num_sects > 0 %>

    <% end %>
    <% num_sects += 1 %>

<a id="<%=sect%>"><%= head %>

      <% odd_or_even = 0
      for datum in data
        odd_or_even = 1 - odd_or_even
        id = datum["id"] %>
        <tr valign="top" class="ListLine<%= odd_or_even %>">

            <%=
            image_id = datum["thumb_image_id"]
            if image_id
              link_to(image_tag(sprintf("thumb/%d.jpg", image_id), :border => 0),
                :controller => 'observer', :action => 'show_observation', :id => id)
            end
            %>

            <%= link_to(textilize_without_paragraph(h(datum["observation_name"] + " (#{id})")),
              :controller => 'observer', :action => 'show_observation', :id => id) %>

            <%= location_link(datum["where"], datum["location_id"]) %>:
            <%= user_link(datum["user_id"], "#{datum['name']} (#{datum['login']})") %>

            Observation made: <%= datum["when"]%>

            Community confidence:
              <%= v = datum["vote_cache"]
                v.nil? || v == "" ? "no votes" : (v.to_f*100/3).round.to_s + "%" %>

      <% end %>

<%=
      x = pagination_links(pages, :name => arg, :params => args)
      # Wow this is ugly, but I can't find an option to pass to pagination_links to do it for me.
      x.to_s.gsub(/<a href="([^<>]*)">/, '')
    %>

  <% end %>
<% end %>

    <%= :show_name_name_created.l %>: <%= @name.created %>

    <%= :show_name_last_modified.l %>: <%= @name.modified %> by <%= user_link(@name.user) %>

    <% rss_log = @name.rss_log
       if rss_log %>
    	<%= link_to :show_name_show_log.l, :controller => 'observer', :action => 'show_rss_log', :id => rss_log.id %>
    <% end %>


Resolve compilation error.

Resolve compilation error.

<%= l(:label_revision) %> <%= format_revision(@rev_to) + ':' if @rev_to %><%= format_revision(@rev) %> <%=h @path %>

<% link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => @rev}, :caption => "Return to overview") if params[:rev] %>
<% link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => @rev_to}, :caption => "Return to overview") if params[:rev_to] %>

<% form_tag({:path => to_path_param(@path)}, :method => 'get') do %>
  <%= hidden_field_tag('rev', params[:rev]) if params[:rev] %>
  <%= hidden_field_tag('rev_to', params[:rev_to]) if params[:rev_to] %>

<%= l(:label_view_diff) %>
  <%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %>

<% end %>

<% cache(@cache_key) do -%>
<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
<% end -%>

<% other_formats_links do |f| %>
	<%= f.link_to 'Diff', :url => params, :caption => 'Unified diff' %>
<% end %>

<% html_title(with_leading_slash(@path), 'Diff') -%>

<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>

<%= l(:label_revision) %> <%= format_revision(@rev_to) + ':' if @rev_to %><%= format_revision(@rev) %> <%=h @path %>

<% link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => @rev}, :caption => "Return to overview" if params[:rev] %>
<% link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => @rev_to}, :caption => "Return to overview" if params[:rev_to] %>

<% form_tag({:path => to_path_param(@path)}, :method => 'get') do %>
  <%= hidden_field_tag('rev', params[:rev]) if params[:rev] %>
  <%= hidden_field_tag('rev_to', params[:rev_to]) if params[:rev_to] %>

<%= l(:label_view_diff) %>
  <%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %>

<% end %>

<% cache(@cache_key) do -%>
<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
<% end -%>

<% other_formats_links do |f| %>
	<%= f.link_to 'Diff', :url => params, :caption => 'Unified diff' %>
<% end %>

<% html_title(with_leading_slash(@path), 'Diff') -%>

<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>


ActionItem153: displaying the environment name at the homepage

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

<%= flash[:notice] %>

<%= @environment.name %>

<%= @environment.description %>

<%= _('Search') %>

  <% form_tag :controller => 'search', :action => 'index' do %>

      <%= text_field_tag('query', '', :size => 50) %>
      <%= submit_button(:search, _('Search')) %>

      <%= lightbox_link_to _('More search options'), :controller => 'search', :action => 'popup' %>

  <% end %>

<%= flash[:notice] %>

<%= @environment.description %>

<%= _('Search') %>

  <% form_tag :controller => 'search', :action => 'index' do %>

      <%= text_field_tag('query', '', :size => 50) %>
      <%= submit_button(:search, _('Search')) %>

      <%= lightbox_link_to _('More search options'), :controller => 'search', :action => 'popup' %>

  <% end %>


ActionItem1218: adding a "Read more" link

<% if environment.enabled?('display_wizard_signup') && !logged_in? %>
  <%= lightbox_button(:new, _('Signup'), { :controller => 'account', :action => 'wizard' }, :class => 'wizard', :id => 'signup-wizard') %>
<% end %>

<% if @has_news %>

<%= _('News') %>

  <% cache @news_cache_key do %>

      <% @highlighted_news.each_with_index do |highlighted, index| %>
        <div class='highlighted-news-item post-<%= index + 1 %>'>

<%= link_to(highlighted.title, highlighted.url, :class => 'post-title') %>

          <%= show_date(highlighted.published_at, true) %>

<%= highlighted.first_paragraph %>

            <%= link_to(_('Read more'), highlighted.url) %>

      <% end%>

        <% @portal_news.each do |news| %>

          <%= show_date(news.published_at, true) %>
          <%= link_to(news.title, news.url, :class =>  'post-title' ) %>

        <% end%>

    <% @area_news.each_with_index do |folder, i| %>
      <% content_tag(:div, :class => ["news-area", ['even', 'odd'][i%2]].join(' ')) do %>

<%= link_to folder.title, folder.url %>

          <% folder.news(4).each do |news| %>

 <%= link_to(news.title, news.url) %>

          <% end%>

        <%= link_to _('View more'), folder.url, :class => 'news-see-more'  %>
      <%end %>
    <% end %>
  <% end %>
<% else %>
  <%= environment.description %>
<% end %>

<% if environment.enabled?('search_in_home') %>

    <% form_tag :controller => 'search', :action => 'index' do %>

        <%= text_field_tag('query', '', :size => 50) %>
        <%= submit_button(:search, _('Search')) %>

        <%= lightbox_link_to _('More options'), :controller => 'search', :action => 'popup' %>

    <% end %>

<% end %>

<% if environment.enabled?('display_wizard_signup') && !logged_in? %>
  <%= lightbox_button(:new, _('Signup'), { :controller => 'account', :action => 'wizard' }, :class => 'wizard', :id => 'signup-wizard') %>
<% end %>

<% if @has_news %>

<%= _('News') %>

  <% cache @news_cache_key do %>

      <% @highlighted_news.each_with_index do |highlighted, index| %>
        <div class='highlighted-news-item post-<%= index + 1 %>'>

<%= link_to(highlighted.title, highlighted.url, :class => 'post-title') %>

          <%= show_date(highlighted.published_at, true) %>

<%= highlighted.first_paragraph %>

      <% end%>

        <% @portal_news.each do |news| %>

          <%= show_date(news.published_at, true) %>
          <%= link_to(news.title, news.url, :class =>  'post-title' ) %>

        <% end%>

    <% @area_news.each_with_index do |folder, i| %>
      <% content_tag(:div, :class => ["news-area", ['even', 'odd'][i%2]].join(' ')) do %>

<%= link_to folder.title, folder.url %>

          <% folder.news(4).each do |news| %>

 <%= link_to(news.title, news.url) %>

          <% end%>

        <%= link_to _('View more'), folder.url, :class => 'news-see-more'  %>
      <%end %>
    <% end %>
  <% end %>
<% else %>
  <%= environment.description %>
<% end %>

<% if environment.enabled?('search_in_home') %>

    <% form_tag :controller => 'search', :action => 'index' do %>

        <%= text_field_tag('query', '', :size => 50) %>
        <%= submit_button(:search, _('Search')) %>

        <%= lightbox_link_to _('More options'), :controller => 'search', :action => 'popup' %>

    <% end %>

<% end %>


Fixing static sidebar. Old, deprecated code silently breaking. We need to find a way to test them

<%= sidebar.title %>

<%= sidebar.body %>

<%= @sidebar.title %>

<%= @sidebar.body %>


Added css and head includes to editor

Added css and head includes to editor

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <title><%= "Webiva Page Editor".t %></title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <%= stylesheet_link_tag 'common' %>
    <%= theme_stylesheet_link_tag  "main" %>
    <%= javascript_include_tag :defaults %>
    <%= javascript_include_tag "builder" %>
    <%= javascript_include_tag "overlib/overlib" %>
    <%= javascript_include_tag "menu_editor" %>
    <%= javascript_include_tag "tiny_mce/tiny_mce" %>
    <%= javascript_include_tag "edit" %>
    <%= javascript_include_tag "page_info" %>
    <%= javascript_include_tag "swfobject.js" %>
    <%= stylesheet_link_tag "redbox" %>
    <%= javascript_include_tag "redbox" %>
    <%= javascript_include_tag "menu.js" %>
    <%= javascript_include_tag "shortcut" %>

    <% if @output.includes[:css] -%>
        <% @output.includes[:css].uniq.each do |css| -%>
          <%= stylesheet_link_tag css %>
        <% end -%>
    <% end -%>
    <%= strip_script_tags(@output.head) unless @output.head.blank? -%>

<%= "Save Changes".t %>?

  <%= "Warning, you have unsaved changes on this page. Would you like to save before continuing".t %>?

  <input class='cms_button' type='button' value='<%= vh "Yes".t %>' onclick='cmsEdit.saveFirst();' />
  <input class='cms_button' type='button' value='<%= vh "No".t %>' onclick='cmsEdit.finishAction();' />
  <input class='cms_button' type='button' value='<%= vh "Cancel".t %>' onclick='cmsEdit.cancelAction();' />

<%= "Save as a custom version".t %>

  <form onsubmit='cmsEdit.saveAsSpecificSubmit(this); return false;'>
    <%= "New Version Number: ".t %><input type='text' size='30' value='' />
    <input type='submit' value='<%= "Save".t %>'/>
    <input type='submit' value='<%= "Cancel".t %>' onclick='cmsEdit.closeBox(); return false;'/>
  </form>

			<%= "Title:".t %>

      <%= @revision.title.to_s.empty? ?  "[No Title]".t : truncate(@revision.title.to_s,:length => 30) %>

			<%= "Version:".t %>
      <%= dec(@revision.revision) %>

          <%= "Loading Versions...".t %>

			<%= "Language:".t %> <%= @revision.language.upcase %>

          <%= render :partial => 'revision_languages', :locals => { :revision => @revision } %>

			<%= "Page:".t %>
          <img src='<%= @page.page_type == 'page' ? theme_src('icons/page.gif') : theme_src('icons/framework.gif') %>' align='absmiddle' />
      <%= @site_node.node_path %>

        <% @pages.each do |page| -%>
          <% if myself.has_role?('editor_structure') || page[0].page_type == 'page' -%>
          <a href='javascript:void(0);' class='cms_ajax_link<%= '_selected' if @site_node.id == page[0].id %>' onclick='cmsEdit.reloadPage("<%= page[0].page_type %>",<%= page[0].id %>,"<%= page[1] %>");'  id='page_selector_<%= page[0].page_type %>_<%= page[0].id %>'>
          <img src='<%= page[0].page_type == 'page' ? theme_src('/images/icons/page.gif') : theme_src('/images/icons/framework.gif') %>' align='absmiddle' />
            <%= page[0].node_path %>

         <% end -%>
        <% end -%>

        <%= "Status:".t %>  <%= @revision.active ? theme_image_tag('icons/pageeditor/active.gif') + ' ' + 'Active'.t : theme_image_tag('icons/pageeditor/inactive.gif') +  ' ' + 'Inactive'.t %>

        <%= render :partial => 'saved_by', :locals => {:revision => @real_revision } %>

          <%= "Loading History...".t %>

      <% @paragraph_types.each do |para| -%>
        <% if para.is_a?(Array) -%>
            <% if para[0] != 'hidden' && !para[6] %>
              <a class='cms_ajax_link'  href='javascript:void(0);' onclick='cmsEdit.addParagraph("<%= para[3].to_s.gsub("/","_") %>_<%= para[1] %>",<%= para[5] || 0 %>);'><%= "+Add".t %> <%= para[5] ? para[2] : para[2].t  %>

            <% end -%>
        <% else %>
          <%= para.t %>

        <% end -%>
      <% end -%>

      <a href='<%= url_for :controller => '/structure', :action => 'index', :version => @site_node.site_version_id %>' id='cms_structure_icon' onclick="return cmsEdit.leavePage('<%= url_for :controller => '/structure', :action => 'index' %>'); " title='<%= "Return to Website".t %>' ><%= theme_image_tag '/images/icons/pageeditor/structure.gif',:align=>'absmiddle' %>
       |
      <% if myself.has_role?('editor_files') %>
      <%= link_to image_tag(theme_src("/images/icons/pageeditor/files_and_images.gif"),:align=>'absmiddle', :title => "Show File Manager".t ) , { :controller => 'file', :action => 'popup' , :popup_type => 'select', :path => 0 }, :popup => ['file_manager', 'height=400,width=800,scrollbars,resizeable' ] %>
       |
      <% end -%>
      <a href='javascript:void(0);' id='cms_add_paragraph_icon' title='<%= "Add a new Paragraph".t %>' onclick='cmsEdit.addSelectParagraph();'><%= theme_image_tag '/images/icons/pageeditor/add_paragraph.gif', :align=>'absmiddle' %>
      <a href='javascript:void(0);' id='cms_cancel_add_paragraph_icon' style='display:none;' title='<%= "Cancel Add Paragraph".t %>' onclick='cmsEdit.cancelAddParagraph();'><%= theme_image_tag '/images/icons/pageeditor/cancel_add_paragraph.gif', :align=>'absmiddle' %>
      <span id='cms_add_framework_elements_icons' style='position:relative; <%= "display:none;" if @container_arg=='page' %>'>
        <a href='javascript:void(0);' id='cms_add_framework_element_icon' title='<%= "Add a new Framework Feature".t %>' onclick='cmsEdit.addSelectFrameworkElement();'><%= theme_image_tag '/images/icons/pageeditor/add_framework.gif', :align=>'absmiddle' %>
        <a href='javascript:void(0);' id='cms_cancel_add_framework_element_icon' style='display:none;' title='<%= "Cancel Add Paragraph".t %>' onclick='cmsEdit.cancelAddFrameworkElement();'><%= theme_image_tag '/images/icons/pageeditor/cancel_add_framework.gif', :align=>'absmiddle' %>

            <%= "Add a Zone Lock".t %>

            <%= "Clear a Zone".t %>

      <a href='javascript:void(0);' id='cms_preview_icon' onclick='cmsEdit.previewPage();' title='<%= vh "Preview Page".t %>' ><%= theme_image_tag '/images/icons/pageeditor/preview.gif',:align=>'absmiddle' %>
      <a href='javascript:void(0);' id='cms_cancel_preview_icon' onclick='cmsEdit.cancelPreview();' title='<%= vh "Cancel Preview Page".t %>' style='display:none;' ><%= theme_image_tag '/images/icons/pageeditor/preview_return.gif',:align=>'absmiddle' %>
      <a href='javascript:void(0);' id='cms_connection_icon' onclick='cmsEdit.pageConnections();' title='<%= vh "View Page Connnections".t %>'><%= theme_image_tag '/images/icons/pageeditor/connections.gif',:align=>'absmiddle' %>
      <a href='javascript:void(0);' id='cms_variables_icon' onclick='cmsEdit.pageVariables();' title='<%= vh "View Page Variables".t %>'><%= theme_image_tag '/images/icons/pageeditor/variables.gif',:align=>'absmiddle' %>
      <a href='javascript:void(0);' id='cms_refresh_icon' onclick='cmsEdit.refreshInfo();' title='<%= vh "Refresh Info".t %>'><%= theme_image_tag '/images/icons/pageeditor/refresh.gif',:align=>'absmiddle' %>

      <a id='cms_goto_page' href='<%= @goto_page_override_url || @page.node_path %>'  onclick='return cmsEdit.gotoPage();' ><%= "Goto Page".t %>
      |
      <input type='submit' id='cms_save_changes' value='<%= vh "Save Changes".t %>' disabled='true' onclick='cmsEdit.saveChanges(); return false;' />
      <input type='submit' id='cms_save_as_button' value='<%= vh "Save As...".t %>' onclick='cmsEdit.saveAs(); return false;' />
      <div id='cms_save_as' onmouseover='delayedHideShow(this)' onmouseout='delayedHide(this);' class='cms_popup' style='display:none; right:1px; top:25px; <%= Locale.language_code == 'fr' ? 'width:450px;' : 'width:200px;' %> '>
        <%= "Save As a New Minor Version".t %>

        <%= "Save As a New Major Version".t %>

        <%= "Save As a Custom Version".t %>

      <img src='<%= theme_src("framework/page_title_menu_icon.gif") %>' width='24' height='24' align='absmiddle'/>

          <%= "Delete this Edit".t %>

          <%= "Delete this Version".t %>

          <%= "Delete this Version (All Languages)".t %>

      <img id='cms_saving_icon' src='<%= theme_src "loading_small.gif" %>' width='24' height='24' align='middle' style='visibility:hidden;'/>

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <title><%= "Webiva Page Editor".t %></title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <%= stylesheet_link_tag 'common' %>
    <%= theme_stylesheet_link_tag  "main" %>
    <%= javascript_include_tag :defaults %>
    <%= javascript_include_tag "builder" %>
    <%= javascript_include_tag "overlib/overlib" %>
    <%= javascript_include_tag "menu_editor" %>
    <%= javascript_include_tag "tiny_mce/tiny_mce" %>
    <%= javascript_include_tag "edit" %>
    <%= javascript_include_tag "page_info" %>
    <%= javascript_include_tag "swfobject.js" %>
    <%= stylesheet_link_tag "redbox" %>
    <%= javascript_include_tag "redbox" %>
    <%= javascript_include_tag "menu.js" %>
    <%= javascript_include_tag "shortcut" %>

<%= "Save Changes".t %>?

  <%= "Warning, you have unsaved changes on this page. Would you like to save before continuing".t %>?

  <input class='cms_button' type='button' value='<%= vh "Yes".t %>' onclick='cmsEdit.saveFirst();' />
  <input class='cms_button' type='button' value='<%= vh "No".t %>' onclick='cmsEdit.finishAction();' />
  <input class='cms_button' type='button' value='<%= vh "Cancel".t %>' onclick='cmsEdit.cancelAction();' />

<%= "Save as a custom version".t %>

  <form onsubmit='cmsEdit.saveAsSpecificSubmit(this); return false;'>
    <%= "New Version Number: ".t %><input type='text' size='30' value='' />
    <input type='submit' value='<%= "Save".t %>'/>
    <input type='submit' value='<%= "Cancel".t %>' onclick='cmsEdit.closeBox(); return false;'/>
  </form>

			<%= "Title:".t %>

      <%= @revision.title.to_s.empty? ?  "[No Title]".t : truncate(@revision.title.to_s,:length => 30) %>

			<%= "Version:".t %>
      <%= dec(@revision.revision) %>

          <%= "Loading Versions...".t %>

			<%= "Language:".t %> <%= @revision.language.upcase %>

          <%= render :partial => 'revision_languages', :locals => { :revision => @revision } %>

			<%= "Page:".t %>
          <img src='<%= @page.page_type == 'page' ? theme_src('icons/page.gif') : theme_src('icons/framework.gif') %>' align='absmiddle' />
      <%= @site_node.node_path %>

        <% @pages.each do |page| -%>
          <% if myself.has_role?('editor_structure') || page[0].page_type == 'page' -%>
          <a href='javascript:void(0);' class='cms_ajax_link<%= '_selected' if @site_node.id == page[0].id %>' onclick='cmsEdit.reloadPage("<%= page[0].page_type %>",<%= page[0].id %>,"<%= page[1] %>");'  id='page_selector_<%= page[0].page_type %>_<%= page[0].id %>'>
          <img src='<%= page[0].page_type == 'page' ? theme_src('/images/icons/page.gif') : theme_src('/images/icons/framework.gif') %>' align='absmiddle' />
            <%= page[0].node_path %>

         <% end -%>
        <% end -%>

        <%= "Status:".t %>  <%= @revision.active ? theme_image_tag('icons/pageeditor/active.gif') + ' ' + 'Active'.t : theme_image_tag('icons/pageeditor/inactive.gif') +  ' ' + 'Inactive'.t %>

        <%= render :partial => 'saved_by', :locals => {:revision => @real_revision } %>

          <%= "Loading History...".t %>

      <% @paragraph_types.each do |para| -%>
        <% if para.is_a?(Array) -%>
            <% if para[0] != 'hidden' && !para[6] %>
              <a class='cms_ajax_link'  href='javascript:void(0);' onclick='cmsEdit.addParagraph("<%= para[3].to_s.gsub("/","_") %>_<%= para[1] %>",<%= para[5] || 0 %>);'><%= "+Add".t %> <%= para[5] ? para[2] : para[2].t  %>

            <% end -%>
        <% else %>
          <%= para.t %>

        <% end -%>
      <% end -%>

      <a href='<%= url_for :controller => '/structure', :action => 'index', :version => @site_node.site_version_id %>' id='cms_structure_icon' onclick="return cmsEdit.leavePage('<%= url_for :controller => '/structure', :action => 'index' %>'); " title='<%= "Return to Website".t %>' ><%= theme_image_tag '/images/icons/pageeditor/structure.gif',:align=>'absmiddle' %>
       |
      <% if myself.has_role?('editor_files') %>
      <%= link_to image_tag(theme_src("/images/icons/pageeditor/files_and_images.gif"),:align=>'absmiddle', :title => "Show File Manager".t ) , { :controller => 'file', :action => 'popup' , :popup_type => 'select', :path => 0 }, :popup => ['file_manager', 'height=400,width=800,scrollbars,resizeable' ] %>
       |
      <% end -%>
      <a href='javascript:void(0);' id='cms_add_paragraph_icon' title='<%= "Add a new Paragraph".t %>' onclick='cmsEdit.addSelectParagraph();'><%= theme_image_tag '/images/icons/pageeditor/add_paragraph.gif', :align=>'absmiddle' %>
      <a href='javascript:void(0);' id='cms_cancel_add_paragraph_icon' style='display:none;' title='<%= "Cancel Add Paragraph".t %>' onclick='cmsEdit.cancelAddParagraph();'><%= theme_image_tag '/images/icons/pageeditor/cancel_add_paragraph.gif', :align=>'absmiddle' %>
      <span id='cms_add_framework_elements_icons' style='position:relative; <%= "display:none;" if @container_arg=='page' %>'>
        <a href='javascript:void(0);' id='cms_add_framework_element_icon' title='<%= "Add a new Framework Feature".t %>' onclick='cmsEdit.addSelectFrameworkElement();'><%= theme_image_tag '/images/icons/pageeditor/add_framework.gif', :align=>'absmiddle' %>
        <a href='javascript:void(0);' id='cms_cancel_add_framework_element_icon' style='display:none;' title='<%= "Cancel Add Paragraph".t %>' onclick='cmsEdit.cancelAddFrameworkElement();'><%= theme_image_tag '/images/icons/pageeditor/cancel_add_framework.gif', :align=>'absmiddle' %>

            <%= "Add a Zone Lock".t %>

            <%= "Clear a Zone".t %>

      <a href='javascript:void(0);' id='cms_preview_icon' onclick='cmsEdit.previewPage();' title='<%= vh "Preview Page".t %>' ><%= theme_image_tag '/images/icons/pageeditor/preview.gif',:align=>'absmiddle' %>
      <a href='javascript:void(0);' id='cms_cancel_preview_icon' onclick='cmsEdit.cancelPreview();' title='<%= vh "Cancel Preview Page".t %>' style='display:none;' ><%= theme_image_tag '/images/icons/pageeditor/preview_return.gif',:align=>'absmiddle' %>
      <a href='javascript:void(0);' id='cms_connection_icon' onclick='cmsEdit.pageConnections();' title='<%= vh "View Page Connnections".t %>'><%= theme_image_tag '/images/icons/pageeditor/connections.gif',:align=>'absmiddle' %>
      <a href='javascript:void(0);' id='cms_variables_icon' onclick='cmsEdit.pageVariables();' title='<%= vh "View Page Variables".t %>'><%= theme_image_tag '/images/icons/pageeditor/variables.gif',:align=>'absmiddle' %>
      <a href='javascript:void(0);' id='cms_refresh_icon' onclick='cmsEdit.refreshInfo();' title='<%= vh "Refresh Info".t %>'><%= theme_image_tag '/images/icons/pageeditor/refresh.gif',:align=>'absmiddle' %>

      <a id='cms_goto_page' href='<%= @goto_page_override_url || @page.node_path %>'  onclick='return cmsEdit.gotoPage();' ><%= "Goto Page".t %>
      |
      <input type='submit' id='cms_save_changes' value='<%= vh "Save Changes".t %>' disabled='true' onclick='cmsEdit.saveChanges(); return false;' />
      <input type='submit' id='cms_save_as_button' value='<%= vh "Save As...".t %>' onclick='cmsEdit.saveAs(); return false;' />
      <div id='cms_save_as' onmouseover='delayedHideShow(this)' onmouseout='delayedHide(this);' class='cms_popup' style='display:none; right:1px; top:25px; <%= Locale.language_code == 'fr' ? 'width:450px;' : 'width:200px;' %> '>
        <%= "Save As a New Minor Version".t %>

        <%= "Save As a New Major Version".t %>

        <%= "Save As a Custom Version".t %>

      <img src='<%= theme_src("framework/page_title_menu_icon.gif") %>' width='24' height='24' align='absmiddle'/>

          <%= "Delete this Edit".t %>

          <%= "Delete this Version".t %>

          <%= "Delete this Version (All Languages)".t %>

      <img id='cms_saving_icon' src='<%= theme_src "loading_small.gif" %>' width='24' height='24' align='middle' style='visibility:hidden;'/>

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


double arg

double arg

<% @title = 'Email Features' %>

Sending to <%= @users.length %> users.

<% form_tag(:action => 'email_features') do %>
  <%= submit_tag("Send") %>

  Feature Email

  <%= text_area('feature_email', 'content', :cols => 80) %>

    Users: <%= (@users.map { |u| u.login }).join(', ') %>

<% end %>

<% @title = 'Email Features' %>

Sending to <%= @users.length %> users.

<% form_tag(:action => 'feature_email') do %>
  <%= submit_tag("Send") %>

  Feature Email

  <%= text_area('feature_email', 'content', :cols => 80) %>

    Users: <%= (@users.map { |u| u.login }).join(', ') %>

<% end %>


removendo post de exemplo

removendo post de exemplo


Improve wording for annotations in search results.

<% if @highlight_words.nil?
      @highlight_words = []
end %>

        <% if not event.incoming_message.nil? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message) %>
        <% elsif not event.outgoing_message.nil? and event.event_type == 'followup_sent' %>
            <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_url(event.outgoing_message) %>
        <% elsif not event.comment.nil? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), comment_url(event.comment) %>
        <% else %>
            <%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
        <% end %>

        <%= highlight_and_excerpt(event.search_text_main, @highlight_words, 150) %>

    <span class="bottomline icon_<%= info_request.calculate_status %>">

        <%= info_request.display_status %>

        <% if event.event_type == 'sent' %>
            Request sent to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
            on <%= simple_date(event.created_at) %>.
        <% elsif event.event_type == 'followup_sent' %>
            Follow up sent to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
            on <%= simple_date(event.created_at) %>.
        <% elsif event.event_type == 'response' %>
            <% if event.calculated_state.nil? %>
                Response
            <% else %>
                <%=event.display_status %>
            <% end %>
            by <%= public_body_link(info_request.public_body) %>
            to <%= user_link(info_request.user) %>
            on <%= simple_date(event.created_at) %>.
        <% elsif event.event_type == 'comment' %>
            Request to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>.
            Annotated by <%= user_link(event.comment.user) %>
            on <%= simple_date(event.created_at) %>.
        <% else %>
            <% raise "unknown event type indexed " + event.event_type %>
        <% end %>

<% if @highlight_words.nil?
      @highlight_words = []
end %>

        <% if not event.incoming_message.nil? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message) %>
        <% elsif not event.outgoing_message.nil? and event.event_type == 'followup_sent' %>
            <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_url(event.outgoing_message) %>
        <% elsif not event.comment.nil? %>
            <%= link_to highlight_words(info_request.title, @highlight_words), comment_url(event.comment) %>
        <% else %>
            <%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
        <% end %>

        <%= highlight_and_excerpt(event.search_text_main, @highlight_words, 150) %>

    <span class="bottomline icon_<%= info_request.calculate_status %>">

        <%= info_request.display_status %>

        <% if event.event_type == 'sent' %>
            Request sent to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'followup_sent' %>
            Follow up sent to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'response' %>
            <% if event.calculated_state.nil? %>
                Response
            <% else %>
                <%=event.display_status %>
            <% end %>
            by <%= public_body_link(info_request.public_body) %>
            to <%= user_link(info_request.user) %>
        <% elsif event.event_type == 'comment' %>
            Annotation by <%= user_link(event.comment.user) %>
            on request to <%= public_body_link(info_request.public_body) %>
            by <%= user_link(info_request.user) %>
        <% else %>
            <% raise "unknown event type indexed " + event.event_type %>
        <% end %>
        on <%= simple_date(event.created_at) %>.


Fixed HTTP cache on generated images.

Fixed HTTP cache on generated images.

<%
	idstr = Digest::MD5.hexdigest("#{_get["path"]}_#{_get["smartsize"].to_i}_#{_get["width"].to_i}_#{_get["height"].to_i}_#{_get["maxwidth"].to_i}_#{_get["maxheight"].to_i}_#{_get["rounded_corners"].to_i}_#{_get["border"].to_i}_#{_get["border_color"]}")

	if !_get["path"] or !File.exists?(_get["path"])
    print "File does not exist: '#{_get["path"]}'.\n"
    exit
  end

	time_orig = File.mtime(_get["path"])

	tmp_use = false
	tmp_write = false
	if $knj_webscripts_image_config
		tmp_use = true
		tmp_path = "#{$knj_webscripts_image_config["tmp_path"]}/#{idstr}"
		tmp_exists = File.exists?(tmp_path)
		tmp_write = true if !tmp_exists

		if !tmp_write and tmp_exists
			time_cache = File.mtime(tmp_path)

			if time_orig > time_cache
				tmp_write = true
			end
		end
	end

	notchanged = false

	if _httpsession.handler.modified_since and time_cache and _httpsession.handler.modified_since.utc.to_s == time_cache.utc.to_s
    notchanged = true
  elsif _httpsession.handler.modified_since and _httpsession.handler.modified_since.utc.to_s == time_orig.utc.to_s
    notchanged = true
  end

  if notchanged
    _httpsession.resp.status = 304
    exit
  end

	if !tmp_use or tmp_write or _get["force"].to_i > 0
    pic = Magick::Image.read(_get["path"]).first
    pic.format = "png"

		width = pic.columns
		height = pic.rows

		height = _get["height"].to_i if _get["height"]
		width = _get["width"].to_i if _get["width"]

		if _get["smartsize"]
			if pic.columns > pic.rows
				width = _get["smartsize"].to_i
				height = (pic.rows.to_f / (pic.columns.to_f / width.to_f)).to_i
			else
				height = _get["smartsize"].to_i
				width = (pic.columns.to_f / (pic.rows.to_f / height.to_f)).to_i
			end
		end

		if _get["maxwidth"]
			maxwidth = _get["maxwidth"].to_i

			if width > maxwidth
				height = (pic.rows.to_f / (pic.columns.to_f / maxwidth.to_f)).to_i
				width = maxwidth
			end
		end

		if _get["maxheight"]
			maxheight = _get["maxheight"].to_i

			if height > maxheight
				width = (pic.columns.to_f / (pic.rows.to_f / maxheight.to_f)).to_i
				height = maxheight
			end
		end

		if _get["width"] and _get["height"]
			width = _get["width"].to_i
			height = _get["height"].to_i
		end

		if height != pic.rows or width != pic.columns
			pic = pic.resize_to_fit(width.to_i, height.to_i)
		end

		if _get["rounded_corners"]
      args = {:img => pic, :radius => _get["rounded_corners"].to_i}

      if _get["border"] and _get["border_color"]
        args[:border] = _get["border"].to_i
        args[:border_color] = _get["border_color"]
      end

      Knj::Image.rounded_corners(args)
    end

		blob_cont = pic.to_blob
	end

	if tmp_write and blob_cont
    File.open(tmp_path, "w") do |fp|
      fp.write(blob_cont)
    end
	end

	if tmp_use
    _kas.header("Last-Modified", "#{time_orig.httpdate} GMT") if time_orig
		_kas.header("Content-Type", "image/png")
		print File.read(tmp_path)
	else
    _kas.header("Last-Modified", "#{time_orig.httpdate} GMT") if time_orig
		_kas.header("Content-Type", "image/png")
		print blob_cont
	end
%>

<%
	idstr = Digest::MD5.hexdigest("#{_get["path"]}_#{_get["smartsize"].to_i}_#{_get["width"].to_i}_#{_get["height"].to_i}_#{_get["maxwidth"].to_i}_#{_get["maxheight"].to_i}_#{_get["rounded_corners"].to_i}_#{_get["border"].to_i}_#{_get["border_color"]}")

	tmp_use = false
	tmp_write = false
	if $knj_webscripts_image_config
		tmp_use = true
		tmp_path = "#{$knj_webscripts_image_config["tmp_path"]}/#{idstr}"
		tmp_exists = File.exists?(tmp_path)
		tmp_write = true if !tmp_exists

		if !tmp_write and tmp_exists
			time_orig = File.mtime(_get["path"])
			time_cache = File.mtime(tmp_path)

			if time_orig > time_cache
				tmp_write = true
			end
		end
	end

	if !_get["path"] or !File.exists?(_get["path"])
    print "File does not exist: '#{_get["path"]}'.\n"
    exit
  end

	if !tmp_use or tmp_write or _get["force"].to_i > 0
    pic = Magick::Image.read(_get["path"]).first
    pic.format = "png"

		width = pic.columns
		height = pic.rows

		height = _get["height"].to_i if _get["height"]
		width = _get["width"].to_i if _get["width"]

		if _get["smartsize"]
			if pic.columns > pic.rows
				width = _get["smartsize"].to_i
				height = (pic.rows.to_f / (pic.columns.to_f / width.to_f)).to_i
			else
				height = _get["smartsize"].to_i
				width = (pic.columns.to_f / (pic.rows.to_f / height.to_f)).to_i
			end
		end

		if _get["maxwidth"]
			maxwidth = _get["maxwidth"].to_i

			if width > maxwidth
				height = (pic.rows.to_f / (pic.columns.to_f / maxwidth.to_f)).to_i
				width = maxwidth
			end
		end

		if _get["maxheight"]
			maxheight = _get["maxheight"].to_i

			if height > maxheight
				width = (pic.columns.to_f / (pic.rows.to_f / maxheight.to_f)).to_i
				height = maxheight
			end
		end

		if _get["width"] and _get["height"]
			width = _get["width"].to_i
			height = _get["height"].to_i
		end

		if height != pic.rows or width != pic.columns
			pic = pic.resize_to_fit(width.to_i, height.to_i)
		end

		if _get["rounded_corners"]
      args = {:img => pic, :radius => _get["rounded_corners"].to_i}

      if _get["border"] and _get["border_color"]
        args[:border] = _get["border"].to_i
        args[:border_color] = _get["border_color"]
      end

      Knj::Image.rounded_corners(args)
    end

		blob_cont = pic.to_blob
	end

	print "wee"

	if tmp_write and blob_cont
    print "hmm"
		Knj::Php.file_put_contents(tmp_path, blob_cont)
	end

	if tmp_use
    begin
      print "tmppp"
      print "2"

      #_kas.header("Last-Modified", "#{time_orig.httpdate} GMT") if time_orig
      #_kas.header("Content-Type", "image/png")
      print "File read:\n"
      print File.read(tmp_path)
      print "Done with file read.\n"
		rescue => e
      STDOUT.print Knj::Errors.error_str(e)
      raise e
		end

		exit
	else
    print "no tmp"

    #_kas.header("Last-Modified", "#{time_orig.httpdate} GMT") if time_orig
		#_kas.header("Content-Type", "image/png")
		print blob_cont
	end
%>


Updating generator of view for new records to correct syntax for create_url

<%@metaform_include_assets = true%>

New Record in <%= h @form.name %>

<% form_tag(Record.create_url(@form.class.to_s,@presentation,@current), :method => :post, :id => 'metaForm') do -%>
	<%= @form_html%>
<% end -%>
<%= javascript_tag @form_javascript%>

<%@metaform_include_assets = true%>

New Record in <%= h @form.name %>

<% form_tag(Record.create_url(@form,@presentation,@current), :method => :post, :id => 'metaForm') do -%>
	<%= @form_html%>
<% end -%>
<%= javascript_tag @form_javascript%>


remove comment

remove comment

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

      <%= link_to_unless_current 'Dashboard', :controller => 'projects', :action => 'index' %>

      <%= link_to 'Documentation', '/documentation/docs.html' %>

    <%= link_to image_tag("cruise_logo.png"), '/' %>

  <% if flash[:notice] and !flash[:notice].blank? -%>

<%= h flash[:notice] %>

  <% end -%>


Removed show_name2.rhtml

Removed show_name2.rhtml

<%
  @title = :show_name_title.t(:name => @name.display_name)
  Textile.register_name(@name)

  # Google Images | Distribution Map | Email Tracking
  new_tab_set do
    add_tab(:google_images.t,
            "http://images.google.com/images?q=#{@name.text_name}")
    if @data != []
      add_tab(:show_name_distribution_map.t, :action => 'map', :id => @name.id,
              :params => query_params)
    end
    add_tab(:show_name_email_tracking.t, :action => 'email_tracking',
            :id => @name.id, :params => query_params)
  end

  # Edit Name | Bulk Name Edit | Add Name | Change Synonyms | Approve/Deprecate
  new_tab_set do
    add_tab(:show_name_edit_name.t, :action => 'edit_name', :id => @name.id,
            :params => query_params)
    add_tab(:show_name_bulk_name_edit.t, :action => 'bulk_name_edit',
            :params => query_params)
    add_tab(:show_name_add_name.t, :action => 'create_name',
            :params => query_params)
    add_tab(:show_name_change_synonyms.t, :action => 'change_synonyms',
            :id => @name.id, :params => query_params)
    if @name.deprecated
      add_tab(:APPROVE.t, :action => 'approve_name', :id => @name.id,
              :params => query_params)
    else
      add_tab(:DEPRECATE.t, :action => 'deprecate_name', :id => @name.id,
              :params => query_params)
    end
  end

  draw_prev_next_tabs(@name)
  draw_interest_icons(@name)
%>

    <%
    # ----------------------------------------
    #  Show the basic name information
    # ----------------------------------------
    %>

        <%= render(:partial => 'name', :object => @name, :locals =>
                   { :synonyms => true } ) %>

        <%= show_previous_version(@name) %>

        <% for parent in @parents %>
          <%= rank_as_string(@parents[0].rank) %>:
            <%= link_to(parent.display_name.t, :action => 'show_name2',
                        :id => parent.id, :params => query_params) %>

        <% end %>
        <% if @children_data.length > 0 %>
          <%= link_to("#{:show_object.t(:type => @children_data[0].rank.to_s)}", :action => 'index_name',
                      :params => query_params(@children_query)) %>

        <% end %>

        <%= set_export_status_controls(@name) %>

      <%= show_best_image(@consensus_data) %>

      <%= name_section_link(:show_name_observations.t, @consensus_data, @consensus_query) %>
      <%= name_section_link(:show_name_synonym_observations.t, @synonym_data, @synonym_query) %>
      <%= name_section_link(:show_name_other_observations.t, @other_data, @other_query) %>
      <%= name_section_link(:show_name_subtaxa_observations.t, @subtaxa_data, @subtaxa_query) %>

    <%
    # ----------------------------------------
    #  Show a list of NameDescriptions.
    # ----------------------------------------
    %>

      <%= show_alt_descriptions(@name, @projects) %>

<%
# ----------------------------------------
#  Show comments and notes.
# ----------------------------------------
%>
<% if @name.has_notes? %>

<%= :show_name_notes.t %>:

  <%= colored_notes_box(true, sanitize(@name.notes).tpl) %>
<% end %>

  <%= show_authors_and_editors(@name) %>

<%= render(:partial => 'comment/show_comments', :locals =>
           { :object => @name, :controls => true }) %>

<%= show_object_footer(@name) %>


fix null graph

fix null graph

git-svn-id: d766b2a131eb5d649bacb6a45bc0bcd899bdfdb3@156 c938ebee-df10-0410-95fc-be8c4b0ebdd5

      <% if @flash[:notice] || @flash[:notice].to_s != ""%>

<%=@flash[:notice]%>

      <% end %>

          支出

        <% for summary in @expenses_summaries %>

            <%= summary.name %>
            <%= @expenses_sum != 0 ?
      (summary.sum * 100.0 / @expenses_sum).round : 0%>%
            <%= number_with_delimiter(summary.sum)%>

        <% end %>

          収入

        <% for summary in @incomes_summaries %>

            <%= summary.name %>
            <%= @incomes_sum != 0 ?
(summary.sum * 100.0 / @incomes_sum).round : 0 %>%
            <%= number_with_delimiter(summary.sum)%>

        <% end %>

          支出合計
          <%= number_with_delimiter(@expenses_sum)%>

          収入合計
          <%= number_with_delimiter(@incomes_sum)%>

<%
  labels = ''
  values = ''
  for summary in @expenses_summaries
     v = (@expenses_sum != 0 ? (summary.sum * 100.0 / @expenses_sum).round : 0)
     values += v.to_s + ','
     labels += summary.name + ','
  end
%>
<% if labels.count(',') > 1 then %>

	 <img src="<%= url_for(:controller=>'graph', :action=>'pie', :labels=>labels, :values=>values) %>" />

<% end %>

<%
  labels = ''
  values = ''
  for summary in @incomes_summaries
     v = (@incomes_sum != 0 ? (summary.sum * 100.0 / @incomes_sum).round : 0)
     values += v.to_s + ','
     labels += summary.name + ','
  end
%>
<% if labels.count(',') > 1 then %>

	 <img src="<%= url_for(:controller=>'graph', :action=>'pie', :labels=>labels, :values=>values) %>" />

<% end %>

    <div class="<%= @profit >= 0 ? "profit" : "loss" %>">
      <%= @profit >= 0 ? "利益" : "損失" %>合計
      <%= number_with_delimiter(@profit.abs)%>円

            資産減少

          <% for summary in @asset_minus_summaries %>

              <%= summary.account.name %>
              -<%= number_with_delimiter(summary.diff.abs)%>

          <% end %>

            資産増加

          <% for summary in @asset_plus_summaries %>

              <%= summary.account.name %>
              +<%= number_with_delimiter(summary.diff)%>

          <% end %>

            減少合計
            -<%= number_with_delimiter(@assets_minus_sum.abs)%>

            増加合計
            +<%= number_with_delimiter(@assets_plus_sum)%>

      <% if @flash[:notice] || @flash[:notice].to_s != ""%>

<%=@flash[:notice]%>

      <% end %>

          支出

        <% for summary in @expenses_summaries %>

            <%= summary.name %>
            <%= @expenses_sum != 0 ?
      (summary.sum * 100.0 / @expenses_sum).round : 0%>%
            <%= number_with_delimiter(summary.sum)%>

        <% end %>

          収入

        <% for summary in @incomes_summaries %>

            <%= summary.name %>
            <%= @incomes_sum != 0 ?
(summary.sum * 100.0 / @incomes_sum).round : 0 %>%
            <%= number_with_delimiter(summary.sum)%>

        <% end %>

          支出合計
          <%= number_with_delimiter(@expenses_sum)%>

          収入合計
          <%= number_with_delimiter(@incomes_sum)%>

<%
  labels = ''
  values = ''
  for summary in @expenses_summaries
     v = (@expenses_sum != 0 ? (summary.sum * 100.0 / @expenses_sum).round : 0)
     values += v.to_s + ','
     labels += summary.name + ','
  end
%>

	 <img src="<%= url_for(:controller=>'graph', :action=>'pie', :labels=>labels, :values=>values) %>" />

<%
  labels = ''
  values = ''
  for summary in @incomes_summaries
     v = (@incomes_sum != 0 ? (summary.sum * 100.0 / @incomes_sum).round : 0)
     values += v.to_s + ','
     labels += summary.name + ','
  end
%>

	 <img src="<%= url_for(:controller=>'graph', :action=>'pie', :labels=>labels, :values=>values) %>" />

    <div class="<%= @profit >= 0 ? "profit" : "loss" %>">
      <%= @profit >= 0 ? "利益" : "損失" %>合計
      <%= number_with_delimiter(@profit.abs)%>円

            資産減少

          <% for summary in @asset_minus_summaries %>

              <%= summary.account.name %>
              -<%= number_with_delimiter(summary.diff.abs)%>

          <% end %>

            資産増加

          <% for summary in @asset_plus_summaries %>

              <%= summary.account.name %>
              +<%= number_with_delimiter(summary.diff)%>

          <% end %>

            減少合計
            -<%= number_with_delimiter(@assets_minus_sum.abs)%>

            増加合計
            +<%= number_with_delimiter(@assets_plus_sum)%>


More precise.

More precise.

<% @show_tips = @xapian_requests.nil? || (@total_hits == 0) %>

<% if @query.nil? %>
    <% @title = "Search Freedom of Information requests, public authorities and users" %>

<%=@title%>

<% elsif @total_hits == 0 %>
    <% @title = "Nothing found for '" + h(@query) + "'" %>
<% else %>
    <% @title = "Results page " + @page.to_s %>
<% end%>

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

       <%= text_field_tag 'query', @query, { :size => 40 } %>
       <%= hidden_field_tag 'sortby', params[:sortby] %>
       <%= submit_tag "Search" %>
       <% if not @show_tips %>
             Advanced tips
       <% end %>

<% end %>

<% if not @query.nil? %>

    <%=link_to_unless @sortby.nil?, "Show most relevant results first", search_url(@query, nil) %>
    |
    <%=link_to_unless @sortby == 'newest', "Newest results first", search_url(@query, 'newest') %>
    <% if @sortby == 'described' %>
    | Recently described results first
    <% end %>

<% end %>

<% if @total_hits == 0 %>

<%=@title %>

<% end %>

<% if not @query.nil? %>
    <% if @spelling_correction %>

Did you mean: <%= link_to @spelling_correction, search_url(@spelling_correction, @sortby) %>

    <% end %>

    <% if @track_thing and (@xapian_bodies.results.size > 0 or @xapian_users.results.size > 0 or @total_hits == 0)%>
        <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
    <% end %>

    <% if @xapian_bodies.results.size > 0 %>

<%= "Public authorities " + ((@page-1)*@bodies_per_page+1).to_s + "-" + [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s + " of " + @xapian_bodies.matches_estimated.to_s + " for '" + h(@query) + "'" %>

        <% for result in @xapian_bodies.results %>
            <%= render :partial => 'body/body_listing_single', :locals => { :public_body => result[:model] }  %>
        <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %>
    <% end %>

    <% if @xapian_users.results.size > 0 %>

<%= "People " + ((@page-1)*@users_per_page+1).to_s + "-" + [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s + " of " + @xapian_users.matches_estimated.to_s + " for '" + h(@query) + "'" %>

        <% for result in @xapian_users.results %>
            <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
        <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %>
    <% end %>

    <% if @xapian_requests.results.size > 0 %>

<%= "FOI requests " + ((@page-1)*@requests_per_page+1).to_s + "-" + [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s + " of " + @xapian_requests.matches_estimated.to_s + " for '" + h(@query) + "'" %>

        <% if @track_thing %>
            <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
        <% end %>

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

        <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %>
        <% if @track_thing %>

            <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
        <% end %>
    <% end %>
<% end %>

<% if @show_tips %>

Search tips

Enter words that you want to find separated by spaces, e.g. climbing lane

Use OR (in capital letters) where you don't mind which word,  e.g. commons OR lords

Use quotes when you want to find an exact phrase, e.g. "Liverpool City Council"

variety: with value sent, followup_sent, response, comment, authority or user to select type of thing to search for.

Type status: to select based on the status or historical status of the request, see table below.

requested_from:home_office to restrict to requests from the <%= link_to "Home Office", show_public_body_url(:url_name => 'home_office') %>, typing the name as in the URL.

requested_by:julian_todd to restrict to requests made by <%= link_to "Julian Todd", show_user_url(:url_name => 'julian_todd') %>, typing the name as in the URL.

request: to restrict to a specific request, typing the title as in the URL.

filetype:pdf to find all responses with PDF attachments. Or try these: <%= IncomingMessage.get_all_file_extentions%>.

Type 01/01/2008..14/01/2008 to only show things that happened in the first two weeks of January.

Read about advanced search operators, such as proximity and wildcards.

status:waiting_response	 Waiting for the public authority to reply

status:not_held	 The public authority does not have the information requested

status:rejected	 The request was rejected by the public authority

status:partially_successful	 Some of the information requested has been received

status:successful	 All of the information requested has been received

status:waiting_clarification	 The public authority would like part of the request explained

status:waiting_classification	 A new response has arrived, but it hasn't been categorised yet

status:requires_admin	 A strange reponse, required attention by the WhatDoTheyKnow team

<% end %>

<% @show_tips = @xapian_requests.nil? || (@total_hits == 0) %>

<% if @query.nil? %>
    <% @title = "Search Freedom of Information requests, public authorities and users" %>

<%=@title%>

<% elsif @total_hits == 0 %>
    <% @title = "Nothing found for '" + h(@query) + "'" %>
<% else %>
    <% @title = "Results page " + @page.to_s %>
<% end%>

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

       <%= text_field_tag 'query', @query, { :size => 40 } %>
       <%= hidden_field_tag 'sortby', params[:sortby] %>
       <%= submit_tag "Search" %>
       <% if not @show_tips %>
             Advanced tips
       <% end %>

<% end %>

<% if not @query.nil? %>

    <%=link_to_unless @sortby.nil?, "Show most relevant results first", search_url(@query, nil) %>
    |
    <%=link_to_unless @sortby == 'newest', "Newest results first", search_url(@query, 'newest') %>
    <% if @sortby == 'described' %>
    | Recently described results first
    <% end %>

<% end %>

<% if @total_hits == 0 %>

<%=@title %>

<% end %>

<% if not @query.nil? %>
    <% if @spelling_correction %>

Did you mean: <%= link_to @spelling_correction, search_url(@spelling_correction, @sortby) %>

    <% end %>

    <% if @track_thing and (@xapian_bodies.results.size > 0 or @xapian_users.results.size > 0 or @total_hits == 0)%>
        <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
    <% end %>

    <% if @xapian_bodies.results.size > 0 %>

<%= "Public authorities " + ((@page-1)*@bodies_per_page+1).to_s + "-" + [@page*@bodies_per_page, @xapian_bodies.matches_estimated].min.to_s + " of " + @xapian_bodies.matches_estimated.to_s + " for '" + h(@query) + "'" %>

        <% for result in @xapian_bodies.results %>
            <%= render :partial => 'body/body_listing_single', :locals => { :public_body => result[:model] }  %>
        <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %>
    <% end %>

    <% if @xapian_users.results.size > 0 %>

<%= "People " + ((@page-1)*@users_per_page+1).to_s + "-" + [@page*@users_per_page, @xapian_users.matches_estimated].min.to_s + " of " + @xapian_users.matches_estimated.to_s + " for '" + h(@query) + "'" %>

        <% for result in @xapian_users.results %>
            <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %>
        <% end %>

        <%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %>
    <% end %>

    <% if @xapian_requests.results.size > 0 %>

<%= "FOI requests " + ((@page-1)*@requests_per_page+1).to_s + "-" + [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s + " of " + @xapian_requests.matches_estimated.to_s + " for '" + h(@query) + "'" %>

        <% if @track_thing %>
            <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
        <% end %>

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

        <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %>
        <% if @track_thing %>

            <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %>
        <% end %>
    <% end %>
<% end %>

<% if @show_tips %>

Search tips

Enter words that you want to find separated by spaces, e.g. climbing lane

Use OR (in capital letters) where you don't mind which word,  e.g. commons OR lords

Use quotes when you want to find an exact phrase, e.g. "Liverpool City Council"

variety: with value sent, followup_sent, response, comment, authority or user to select type of thing to search for.

Type status: to select based on the status or historical status of the request, see table below.

requested_from:home_office to restrict to requests from the <%= link_to "Home Office", show_public_body_url(:url_name => 'home_office') %>, typing the name as in the URL.

requested_by:julian_todd to restrict to requests made by <%= link_to "Julian Todd", show_user_url(:url_name => 'julian_todd') %>, typing the name as in the URL.

request: to restrict to a specific request, typing the title as in the URL.

filetype:pdf to find all responses in PDF format. Or try these: <%= IncomingMessage.get_all_file_extentions%>.

Type 01/01/2008..14/01/2008 to only show things that happened in the first two weeks of January.

Read about advanced search operators, such as proximity and wildcards.

status:waiting_response	 Waiting for the public authority to reply

status:not_held	 The public authority does not have the information requested

status:rejected	 The request was rejected by the public authority

status:partially_successful	 Some of the information requested has been received

status:successful	 All of the information requested has been received

status:waiting_clarification	 The public authority would like part of the request explained

status:waiting_classification	 A new response has arrived, but it hasn't been categorised yet

status:requires_admin	 A strange reponse, required attention by the WhatDoTheyKnow team

<% end %>


LInk from admin interface to home page of site is useful

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

      <meta http-equiv="content-type" content="text/html;charset=UTF-8" >
      <title>WhatDoTheyKnow admin<%= @title ? ":" : "" %> <%=@title%></title>
      <%
        # Have to do explicit tag for stylesheet, to get absolute path on main server
      %>
      <%= tag("link", { "rel" => "Stylesheet", "type" => "text/css", "media" => "screen", "href" => admin_public_url(stylesheet_path('admin')) }) %>

<%= link_to 'WhatDoTheyKnow', main_url('/') %> admin interface:
    <%= link_to 'Overview', admin_url('') %>
    | <%= link_to 'Timeline', admin_url('timeline') %>
    | <%= link_to 'Public authorities', admin_url('body/list') %>
    | <%= link_to 'Requests', admin_url('request/list') %>
    | <%= link_to 'Users', admin_url('user/list') %>

<%= flash[:notice] %>

    <%= yield  %>

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

      <meta http-equiv="content-type" content="text/html;charset=UTF-8" >
      <title>WhatDoTheyKnow admin<%= @title ? ":" : "" %> <%=@title%></title>
      <%
        # Have to do explicit tag for stylesheet, to get absolute path on main server
      %>
      <%= tag("link", { "rel" => "Stylesheet", "type" => "text/css", "media" => "screen", "href" => admin_public_url(stylesheet_path('admin')) }) %>

WhatDoTheyKnow admin interface:
    <%= link_to 'Overview', admin_url('') %>
    | <%= link_to 'Timeline', admin_url('timeline') %>
    | <%= link_to 'Public authorities', admin_url('body/list') %>
    | <%= link_to 'Requests', admin_url('request/list') %>
    | <%= link_to 'Users', admin_url('user/list') %>

<%= flash[:notice] %>

    <%= yield  %>


subforms now use the configured association.options[:order], when  available. they only sort by id as a backup routine.

<%
parent_record = @record
associated = column.singular_association? ? [parent_record.send(column.name)].compact : parent_record.send(column.name)
associated = associated.sort_by {|r| r.id} unless column.association.options.has_key?(:order)

show_blank_record = (column.plural_association? or (column.singular_association? and associated.empty?))
show_blank_record = false if column.through_association?
show_blank_record = false unless column.association.klass.authorized_for?(:action => :create)

-%>

<%= column.label -%>

  <% @record = column.association.klass.new -%>
  <%= render :partial => 'form_association_header', :locals => {:parent_record => parent_record} %>

  <tbody id="<%= sub_form_list_id(:association => column.name) %>">
    <% associated.each_index do |index| %>
    <% @record = associated[index] -%>

      <% scope = column.plural_association? ? "[#{column.name}][#{@record.id}]" : "[#{column.name}]" -%>
      <%= render :partial => 'form_association_record', :locals => {:scope => scope, :parent_record => parent_record} %>

    <% end -%>

    <% if show_blank_record -%>
    <% @record = column.association.klass.new -%>

      <% scope = column.plural_association? ? "[#{column.name}][#{generate_temporary_id}]" : "[#{column.name}]" -%>
      <%= render :partial => 'form_association_record', :locals => {:scope => scope, :parent_record => parent_record} %>

    <% end -%>

<%= render :partial => 'form_association_footer', :locals => {:parent_record => parent_record, :column => column, :associated => associated} -%>

<% @record = parent_record -%>

<%
parent_record = @record
associated = column.singular_association? ? [parent_record.send(column.name)].compact : parent_record.send(column.name).sort_by {|r| r.id}

show_blank_record = (column.plural_association? or (column.singular_association? and associated.empty?))
show_blank_record = false if column.through_association?
show_blank_record = false unless column.association.klass.authorized_for?(:action => :create)

-%>

<%= column.label -%>

  <% @record = column.association.klass.new -%>
  <%= render :partial => 'form_association_header', :locals => {:parent_record => parent_record} %>

  <tbody id="<%= sub_form_list_id(:association => column.name) %>">
    <% associated.each_index do |index| %>
    <% @record = associated[index] -%>

      <% scope = column.plural_association? ? "[#{column.name}][#{@record.id}]" : "[#{column.name}]" -%>
      <%= render :partial => 'form_association_record', :locals => {:scope => scope, :parent_record => parent_record} %>

    <% end -%>

    <% if show_blank_record -%>
    <% @record = column.association.klass.new -%>

      <% scope = column.plural_association? ? "[#{column.name}][#{generate_temporary_id}]" : "[#{column.name}]" -%>
      <%= render :partial => 'form_association_record', :locals => {:scope => scope, :parent_record => parent_record} %>

    <% end -%>

<%= render :partial => 'form_association_footer', :locals => {:parent_record => parent_record, :column => column, :associated => associated} -%>

<% @record = parent_record -%>


Moved the edit feeding tasks up and the add feeding tasks down so that it was easier to use.

<%= render :partial => 'tasks/tasks_common_info', :locals => {:task_type => 'Feeding', :tasks => cage.tasks.feeding_tasks, :cage=>cage} %>

Edit Feeding Tasks:

This will change all feeding tasks to match the parameters below

<% form_remote_tag(:update => "tasks_div",
                       :url => { :controller => 'tasks', :action => 'update_multiple_feeding_tasks', :id => cage },
                       :position => "replace") do %>

<%= render :partial => 'tasks/tasks_common_feeding_form', :locals=>{:cage=>cage} %>

<% end %>

Add Feeding Tasks:

This will add a feeding task to the list above

<%= render :partial => 'tasks/remote_new_feed_cage_task', :locals => {:cage => cage, :div_id => 'tasks_div', :users => User.current,
                                :source => 'show_cage', :single_cage_task_list => true, :quick_add => false} %>

<%= render :partial => 'tasks/tasks_common_info', :locals => {:task_type => 'Feeding', :tasks => cage.tasks.feeding_tasks, :cage=>cage} %>

Add Feeding Tasks:

This will add a feeding task to the list above

<%= render :partial => 'tasks/remote_new_feed_cage_task', :locals => {:cage => cage, :div_id => 'tasks_div', :users => User.current,
                                :source => 'show_cage', :single_cage_task_list => true, :quick_add => false} %>

Edit Feeding Tasks:

This will change all feeding tasks to match the parameters below

<% form_remote_tag(:update => "tasks_div",
                       :url => { :controller => 'tasks', :action => 'update_multiple_feeding_tasks', :id => cage },
                       :position => "replace") do %>

<%= render :partial => 'tasks/tasks_common_feeding_form', :locals=>{:cage=>cage} %>

<% end %>


fix remember choice for event group scope

<%= if @columns then "
" end %>

<div id="event_group_links" class="<%= if @columns then "centerblock" end %>">
  <%= render :partial => 'ajax_tree/tree' %>

<% if params[:show_hidden] -%>
    Showing all event groups
  <% else -%>
    <%= link_to 'Show hidden event groups', '/event_groups/scope?show_hidden=true' %>
  <% end %>

<%= check_box_tag 'remember', 'true', true, :onClick => "update_links();" %>Remember my choice for next time.

<%= if @columns then "
" end %>