Use real quotation marks, not ascii apostrophes

<% @title = "Making requests" %>

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

<%= @title %> #

I’m not sure which authority to make my request to, how can I find out? #

It can be hard to untangle the complicated structure of government, and work out
who has the information you want. Here are a few tips:

Browse or search WhatDoTheyKnow looking for similar requests to yours.

When you’ve found an authority you think might have the information, use
the "home page" link on the right hand side of their page to check what they do
on their website.

Contact the authority by phone or email to ask if they hold the kind of
information you’re after.

Don’t worry excessively about getting the right authority. If you get it
wrong, they ought to advise you who to make the request to instead.

If you’ve got a thorny case, please contact us for help.

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, we’d love
to hear from you too.

Why do you include some authorities that aren’t formally subject to FOI?#

WhatDoTheyKnow lets you make requests for information to a range of
organisations:

 Those formally subject to the FOI Act

 Those formally subject to the Environmental Regulations (a less well
  defined group)

 Those which voluntarily comply with the FOI Act

 Those which aren’t subject to the Act but we think should be, on grounds
  such as them having significant public responsibilities.

In the last case, we’re using the site to lobby for expansion of the
scope of the FOI Act. Even if an organisation is not legally obliged to respond
to an FOI request, they can still do so voluntarily.

Why must I keep my request focused?#

Please put in your request only what is needed so that someone can
easily identify what information you are asking for. Please do
not include any of the following:

arguments about your cause

statements that could defame or insult others

If you do, we may have to remove your request to avoid problems with
libel law, which is a pain for both you and us. Short, succinct messages
make it easier for authorities to be clear what information you are
requesting, which means you will get a reply more quickly.

If you want information to support an argument or campaign, Freedom of
Information is a powerful tool. Although you may not use this site to
run your campaign, we encourage you to use it to get the information you
need. We also encourage to run your campaign elsewhere - one effective
and very easy way is to <%= link_to 'start your own blog',
"http://wordpress.com/"%>. You are welcome to link to your campaign
from this site in an annotation to your request (you can make
annotations after submitting the request).

Does it cost me anything to make a request?#

Making an FOI request is nearly always free.

Authorities often include unnecessary, scary, boilerplate in
acknowledgement messages saying they "may" charge a fee. Ignore such notices.
They hardly ever will actually charge a fee.  If they do, they can only charge you if
you have specifically agreed in advance to pay.  More
    details from the Information Commissioner.

Sometimes an authority will refuse your request, saying that the cost
of handling it exceeds £600 (for central government) or £450 (for all other
public authorities). At this point you can refine your
request. e.g. it would be much cheaper for an authority to tell you the amount
spent on marshmallows in the past year than in the past ten years.

How quickly will I get a response? #

By law, public authorities must respond promptly to
requests.

Even if they are not prompt, in nearly all cases they must respond within
20 working days. If you had to clarify your request, or they are a school,
or one or two other cases, then they may have more time
(full details).

WhatDoTheyKnow will email you if you don’t get a timely response.  You can
then send the public authority a message to remind them, and tell them if they
are breaking the law.

What if I never get a response?#

There are several things you can do if you never get a response.

Sometimes there has been a genuine problem and the authority never
    received the request. It is worth telephoning the authority and politely
    checking that they received the request. It was sent to them by email.

If they have not received it, the problem is most likely due to
    "spam filters". Refer the authority to the measures in the answer
    ‘I can see a request on WhatDoTheyKnow, but we never got it by email!’
    in the FOI officers section of this help.

If you’re still having no luck, then you can ask for an internal review,
    and then complain to the Information Commissioner about the authority.
    Read our page ‘Unhappy about the response you got?’.

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?’.

It says I can’t re-use the information I got!#

Authorities often add legal boilerplate about the
"Re-Use of Public Sector
Information Regulations 2005", which at first glance implies you may not
be able do anything with the information.

You can, of course, write articles about the information or summarise it, or
quote parts of it. We also think you should feel free to republish the
information in full, just as we do, even though in theory you might not be
allowed to do so.  See our policy on copyright.

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 Commissioner’s website.

If you’re requesting information from a Scottish public authority,
the process is very similar. There are differences around time
limits for compliance.
See the Scottish
Information Commissioner’s guidance for details.

Can I request information about myself? #

No. 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 "How to access your information" (on the Information Commissioner’s
website) explains how to do this.

If you see that somebody has included personal information, perhaps
unwittingly, in a request, please contact us
immediately so we can remove it.

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.

Why can I only request information about the environment from some authorities? #

Some public authorities, such as Milford Haven Port Authority,
don’t come under the Freedom of Information Act, but do come under another law called
the Environmental Information Regulations (EIR).

It’s a very similar law, so you make a request
to them using WhatDoTheyKnow in just the same way as an FOI request. The only
difference is that on the page where your write you request, it reminds you
that you can only request "environmental information" and tells you what that
means. It is quite broad.

You can, of course, request environmental information from other
authorities. Just make a Freedom of Information (FOI) request as normal. The
authority has a duty to work out if the Environmental Information Regulations
(EIR) is the more appropriate legislation to reply under.

Can I make the same to request to lots of authorities, e.g. all councils? #

We ask you to first send a test version of your request to a few
authorities. Their responses will help you improve the wording of your request,
so that you get the best information when you send the request to all of
the authorities. There is currently no automated system for sending the request
to the other authorities, you must copy and paste it by hand.

I made a request off the site, how do I upload it to the archive?#

WhatDoTheyKnow is an archive of requests made through the site,
and does not try to be an archive of all FOI requests. We’ll never support uploading
other requests. For one thing, we wouldn’t be able to verify that other
responses actually came from the authority. If this really matters to you,
you can always make the same request again via WhatDoTheyKnow.

How do you moderate request annotations? #

Annotations on WhatDoTheyKnow are to help
people get the information they want, or to give them pointers to places they
can go to help them act on it. We reserve the right to remove anything else.

Endless, political discussions are not allowed.
Post a link to a suitable forum or campaign site elsewhere.

Next, read about your privacy -->

<% @title = "Making requests" %>

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

<%= @title %> #

I'm not sure which authority to make my request to, how can I find out? #

It can be hard to untangle the complicated structure of government, and work out
who has the information you want. Here are a few tips:

Browse or search WhatDoTheyKnow looking for similar requests to yours.

When you've found an authority you think might have the information, use
the "home page" link on the right hand side of their page to check what they do
on their website.

Contact the authority by phone or email to ask if they hold the kind of
information you're after.

Don't worry excessively about getting the right authority. If you get it
wrong, they ought to advise you who to make the request to instead.

If you've got a thorny case, please contact us for help.

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, we'd love
to hear from you too.

Why do you include some authorities that aren't formally subject to FOI?#

WhatDoTheyKnow lets you make requests for information to a range of
organisations:

 Those formally subject to the FOI Act

 Those formally subject to the Environmental Regulations (a less well
  defined group)

 Those which voluntarily comply with the FOI Act

 Those which aren't subject to the Act but we think should be, on grounds
  such as them having significant public responsibilities.

In the last case, we're using the site to lobby for expansion of the
scope of the FOI Act. Even if an organisation is not legally obliged to respond
to an FOI request, they can still do so voluntarily.

Why must I keep my request focused?#

Please put in your request only what is needed so that someone can
easily identify what information you are asking for. Please do
not include any of the following:

arguments about your cause

statements that could defame or insult others

If you do, we may have to remove your request to avoid problems with
libel law, which is a pain for both you and us. Short, succinct messages
make it easier for authorities to be clear what information you are
requesting, which means you will get a reply more quickly.

If you want information to support an argument or campaign, Freedom of
Information is a powerful tool. Although you may not use this site to
run your campaign, we encourage you to use it to get the information you
need. We also encourage to run your campaign elsewhere - one effective
and very easy way is to <%= link_to 'start your own blog',
"http://wordpress.com/"%>. You are welcome to link to your campaign
from this site in an annotation to your request (you can make
annotations after submitting the request).

Does it cost me anything to make a request?#

Making an FOI request is nearly always free.

Authorities often include unnecessary, scary, boilerplate in
acknowledgement messages saying they "may" charge a fee. Ignore such notices.
They hardly ever will actually charge a fee.  If they do, they can only charge you if
you have specifically agreed in advance to pay.  More
    details from the Information Commissioner.

Sometimes an authority will refuse your request, saying that the cost
of handling it exceeds £600 (for central government) or £450 (for all other
public authorities). At this point you can refine your
request. e.g. it would be much cheaper for an authority to tell you the amount
spent on marshmallows in the past year than in the past ten years.

How quickly will I get a response? #

By law, public authorities must respond promptly to
requests.

Even if they are not prompt, in nearly all cases they must respond within
20 working days. If you had to clarify your request, or they are a school,
or one or two other cases, then they may have more time
(full details).

WhatDoTheyKnow will email you if you don't get a timely response.  You can
then send the public authority a message to remind them, and tell them if they
are breaking the law.

What if I never get a response?#

There are several things you can do if you never get a response.

Sometimes there has been a genuine problem and the authority never
    received the request. It is worth telephoning the authority and politely
    checking that they received the request. It was sent to them by email.

If they have not received it, the problem is most likely due to
    "spam filters". Refer the authority to the measures in the answer
    'I can see a request on WhatDoTheyKnow, but we never got it by email!'
    in the FOI officers section of this help.

If you're still having no luck, then you can ask for an internal review,
    and then complain to the Information Commissioner about the authority.
    Read our page 'Unhappy about the response you got?'.

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?'.

It says I can't re-use the information I got!#

Authorities often add legal boilerplate about the
"Re-Use of Public Sector
Information Regulations 2005", which at first glance implies you may not
be able do anything with the information.

You can, of course, write articles about the information or summarise it, or
quote parts of it. We also think you should feel free to republish the
information in full, just as we do, even though in theory you might not be
allowed to do so.  See our policy on copyright.

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 Commissioner's website.

If you're requesting information from a Scottish public authority,
the process is very similar. There are differences around time
limits for compliance.
See the Scottish
Information Commissioner's guidance for details.

Can I request information about myself? #

No. 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 "How to access your information" (on the Information Commissioner's
website) explains how to do this.

If you see that somebody has included personal information, perhaps
unwittingly, in a request, please contact us
immediately so we can remove it.

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.

Why can I only request information about the environment from some authorities? #

Some public authorities, such as Milford Haven Port Authority,
don’t come under the Freedom of Information Act, but do come under another law called
the Environmental Information Regulations (EIR).

It's a very similar law, so you make a request
to them using WhatDoTheyKnow in just the same way as an FOI request. The only
difference is that on the page where your write you request, it reminds you
that you can only request "environmental information" and tells you what that
means. It is quite broad.

You can, of course, request environmental information from other
authorities. Just make a Freedom of Information (FOI) request as normal. The
authority has a duty to work out if the Environmental Information Regulations
(EIR) is the more appropriate legislation to reply under.

Can I make the same to request to lots of authorities, e.g. all councils? #

We ask you to first send a test version of your request to a few
authorities. Their responses will help you improve the wording of your request,
so that you get the best information when you send the request to all of
the authorities. There is currently no automated system for sending the request
to the other authorities, you must copy and paste it by hand.

I made a request off the site, how do I upload it to the archive?#

WhatDoTheyKnow is an archive of requests made through the site,
and does not try to be an archive of all FOI requests. We'll never support uploading
other requests. For one thing, we wouldn't be able to verify that other
responses actually came from the authority. If this really matters to you,
you can always make the same request again via WhatDoTheyKnow.

How do you moderate request annotations? #

Annotations on WhatDoTheyKnow are to help
people get the information they want, or to give them pointers to places they
can go to help them act on it. We reserve the right to remove anything else.

Endless, political discussions are not allowed.
Post a link to a suitable forum or campaign site elsewhere.

Next, read about your privacy -->


Correctly calculate whether we have edit perms

<%=h @questionnaire.title%>

<%= error_messages_for :questionnaire %>
<%= javascript_include_tag "layout.js" %>

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

<% @editing = (logged_in? && logged_in_person.permitted?(@questionnaire, "edit")) -%>

<% form_for(:questionnaire, @questionnaire, :url => questionnaire_path(@questionnaire), :html => { :method => :put }) do |f| %>

      <%= jipe_editor @questionnaire, :title, :editing => @editing %>

    <% authors = @questionnaire.permitted_people("edit").collect {|p| p.name}.join(", ") -%>
    <% if authors.length > 0 -%>

      By <%=h authors %>
    <% end -%>

    <% if @editing -%>

Tags:
      <%=text_field_tag "questionnaire[tags]", @questionnaire.tag_names.join(", ") %>
    <% elsif @questionnaire.tags.size > 0 -%>

Tags:
      <%=h @questionnaire.tag_names.join(", ") %>
    <% end -%>

      <%= pluralize(@questionnaire.pages.count, "page") %>

      <%= pluralize(@questionnaire.fields.count, "question") %>

Welcome page

    <% if @editing -%>

The welcome page is the first thing your visitors will see before starting your survey.  You can put any introductory
      text you'd like on the welcome page.

For advanced formatting and other customizations, you can insert custom HTML code by clicking the "HTML" tab.

      <%= render :partial => "html_editor", :locals => {:obj => @questionnaire, :field => "welcome_text"}%>
    <% else -%>
	  <% if @questionnaire.welcome_text.blank? -%>

This survey has no custom welcome page content.

	  <% else -%>

          <%= sanitize @questionnaire.welcome_text %>

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

    <% if @editing -%>

<%= submit_tag "Save changes" %>

    <% end -%>
<% end %>

<% if @editing and logged_in? and logged_in_person.permitted?(@questionnaire, "destroy") -%>

Delete this survey

This will permanently delete this survey, along with all the responses to it.
	We highly recommend exporting <%= link_to "the survey", :action => "export" %> and
	<%= link_to "its responses", export_responses_path(@questionnaire) %> before proceeding.

  <%= link_to "Delete this survey", questionnaire_path(@questionnaire), :method => "delete",
	  :confirm => "Are you sure you wish to delete the survey \"#{@questionnaire.title}\" and all " +
				  "its responses?  We recommend exporting it to a file first, if you haven't already " +
				  "done so.",
	  :style => "border: 1px #f00 solid; background-color: #faa; color: black;
	             padding: 0.5em; margin: 0.5em; cursor: pointer;
	             text-decoration: none; font-weight: bold;
				 border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;" %>
<% end -%>

<%=h @questionnaire.title%>

<%= error_messages_for :questionnaire %>
<%= javascript_include_tag "layout.js" %>

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

<% @editing = logged_in? and logged_in_person.permitted?(@questionnaire, "edit") -%>

<% form_for(:questionnaire, @questionnaire, :url => questionnaire_path(@questionnaire), :html => { :method => :put }) do |f| %>

      <%= jipe_editor @questionnaire, :title, :editing => @editing %>

    <% authors = @questionnaire.permitted_people("edit").collect {|p| p.name}.join(", ") -%>
    <% if authors.length > 0 -%>

      By <%=h authors %>
    <% end -%>

    <% if @editing -%>

Tags:
      <%=text_field_tag "questionnaire[tags]", @questionnaire.tag_names.join(", ") %>
    <% elsif @questionnaire.tags.size > 0 -%>

Tags:
      <%=h @questionnaire.tag_names.join(", ") %>
    <% end -%>

      <%= pluralize(@questionnaire.pages.count, "page") %>

      <%= pluralize(@questionnaire.fields.count, "question") %>

Welcome page

    <% if @editing -%>

The welcome page is the first thing your visitors will see before starting your survey.  You can put any introductory
      text you'd like on the welcome page.

For advanced formatting and other customizations, you can insert custom HTML code by clicking the "HTML" tab.

      <%= render :partial => "html_editor", :locals => {:obj => @questionnaire, :field => "welcome_text"}%>
    <% else -%>
	  <% if @questionnaire.welcome_text.blank? -%>

This survey has no custom welcome page content.

	  <% else -%>

          <%= sanitize @questionnaire.welcome_text %>

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

    <% if @editing -%>

<%= submit_tag "Save changes" %>

    <% end -%>
<% end %>

<% if @editing and logged_in? and logged_in_person.permitted?(@questionnaire, "destroy") -%>

Delete this survey

This will permanently delete this survey, along with all the responses to it.
	We highly recommend exporting <%= link_to "the survey", :action => "export" %> and
	<%= link_to "its responses", export_responses_path(@questionnaire) %> before proceeding.

  <%= link_to "Delete this survey", questionnaire_path(@questionnaire), :method => "delete",
	  :confirm => "Are you sure you wish to delete the survey \"#{@questionnaire.title}\" and all " +
				  "its responses?  We recommend exporting it to a file first, if you haven't already " +
				  "done so.",
	  :style => "border: 1px #f00 solid; background-color: #faa; color: black;
	             padding: 0.5em; margin: 0.5em; cursor: pointer;
	             text-decoration: none; font-weight: bold;
				 border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;" %>
<% end -%>


use currency_fmt for account list; text-align: right for saldi

Accounts

<%= link_to 'New account', :action => 'new' %>

    Number
    Title
    Type
    Saldo

<% for account in @accounts %>

    <%=h account.number %>
    <%= link_to h(account.title), :action => 'show', :id => account %>
    <%=h account.account_type.title unless account.account_type.nil? %>
    <%=h currency_fmt(account.saldo.abs) %>
    <%= link_to 'Edit', :action => 'edit', :id => account %>
    <%= link_to 'Destroy', { :action => 'destroy', :id => account }, :confirm => 'Are you sure?', :post => true %>

<% end %>

<%= link_to 'Previous page', { :page => @account_pages.current.previous } if @account_pages.current.previous %>
<%= link_to 'Next page', { :page => @account_pages.current.next } if @account_pages.current.next %>

Accounts

<%= link_to 'New account', :action => 'new' %>

    Number
    Title
    Type
    Saldo

<% for account in @accounts %>

    <%=h account.number %>
    <%= link_to h(account.title), :action => 'show', :id => account %>
    <%=h account.account_type.title unless account.account_type.nil? %>
    <%=h account.saldo.abs %>
    <%= link_to 'Edit', :action => 'edit', :id => account %>
    <%= link_to 'Destroy', { :action => 'destroy', :id => account }, :confirm => 'Are you sure?', :post => true %>

<% end %>

<%= link_to 'Previous page', { :page => @account_pages.current.previous } if @account_pages.current.previous %>
<%= link_to 'Next page', { :page => @account_pages.current.next } if @account_pages.current.next %>


sorry, removed debugging info

sorry, removed debugging info

<%
if genre = @user_request.referent.metadata['genre']
	type = genre.capitalize+'s'
else
	type = 'Resources'
end
%>

Finding <%=type%>

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

Electronic version  via:

<% fulltxt = get_service_type('fulltext').each do | ft |
    target = ft.service_response.service.to_fulltext(ft.service_response)
%>

 <%= link_to target[:display_text], {:controller=>'link_router', :id=>ft.id}, 'target'=>"_blank" %>

<% unless target[:coverage].blank? %>

<%= target[:coverage] %>
<% end
%>
<% unless target[:note].blank? %>

<%= target[:note] %>
<% end
%>

<%
end

if fulltxt.empty?
%>

Not Available

<%
end
%>

Paper version  via:

<%
src = ""
holdings = get_service_type('holding').each do |p|
  target = p.service_response.service.to_holding(p.service_response)
  if src != target[:source_name]
  %>

<%= target[:source_name] %>

  <%
  src = target[:source_name]
  end
  if target[:call_number] == ""
  	display_text = target[:display_text]
  else
  	display_text = target[:call_number]
  end
  %>

<%= link_to display_text, {:controller=>'link_router', :id=>p.id}, 'target'=>'_blank' %>

<%
    unless display_text == target[:display_text]%>

<%= target[:display_text] %>
    <% end
    if target.has_key?(:status)%>

      <% if target[:status] == "Not Charged" or target[:status] == "Available" %>
      <%= target[:status].sub(/Not Charged/, "Available")%>
      <% else %>
      <%= target[:status] %>
      <% end %>

      <%
      end%>

  <%

  end
  %>

<%
if holdings.empty?
    unless title_search = search_opac_for_title(@user_request)
%>

Not Available

<%
else %>

<%= title_search -%>

<% end end %>

<% if session[:coins] %>

Check for holdings:

<%    session[:coins].each { | coins |
        unless coins[:text]
          label = image_tag(coins[:icon], :border=>0)
        else
          label = coins[:text]
        end
    %>

<a href="<%= coins[:host]%>?<%= @user_request.referent.to_context_object.kev %>" target="_blank"><%= label %>

    <%}%>

<%   end
%>

<% if display_ill?
%>

Request a copy via:

<% get_service_type('document_delivery').each do | doc_del_type |

    valueHash = doc_del_type.view_data_from_service_type

    if @user_request.referent.format == 'journal'
        #valueHash[:url].sub!(/genre=[^\&]*/, 'genre=article')
    end

    %>

<%= link_to valueHash[:display_text], {:controller=>'link_router', :id=>doc_del_type.id}, 'target'=>'_blank'%>

<% end %>

<% end %>

<%
unless get_service_type('relevant links').empty? %>

Closest Web Results:  [<%= link_to_function "hide", "activelyHideWebResults()"%>]

<% get_service_type('relevant links').each do |web|
   target = web.service.to_web_link
%>

<%= link_to target[:title], {:controller=>'link_router', :id=>web.id}, 'target'=>"_blank"%>

<%= target[:description] %>
<%
end %>

[<%= link_to_function "Show closest web results", "activelyShowWebResults()"%>]

<% end %>

  <%= render :partial=>"menu" %>
  <%= render :partial=>"highlighted_links_start" %>

<%
if genre = @user_request.referent.metadata['genre']
	type = genre.capitalize+'s'
else
	type = 'Resources'
end
%>

Finding <%=type%>

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

Electronic version  via:

<% fulltxt = get_service_type('fulltext').each do | ft |
    target = ft.service_response.service.to_fulltext(ft.service_response)
%>

 <%= link_to target[:display_text], {:controller=>'link_router', :id=>ft.id}, 'target'=>"_blank" %>

<% unless target[:coverage].blank? %>

<%= target[:coverage] %>
<% end
%>
<% unless target[:note].blank? %>

<%= target[:note] %>
<% end
%>

<%
end

if fulltxt.empty?
%>

Not Available

<%
end
%>

Paper version  via:

<%
src = ""
holdings = get_service_type('holding').each do |p|
  target = p.service_response.service.to_holding(p.service_response)
  if src != target[:source_name]
  %>

<%= target[:source_name] %>

  <%
  src = target[:source_name]
  end
  if target[:call_number] == ""
  	display_text = target[:display_text]
  else
  	display_text = target[:call_number]
  end
  %>

<%= link_to display_text, {:controller=>'link_router', :id=>p.id}, 'target'=>'_blank' %>

<%
    unless display_text == target[:display_text]%>

<%= target[:display_text] %>
    <% end
    if target.has_key?(:status)%>

      <% if target[:status] == "Not Charged" or target[:status] == "Available" %>
      <%= target[:status].sub(/Not Charged/, "Available")%>
      <% else %>
      <%= target[:status] %>
      <% end %>

      <%
      end%>

  <%

  end
  %>

<%
if holdings.empty?
    unless title_search = search_opac_for_title(@user_request)
%>

Not Available

<%
else %>

<%= title_search -%>

<% end end %>

<% if session[:coins] %>

Check for holdings:

<%    session[:coins].each { | coins |
        unless coins[:text]
          label = image_tag(coins[:icon], :border=>0)
        else
          label = coins[:text]
        end
    %>

<a href="<%= coins[:host]%>?<%= @user_request.referent.to_context_object.kev %>" target="_blank"><%= label %>

    <%}%>

<%   end
%>

<% if display_ill?
%>

Request a copy via:

<% get_service_type('document_delivery').each do | doc_del_type |

    valueHash = doc_del_type.view_data_from_service_type

    if @user_request.referent.format == 'journal'
        #valueHash[:url].sub!(/genre=[^\&]*/, 'genre=article')
    end

    %>

valueHash? <%= valueHash.keys %> <%= link_to valueHash[:display_text], {:controller=>'link_router', :id=>doc_del_type.id}, 'target'=>'_blank'%>

<% end %>

<% end %>

<%
unless get_service_type('relevant links').empty? %>

Closest Web Results:  [<%= link_to_function "hide", "activelyHideWebResults()"%>]

<% get_service_type('relevant links').each do |web|
   target = web.service.to_web_link
%>

<%= link_to target[:title], {:controller=>'link_router', :id=>web.id}, 'target'=>"_blank"%>

<%= target[:description] %>
<%
end %>

[<%= link_to_function "Show closest web results", "activelyShowWebResults()"%>]

<% end %>

  <%= render :partial=>"menu" %>
  <%= render :partial=>"highlighted_links_start" %>


Added a checkbox to 'save & publish' from the edit window. Closes #164 (0.5).

git-svn-id: e099d366fb13ea49c9e8e170ced890dab3ea84f7@882 aaa19a3b-e121-0410-9d45-962fd44e537e

<%= error_messages_for @node %>

<%= search_box(:ajax=>true) %>

  <% (partial = form_tabs).each_index do |i| %><div id='<%= partial[i] %>_sel' <%= i == 0 ? "class='selected'" : "" %>><%= link_to_function(_(partial[i] + '_tab'), "select_tab('#{partial[i]}');") %>
<% end %>

  <% form_tag( node_path(@node[:zip]), :method => :put, :multipart => @node.kind_of?(Document), :id => 'node_form') do -%>

    <input type='hidden' name='edit' value='popup'/>

    <% if @node.can_publish? %><%= _('publish') %> <input type='checkbox' name='node[v_status]' value='50'<%= params[:pub] ? " checked='checked'" : '' %>/><% end -%>

<input type='submit' onclick="$('loader').style.visibility = 'visible';" value='<%= _('validate') %>'/>

<%= submit_to_remote('save', _('save'), :url => save_text_node_path(:id => @node[:zip]), :loading=>"$('loader').style.visibility = 'visible';") %>

    <% unless @node.version.new_record? %>

<%# FIXME = submit_to_remote('backup', _('backup'), :url=>{:action => 'backup', :controller=>'version', :id=>@node.v_id}, :loading=>"$('loader').style.visibility = 'visible';") %>

    <% end -%>

<a href='#' onclick='uploader=window.open("<%= new_document_path(:parent_id=>@node[:zip])%>", "uploader", "location=1,width=400,height=300");uploader.opener = opener;return false;'><%= _('btn_add_document')%>

<%= readers_for(@node) %>

<% partial.each_index do |i| %><div id='<%= partial[i] %>_tab' <%= i == 0 ? "" : "style='display:none;'" %> class='tab_content'>
  <%= render :partial=>"templates/edit_tabs/#{partial[i]}" %>

<% end %>

<% end -%>

<%#= css_edit %>
<%= javascript_start %>
var current_tab = $('<%= partial[0] %>_tab');
var current_sel = $('<%= partial[0] %>_sel');
function select_tab(name) {
  var obj = $(name+'_tab');
  var obj_sel = $(name+'_sel');
  current_tab.style.display = 'none';
  current_sel.className = '';
  current_tab = obj;
  current_sel = obj_sel;
  current_tab.style.display = '';
  current_sel.className = 'selected';
}
Event.observe(window, 'resize', function() { Zena.resizeElement('node_v_text'); } );
Event.observe(window, 'resize', function() { Zena.resizeElement('node_v_text'); } );
function popup_loaded() {
  Zena.resizeElement('node_v_text');
}
<%= javascript_end %>
<% ['v_text', 'v_summary', 'v_title'].each do |field| -%>
<%= observe_field("node_#{field}", :frequency=>3, :function=>"opener.Zena.editor_preview('#{preview_version_url(:node_id=>@node[:zip], :id=>(@node.v_number || 0), :_method => :put, :key => field, :escape => false)}',element,value)") %>
<% end -%>

<%= error_messages_for @node %>

<%= search_box(:ajax=>true) %>

  <% (partial = form_tabs).each_index do |i| %><div id='<%= partial[i] %>_sel' <%= i == 0 ? "class='selected'" : "" %>><%= link_to_function(_(partial[i] + '_tab'), "select_tab('#{partial[i]}');") %>
<% end %>

  <% form_tag( node_path(@node[:zip]), :method => :put, :multipart => @node.kind_of?(Document), :id => 'node_form') do -%>

    <input type='hidden' name='edit' value='popup'/>
    <% if params[:pub] -%><input type='hidden' name='node[v_status]' value='50'/><% end -%>

<input type="submit" onclick="$('loader').style.visibility = 'visible';" value='<%= _('validate') %>'/>

<%= submit_to_remote('save', _('save'), :url => save_text_node_path(:id => @node[:zip]), :loading=>"$('loader').style.visibility = 'visible';") %>

    <% unless @node.version.new_record? %>

<%# FIXME = submit_to_remote('backup', _('backup'), :url=>{:action => 'backup', :controller=>'version', :id=>@node.v_id}, :loading=>"$('loader').style.visibility = 'visible';") %>

    <% end -%>

<a href='#' onclick='uploader=window.open("<%= new_document_path(:parent_id=>@node[:zip])%>", "uploader", "location=1,width=400,height=300");uploader.opener = opener;return false;'><%= _('btn_add_document')%>

<%= readers_for(@node) %>

<% partial.each_index do |i| %><div id='<%= partial[i] %>_tab' <%= i == 0 ? "" : "style='display:none;'" %> class='tab_content'>
  <%= render :partial=>"templates/edit_tabs/#{partial[i]}" %>

<% end %>

<% end -%>

<%#= css_edit %>
<%= javascript_start %>
var current_tab = $('<%= partial[0] %>_tab');
var current_sel = $('<%= partial[0] %>_sel');
function select_tab(name) {
  var obj = $(name+'_tab');
  var obj_sel = $(name+'_sel');
  current_tab.style.display = 'none';
  current_sel.className = '';
  current_tab = obj;
  current_sel = obj_sel;
  current_tab.style.display = '';
  current_sel.className = 'selected';
}
Event.observe(window, 'resize', function() { Zena.resizeElement('node_v_text'); } );
Event.observe(window, 'resize', function() { Zena.resizeElement('node_v_text'); } );
function popup_loaded() {
  Zena.resizeElement('node_v_text');
}
<%= javascript_end %>
<% ['v_text', 'v_summary', 'v_title'].each do |field| -%>
<%= observe_field("node_#{field}", :frequency=>3, :function=>"opener.Zena.editor_preview('#{preview_version_url(:node_id=>@node[:zip], :id=>(@node.v_number || 0), :_method => :put, :key => field, :escape => false)}',element,value)") %>
<% end -%>


Fixed titlebar handler issues

Fixed titlebar handler issues

  <% if myself.id %>

    « View Site
    <% if @cms_return_to_site_url -%> |
      <a href='<%= h @cms_return_to_site_url -%>'>« Return to site
    <% end -%>

    <a href='<%= url_for :controller => "/account" %>'><%= "my account".t %>
      |
    <a href='<%= url_for :controller => '/manage/access', :action => 'logout' %>'><%= "logout".t %>
      |
      <%= webiva_search_widget -%>

  <% end -%>

<img src='<%= WEBIVA_LOGO_FILE || theme_src("framework/logo.gif") %>'>

<%  # Foreground, Background
    @menu_colors = { 'website' => [ '#29974e', '#add4b8' ],
                    'files_and_images' => [ '#df5323', "#d4a451" ],
                    'content' => [ '#539424', "#c1d0a1" ],
                    'e_marketing' => [ '#5299c4', "#d3e8ec" ],
                    'options' => [ '#be8806', "#f3e380" ],
                    'system' => [ '#5a514f', "#c9ccce" ],
                    'people' => [ '#8d796a', "#d0c5a3"  ]
                    }
    %>

          <% @menu.each do |mnu| -%>

<a href='<%= mnu[3] %>' style='background-image:url(<%= theme_src("framework/menu_icon/#{mnu[1]}#{@cms_page_info[:section] == mnu[0] ? '_selected' : ''}.gif")  %>); color:<%= @menu_colors[mnu[0]][0] %>'><%= mnu[2].t %>

          <% end -%>

<div id='cms_title_bar' style=' <%= "background-color:#{@menu_colors[@cms_page_info[:section]][1]}; color:#{@menu_colors[@cms_page_info[:section]][0]}" if @menu_colors[@cms_page_info[:section]] %>'>
     <% if  @cms_page_info[:title].is_a?(Array) %>
          <% @cms_page_info[:title].each do |item| %>
            <% if item.is_a?(Array) && item[1] %>
              <a style='<%= "color:#{@menu_colors[@cms_page_info[:section]][0]}" if @menu_colors[@cms_page_info[:section]] %>'  href='<%= item[1] %>'><%= h( item.length > 2 ? sprintf(item[0].t,*item[2..-1]) : item[0].t) %>
            <% else -%>
              <% if item.is_a?(Array) %>
                <%= h(sprintf(item[0].t,*item[2..-1])) %>
              <% else -%>
                <%= h item.t %>
              <% end -%>
            <% end -%>
            <%= ">" unless item == @cms_page_info[:title].last %>
          <% end -%>
      <% else -%>
			 <%= @cms_page_info[:title].t %>
      <% end -%>

        <% if session[:context_translation] && permit?('client_admin') %>
          <a href='javascript:void(0);' onclick='openWindow("<%= url_for :controller => '/manage/translate', :action => 'context' %>","Win",800,600,"yes","yes");'><img src='<%= theme_src("framework/page_title_translate.gif") %>' width='32' height='32' align='absmiddle'/>

        <% end -%>
        <% if @cms_titlebar_handlers && @cms_titlebar_handlers.length > 0 -%>
          <%= @cms_titlebar_handlers.map { |h| h.titlebar_html }.join("") -%>
        <% end -%>
        <% if @cms_page_info[:menu_js] %>
        <a href='javascript:void(0);' onclick='<%= @cms_page_info[:menu_js] %>'><img src='<%= theme_src("framework/page_title_menu_icon.gif")%>' width='28' height='29'  align='absmiddle' />
        <% end -%>

  <% if flash[:notice] %>

<%= flash[:notice] %> (Close Notice)

  <% end -%>
  <%= render :partial => '/layouts/wizard_top' if @wizard %>
    <div id='cms_<%=@cms_page_info[:section]%>_content'>
    <%= yield %>

  <%= render :partial => '/layouts/wizard_bottom' if @wizard %>

  <% if myself.id %>

    « View Site
    <% if @cms_return_to_site_url -%> |
      <a href='<%= h @cms_return_to_site_url -%>'>« Return to site
    <% end -%>

    <a href='<%= url_for :controller => "/account" %>'><%= "my account".t %>
      |
    <a href='<%= url_for :controller => '/manage/access', :action => 'logout' %>'><%= "logout".t %>
      |
      <%= webiva_search_widget -%>

  <% end -%>

<img src='<%= WEBIVA_LOGO_FILE || theme_src("framework/logo.gif") %>'>

<%  # Foreground, Background
    @menu_colors = { 'website' => [ '#29974e', '#add4b8' ],
                    'files_and_images' => [ '#df5323', "#d4a451" ],
                    'content' => [ '#539424', "#c1d0a1" ],
                    'e_marketing' => [ '#5299c4', "#d3e8ec" ],
                    'options' => [ '#be8806', "#f3e380" ],
                    'system' => [ '#5a514f', "#c9ccce" ],
                    'people' => [ '#8d796a', "#d0c5a3"  ]
                    }
    %>

          <% @menu.each do |mnu| -%>

<a href='<%= mnu[3] %>' style='background-image:url(<%= theme_src("framework/menu_icon/#{mnu[1]}#{@cms_page_info[:section] == mnu[0] ? '_selected' : ''}.gif")  %>); color:<%= @menu_colors[mnu[0]][0] %>'><%= mnu[2].t %>

          <% end -%>

<div id='cms_title_bar' style=' <%= "background-color:#{@menu_colors[@cms_page_info[:section]][1]}; color:#{@menu_colors[@cms_page_info[:section]][0]}" if @menu_colors[@cms_page_info[:section]] %>'>
     <% if  @cms_page_info[:title].is_a?(Array) %>
          <% @cms_page_info[:title].each do |item| %>
            <% if item.is_a?(Array) && item[1] %>
              <a style='<%= "color:#{@menu_colors[@cms_page_info[:section]][0]}" if @menu_colors[@cms_page_info[:section]] %>'  href='<%= item[1] %>'><%= h( item.length > 2 ? sprintf(item[0].t,*item[2..-1]) : item[0].t) %>
            <% else -%>
              <% if item.is_a?(Array) %>
                <%= h(sprintf(item[0].t,*item[2..-1])) %>
              <% else -%>
                <%= h item.t %>
              <% end -%>
            <% end -%>
            <%= ">" unless item == @cms_page_info[:title].last %>
          <% end -%>
      <% else -%>
			 <%= @cms_page_info[:title].t %>
      <% end -%>

        <% if session[:context_translation] && permit?('client_admin') %>
          <a href='javascript:void(0);' onclick='openWindow("<%= url_for :controller => '/manage/translate', :action => 'context' %>","Win",800,600,"yes","yes");'><img src='<%= theme_src("framework/page_title_translate.gif") %>' width='32' height='32' align='absmiddle'/>

        <% end -%>
        <% if @cms_titlebar_handlers.length > 0 -%>
          <%= @cms_titlebar_handlers.map { |h| h.titlebar_html }.join("") -%>
        <% end -%>
        <% if @cms_page_info[:menu_js] %>
        <a href='javascript:void(0);' onclick='<%= @cms_page_info[:menu_js] %>'><img src='<%= theme_src("framework/page_title_menu_icon.gif")%>' width='28' height='29'  align='absmiddle' />
        <% end -%>

  <% if flash[:notice] %>

<%= flash[:notice] %> (Close Notice)

  <% end -%>
  <%= render :partial => '/layouts/wizard_top' if @wizard %>
    <div id='cms_<%=@cms_page_info[:section]%>_content'>
    <%= yield %>

  <%= render :partial => '/layouts/wizard_bottom' if @wizard %>


fixing a couple problems in subforms related to trying to create new records and failing validation. the resulting redrawn form first failed to sort the records  because new records have no id, and then ended up not giving new records another random id for valid input names.

<%
parent_record = @record
associated = column.singular_association? ? [parent_record.send(column.name)].compact : parent_record.send(column.name)
associated = associated.sort_by {|r| r.new_record? ? 99999999999 : 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 -%> (<%= link_to_visibility_toggle(:default_visible => !column.collapsed) -%>)

<div <%= 'style="display: none;"' if column.collapsed -%>>

  <% @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] -%>
    <% if @record.errors.count -%>

      <td colspan="<%= active_scaffold_config_for(@record.class).subform.columns.length + 1 %>">
        <%= error_messages_for :record %>

    <% end %>
    <tr class="association-record <%= 'association-record-new' if @record.new_record? -%>">
      <% scope = column.plural_association? ? "[#{column.name}][#{@record.id || generate_temporary_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)
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 -%> (<%= link_to_visibility_toggle(:default_visible => !column.collapsed) -%>)

<div <%= 'style="display: none;"' if column.collapsed -%>>

  <% @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] -%>
    <% if @record.errors.count -%>

      <td colspan="<%= active_scaffold_config_for(@record.class).subform.columns.length + 1 %>">
        <%= error_messages_for :record %>

    <% end %>
    <tr class="association-record <%= 'association-record-new' if @record.new_record? -%>">
      <% 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 -%>


global menu: clicking people takes you to 'my friends'

<%= render :partial => 'layouts/menu_login' %>

  <%- if logged_in? -%>
    <%- if current_site.network -%>
      <li id='menu_home' class='<%= @active_tab == :home ? 'active' : '' %>'>
        <%= link_to_active 'Home'[:menu_home], '/', @active_tab == :home %>

    <%- end -%>
    <li id='menu_me' class='<%= @active_tab == :me ? 'active' : '' %>'>
      <%= link_to_active 'Me'[:menu_me], '/me/dashboard', @active_tab == :me %>

  <%- else -%>
    <li class='<%= @active_tab == :home ? 'active' : '' %>'>
      <%= link_to_active "Home"[:menu_home], '/', @active_tab == :home %>

  <%- end -%>

  <%# for now, i am disabling these tabs when not logged in. why? because
      the controllers currently bomb out in bad ways if you are not logged in. %>
  <%- if logged_in? -%>
    <li id='menu_people' class='<%= @active_tab == :people ? 'active' : '' %>'>
      <%= link_to_active "People"[:menu_people], people_url(:action => :contacts), @active_tab == :people %>

    <li id='menu_groups' class='<%= @active_tab == :groups ? 'active' : '' %>'>
      <% url = logged_in? ? group_directory_url(:action => :my) : group_directory_url %>
      <%= link_to_active "Groups"[:menu_groups], url, @active_tab == :groups %>

    <%- if current_site.has_networks? -%>
      <li id='menu_networks' class='<%= @active_tab == :networks ? 'active' : '' %>'>
        <% url = logged_in? ? network_directory_url(:action => :my) : network_directory_url %>
        <%= link_to_active "Networks"[:menu_networks], url, @active_tab == :networks %>

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

  <%- if logged_in? and current_site.chat? -%>
  <li class='<%= @active_tab == :chat ? 'active' : '' %>'>
    <%= link_to_active "Chat"[:menu_chat], '/chat', @active_tab == :chat %>

  <%- end -%>

  <%= call_hook :top_menu %>

<%= render :partial => 'layouts/menu_login' %>

  <%- if logged_in? -%>
    <%- if current_site.network -%>
      <li id='menu_home' class='<%= @active_tab == :home ? 'active' : '' %>'>
        <%= link_to_active 'Home'[:menu_home], '/', @active_tab == :home %>

    <%- end -%>
    <li id='menu_me' class='<%= @active_tab == :me ? 'active' : '' %>'>
      <%= link_to_active 'Me'[:menu_me], '/me/dashboard', @active_tab == :me %>

  <%- else -%>
    <li class='<%= @active_tab == :home ? 'active' : '' %>'>
      <%= link_to_active "Home"[:menu_home], '/', @active_tab == :home %>

  <%- end -%>

  <%# for now, i am disabling these tabs when not logged in. why? because
      the controllers currently bomb out in bad ways if you are not logged in. %>
  <%- if logged_in? -%>
    <li id='menu_people' class='<%= @active_tab == :people ? 'active' : '' %>'>
      <%= link_to_active "People"[:menu_people], people_url, @active_tab == :people %>

    <li id='menu_groups' class='<%= @active_tab == :groups ? 'active' : '' %>'>
      <% url = logged_in? ? group_directory_url(:action => :my) : group_directory_url %>
      <%= link_to_active "Groups"[:menu_groups], url, @active_tab == :groups %>

    <%- if current_site.has_networks? -%>
      <li id='menu_networks' class='<%= @active_tab == :networks ? 'active' : '' %>'>
        <% url = logged_in? ? network_directory_url(:action => :my) : network_directory_url %>
        <%= link_to_active "Networks"[:menu_networks], url, @active_tab == :networks %>

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

  <%- if logged_in? and current_site.chat? -%>
  <li class='<%= @active_tab == :chat ? 'active' : '' %>'>
    <%= link_to_active "Chat"[:menu_chat], '/chat', @active_tab == :chat %>

  <%- end -%>

  <%= call_hook :top_menu %>


Cleaned up areas.rhtml.

Cleaned up areas.rhtml.

<%
def sortAreas
	arr = []
	WORLD_MAP_AREA.each_pair do |id, hash|
		arr << {:id => id, :name => AREA_TABLE[id][:name]}
	end
	return arr.sort {|a,b| a[:name] <=> b[:name] }
end

areas = sortAreas
%>

Areas:

ID	Name

<% areas.each {|a| %>
	<%= "
#{a[:id]}	#{a[:name]}
" %>
<% } %>

<%
def sortAreas
	arr = []
	WORLD_MAP_AREA.each_pair do |id, hash|
		arr << {:id => id, :name => AREA_TABLE[id][:name]}
	end
	return arr.sort {|a,b| a[:name] <=> b[:name] }
end

areas = sortAreas
%>

Areas:

ID	Name

<%=
s = ''
areas.each {|a|
	s += "
#{a[:id]}	#{a[:name]}
"
}
s
%>


Add a link to a user's home location if they have one.


less scary edition warning

less scary edition warning

<% # Can actually be probably used for other service types than full text.
   # But anyway, displays a typical full text element in typical markup.
   # pass in a ServiceType object for the response as :object

   #optional argument, :locals => {:li_class => 'whatever'}
   li_class ||= "fulltextlink"
   show_source ||= false

   # passed in in :object or :collection
   view_data = fulltext_element.view_data
%>

<li class="<%= li_class %>"> <%= link_to view_data[:display_text], {:controller=>'link_router', :id=>fulltext_element.id}, 'target'=>"_blank" %>

<% if show_source %>

from <%= view_data[:source] || fulltext_element.service_response.service.display_name %>

<% end %>

<% unless view_data[:coverage].blank? %>

  <%= view_data[:coverage] %>

<% end
%>
<% unless view_data[:notes].blank? %>

<%= view_data[:notes] %>

<% end %>
<% unless view_data[:authentication].blank? %>

Authentication: <%= view_data[:authentication] %>

<% end %>

<% if (!view_data[:match_reliability].blank?) && view_data[:match_reliability] != ServiceResponse::MatchExact %>

    Edition information <%= view_data[:edition_str] %>

<% end %>

  Debug info: <%= fulltext_element.service_response.service.id %>

  <% unless view_data[:debug_info].blank? %>
    ; <%= view_data[:debug_info] %>
  <% end %>

<% # Can actually be probably used for other service types than full text.
   # But anyway, displays a typical full text element in typical markup.
   # pass in a ServiceType object for the response as :object

   #optional argument, :locals => {:li_class => 'whatever'}
   li_class ||= "fulltextlink"
   show_source ||= false

   # passed in in :object or :collection
   view_data = fulltext_element.view_data
%>

<li class="<%= li_class %>"> <%= link_to view_data[:display_text], {:controller=>'link_router', :id=>fulltext_element.id}, 'target'=>"_blank" %>

<% if show_source %>

from <%= view_data[:source] || fulltext_element.service_response.service.display_name %>

<% end %>

<% unless view_data[:coverage].blank? %>

  <%= view_data[:coverage] %>

<% end
%>
<% unless view_data[:notes].blank? %>

<%= view_data[:notes] %>

<% end %>
<% unless view_data[:authentication].blank? %>

Authentication: <%= view_data[:authentication] %>

<% end %>

<% if (!view_data[:match_reliability].blank?) && view_data[:match_reliability] != ServiceResponse::MatchExact %>

    May be an alternate edition <%= view_data[:edition_str] %>

<% end %>

  Debug info: <%= fulltext_element.service_response.service.id %>

  <% unless view_data[:debug_info].blank? %>
    ; <%= view_data[:debug_info] %>
  <% end %>


correct preview link

correct preview link

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

<% with_options :controller => 'articles', :id => event.article_id do |article| -%>
<li class="event-comment<%= " shade" if shaded %>">
  <%= event_time_for event, later %>

<%= truncate strip_tags(event.body), 100 %>

  <%= link_to_article event.article %> was commented on.

    Article:
    <%= article.link_to 'Comments', :action => 'comments' %> |
    <%= article.link_to 'Preview',  :action => 'show' %> |
    <%= link_to_image('page_edit', { :controller => 'articles', :action => 'edit', :id => event.article_id }, { :size => '16x16' }) %> |
    by <%=h event.author %>

<% end -%>

<% with_options :controller => 'articles', :id => event.article_id do |article| -%>
<li class="event-comment<%= " shade" if shaded %>">
  <%= event_time_for event, later %>

<%= truncate strip_tags(event.body), 100 %>

  <%= link_to_article event.article %> was commented on.

    Article:
    <%= article.link_to 'Comments', :action => 'comments' %> |
    <%= article.link_to 'Preview',  :action => 'edit' %> |
    <%= article.link_to_image('page_edit', { :action => 'edit' }, { :size => '16x16' }) %> |
    by <%=h event.author %>

<% end -%>


Add warnings not to reply to message notifications directly.

Hi <%= @to_user %>,

<%= @from_user %> has sent you a message through OpenStreetMap with the subject "<%= @subject %>":

==
<%= @body %>
==

You can also read the message at <%= @readurl %>
and you can reply at <%= @replyurl %>


added google webmaster tools meta tag

added google webmaster tools meta tag

  <% if @page && @work && @collection
       title = "#{@collection.title} -- #{@work.title} -- #{@page.title} (FromThePage)"
     elsif @work && @collection
       title = @collection.title + ' -- ' + @work.title + ' (FromThePage)'
     elsif @article && @collection
       title = @collection.title + ' -- ' + @article.title + ' (FromThePage)'
     elsif @collection && @collection.title
       title = @collection.title + ' (FromThePage)'
     else
       title = 'FromThePage'
     end
  %>
  <title><%= title %></title>
  <%=  javascript_include_tag :defaults %>
  <%= stylesheet_link_tag 'application' %>
  <%= stylesheet_link_tag 'transcribe' %>
  <meta name="verify-v1" content="2pFw887E35Fhfkyj/nFGzyui8dJ4rLbluudrp1mDcj0=" />

    <%= link_to('Dashboard', { :controller => 'dashboard',
                               :ol => 'l_hd_dlink' }) %> |
    <% if logged_in? %>
	    <%= link_to('Log out', { :controller => 'account',
	                             :action => 'logout',
                               :ol => 'l_hd_lo' }) %>
    <% else %>
	    <%= link_to('Log in', { :controller => 'account',
	                            :action => 'login',
                               :ol => 'l_hd_li' }) %>
	    |
	    <%= link_to('Sign Up', { :controller => 'account',
	                             :action => 'signup',
                               :ol => 'l_hd_signup' }) %>
    <% end %>

        <%= link_to('FromThePage',
                    { :controller => 'static',
                      :action => 'splash',
                      :ol => 'l_hd_logo' },
                    { :class => 'site-logo' }) %>

      <% if (@work && @work.title) || (@collection && @collection.title) %>

	        <% if @collection %>
		        <%= link_to(@collection.title,
		                    { :controller => 'collection',
		                      :action => 'show',
		                      :collection_id => @collection.id,
                          :ol => 'l_hd_c_link' }) %>
	        <% end %>
	        <%= "—" if @collection && @work %>
	        <% if @work && @work.title %>
		        <%= link_to(@work.title,
		                    { :controller => 'display',
		                      :action => 'read_work',
		                      :work_id => @work.id,
                          :ol => 'l_hd_w_link' }) %>
	        <% end %>

      <% end %>

<% if(flash[:notice]) %>

<%= flash[:notice] %>

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

<%= flash[:error] %>

<% end %>

<%= @content_for_layout %>

  <% if @page && @work && @collection
       title = "#{@collection.title} -- #{@work.title} -- #{@page.title} (FromThePage)"
     elsif @work && @collection
       title = @collection.title + ' -- ' + @work.title + ' (FromThePage)'
     elsif @article && @collection
       title = @collection.title + ' -- ' + @article.title + ' (FromThePage)'
     elsif @collection && @collection.title
       title = @collection.title + ' (FromThePage)'
     else
       title = 'FromThePage'
     end
  %>
  <title><%= title %></title>
  <%=  javascript_include_tag :defaults %>
  <%= stylesheet_link_tag 'application' %>
  <%= stylesheet_link_tag 'transcribe' %>

    <%= link_to('Dashboard', { :controller => 'dashboard',
                               :ol => 'l_hd_dlink' }) %> |
    <% if logged_in? %>
	    <%= link_to('Log out', { :controller => 'account',
	                             :action => 'logout',
                               :ol => 'l_hd_lo' }) %>
    <% else %>
	    <%= link_to('Log in', { :controller => 'account',
	                            :action => 'login',
                               :ol => 'l_hd_li' }) %>
	    |
	    <%= link_to('Sign Up', { :controller => 'account',
	                             :action => 'signup',
                               :ol => 'l_hd_signup' }) %>
    <% end %>

        <%= link_to('FromThePage',
                    { :controller => 'static',
                      :action => 'splash',
                      :ol => 'l_hd_logo' },
                    { :class => 'site-logo' }) %>

      <% if (@work && @work.title) || (@collection && @collection.title) %>

	        <% if @collection %>
		        <%= link_to(@collection.title,
		                    { :controller => 'collection',
		                      :action => 'show',
		                      :collection_id => @collection.id,
                          :ol => 'l_hd_c_link' }) %>
	        <% end %>
	        <%= "—" if @collection && @work %>
	        <% if @work && @work.title %>
		        <%= link_to(@work.title,
		                    { :controller => 'display',
		                      :action => 'read_work',
		                      :work_id => @work.id,
                          :ol => 'l_hd_w_link' }) %>
	        <% end %>

      <% end %>

<% if(flash[:notice]) %>

<%= flash[:notice] %>

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

<%= flash[:error] %>

<% end %>

<%= @content_for_layout %>


Add 'delete' function to questionnaires

Add 'delete' function to questionnaires

<%=h @questionnaire.title%>

<%= error_messages_for :questionnaire %>
<%= javascript_include_tag "layout.js" %>

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

<% @editing = logged_in? and logged_in_person.permitted?(@questionnaire, "edit") -%>

<% form_for(:questionnaire, @questionnaire, :url => questionnaire_path(@questionnaire), :html => { :method => :put }) do |f| %>

      <%= jipe_editor @questionnaire, :title, :editing => @editing %>

    <% authors = @questionnaire.permitted_people("edit").collect {|p| p.name}.join(", ") -%>
    <% if authors.length > 0 -%>

      By <%=h authors %>
    <% end -%>

    <% if @editing -%>

Tags:
      <%=text_field_tag "questionnaire[tags]", @questionnaire.tag_names.join(", ") %>
    <% elsif @questionnaire.tags.size > 0 -%>

Tags:
      <%=h @questionnaire.tag_names.join(", ") %>
    <% end -%>

      <%= pluralize(@questionnaire.pages.count, "page") %>

      <%= pluralize(@questionnaire.fields.count, "question") %>

Welcome page

    <% if @editing -%>

The welcome page is the first thing your visitors will see before starting your survey.  You can put any introductory
      text you'd like on the welcome page.

For advanced formatting and other customizations, you can insert custom HTML code by clicking the "HTML" tab.

      <%= render :partial => "html_editor", :locals => {:obj => @questionnaire, :field => "welcome_text"}%>
    <% else -%>
	  <% if @questionnaire.welcome_text.blank? -%>

This survey has no custom welcome page content.

	  <% else -%>

          <%= sanitize @questionnaire.welcome_text %>

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

    <% if @editing -%>

<%= submit_tag "Save changes" %>

    <% end -%>

	<% if logged_in? and logged_in_person.permitted?(@questionnaire, "destroy") -%>

Delete this survey

This will permanently delete this survey, along with all the responses to it.
	    We highly recommend exporting <%= link_to "the survey", :action => "export" %> and
		<%= link_to "its responses", export_responses_path(@questionnaire) %> before proceeding.

	  <%= button_to "Delete this survey", questionnaire_path(@questionnaire), :method => "delete",
		  :confirm => "Are you sure you wish to delete the survey \"#{@questionnaire.title}\" and all " +
		              "its responses?  We recommend exporting it to a file first, if you haven't already " +
		              "done so." %>
	<% end -%>
<% end %>

<%=h @questionnaire.title%>

<%= error_messages_for :questionnaire %>
<%= javascript_include_tag "layout.js" %>

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

<% @editing = logged_in? and logged_in_person.permitted?(@questionnaire, "edit") -%>

<% form_for(:questionnaire, @questionnaire, :url => questionnaire_path(@questionnaire), :html => { :method => :put }) do |f| %>

      <%= jipe_editor @questionnaire, :title, :editing => @editing %>

    <% authors = @questionnaire.permitted_people("edit").collect {|p| p.name}.join(", ") -%>
    <% if authors.length > 0 -%>

      By <%=h authors %>
    <% end -%>

    <% if @editing -%>

Tags:
      <%=text_field_tag "questionnaire[tags]", @questionnaire.tag_names.join(", ") %>
    <% elsif @questionnaire.tags.size > 0 -%>

Tags:
      <%=h @questionnaire.tag_names.join(", ") %>
    <% end -%>

      <%= pluralize(@questionnaire.pages.count, "page") %>

      <%= pluralize(@questionnaire.fields.count, "question") %>

Welcome page

    <% if @editing -%>

The welcome page is the first thing your visitors will see before starting your survey.  You can put any introductory
      text you'd like on the welcome page.

For advanced formatting and other customizations, you can insert custom HTML code by clicking the "HTML" tab.

      <%= render :partial => "html_editor", :locals => {:obj => @questionnaire, :field => "welcome_text"}%>
    <% else -%>
	  <% if @questionnaire.welcome_text.blank? -%>

This survey has no custom welcome page content.

	  <% else -%>

          <%= sanitize @questionnaire.welcome_text %>

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

    <% if @editing -%>

<%= submit_tag "Save changes" %>

    <% end -%>
<% end %>


changes made to make ROR work

changes made to make ROR work

git-svn-id: f67d969b640da65cb7bc1d229e09fd6d2db44ae1@293 392d7b7b-3f31-0410-9dc3-c95a9635ea79

<% if flash[:notice] != nil and flash[:notice].strip != "" %>

	<%= flash[:notice] %>

<% end %>

Reviews for <%= @assignment.name %>

  <%review_no = 1%>
  <%for review_map in @review_mapping %>
  <% @review = Review.find_by_review_mapping_id(review_map.id) %>
  <% if (@review)%>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review <%= review_no%>  <%= link_to "View",{:controller => 'review', :action => 'view_review', :id => @review.id} %>
  <%= link_to "Edit",{:controller => 'review', :action => 'edit_review', :id => @review.id} %>

  <% else %>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review <%=review_no%>  <%= link_to "Begin",{:controller => 'review', :action => 'new_review', :id => review_map.id} %>

  <% end %>
  <%review_no += 1
  end %>

 <% if @can_view_review_of_review == 1 && @review_of_review_mappings.size > 0 %>

Reviews of reviews for <%= @assignment.name %>

  <%ror_no = 1%>
  <%for ror_map in @review_of_review_mappings %>
  <%
  @ror = ReviewOfReview.find_by_review_of_review_mapping_id(ror_map.id) %>
  <% if (@ror)%>

Review of Review <%=ror_no%>  <%= link_to "View",{:controller => 'review_of_review', :action => 'view_review_of_review', :id => @ror.id} %>

  <% else %>

Review of Review <%=ror_no%>  <%= link_to "Begin",{:controller => 'review_of_review', :action => 'new_review_of_review', :id => ror_map.id} %>

  <% end %>
  <%ror_no += 1
  end %>

 <%end%>

<% if flash[:notice] != nil and flash[:notice].strip != "" %>

	<%= flash[:notice] %>

<% end %>

Reviews for <%= @assignment.name %>

  <%review_no = 1%>
  <%for review_map in @review_mapping %>
  <% @review = Review.find_by_review_mapping_id(review_map.id) %>
  <% if (@review)%>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review <%= review_no%>  <%= link_to "View",{:controller => 'review', :action => 'view_review', :id => @review.id} %>
  <%= link_to "Edit",{:controller => 'review', :action => 'edit_review', :id => @review.id} %>

  <% else %>

<%= Assignment.find_by_id(review_map.assignment_id).name %> Review <%=review_no%>  <%= link_to "Begin",{:controller => 'review', :action => 'new_review', :id => review_map.id} %>

  <% end %>
  <%review_no += 1
  end %>

 <% if @can_view_review_of_review == 1 %>

Reviews of reviews for <%= @assignment.name %>

  <%ror_no = 1%>
  <%for ror_map in @review_of_review_mappings %>
  <%
  @ror = ReviewOfReview.find_by_review_of_review_mapping_id(ror_map.id) %>
  <% if (@ror)%>

Review of Review <%=ror_no%>  <%= link_to "View",{:controller => 'review_of_review', :action => 'view_review_of_review', :id => @ror.id} %>

  <% else %>

Review of Review <%=ror_no%>  <%= link_to "Begin",{:controller => 'review_of_review', :action => 'new_review_of_review', :id => ror_map.id} %>

  <% end %>
  <%ror_no += 1
  end %>

		<% if @can_view_review_of_review == 1
			current_ror = ReviewOfReviewMapping.count_by_sql("select count(*) from review_of_review_mappings, reviews where reviewer_id ="+@reviewer_id.to_s)
			max_ror = @assignment.num_review_of_reviews
			if current_ror < max_ror%>
			<%= link_to "New review of review",{:controller => 'review_of_review', :action => 'new_review_of_review', :user => @reviewer_id, :assignment => @assignment_id} %>
		    <% 	end
			else %>
			New review of review
		<% end %>

Existing reviews of reviews

  <%ror_no = 1%>
  <%for ror_map in @review_of_review_mappings %>
  <%
  @ror = ReviewOfReview.find_by_review_of_review_mapping_id(ror_map.id) %>
  <% if (@ror)%>

Review of Review <%=ror_no%>  <%= link_to "View",{:controller => 'review_of_review', :action => 'view_review_of_review', :id => @ror.id} %>

  <% else %>

Review of Review <%=ror_no%>  <%= link_to "Begin",{:controller => 'review_of_review', :action => 'new_review_of_review', :id => ror_map.id} %>

  <% end %>
  <%ror_no += 1
  end %>

 <% end %>


Fixed bug in show_comments for show_name page.

<%
  @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_name',
                        :id => parent.id, :params => query_params) %>

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

        <% end %>

        <%= set_export_status_controls(@name) %>

      <%= show_best_image(@first_consensus) %>

      <%= name_section_link(:show_name_observations.t, @first_consensus, @consensus_query) %>
      <%= name_section_link(:show_name_synonym_observations.t, @has_synonym, @synonym_query) %>
      <%= name_section_link(:show_name_other_observations.t, @has_other, @other_query) %>
      <%= name_section_link(:show_name_subtaxa_observations.t, @has_subtaxa, @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, :limit => nil }) %>

<%= show_object_footer(@name) %>

<%
  @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_name',
                        :id => parent.id, :params => query_params) %>

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

        <% end %>

        <%= set_export_status_controls(@name) %>

      <%= show_best_image(@first_consensus) %>

      <%= name_section_link(:show_name_observations.t, @first_consensus, @consensus_query) %>
      <%= name_section_link(:show_name_synonym_observations.t, @has_synonym, @synonym_query) %>
      <%= name_section_link(:show_name_other_observations.t, @has_other, @other_query) %>
      <%= name_section_link(:show_name_subtaxa_observations.t, @has_subtaxa, @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) %>


added links for the bat, cage, and medical problem

Do Treatments for Medical Problem: <%= @medical_problem.title %>

<% form_tag :action => 'medical_task_done', :medical_problem => @medical_problem do %>

Bat

<%= link_to @medical_problem.bat.band, :controller => 'bats', :action => 'show', :id => @medical_problem.bat %>

Cage

<%= link_to @medical_problem.bat.cage.name, :controller => 'cages', :action => 'show', :id => @medical_problem.bat.cage %>

Medical Problem

<%= link_to @medical_problem.title, :controller => 'medical_problems', :action => 'show', :id => @medical_problem %>

Description

<%= @medical_problem.description %>

Weight

		<%= render :partial => 'bats/weigh_one_bat', :locals => {:bat => @medical_problem.bat, :initial_weight => true} %>

Treatment

  <% for treatment in @medical_problem.medical_treatments.current %>
    <%= check_box('treatments_done', treatment.id) %><label for='treatments_done_<%= treatment.id %>'><%= treatment.title %>

  <% end %>
  <%= check_box('one_time_treatment', '0') %><%= text_field 'new_task', 'title', :value=> 'one time treatment' %>

<%= link_to 'Add a new reoccurring treatment', :controller => 'medical_treatments', :action => 'new', :id => @medical_problem %>

Date Treatment Given

<%= datetime_select 'task_history', 'date_done' %>

Remarks

<%= text_area 'task_history', 'remarks', :rows => 2  %>

<%= submit_tag "Medical Treatment Done" %>
<% end %>

<%= render :partial => 'tasks/show_all_task_histories', :locals => {:task_histories => @task_histories, :redirect_me => 'do_medical_task'} %>

<%= render :partial => 'bats/display_weights', :locals => {:bat => @medical_problem.bat} %>

Do Treatments for Medical Problem

<% form_tag :action => 'medical_task_done', :medical_problem => @medical_problem do %>

Bat

<%= @medical_problem.bat.band %>

Cage

<%= @medical_problem.bat.cage.name %>

Medical Problem

<%= @medical_problem.title %>

Description

<%= @medical_problem.description %>

Weight

		<%= render :partial => 'bats/weigh_one_bat', :locals => {:bat => @medical_problem.bat, :initial_weight => true} %>

Treatment

  <% for treatment in @medical_problem.medical_treatments.current %>
    <%= check_box('treatments_done', treatment.id) %><label for='treatments_done_<%= treatment.id %>'><%= treatment.title %>

  <% end %>
  <%= check_box('one_time_treatment', '0') %><%= text_field 'new_task', 'title', :value=> 'one time treatment' %>

<%= link_to 'Add a new reoccurring treatment', :controller => 'medical_treatments', :action => 'new', :id => @medical_problem %>

Date Treatment Given

<%= datetime_select 'task_history', 'date_done' %>

Remarks

<%= text_area 'task_history', 'remarks', :rows => 2  %>

<%= submit_tag "Medical Treatment Done" %>
<% end %>

<%= render :partial => 'tasks/show_all_task_histories', :locals => {:task_histories => @task_histories, :redirect_me => 'do_medical_task'} %>

<%= render :partial => 'bats/display_weights', :locals => {:bat => @medical_problem.bat} %>


Allow disclosure log url to be edited in admin interface

<%= error_messages_for 'public_body' %>

    <% for locale in I18n.available_locales do %>

<a href="#div-locale-<%=locale.to_s%>"><%=locale_name(locale.to_s)%>

    <% end %>

<%
    for locale in I18n.available_locales do
        if locale==I18n.default_locale  # The default locale is submitted as part of the bigger object...
            prefix = 'public_body'
            object = @public_body
        else                            # ...but additional locales go "on the side"
            prefix = "public_body[translated_versions][]"
            object = @public_body.new_record? ?
                        PublicBody::Translation.new :
                        @public_body.translation(locale.to_s) || PublicBody::Translation.new
        end

        fields_for prefix, object do |t|
%>
    <div id="div-locale-<%=locale.to_s%>">
        <%= t.hidden_field :locale, :value => locale.to_s %>

<label for="<%= form_tag_id(t.object_name, :name, locale) %>">Name

        <%= t.text_field :name, :size => 60, :id => form_tag_id(t.object_name, :name, locale)  %>

<label for="<%= form_tag_id(t.object_name, :short_name, locale) %>">Short name (only put in abbreviations which are really used, otherwise leave blank. Short or long name is used in the URL - don't worry about breaking URLs through renaming, as the history is used to redirect)

        <%= t.text_field :short_name, :size => 60, :id => form_tag_id(t.object_name, :short_name, locale)  %>

<label for="<%= form_tag_id(t.object_name, :request_email, locale) %>">Request email (set to blank (empty string) if can't find an address; these emails are public as anyone can view with a CAPTCHA)

        <%= t.text_field :request_email, :size => 40, :id => form_tag_id(t.object_name, :request_email, locale)  %>

<label for="<%= form_tag_id(t.object_name, :publication_scheme, locale) %>">Publication scheme URL

        <%= t.text_field :publication_scheme, :size => 60, :id => form_tag_id(t.object_name, :publication_scheme, locale)  %>

<label for="<%= form_tag_id(t.object_name, :disclosure_log, locale) %>">Disclosure log URL

        <%= t.text_field :disclosure_log, :size => 60, :id => form_tag_id(t.object_name, :disclosure_log, locale)  %>

<label for="<%= form_tag_id(t.object_name, :notes, locale) %>">Public notes (HTML, for users to consider when making FOI requests to the authority)

        <%= t.text_area :notes, :rows => 3, :cols => 60, :id => form_tag_id(t.object_name, :notes, locale)  %>

<%
        end
    end
%>

Common Fields

Tags (space separated; see list of tags on the right; also not_apply if FOI and EIR no longer apply to authority, eir_only if EIR but not FOI applies to authority, defunct if the authority no longer exists; charity:NUMBER if a registered charity)

<%= text_field :public_body, :tag_string, :size => 60, :id => 'public_body_tag_string'  %>

Home page (of whole authority, not just their FOI page; set to blank (empty string) to guess it from the email)

<%= text_field :public_body, :home_page, :size => 60, :id => 'public_body_home_page'  %>

Comment for this edit (put URL or other source of new info)

<%= text_area :public_body, :last_edit_comment, :rows => 3, :cols => 60, :id => 'public_body_last_edit_comment'  %>

<%= error_messages_for 'public_body' %>

    <% for locale in I18n.available_locales do %>

<a href="#div-locale-<%=locale.to_s%>"><%=locale_name(locale.to_s)%>

    <% end %>

<%
    for locale in I18n.available_locales do
        if locale==I18n.default_locale  # The default locale is submitted as part of the bigger object...
            prefix = 'public_body'
            object = @public_body
        else                            # ...but additional locales go "on the side"
            prefix = "public_body[translated_versions][]"
            object = @public_body.new_record? ?
                        PublicBody::Translation.new :
                        @public_body.translation(locale.to_s) || PublicBody::Translation.new
        end

        fields_for prefix, object do |t|
%>
    <div id="div-locale-<%=locale.to_s%>">
        <%= t.hidden_field :locale, :value => locale.to_s %>

<label for="<%= form_tag_id(t.object_name, :name, locale) %>">Name

        <%= t.text_field :name, :size => 60, :id => form_tag_id(t.object_name, :name, locale)  %>

<label for="<%= form_tag_id(t.object_name, :short_name, locale) %>">Short name (only put in abbreviations which are really used, otherwise leave blank. Short or long name is used in the URL - don't worry about breaking URLs through renaming, as the history is used to redirect)

        <%= t.text_field :short_name, :size => 60, :id => form_tag_id(t.object_name, :short_name, locale)  %>

<label for="<%= form_tag_id(t.object_name, :request_email, locale) %>">Request email (set to blank (empty string) if can't find an address; these emails are public as anyone can view with a CAPTCHA)

        <%= t.text_field :request_email, :size => 40, :id => form_tag_id(t.object_name, :request_email, locale)  %>

<label for="<%= form_tag_id(t.object_name, :publication_scheme, locale) %>">Publication scheme URL

        <%= t.text_field :publication_scheme, :size => 60, :id => form_tag_id(t.object_name, :publication_scheme, locale)  %>

<label for="<%= form_tag_id(t.object_name, :notes, locale) %>">Public notes (HTML, for users to consider when making FOI requests to the authority)

        <%= t.text_area :notes, :rows => 3, :cols => 60, :id => form_tag_id(t.object_name, :notes, locale)  %>

<%
        end
    end
%>

Common Fields

Tags (space separated; see list of tags on the right; also not_apply if FOI and EIR no longer apply to authority, eir_only if EIR but not FOI applies to authority, defunct if the authority no longer exists; charity:NUMBER if a registered charity)

<%= text_field :public_body, :tag_string, :size => 60, :id => 'public_body_tag_string'  %>

Home page (of whole authority, not just their FOI page; set to blank (empty string) to guess it from the email)

<%= text_field :public_body, :home_page, :size => 60, :id => 'public_body_home_page'  %>

Comment for this edit (put URL or other source of new info)

<%= text_area :public_body, :last_edit_comment, :rows => 3, :cols => 60, :id => 'public_body_last_edit_comment'  %>


forgot to fix the width for password textbox

<% unless logged_in_and_registered? -%>

            Log in / Register

        <% form_tag session_path do %>
        <%= hidden_field_tag "called_from[controller]", controller.controller_name -%>
        <%= hidden_field_tag "called_from[action]", controller.action_name -%>
        <%= hidden_field_tag "called_from[id]", params[:id] -%>

                    Login:

                    <%= text_field_tag 'login', nil, :class => 'field', :style => 'width:150px'-%>

                    Password:

                    <%= password_field_tag 'password', nil, :class => 'field', :style => 'width:150px'-%>

                    Remember me: <%= check_box_tag 'remember_me',nil,false, {:style=>"width:2em;"} %>

                    <%= image_tag "openid-16x16.gif" %>OpenID:

                    <%= text_field_tag 'openid_identifier', nil, :class => 'field', :style => 'width:150px' -%>

                Alternatively...

                Log in using <%= image_tag "openid-16x16.gif" %>OpenID

            <%= submit_tag "Log in", :id=>"login_button",:onclick=>"$('login_button').disabled=true;this.form.submit();return(false);" %>

        <% end %>

            Need an account?

            <%= link_to "Sign up", signup_url %>

            <%= link_to "Forgotten password?", forgot_password_url %>

<% end -%>

<% unless logged_in_and_registered? -%>

            Log in / Register

        <% form_tag session_path do %>
        <%= hidden_field_tag "called_from[controller]", controller.controller_name -%>
        <%= hidden_field_tag "called_from[action]", controller.action_name -%>
        <%= hidden_field_tag "called_from[id]", params[:id] -%>

                    Login:

                    <%= text_field_tag 'login', nil, :class => 'field', :style => 'width:150px'-%>

                    Password:

                    <%= password_field_tag 'password', nil, :class => 'field', :style => 'width:auto'-%>

                    Remember me: <%= check_box_tag 'remember_me',nil,false, {:style=>"width:2em;"} %>

                    <%= image_tag "openid-16x16.gif" %>OpenID:

                    <%= text_field_tag 'openid_identifier', nil, :class => 'field', :style => 'width:150px' -%>

                Alternatively...

                Log in using <%= image_tag "openid-16x16.gif" %>OpenID

            <%= submit_tag "Log in", :id=>"login_button",:onclick=>"$('login_button').disabled=true;this.form.submit();return(false);" %>

        <% end %>

            Need an account?

            <%= link_to "Sign up", signup_url %>

            <%= link_to "Forgotten password?", forgot_password_url %>

<% end -%>


Switched to Agaricus color schema as the default.

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

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

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

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

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

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

<%= flash[:notice] %>

            <%= @content_for_layout %>

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

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

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

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

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

<%= flash[:notice] %>

            <%= @content_for_layout %>


minor change to header border in CSS

minor change to header border in CSS

@import url(http://fonts.googleapis.com/css?family=Permanent+Marker&v2);

body
{
  font-family: Verdana, Arial, sans-serif;
}

h1, h2, h3
{
  font-family: Gill Sans, Trebuchet MS, Helvetica, sans-serif;
}

#banner
{
	background-color: #003399;
	background-image: none;
	border-color: #999;
	border-width: 0 0 1px 0;
}

#tagline,
#header
{
  visibility: hidden;
}

#orglogo
{
  text-align: left;
	font-size: 64px;
  font-family: 'Permanent Marker', cursive;
  margin-left: 0px;
	width: 80%;

	background-image: url(../asktheeu-theme/images/navimg/asktheeu-logo.png);
	background-repeat: no-repeat;
	background-position: -30px 0px;
	height: 100px;

  color: #FFCC00;
}

#orglogo span
{
  margin-left: 2.5em;
}

div.lang {
  top: 5px;
  padding-right: 5px;
  font-weight: bold;
  color: #DDD;
}

div.lang a {
  color: #777;
}

#topnav {
  background-color: #002266;
  font-weight: bold;
}

@import url(http://fonts.googleapis.com/css?family=Permanent+Marker&v2);

body
{
  font-family: Verdana, Arial, sans-serif;
}

h1, h2, h3
{
  font-family: Gill Sans, Trebuchet MS, Helvetica, sans-serif;
}

#banner
{
	background-color: #003399;
	background-image: none;
	border-color: #999;
	border-width: 1px;
}

#tagline,
#header
{
  visibility: hidden;
}

#orglogo
{
  text-align: left;
	font-size: 64px;
  font-family: 'Permanent Marker', cursive;
  margin-left: 0px;
	width: 80%;

	background-image: url(../asktheeu-theme/images/navimg/asktheeu-logo.png);
	background-repeat: no-repeat;
	background-position: -30px 0px;
	height: 100px;

  color: #FFCC00;
}

#orglogo span
{
  margin-left: 2.5em;
}

div.lang {
  top: 5px;
  padding-right: 5px;
  font-weight: bold;
  color: #DDD;
}

div.lang a {
  color: #777;
}

#topnav {
  background-color: #002266;
  font-weight: bold;
}


changing review, author feedback, meta review and teammate review scores to refer to the scores table.

git-svn-id: f67d969b640da65cb7bc1d229e09fd6d2db44ae1@441 392d7b7b-3f31-0410-9dc3-c95a9635ea79

Scores for <%= Assignment.find(@assignment_id).name %>

<% if flash[:notice] != nil and flash[:notice].strip != "" %>

	<%= flash[:notice] %>

<% end %>
<%
    review_no = 1
	grade = 0
    _time = Time.now.month.to_s + "/" + Time.now.day.to_s + "/" + Time.now.year.to_s
    for review_map in @review_mapping
        for review in review_map.reviews%>
            Review <%=review_no%> done on <%= review.created_at.strftime('%A %B %d %Y, %I:%M%p') %><a href="#1" onClick="toggleVis('<%=review_no %>');">
		<span class="inline" id="<%=review_no %>_show">View
              	<span class="inline" id="<%=review_no %>_hide" style="display: none">Hide

			<div id="<%=review_no%>_myDiv" style="display:none">

                Question
                Score
				Comment

             <%
             total = 0
             for review_score in Score.find(:all, :conditions=>["instance_id=? and questionnaire_type_id=?",review.id, QuestionnaireType.find_by_name("Review").id])
                #if (!Question.find(review_score.question_id).true_false)
                    total += review_score.score
                #end%>

                    <%=Question.find(review_score.question_id).txt%>	<%=review_score.score%>  	<%=review_score.comments%>

            <%end
			  grade += total%>

Total	<%=total%>  	Score: <%=sprintf("%.2f",total.to_f*100/@sum_of_max.to_f)%>%

           Additional comment : <%=review.additional_comment%>

           <% @mapping = ReviewMapping.find(review_map.id) %>
           <% @assgt_id = @mapping.assignment_id %>
           <% @assignment = Assignment.find(@assgt_id)
		if @assignment.team_assignment
			@team_id = @mapping.team_id
		else
			@author_id = @mapping.author_id
		end
	   %>

		     <%if(ReviewFeedback.find(:first,:conditions =>["review_id = ? and assignment_id = ?", review.id, @assignment_id]))%>

 View feedback : <%= link_to "View", {:controller =>'review_feedback', :action=>'view_feedback', :id1 =>@assgt_id, :id2 =>@author_id, :id3=>review.id, :id4=>@team_id} %>

 Edit feedback : <%= link_to "Edit", {:controller =>'review_feedback', :action =>'edit_feedback', :id1 =>@assgt_id, :id2 =>@author_id, :id3=>review.id, :id4=>@team_id} %>

		     <% else %>

Give feedback to reviewer:<%= link_to "Begin", {:controller => 'review_feedback', :action => 'new_feedback',:id1 =>@assgt_id, :id2 =>@author_id, :id3=>review.id, :id4=>@team_id} %>

				      <% end
					%>

		   <%review_no +=1
        end
	end%>
    <% if review_no-1 > 0 %>

Grade

		Average (of all reviews) = <%=sprintf("%.2f",grade.to_f/(review_no-1).to_f) %>
		<%if @final_penalty !=0%>

Penalty units= <%=@penalty_units%> Penalty per unit=<%=@late_policy.penalty_per_unit%> Maximum penalty=<%=@late_policy.max_penalty%>

		<%end%>
		  Final grade = <%=sprintf("%.2f",(grade.to_f/(review_no-1).to_f)*100/@sum_of_max.to_f-@final_penalty.to_f)%>%

   	<%else%>
		<%if @assignment.wiki_type_id == 2 %>
			<%if @assignment.team_assignment %>
				There are no reviews of your work yet.
			<%else%>
				<%if review_mediawiki @assignment.directory_path, _time, @user_name == ''%>
					There are no reviews of your work because it seems that you have not submitted anything for this assignment.
				<%else%>
					There are no reviews of your work yet.
				<%end%>
			<%end%>
		<%else%>
			There are no reviews on your work yet.
		<%end%>
	<%end%>
<%if(@review_of_review_mappings.size > 0)%>

Reviews of reviews

  <%ror_no = 1%>
   <% for ror_map in @review_of_review_mappings %>
  <%
  @ror = ReviewOfReview.find_by_review_of_review_mapping_id(ror_map.id) %>
  <% if (@ror)%>

Review of Review <%=ror_no%>  <%= link_to "View",{:controller => 'review_of_review', :action => 'view', :id => @ror.id} %>
  <% end %>
  <%ror_no += 1
  	end
  end%>

Scores for <%= Assignment.find(@assignment_id).name %>

<% if flash[:notice] != nil and flash[:notice].strip != "" %>

	<%= flash[:notice] %>

<% end %>
<%
    review_no = 1
	grade = 0
    _time = Time.now.month.to_s + "/" + Time.now.day.to_s + "/" + Time.now.year.to_s
    for review_map in @review_mapping
        for review in review_map.reviews%>
            Review <%=review_no%> done on <%= review.created_at.strftime('%A %B %d %Y, %I:%M%p') %><a href="#1" onClick="toggleVis('<%=review_no %>');">
		<span class="inline" id="<%=review_no %>_show">View
              	<span class="inline" id="<%=review_no %>_hide" style="display: none">Hide

			<div id="<%=review_no%>_myDiv" style="display:none">

                Question
                Score
				Comment

             <%
             total = 0
             for review_score in ReviewScore.find(:all, :conditions=>["review_id=? and questionnaire_type_id=?",review.id, QuestionnaireType.find_by_name("Review Rubric").id])
                #if (!Question.find(review_score.question_id).true_false)
                    total += review_score.score
                #end%>

                    <%=Question.find(review_score.question_id).txt%>	<%=review_score.score%>  	<%=review_score.comments%>

            <%end
			  grade += total%>

Total	<%=total%>  	Score: <%=sprintf("%.2f",total.to_f*100/@sum_of_max.to_f)%>%

           Additional comment : <%=review.additional_comment%>

           <% @mapping = ReviewMapping.find(review_map.id) %>
           <% @assgt_id = @mapping.assignment_id %>
           <% @assignment = Assignment.find(@assgt_id)
		if @assignment.team_assignment
			@team_id = @mapping.team_id
		else
			@author_id = @mapping.author_id
		end
	   %>

		     <%if(ReviewFeedback.find(:first,:conditions =>["review_id = ? and assignment_id = ?", review.id, @assignment_id]))%>

 View feedback : <%= link_to "View", {:controller =>'review_feedback', :action=>'view_feedback', :id1 =>@assgt_id, :id2 =>@author_id, :id3=>review.id, :id4=>@team_id} %>

 Edit feedback : <%= link_to "Edit", {:controller =>'review_feedback', :action =>'edit_feedback', :id1 =>@assgt_id, :id2 =>@author_id, :id3=>review.id, :id4=>@team_id} %>

		     <% else %>

Give feedback to reviewer:<%= link_to "Begin", {:controller => 'review_feedback', :action => 'new_feedback',:id1 =>@assgt_id, :id2 =>@author_id, :id3=>review.id, :id4=>@team_id} %>

				      <% end
					%>

		   <%review_no +=1
        end
	end%>
    <% if review_no-1 > 0 %>

Grade

		Average (of all reviews) = <%=sprintf("%.2f",grade.to_f/(review_no-1).to_f) %>
		<%if @final_penalty !=0%>

Penalty units= <%=@penalty_units%> Penalty per unit=<%=@late_policy.penalty_per_unit%> Maximum penalty=<%=@late_policy.max_penalty%>

		<%end%>
		  Final grade = <%=sprintf("%.2f",(grade.to_f/(review_no-1).to_f)*100/@sum_of_max.to_f-@final_penalty.to_f)%>%

   	<%else%>
		<%if @assignment.wiki_type_id == 2 %>
			<%if @assignment.team_assignment %>
				There are no reviews of your work yet.
			<%else%>
				<%if review_mediawiki @assignment.directory_path, _time, @user_name == ''%>
					There are no reviews of your work because it seems that you have not submitted anything for this assignment.
				<%else%>
					There are no reviews of your work yet.
				<%end%>
			<%end%>
		<%else%>
			There are no reviews on your work yet.
		<%end%>
	<%end%>
<%if(@review_of_review_mappings.size > 0)%>

Reviews of reviews

  <%ror_no = 1%>
   <% for ror_map in @review_of_review_mappings %>
  <%
  @ror = ReviewOfReview.find_by_review_of_review_mapping_id(ror_map.id) %>
  <% if (@ror)%>

Review of Review <%=ror_no%>  <%= link_to "View",{:controller => 'review_of_review', :action => 'view', :id => @ror.id} %>
  <% end %>
  <%ror_no += 1
  	end
  end%>