Typos

Typos

<% @title = "About" %>

Contact us

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

Introduction to WhatDoTheyKnow #

What is WhatDoTheyKnow for? #

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

How does the site work? #

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

Why would I bother to do this? #

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

Why would the public authority bother to reply? #

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

Who makes it? #

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

Making requests #

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

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

How quickly will I get a response? #

By law public authorities must respond "promptly", and in any event not later
than 20 working days after receiving your request. The date of that hard limit
is shown on the page for your request. You will be emailed if this date goes by
without a response, so you can send the public authority another note to remind
them that they are breaking the law. Note: If you had to
clarify your request, the clock starts from that date, instead of the date they
received your initial request.

What if I'm not satisfied with the response? #

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

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

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

Can I request information about myself? #

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

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

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

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

Some public authorities, such as South East Water,
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 you write you request, it reminds you that you can only
request "environmental information" and tells you what that means. It is quite broad.

So can I request information using EIR from other authorities? #

Yes, 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.

Privacy questions #

Who gets to see my email address? #

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

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

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

Why will my name appear publically on the site? #

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

So I can make an FOI request using a pseudonym? #

It is good practice for the public authority to reply to an anonymous request,
except in special circumstances such as if they suspect you of making vexatious
requests. See Freedom of Information Good Practice Guidance No 6
for details.  You should refer to this if a public authority attempts to refuse
a request because you used a pseudonym.

However, there are good reasons to use your real name: see the previous
question.  If nothing else, it avoids the risk of an authority being picky,
ignoring the guidance and refusing your request.

They've asked for my postal address! #

If a public authority asks you for your full, physical address, reply to them saying
that section 8.1.b of the FOI Act asks for an "address for correspondence",
and that the email address you are using is sufficient.

The Ministry of Justice has guidance
on this –
"As well as hard copy written correspondence, requests that are
transmitted electronically (for example, in emails) are acceptable
... If a request is received by email and no postal address is given, the email
address should be treated as the return address."

As if that isn't enough, the Information Commissioner's
Hints for Practitioners say
"Any correspondence could include a request for information. If it is written (this includes e-mail), legible, gives the name of the applicant, an address for reply (which could be electronic), and includes a description of the information required, then it will fall within the scope of the legislation."

No no, they need a postal address to send a paper response! #

If an authority only has a paper copy of the information that you want,
they may ask you for a postal address. To start with, try persuading them
to scan in the documents for you. You can even offer to gift them a scanner, which in that particular case
embarrassed the authority into finding one they had already.

If that doesn't work, and you want to provide your postal address privately
in order to receive the documents, then please contact
us.

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.

FOI officer questions #

I just got here from bottom of an FOI request, what is going on? #

WhatDoTheyKnow is a service run by a charity. It helps ordinary members
of the public make FOI requests, and easily track and share the responses.

The FOI request you received was made by someone using WhatDoTheyKnow. You can
simply reply to the request as you would any other request from an individual.
The only difference is that your response will be automatically published on
the Internet.

If you have privacy or other concerns, please read the answers below.
You might also like to read this page from the top to find out more about what
the site does from the point of view of a user. You can also search the
site to find the authority that you work for, and view the status of
any requests made using the site.

Finally, we welcome comments and
thoughts from FOI officers, please get in touch.

Why are you publishing responses to FOI requests? #

We think there are lots of benefits. Most importantly it will encourage the
public to be more interested and involved in the work of government. We
also hope that it will reduce the number of duplicate requests on any
subject that a public body will receive. Given that Freedom of Information
responses contain public information, which anybody could easily request
again from the public authority, we think there should be no reason not to
publish it widely.

Are the people making requests real people? #

Yes. For the purposes of keeping track of responses we use
computer-generated email addresses for each request. However, before
they can send a request, each user must register on the site with a
unique email address that we then verify. You can search this site and
find a page listing all requests that each person has made.

An email isn't a sufficient address for an FOI request! #

Yes it is. This
letter from the ICO to Rother District Council gives guidance on the matter, specifically
in the context of requests made via WhatDoTheyKnow.

Aren't you making lots of vexatious requests? #

WhatDoTheyKnow is not making any requests. We are sending requests on
behalf of our users, who are real people making the requests.

Look at it like this - if lots of different people made requests from
different Hotmail email addresses, then you would not think that Microsoft were
making vexatious requests. It is exactly the same if lots of requests are made
via WhatDoTheyKnow. Moreover, since all requests are public it is much easier
for you to see if one of our users is making vexatious requests, and for us to
block them when that happens.

If that isn't enough for you, the
letter from the ICO to Rother District Council gives some guidance on the matter.

Isn't it a problem that you publish the names of civil servants and the text of emails? #

Officers or servants responding to requests are doing so on behalf of the
public as part of their job, and we publish their response on that
basis. Usually the names and phone numbers of FOI officers are already
available on authority websites. We also encourage our users to give their real
name too, so it is fair both ways.

Do you publish email addresses or mobile phone numbers? #

We automatically remove email addresses and labelled mobile phone numbers
that are in the email part of responses from public authorities. Please
contact us if we've missed one. We don't currently
remove these from attachments,
such as Word documents.

Can you take down private information about me? #

If you see any information on the site which you'd like us to remove or
hide, then please let us know. We'll then
remove it, provided it is genuinely private information.

Credit where credit is due #

Which people made WhatDoTheyKnow? #

Oh, nearly everyone (and maybe you too)!

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

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

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

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

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

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

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

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

You're all stars.

<% @title = "About" %>

Contact us

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

Introduction to WhatDoTheyKnow #

What is WhatDoTheyKnow for? #

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

How does the site work? #

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

Why would I bother to do this? #

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

Why would the public authority bother to reply? #

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

Who makes it? #

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

Making requests #

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

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

How quickly will I get a response? #

By law public authorities must respond "promptly", and in any event not later
than 20 working days after receiving your request. The date of that hard limit
is shown on the page for your request. You will be emailed if this date goes by
without a response, so you can send the public authority another note to remind
them that they are breaking the law. Note: If you had to
clarify your request, the clock starts from that date, instead of the date they
received your initial request.

What if I'm not satisfied with the response? #

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

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

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

Can I request information about myself? #

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

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

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

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

Some public authorities, such as South East Water,
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 you write you request, it reminds you that you can only
request "environmental information" and tells you what that means. It is quite broad.

So can I request information using EIR from other authorities? #

Yes, 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.

Privacy questions #

Who gets to see my email address? #

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

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

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

Why will my name appear publically on the site? #

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

So I can make an FOI request using a pseudonym? #

It is good practice for the public authority to reply to an anonymous request,
except in special circumstances such as if they suspect you of making vexatious
requests. See Freedom of Information Good Practice Guidance No 6
for details.  You should refer to this if a public authority attempts to refuse
a request because you used a pseudonym.

However, there are good reasons to use your real name: see the previous
question.  If nothing else, it avoids the risk of an authority being picky,
ignoring the guidance and refusing your request.

They've asked for my postal address! #

If a public authority asks you for your full, physical address, reply to them saying
that section 8.1.b of the FOI Act asks for an "address for correspondence",
and that the email address you are using is sufficient.

The Ministry of Justice has guidance
on this –
"As well as hard copy written correspondence, requests that are
transmitted electronically (for example, in emails) are acceptable
... If a request is received by email and no postal address is given, the email
address should be treated as the return address."

As if that isn't enough, the Information Commissioner's
Hints for Practitioners say
"Any correspondence could include a request for information. If it is written (this includes e-mail), legible, gives the name of the applicant, an address for reply (which could be electronic), and includes a description of the information required, then it will fall within the scope of the legislation."

No no, they need a postal address to send a paper response! #

If an authority only has a paper copy of the information that you want,
they may ask you for a postal address. To start with, try persuading them
to scan in the documents for you. You can even offer to gift them a scanner, which in that particular case
embarrassed the authority into finding one they had already.

If that doesn't work, and you want to provide your postal address privately
in order to receive the documents, then please contact
us.

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.

FOI officer questions #

I just got here from bottom of an FOI request, what is going on? #

WhatDoTheyKnow is a service run by a charity. It helps ordinary members
of the public make FOI requests, and easily track and share the responses.

The FOI request you received was made by someone using WhatDoTheyKnow. You can
simply reply to the request as you would any other request from an individual.
The only difference is that your response will be automatically published on
the Internet.

If you have privacy or other concerns, please read the answers below.
You might also like to read this page from the top to find out more about what
the site does from the point of view of a user. You can also search the
site to find the authority that you work for, and view the status of
any requests made using the site.

Finally, we welcome comments and
thoughts from FOI officers, please get in touch.

Why are you publishing responses to FOI requests? #

We think there are lots of benefits. Most importantly it will encourage the
public to be more interested and involved in the work of government. We
also hope that it will reduce the number of duplicate requests on any
subject that a public body will receive. Given that Freedom of Information
responses contain public information, which anybody could easily request
again from the public authority, we think there should be no reason not to
publish it widely.

Are the people making requests real people? #

Yes. For the purposes of keeping track of responses we use
computer-generated email addresses for each request. However, before
they can send a request, each user must register on the site with a
unique email address that we then verify. You can search this site and
find a page listing all requests that each person has made.

An email isn't a sufficient address for an FOI request! #

Yes it is. This
letter from the ICO to Rother District Council gives guidance on the matter, specifically
in the context of requests made via WhatDoTheyKnow.

Aren't you making lots of vexatious requests? #

WhatDoTheyKnow is not making any requests. We are sending requests on
behalf of our users, who are real people making the requests.

Look at it like this - if lots of different people made requests from
different Hotmail email addresses, then you would not think that Microsoft were
making vexatious requests. It is exactly the same if lots of requests are made
via WhatDoTheyKnow. Moreover, since all requests are public it is much easier
for you to see if one of our users is making vexatious requests, and for us to
block them when that happens.

If that isn't enough for you, the
letter from the ICO to Rother District Council gives some guidance on the matter.

Isn't it a problem that you publish the names of civil servants and the texr of emails? >#

Officers or servants responding to requests are doing so on behalf of the
public as part of their job, and we publish their response on that
basis. Usually the names and phone numbers of FOI officers are already
available on authority websites. We also encourage our users to give their real
name too, so it is fair both ways.

Do you publish email addresses or mobile phone numbers? #

We automatically remove email addresses and labelled mobile phone numbers
that are in the email part of responses from public authorities. Please
contact us if we've missed one. We don't currently
remove these from attachments,
such as Word documents.

Can you take down private information about me? #

If you see any information on the site which you'd like us to remove or
hide, then please let us know. We'll then
remove it, provided it is genuinely private information.

Credit where credit is due #

Which people made WhatDoTheyKnow? #

Oh, nearly everyone (and maybe you too)!

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

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

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

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

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

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

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

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

You're all stars.


Fix file size.  (closes #324)

Fix file size.  (closes #324)

git-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@536 820eb932-12ee-0310-9ca8-eeb645f39767

  Filename
  Link
  Content Type
  File Size
  Uploaded
  Delete

<% for upload in resources %>
<tr <%= alternate_class %>>
  <%= upload.filename -%>
  <%= link_to "/files/#{upload.filename}", "/files/#{upload.filename}" -%>
  <%= upload.mime -%>
  <%= upload.size rescue 0 -%> bytes
  <%= upload.created_at.strftime('%Y-%m-%d %H:%M:%S') -%>
  <%= link_to_destroy upload -%>

<% end %>

  Filename
  Link
  Content Type
  File Size
  Uploaded
  Delete

<% for upload in resources %>
<tr <%= alternate_class %>>
  <%= upload.filename -%>
  <%= link_to "/files/#{upload.filename}", "/files/#{upload.filename}" -%>
  <%= upload.mime -%>
  <%= upload.size.kilobytes rescue 0 -%>
  <%= upload.created_at.strftime('%Y-%m-%d %H:%M:%S') -%>
  <%= link_to_destroy upload -%>

<% end %>


get rid of gratuitous heading

get rid of gratuitous heading

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

Finding <%=@user_request.referent.type_of_thing.pluralize.titlecase %>

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

            <%= render(:partial => "search_inside") %>

            <%= render(:partial => "cover_image") %>

      <%= render(:partial => "fulltext") %>

      <%= render(:partial => "excerpts") %>

      <%= render(:partial => "audio") %>

    <% docdels = get_service_type('document_delivery')
       if (display_ill?) && (! docdels.empty?)  %>

Request a copy from Inter-Library Loan

          <% docdels.each do | doc_del_type |

                valueHash = doc_del_type.view_data_from_service_type%>

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

        <% end %>

    <% end %>

      <%= render(:partial => ResolveController.partial_for_block[:holding] ) %>

    <% # abstract/toc is admittedly a little bit cheesy right now, it shouldn't
       # neccesary be in this part of the page, and should maybe use
       # fancier ajaxy tab stuff, but we had to get it done. Doesn't deal
       # with background services quite yet.
    %>

      <% toc_list = get_service_type('table_of_contents')
         ab_list = get_service_type('abstract')
      %>

        <% unless toc_list.empty? %>
          <%= render(:partial=>'tables_of_contents') %>
        <% end %>

        <% unless ab_list.empty? %>
          <%= render(:partial=>'abstracts') %>
        <% end %>

<%
relevant_links = get_service_type('relevant_link')
unless relevant_links.empty? %>

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

  <% relevant_link.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=>"help"
%>

  <%= @user_request.to_context_object.coins %>

<%
#{:action=>'web_search', :service_type=>'web_link', :label=>'Web Search Results'}
[{:action=>'toc', :service_type=>'table_of_contents', :label=>'Table of Contents'},
{:action=>'abstract', :service_type=>'abstract', :label=>'Abstract or Description'}].each do | menu |
    unless controller.action_name == menu[:action]
        if get_service_type(menu[:service_type]).length > 0
            li_display= 'block'
        else
            li_display = 'none'
        end %>

  <% link_to menu[:label], :action=>menu[:action], :'umlaut.request_id'=>@user_request.id %>

  <% end
  end
  %>

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

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

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

Finding <%=@user_request.referent.type_of_thing.pluralize.titlecase %>

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

            <%= render(:partial => "search_inside") %>

            <%= render(:partial => "cover_image") %>

      <%= render(:partial => "fulltext") %>

      <%= render(:partial => "excerpts") %>

      <%= render(:partial => "audio") %>

    <% docdels = get_service_type('document_delivery')
       if (display_ill?) && (! docdels.empty?)  %>

Request a copy from Inter-Library Loan

          <% docdels.each do | doc_del_type |

                valueHash = doc_del_type.view_data_from_service_type%>

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

        <% end %>

    <% end %>

      <%= render(:partial => ResolveController.partial_for_block[:holding] ) %>

    <% # abstract/toc is admittedly a little bit cheesy right now, it shouldn't
       # neccesary be in this part of the page, and should maybe use
       # fancier ajaxy tab stuff, but we had to get it done. Doesn't deal
       # with background services quite yet.
    %>

      <% toc_list = get_service_type('table_of_contents')
         ab_list = get_service_type('abstract')
      %>
      <% if toc_list.length + ab_list.length > 0 %>

Abstract and Table of Contents

        <% unless toc_list.empty? %>
          <%= render(:partial=>'tables_of_contents') %>
        <% end %>

        <% unless ab_list.empty? %>
          <%= render(:partial=>'abstracts') %>
        <% end %>

    <% end %>

<%
relevant_links = get_service_type('relevant_link')
unless relevant_links.empty? %>

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

  <% relevant_link.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=>"help"
%>

  <%= @user_request.to_context_object.coins %>

<%
#{:action=>'web_search', :service_type=>'web_link', :label=>'Web Search Results'}
[{:action=>'toc', :service_type=>'table_of_contents', :label=>'Table of Contents'},
{:action=>'abstract', :service_type=>'abstract', :label=>'Abstract or Description'}].each do | menu |
    unless controller.action_name == menu[:action]
        if get_service_type(menu[:service_type]).length > 0
            li_display= 'block'
        else
            li_display = 'none'
        end %>

  <% link_to menu[:label], :action=>menu[:action], :'umlaut.request_id'=>@user_request.id %>

  <% end
  end
  %>

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

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


Fixed bug

Fixed bug

Weigh <%= @bat.band%> in <%= @bat.cage.name %>

<% form_tag :action => 'submit_weight', :id => @bat, :redirectme => params[:redirectme] do %>

<%= render :partial => "bats/weigh_one_bat", :locals => {:bat => @bat} %>

<% end %>

Current Medical Problems for <%= @bat.band%>

<% if @bat.medical_problems.current.length > 0 %>

<%= render :partial=>'medical_problems/show_medical_problems', :locals=>{:medical_problems => @bat.medical_problems, :show_bat => false} %>

<% else %>
No medical problems.
<% end %>

<%= link_to_remote 'Quick-Add New Medical Problem', :url=>{:controller => 'medical_problems', :action => :remote_new_medical_problem, :bat => @bat},
  :update=>'add_medical_problem'%>

<% if @bat.weights.length == 0 %>
No previous weights.
<% else %>
<%= render :partial => 'display_weights', :locals => {:bat => @bat} %>
<% end %>

<%= link_to 'Back', :controller => 'bats', :action => 'choose_bat_to_weigh' %>

Weigh <%= @bat.band%> in <%= @bat.cage.name %>

<% form_tag :action => 'submit_weight', :id => @bat, :redirectme => params[:redirectme] do %>

<%= render :partial => "bats/weigh_one_bat", :locals => {:bat => @bat} %>

<% end %>

Current Medical Problems for <%= @bat.band%>

<% if @bat.medical_problems.current.length > 0 %>

<%= render :partial=>'medical_problems/show_medical_problems', :locals=>{:medical_problems => @bat.medical_problems} %>

<% else %>
No medical problems.
<% end %>

<%= link_to_remote 'Quick-Add New Medical Problem', :url=>{:controller => 'medical_problems', :action => :remote_new_medical_problem, :bat => @bat},
  :update=>'add_medical_problem'%>

<% if @bat.weights.length == 0 %>
No previous weights.
<% else %>
<%= render :partial => 'display_weights', :locals => {:bat => @bat} %>
<% end %>

<%= link_to 'Back', :controller => 'bats', :action => 'choose_bat_to_weigh' %>


Update timeline view for pagination and event timestamps being separate, rather than using created_at.

<% @title = "Timeline" %>

    Hour
    Day
    2 days
    Week
    Month
    All time

<%=h @events_title%>

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

        <% end %>

<%= simple_date(event_at) %>

    <% else %>

    <% end %>
    <% last_date = event_at.to_date %>

    <%= simple_time(event_at) %>

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

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

<% end %>

<% @title = "Timeline" %>

    Hour
    Day
    2 days
    Week
    Month
    All time

<%=h @events_title%>

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

        <% end %>

<%= simple_date(event.created_at) %>

    <% else %>

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

    <%= simple_time(event.created_at) %>

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

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

<% end %>


Better web page

Better web page

<% open('ngrok.log') do |f| %>
  <% f.lines.select { |line| line.include?("URL:") }.each do |line| %>
    Server available at: <%= line.match(/tcp:\/\/(.+:[0-9]+) /)[1] %>
    <br />
  <% end %>
<% end %>

<% open('ngrok.log') do |f| %>
  <% f.lines.select { |line| line.include?("URL:") }.each do |line| %>
    <%= line %>
    <br />
  <% end %>
<% end %>


added list of bats

added list of bats

Colony status as of <%= Time.now.strftime('%d %B, %Y') %>

Bats in <%= link_to 'colony', :controller => 'bats', :action => 'list' %> : <%= Bat.active.length %>

Bats in <%= link_to 'medical care', :controller => 'medical_problems', :action => 'list_current' %> : <%= Bat.sick.length %>

Movers and shakers

<% total_left = 0 %>
<% total_arrived = 0 %>

Month
Left
Arrived

<% for n in 1..Time.now.month %>

<% total_left = total_left + Bat.left_on_month(n).length %>
<% total_arrived = total_arrived + Bat.arrived_on_month(n).length %>
<%= Date::MONTHNAMES[n] %>
<%= Bat.left_on_month(n).length %>
(
<% for bat in Bat.left_on_month(n) %>
<%= bat.band %>
<% end %>
)

<%= Bat.arrived_on_month(n).length %>
(
<% for bat in Bat.arrived_on_month(n) %>
<%= bat.band %>
<% end %>
)

<% end %>

Total
-<%= total_left %>
+<%= total_arrived %>
<%= total_arrived - total_left %>

Colony status as of <%= Time.now.strftime('%d %B, %Y') %>

Bats in <%= link_to 'colony', :controller => 'bats', :action => 'list' %> : <%= Bat.active.length %>

Bats in <%= link_to 'medical care', :controller => 'medical_problems', :action => 'list_current' %> : <%= Bat.sick.length %>

Movers and shakers

<% total_left = 0 %>
<% total_arrived = 0 %>

Month
Left
Arrived

<% for n in 1..Time.now.month %>

<% total_left = total_left + Bat.left_on_month(n).length %>
<% total_arrived = total_arrived + Bat.arrived_on_month(n).length %>
<%= Date::MONTHNAMES[n] %>
<%= Bat.left_on_month(n).length %>
<%= Bat.arrived_on_month(n).length %>

<% end %>

Total
-<%= total_left %>
+<%= total_arrived %>
<%= total_arrived - total_left %>


Update help section 'who makes Right To Know?'

<% @title = "About" %>

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

Introduction to <%= site_name %> #

What is  <%= site_name %> for? #

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

How does the site work? #

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

Why would I bother to do this? #

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

Why would the public authority bother to reply? #

Under Freedom of Information (FOI) law, they have to respond. The response
  will either contain the information you want, or give a valid legal reason why
  it must be kept confidential.

Who makes <%= site_name %>? #

<%= site_name %> is a project of the OpenAustralia Foundation, a charity, and was developed with software by the UK organisation mySociety. It was made possible by a donation from Guy King. If you like what we're doing, then you can make a donation.

How can I keep up with news about <%= site_name %>?#

We have a blog and a twitter feed.

Next, read about making requests -->

<% @title = "About" %>

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

Introduction to <%= site_name %> #

What is  <%= site_name %> for? #

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

How does the site work? #

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

Why would I bother to do this? #

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

Why would the public authority bother to reply? #

Under Freedom of Information (FOI) law, they have to respond. The response
  will either contain the information you want, or give a valid legal reason why
  it must be kept confidential.

Who makes <%= site_name %>? #

<%= site_name %> is created and run by volunteers.
  If you like what we're doing, then you can make a donation.

How can I keep up with news about <%= site_name %>?#

We have a blog and a twitter feed.

Next, read about making requests -->


Improve 100 days counter by using floor instead of round

<% view_cache :ttl => 5.minutes.to_i, :tag => I18n.locale do %>

<%= _("Ejerce tu derecho a saber.") %>

1

2

3

<%= _("Para obtener información de instituciones públicas:") %>

<%= _("Piensa una pregunta para un organismo público.") %>

<%= _("Nosotros enviamos la pregunta por ti.") %>

<%= _("Te avisamos cuando haya una respuesta.") %>

            <%= link_to _("Preguntar »"), body_index_path %>

            <%= link_to _("¿Contestarán? »"), help_requesting_path(:anchor => 'making_requests') %>

<%= _("Cuenta atrás por la transparencia en España") %>

<%= _("Quedan  días para que el PP cumpla su promesa de presentar una ley de acceso a la información") %>

Twittear

<%= _("Haz una búsqueda entre las peticiones ya realizadas:") %>

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

                <%= text_field_tag 'query', params[:query], { :size => 80 } %>
                <%= submit_tag _('Search') %>

              <% end %>

<%= _("Novedades") %>

Duis autem vel eum iriure dolor in hendret in vulputate velit esse molese consequat.

Vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio eros et accumsan et iusto odio dignissim...

Leer más

Duis autem vel eum iriure dolor in hendret in vulputate velit esse molese consequat.

Vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio eros et accumsan et iusto odio dignissim...

Leer más

<%= _("Peticiones destacadas") %>

Duis autem vel eum iriure dolor in hendret in velit esse molese consequat...

24

Personas siguiendo esta petición

También quiero saber

Duis autem vel eum iriure dolor in hendret in velit esse molese consequat...

24

Personas siguiendo esta petición

También quiero saber

<% end %>


close bug 279, thanks to Eric Harris-Braun

git-svn-id: 37079cf3b62e462fadb70604a1f12517db1b00ce@684 3db89d08-1e44-db11-a2a8-0014220fd31b

<% @page_title = 'Page List' %>

<% if current_user.can_create_pages?(@project) %>
  <% subnav(@page_title + ':') do %>
    <%= link_to('Create Page', :project => @project, :action => 'new') %>
  <% end %>
<% else %>

<%= @page_title %>:

<% end %>

<%= render(:partial => 'list') %>

<% @page_title = 'Page List' %>

Page List:

<%= render(:partial => 'list') %>


show total hours on invoice edit page

show total hours on invoice edit page

<% if @invoice.show_subtotal? %>

	Subtotal:
	<%= number_to_currency @invoice.subtotal %>

<% end %>
<% if @invoice.discounted? %>

	Discount:
	<%= number_to_currency (-@invoice.subtotal * @invoice.discount) %> (<%= @invoice.discount * 100 %>%)

<% end %>

	Hours:
	<%= @invoice.total_hours %>
	Total:
	<%= number_to_currency @invoice.total %>

<% if @invoice.show_subtotal? %>

	Subtotal:
	<%= number_to_currency @invoice.subtotal %>

<% end %>
<% if @invoice.discounted? %>

	Discount:
	<%= number_to_currency (-@invoice.subtotal * @invoice.discount) %> (<%= @invoice.discount * 100 %>%)

<% end %>

	Total:
	<%= number_to_currency @invoice.total %>


ActionItem1218: explaining folders order

<%= _('Select folders') %>

<%= _('Select the folders that will hold the news of the initial page of the environment') %>

  <%= labelled_form_field(_('Available folders'), select_tag( 'folders[]', options_from_collection_for_select(@available_portal_folders, :id, :name, nil), {:id => 'portal-folders-list', :multiple => true, :size => 6 }) ) %>

  <%= button :down, _('Add'), '#', { :id => 'add' } %>
  <%= button :up, _('Remove'), '#', { :id => 'remove' } %>

<% form_tag do %>

    <%= labelled_form_field(_('Portal folders'), select_tag( 'folders[]', options_from_collection_for_select(@selected, :id, :name, nil), {:id => 'selected-folders', :multiple => true, :size => 6 })) %>

    <%= _('The same order in which you arrange the folders here will be used for arranging the boxes in the environment initial page.') %>

  <% button_bar do %>
    <%= submit_button 'save', _('Save'), :cancel => {:action => 'index'} %>
  <% end %>
<% end %>

<%= _('Select folders') %>

<%= _('Select the folders that will hold the news of the initial page of the environment') %>

  <%= labelled_form_field(_('Available folders'), select_tag( 'folders[]', options_from_collection_for_select(@available_portal_folders, :id, :name, nil), {:id => 'portal-folders-list', :multiple => true, :size => 6 }) ) %>

  <%= button :down, _('Add'), '#', { :id => 'add' } %>
  <%= button :up, _('Remove'), '#', { :id => 'remove' } %>

<% form_tag do %>

    <%= labelled_form_field(_('Portal folders'), select_tag( 'folders[]', options_from_collection_for_select(@selected, :id, :name, nil), {:id => 'selected-folders', :multiple => true, :size => 6 })) %>

  <% button_bar do %>
    <%= submit_button 'save', _('Save'), :cancel => {:action => 'index'} %>
  <% end %>
<% end %>


Bugfix: it was impossible to uncheck a checkbox by default

<%= start_question @question %>
<% if @editing -%>
	<%= check_box_tag "question[#{@question.id}][default_answer]", "checked",
                (@question.default_answer and @question.default_answer != ''),
		:onChange => "updateDefault(#{@question.id}, this.checked ? 'checked' : '');"%>
<% else -%>
	<%= check_box_tag "question[#{@question.id}]", 'checked', (value and value != '') %>
<% end -%>
<%= end_question @question %>

<%= start_question @question %>
<% if @editing -%>
	<%= check_box "question[]", "default_answer",
		:onChange => "updateDefault(#{@question.id}, this.checked);"%>
<% else -%>
	<%= check_box_tag "question[#{@question.id}]", 'checked', (value and value != '') %>
<% end -%>
<%= end_question @question %>


Minor text change

Minor text change

<% @title = "Preview new FOI request to '" + h(@info_request.public_body.name) + "'" %>

<% form_for(:info_request, @info_request, :html => { :id => 'preview_form' }  ) do |f| %>

Now preview your request

    <%= f.hidden_field(:title) %>

    <% fields_for :outgoing_message do |o| %>

        To: <%=h @info_request.public_body.name %>

Subject: <%=h @info_request.title %>

        <%= @outgoing_message.get_body_for_html_preview %>
        <%= o.hidden_field(:body) %>

    <% end %>

    Note: Your request and any response will be
    displayed publically on this website.

    <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
    <%= hidden_field_tag(:submitted_new_request, 1) %>
    <%= hidden_field_tag(:preview, 0 ) %>
    <%= submit_tag "Re-edit this request", :name => 'reedit' %>
    <%= submit_tag "Send Freedom of Information request", :name => 'submit' %>

<% end %>

<% @title = "Preview new FOI request to '" + h(@info_request.public_body.name) + "'" %>

<% form_for(:info_request, @info_request, :html => { :id => 'preview_form' }  ) do |f| %>

Preview your request

    <%= f.hidden_field(:title) %>

    <% fields_for :outgoing_message do |o| %>

        To: <%=h @info_request.public_body.name %>

Subject: <%=h @info_request.title %>

        <%= @outgoing_message.get_body_for_html_preview %>
        <%= o.hidden_field(:body) %>

    <% end %>

    Note: Your request and any response will be
    displayed publically on this website.

    <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
    <%= hidden_field_tag(:submitted_new_request, 1) %>
    <%= hidden_field_tag(:preview, 0 ) %>
    <%= submit_tag "Re-edit this request", :name => 'reedit' %>
    <%= submit_tag "Send Freedom of Information request", :name => 'submit' %>

<% end %>


Fix user pagination on cases and collages.

	<%= will_paginate @playlists, :container => false, :previous_label => 'Prev', :next_label => 'Next', :params => { :ajax_region => 'playlists' } %>

	<%= will_paginate @collages, :container => false, :previous_label => 'Prev', :next_label => 'Next', :params => { :ajax_region => 'collages' } %>

	<%= will_paginate @cases, :container => false, :previous_label => 'Prev', :next_label => 'Next', :params => { :ajax_region => 'cases' } %>

	<%= will_paginate @playlists, :container => false, :previous_label => 'Prev', :next_label => 'Next', :params => { :ajax_region => 'playlists' } %>

	<%= will_paginate @collages, :container => false, :previous_label => 'Prev', :next_label => 'Next', :params => { :ajax_params => 'collages' } %>

	<%= will_paginate @cases, :container => false, :previous_label => 'Prev', :next_label => 'Next', :params => { :ajax_params => 'cases' } %>


Fix bad merge from previous commit. This prevents an error when loading a task edit view.

Signed-off-by: Grant <7561d7b6fa252e14d948ef730f22c68c9d861f6b@ish.com.au>

<%= error_messages_for 'task' %>
<%

  perms = {}

  ['comment', 'edit', 'reassign', 'prioritize', 'close', 'milestone'].each do |p|
    if @task.project_id.to_i == 0 || current_user.can?( @task.project, p )
      perms[p] = {}
    else
      perms[p] = { :disabled => 'disabled' }
    end
  end

%>

		<fieldset id="task_information" style="padding-right:0.5em;"><legend><%=_ 'Information' %></legend>
			<%=_ 'Summary' %>
			<%= text_field 'task', 'name', { :size => 47, :maxlength => 200, :style => "width:80%;"}.merge( perms['edit'] )  %>

			<%=_ 'Tags' %>
			<%= text_field 'task', 'set_tags', { :size => 47, :value => @task.tags.collect{|t| t.name}.join(', '), :autocomplete => "off", :style => "width:80%;" }.merge( perms['edit'] ) %>

			<%=_ 'Description' %>
			<%= text_area 'task', 'description', { :rows => 15, :style => "width:80%;" }.merge( perms['edit'] )  %>

			<%=_ 'Comment' %>
			<%= text_area_tag 'comment', {}, { :rows => 8, :style => "width:80%;" }.merge( perms['comment'] )  %>

			<%=_ 'Attach file' %>
			<%= file_field_tag 'task_file', { :size => 35, :class => "file" }.merge( perms['comment'] ) %>

			<% if @task.new_record? %>
				<%= submit_tag _("Create"), :class => "button nolabel right" %>
				<%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %> <%=_ 'Send notification emails' %>
			<% else %>
				<%= submit_tag _("Save"), :class => "button nolabel right" %>

				<%
					options = []
					options << [_("Leave Open"), 0] if @task.status == 0
					options << [_("Revert to Open"), 0] if @task.status != 0
					options << [_("Set in Progress"), 1] if @task.status == 0
					options << [_("Leave as in Progress"), 1] if @task.status == 1
					options << [_("Close"), 2] if @task.status == 0 || @task.status == 1
					options << [_("Leave Closed"), 2] if @task.status == 2
					options << [_("Set as Won't Fix"), 3] if @task.status == 0 || @task.status == 1
					options << [_("Leave as Won't Fix"), 3] if @task.status == 3
					options << [_("Set as Invalid"), 4] if @task.status == 0 || @task.status == 1
					options << [_("Leave as Invalid"), 4] if @task.status == 4
					options << [_("Set as Duplicate"), 5] if @task.status == 0 || @task.status == 1
					options << [_("Leave as Duplicate"), 5] if @task.status == 5
					options << [_("Wait"), 6] if @task.status < 2

					can_close = {:disabled => "disabled"} unless current_user.can?( @task.project, 'close' )
					can_close ||= {}

					defer_options = []
					defer_options << [_("Tomorrow"), tz.local_to_utc(tz.now.at_midnight + 1.days).to_s(:db)  ]
					defer_options << [_("End of week"), tz.local_to_utc(tz.now.beginning_of_week + 4.days).to_s(:db)  ]
					defer_options << [_("Next week"), tz.local_to_utc(tz.now.beginning_of_week + 7.days).to_s(:db) ]
					defer_options << [_("One week"), tz.local_to_utc(tz.now.at_midnight + 7.days).to_s(:db) ]
					defer_options << [_("Next month"), tz.local_to_utc(tz.now.next_month.beginning_of_month).to_s(:db)]
					defer_options << [_("One month"), tz.local_to_utc(tz.now.next_month.at_midnight).to_s(:db)]
				%>

				<%= select 'task', 'status', options, {:selected => @task.status}, can_close %>  <%= _("until") %>   <%= select 'task', 'hide_until', defer_options %> <%=_ 'and' %>

				<%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %> <%=_ 'Send notification emails' %>
			<% end %>

		</fieldset>

<% unless @tags.nil? %>

<% end %>

          <% if @task.project_id > 0
               selected_project = @task.project_id
             elsif session[:last_project_id].to_i > 0 && Project.exists?(session[:last_project_id])
               selected_project = session[:last_project_id].to_i
             elsif session[:filter_project].to_i > 0 && Project.exists?(session[:filter_project])
               selected_project = session[:filter_project].to_i
             else
               selected_project = current_user.projects.find(:first, :order => 'name').id
             end

             selected_project = current_user.projects.find(selected_project).id rescue current_user.projects.find(:first, :order => 'name').id

            %>
      <fieldset id="task_project_selection" style="padding-right:0;">
        <legend><%=_ 'Target' %></legend>
          <%=_ 'Project' %>

          <select name="task[project_id]" id="task_project_id" <%= "disabled=\"disabled\"" unless perms['reassign'].empty? %>>
          <% @clients = Customer.find(:all, :conditions => ["company_id = ?", current_user.company_id], :order => "name") %>
          <% @clients.each do |c| %>
          <% @client_projects = current_user.projects.find(:all, :conditions => ["customer_id = #{c.id} AND completed_at IS NULL"], :order => "name" ) %>
            <% if @client_projects.size > 0 %>
            <optgroup class="select_heading" label="<%= h(c.name) %>">
              <% @client_projects.each do |p| %>
                 <option value="<%=p.id%>" class="select_item"<%= " selected" if p.id == selected_project%>><%= p.name %></option>
              <% end %>
            </optgroup>
           <% end %>

          <% end %>

           </select>

          <%=_ 'Milestone' %>
          <% unless @task.id.nil? %>
            <%= select 'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', current_user.company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {}, perms['milestone'] %>
          <% else %>
            <%= select'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', current_user.company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {:selected => session[:filter_milestone] ? session[:filter_milestone].to_i : 0}, perms['milestone'] %>
          <% end %>
          <% if current_user.can?( Project.find(selected_project), 'milestone' ) %>
	  <% end %>

<%

users = Project.find(selected_project).users.find(:all, :order => 'name' ) rescue []

resource_string = "<select id=\"task_users\" name=\"users[]\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('Unassigned')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\">#{us.name}</option>"}.join('') + "</select>"
resource_string = resource_string.split(/\n/).join('').gsub(/'/, "\\\\\'")

owner_string = ''
num = 0
unless @task.users.empty?
  @task.users.each do |u|
    owner_string << "
#{_('Assigned To')}" if num == 0
    owner_string << "
" if num != 0
    owner_string <<  "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{(u.id == us.id ? "selected=\"selected\"" : '')}>#{us.name}</option>"}.join('').gsub(/'/,"\\\\\'") + "</select>" #, perms['reassign'] )

    if( perms['reassign'].keys.size == 0 )
      owner_string << "" if num == 0
      owner_string << "" if num != 0
    end
    owner_string << "
"
    num = num + 1
  end
  owner_string = owner_string.split(/\n/).join('')
else
  owner_string = "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{"selected" if (us.id == current_user.id && @task.created_at.nil?) }>#{us.name}</option>"}.join('') + "</select>" #, perms['reassign']
  owner_string = owner_string.split(/\n/).join('').gsub(/'/, "\\\\\'")

  if perms['reassign'].keys.size == 0
    owner_string = "
#{_('Assigned To')}#{owner_string}"
    owner_string << "
"
  end
  num = num + 1
end

%>

      <% if current_user.option_tracktime.to_i == 1%>
       <%=_ 'Time Estimate' %>
      <%= text_field 'task', 'duration', {:size => 12, :value => (@task.duration.to_i > 0 ? worked_nice(@task.duration) : ""), :class => 'tooltip', :title => _('2w 3d 1h')}.merge(perms['prioritize']) %>

<% else %>
      <%= hidden_field_tag "task[duration]", "#{(@task.duration.to_i > 0 ? worked_nice(@task.duration) : "")}" %>
<% end %>
      <%=_ 'Due Date' %>
        <% if perms['prioritize'].empty? %>
          <% if( (current_user.locale || 'en_US') == 'en_US' )
               date_tooltip = _("Enter task due date, or click calendar button.
For recurring tasks, try:
every day
every thursday
every last friday
every 14 days
every 3rd monday (of a month)")
             else
               date_tooltip = _("Enter task due date, or click calendar button.")
             end %>
          <% if @task.repeat && @task.repeat.length > 0 %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar'), :value => @task.repeat_summary },
          { :ifFormat => current_user.date_format, :firstDay => 1, :range => [2006, 2010], :step => 1, :showOthers => true } %>
          <% else %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar') },
          { :ifFormat => current_user.date_format, :firstDay => 1, :range => [2006, 2010], :step => 1, :showOthers => true } %>
          <% end %>

        <% else %>
          <% if @task.repeat && @task.repeat.length > 0 %>
        <%= text_field 'task', 'due_at', {:size => 12, :value => @task.repeat_summary}.merge(perms['prioritize']) %>

          <% else %>
        <%= text_field 'task', 'due_at', {:size => 12}.merge(perms['prioritize']) %>

          <% end %>
        <% end %>

      </fieldset>

      <fieldset id="task_notify" style="padding-right:0;">
        <legend><%=_ 'Notifications' %></legend>

       <%= owner_string %>

      <%=_ 'Requested By' %>
      <%= text_field 'task', 'requested_by', {:size => 12}.merge(perms['edit']) %>

        <%= _"Notify" %><input type="text" size="12" name="watchers[]" id="notification-input" title="<%=_("Add users by name or email")%>" class="tooltip">

      </fieldset>
      <fieldset id="task_attr" style="padding-right:0;">
        <legend><%=_ 'Attributes' %></legend>
      <%=_ 'Type' %>

        <% disabled = (perms['prioritize'].empty? || @task.new_record?) ? "" : "disabled=\"disabled\"" %>
        <input type="radio" name="task[type_id]" id="task_type_id_0" value="0" style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 0 %> <%= disabled %>/>
          <%=_'Task'%>

        <input type="radio" name="task[type_id]" id="task_type_id_1" value="1" style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 1 %> <%= disabled %>/>
          <%=_'New Feature'%>

        <input type="radio" name="task[type_id]" id="task_type_id_2" value="2"  style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 2 %> <%= disabled %>/>
          <%=_'Defect'%>

        <input type="radio" name="task[type_id]" id="task_type_id_3" value="3"  style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 3 %> <%= disabled %>/>
          <%=_'Improvement'%>

        <%#= select 'task', 'type_id', [[_('Task'),0],[_('New Feature'),1],[_('Defect'),2],[_('Improvement'),3]], {:selected => @task.type_id}, perms['prioritize']  %>

      <%=_ 'Priority' %>
        <%= select 'task', 'priority', [[_('Critical'),3],[_('Urgent'),2],[_('High'),1],[_('Normal'),0],[_('Low'),-1],[_('Lowest'),-2]], {:selected => @task.priority}, perms['prioritize']  %>

      <%=_ 'Severity' %>
        <%= select 'task', 'severity_id', [[_('Blocker'),3],[_('Critical'),2],[_('Major'),1],[_('Normal'),0],[_('Minor'),-1],[_('Trivial'),-2]], {:selected => @task.severity_id}, perms['prioritize']  %>

	<%
		@properties = Property.all_for_company(current_user.company)
		@properties.each do |p|
	-%>
	  <% name = "property_#{ p.id }" -%>
  	  <label for="<%= name %>"><%= h(p.name) %>
	  <select name="task[properties][<%= p.id %>]" id="<%= name %>">
	    <option></option>
	    <% p.property_values.each do |pv| -%>
	      <option value="<%= pv.id %>" <%= @task.property_value(p) == pv ? "selected" : ""  %>>
		<%= h(pv.value) %>
	      </option>
	    <% end -%>
	  </select>
	<% end -%>
      </fieldset>

      <fieldset id="task_dependencies" style="padding-right:0;">
        <legend><%=_ "Dependencies"%></legend>

        <%=_ 'Depends on'%>
        <% if perms['prioritize'].empty? %>
        <input name="dependencies[]" size="12" type="text" id="dependencies_input" title="<%=_("Search by task number or title")%>" class="tooltip" >

        <%= auto_complete_field 'dependencies_input', { :url => { :action => 'dependency_targets' }, :min_chars => 1, :frequency => 0.5, :indicator => 'loading', :select => 'complete_value', :tokens => ',' } %>
        <% else %>
        <input name="dependencies[]" size="12" type="text" disabled="disabled">
        <% end %>

        <% @task.dependencies.each do |d| %>

	        <% if perms['prioritize'].empty? %>
	            <a href="#" onclick="javascript:new Element.remove('dep_<%=d.id%>'); false;" ><img src="/images/cross_small.png" class="close-cross" border="0" title="<%=_ 'Remove'%>" class="tooltip">
	        <% end %>

	        <% if d.done? %>
	        	<% else %> <% end %><%= link_to_task(d) %>
	        	<input name="dependencies[]" type="hidden" value="<%=d.task_num%>">

        <% end %>

      </fieldset>

			<% unless @task.dependants.empty? %>
	      <fieldset id="task_dependants" style="padding-right:0;">
	        <legend><%=_ "Depended on by"%></legend>

	        <% @task.dependants.each do |d| %>

	        <div id="dep_<%=d.id%>">

<% if d.done? %><% else %><% end %><%= link_to_task(d) %>

	        <% end %>

	      </fieldset>
			<% end %>

      <% if @task.attachments.size > 0 %>
      <fieldset id="task_attachments">
        <legend><%=_ "Attachments" %></legend>

        <% for file in @task.attachments %>
        <%= link_to _(''), {:controller => 'project_files', :action => 'destroy', :id => file.id}, :confirm => _("Really delete %s?", file.name) %>
        <%= link_to h(file.name), {:controller => 'project_files', :action => 'download', :id => file.id} %> (<%=number_to_human_size(file.file_size)%>)

        <% end %>
      </fieldset>
      <% end %>

<%= error_messages_for 'task' %>
<%

  perms = {}

  ['comment', 'edit', 'reassign', 'prioritize', 'close', 'milestone'].each do |p|
    if @task.project_id.to_i == 0 || current_user.can?( @task.project, p )
      perms[p] = {}
    else
      perms[p] = { :disabled => 'disabled' }
    end
  end

%>

		<fieldset id="task_information" style="padding-right:0.5em;"><legend><%=_ 'Information' %></legend>
			<%=_ 'Summary' %>
			<%= text_field 'task', 'name', { :size => 47, :maxlength => 200, :style => "width:80%;"}.merge( perms['edit'] )  %>

			<%=_ 'Tags' %>
			<%= text_field 'task', 'set_tags', { :size => 47, :value => @task.tags.collect{|t| t.name}.join(', '), :autocomplete => "off", :style => "width:80%;" }.merge( perms['edit'] ) %>

			<%=_ 'Description' %>
			<%= text_area 'task', 'description', { :rows => 15, :style => "width:80%;" }.merge( perms['edit'] )  %>

			<%=_ 'Comment' %>
			<%= text_area_tag 'comment', {}, { :rows => 8, :style => "width:80%;" }.merge( perms['comment'] )  %>

			<%=_ 'Attach file' %>
			<%= file_field_tag 'task_file', { :size => 35, :class => "file" }.merge( perms['comment'] ) %>

			<% if @task.new_record? %>
				<%= submit_tag _("Create"), :class => "button nolabel right" %>
				<%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %> <%=_ 'Send notification emails' %>
			<% else %>
				<%= submit_tag _("Save"), :class => "button nolabel right" %>

				<%
					options = []
					options << [_("Leave Open"), 0] if @task.status == 0
					options << [_("Revert to Open"), 0] if @task.status != 0
					options << [_("Set in Progress"), 1] if @task.status == 0
					options << [_("Leave as in Progress"), 1] if @task.status == 1
					options << [_("Close"), 2] if @task.status == 0 || @task.status == 1
					options << [_("Leave Closed"), 2] if @task.status == 2
					options << [_("Set as Won't Fix"), 3] if @task.status == 0 || @task.status == 1
					options << [_("Leave as Won't Fix"), 3] if @task.status == 3
					options << [_("Set as Invalid"), 4] if @task.status == 0 || @task.status == 1
					options << [_("Leave as Invalid"), 4] if @task.status == 4
					options << [_("Set as Duplicate"), 5] if @task.status == 0 || @task.status == 1
					options << [_("Leave as Duplicate"), 5] if @task.status == 5
					options << [_("Wait"), 6] if @task.status < 2

					can_close = {:disabled => "disabled"} unless current_user.can?( @task.project, 'close' )
					can_close ||= {}

					defer_options = []
					defer_options << [_("Tomorrow"), tz.local_to_utc(tz.now.at_midnight + 1.days).to_s(:db)  ]
					defer_options << [_("End of week"), tz.local_to_utc(tz.now.beginning_of_week + 4.days).to_s(:db)  ]
					defer_options << [_("Next week"), tz.local_to_utc(tz.now.beginning_of_week + 7.days).to_s(:db) ]
					defer_options << [_("One week"), tz.local_to_utc(tz.now.at_midnight + 7.days).to_s(:db) ]
					defer_options << [_("Next month"), tz.local_to_utc(tz.now.next_month.beginning_of_month).to_s(:db)]
					defer_options << [_("One month"), tz.local_to_utc(tz.now.next_month.at_midnight).to_s(:db)]
				%>

				<%= select 'task', 'status', options, {:selected => @task.status}, can_close %>  <%= _("until") %>   <%= select 'task', 'hide_until', defer_options %> <%=_ 'and' %>

				<%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %> <%=_ 'Send notification emails' %>
			<% end %>

		</fieldset>

<% unless @tags.nil? %>

<% end %>

          <% if @task.project_id > 0
               selected_project = @task.project_id
             elsif session[:last_project_id].to_i > 0 && Project.exists?(session[:last_project_id])
               selected_project = session[:last_project_id].to_i
             elsif session[:filter_project].to_i > 0 && Project.exists?(session[:filter_project])
               selected_project = session[:filter_project].to_i
             else
               selected_project = current_user.projects.find(:first, :order => 'name').id
             end

             selected_project = current_user.projects.find(selected_project).id rescue current_user.projects.find(:first, :order => 'name').id

            %>
      <fieldset id="task_project_selection" style="padding-right:0;">
        <legend><%=_ 'Target' %></legend>
          <%=_ 'Project' %>

          <select name="task[project_id]" id="task_project_id" <%= "disabled=\"disabled\"" unless perms['reassign'].empty? %>>
          <% @clients = Customer.find(:all, :conditions => ["company_id = ?", current_user.company_id], :order => "name") %>
          <% @clients.each do |c| %>
          <% @client_projects = current_user.projects.find(:all, :conditions => ["customer_id = #{c.id} AND completed_at IS NULL"], :order => "name" ) %>
            <% if @client_projects.size > 0 %>
            <optgroup class="select_heading" label="<%= h(c.name) %>">
              <% @client_projects.each do |p| %>
                 <option value="<%=p.id%>" class="select_item"<%= " selected" if p.id == selected_project%>><%= p.name %></option>
              <% end %>
            </optgroup>
           <% end %>

          <% end %>

           </select>

          <%=_ 'Milestone' %>
          <% unless @task.id.nil? %>
            <%= select 'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', current_user.company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {}, perms['milestone'] %>
          <% else %>
            <%= select'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', current_user.company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {:selected => session[:filter_milestone] ? session[:filter_milestone].to_i : 0}, perms['milestone'] %>
          <% end %>
          <% if current_user.can?( Project.find(selected_project), 'milestone' ) %>
	  <% end %>

<%

users = Project.find(selected_project).users.find(:all, :order => 'name' ) rescue []

resource_string = "<select id=\"task_users\" name=\"users[]\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('Unassigned')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\">#{us.name}</option>"}.join('') + "</select>"
resource_string = resource_string.split(/\n/).join('').gsub(/'/, "\\\\\'")

owner_string = ''
num = 0
unless @task.users.empty?
  @task.users.each do |u|
    owner_string << "
#{_('Assigned To')}" if num == 0
    owner_string << "
" if num != 0
    owner_string <<  "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{(u.id == us.id ? "selected=\"selected\"" : '')}>#{us.name}</option>"}.join('').gsub(/'/,"\\\\\'") + "</select>" #, perms['reassign'] )

    if( perms['reassign'].keys.size == 0 )
      owner_string << "" if num == 0
      owner_string << "" if num != 0
    end
    owner_string << "
"
    num = num + 1
  end
  owner_string = owner_string.split(/\n/).join('')
else
  owner_string = "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{"selected" if (us.id == current_user.id && @task.created_at.nil?) }>#{us.name}</option>"}.join('') + "</select>" #, perms['reassign']
  owner_string = owner_string.split(/\n/).join('').gsub(/'/, "\\\\\'")

  if perms['reassign'].keys.size == 0
    owner_string = "
#{_('Assigned To')}#{owner_string}"
    owner_string << "
"
  end
  num = num + 1
end

%>

      <% if current_user.option_tracktime.to_i == 1%>
       <%=_ 'Time Estimate' %>
      <%= text_field 'task', 'duration', {:size => 12, :value => (@task.duration.to_i > 0 ? worked_nice(@task.duration) : ""), :class => 'tooltip', :title => _('2w 3d 1h')}.merge(perms['prioritize']) %>

<% else %>
      <%= hidden_field_tag "task[duration]", "#{(@task.duration.to_i > 0 ? worked_nice(@task.duration) : "")}" %>
<% end %>
      <%=_ 'Due Date' %>
        <% if perms['prioritize'].empty? %>
          <% if( (current_user.locale || 'en_US') == 'en_US' )
               date_tooltip = _("Enter task due date, or click calendar button.
For recurring tasks, try:
every day
every thursday
every last friday
every 14 days
every 3rd monday (of a month)")
             else
               date_tooltip = _("Enter task due date, or click calendar button.")
             end %>
          <% if @task.repeat && @task.repeat.length > 0 %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar'), :value => @task.repeat_summary },
          { :ifFormat => current_user.date_format, :firstDay => 1, :range => [2006, 2010], :step => 1, :showOthers => true } %>
          <% else %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar') },
          { :ifFormat => current_user.date_format, :firstDay => 1, :range => [2006, 2010], :step => 1, :showOthers => true } %>
          <% end %>

        <% else %>
          <% if @task.repeat && @task.repeat.length > 0 %>
        <%= text_field 'task', 'due_at', {:size => 12, :value => @task.repeat_summary}.merge(perms['prioritize']) %>

          <% else %>
        <%= text_field 'task', 'due_at', {:size => 12}.merge(perms['prioritize']) %>

          <% end %>
        <% end %>

      </fieldset>

      <fieldset id="task_notify" style="padding-right:0;">
        <legend><%=_ 'Notifications' %></legend>

       <%= owner_string %>

      <%=_ 'Requested By' %>
      <%= text_field 'task', 'requested_by', {:size => 12}.merge(perms['edit']) %>

        <%= _"Notify" %><input type="text" size="12" name="watchers[]" id="notification-input" title="<%=_("Add users by name or email")%>" class="tooltip">

      </fieldset>
      <fieldset id="task_attr" style="padding-right:0;">
        <legend><%=_ 'Attributes' %></legend>
      <%=_ 'Type' %>

        <% disabled = (perms['prioritize'].empty? || @task.new_record?) ? "" : "disabled=\"disabled\"" %>
        <input type="radio" name="task[type_id]" id="task_type_id_0" value="0" style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 0 %> <%= disabled %>/>
          <%=_'Task'%>

        <input type="radio" name="task[type_id]" id="task_type_id_1" value="1" style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 1 %> <%= disabled %>/>
          <%=_'New Feature'%>

        <input type="radio" name="task[type_id]" id="task_type_id_2" value="2"  style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 2 %> <%= disabled %>/>
          <%=_'Defect'%>

        <input type="radio" name="task[type_id]" id="task_type_id_3" value="3"  style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 3 %> <%= disabled %>/>
          <%=_'Improvement'%>

        <%#= select 'task', 'type_id', [[_('Task'),0],[_('New Feature'),1],[_('Defect'),2],[_('Improvement'),3]], {:selected => @task.type_id}, perms['prioritize']  %>

      <%=_ 'Priority' %>
        <%= select 'task', 'priority', [[_('Critical'),3],[_('Urgent'),2],[_('High'),1],[_('Normal'),0],[_('Low'),-1],[_('Lowest'),-2]], {:selected => @task.priority}, perms['prioritize']  %>

      <%=_ 'Severity' %>
        <%= select 'task', 'severity_id', [[_('Blocker'),3],[_('Critical'),2],[_('Major'),1],[_('Normal'),0],[_('Minor'),-1],[_('Trivial'),-2]], {:selected => @task.severity_id}, perms['prioritize']  %>

	<% @properties.each do |p| -%>
	  <% name = "property_#{ p.id }" -%>
  	  <label for="<%= name %>"><%= h(p.name) %>
	  <select name="task[properties][<%= p.id %>]" id="<%= name %>">
	    <option></option>
	    <% p.property_values.each do |pv| -%>
	      <option value="<%= pv.id %>" <%= @task.property_value(p) == pv ? "selected" : ""  %>>
		<%= h(pv.value) %>
	      </option>
	    <% end -%>
	  </select>
	<% end -%>
      </fieldset>

      <fieldset id="task_dependencies" style="padding-right:0;">
        <legend><%=_ "Dependencies"%></legend>

        <%=_ 'Depends on'%>
        <% if perms['prioritize'].empty? %>
        <input name="dependencies[]" size="12" type="text" id="dependencies_input" title="<%=_("Search by task number or title")%>" class="tooltip" >

        <%= auto_complete_field 'dependencies_input', { :url => { :action => 'dependency_targets' }, :min_chars => 1, :frequency => 0.5, :indicator => 'loading', :select => 'complete_value', :tokens => ',' } %>
        <% else %>
        <input name="dependencies[]" size="12" type="text" disabled="disabled">
        <% end %>

        <% @task.dependencies.each do |d| %>

	        <% if perms['prioritize'].empty? %>
	            <a href="#" onclick="javascript:new Element.remove('dep_<%=d.id%>'); false;" ><img src="/images/cross_small.png" class="close-cross" border="0" title="<%=_ 'Remove'%>" class="tooltip">
	        <% end %>

	        <% if d.done? %>
	        	<% else %> <% end %><%= link_to_task(d) %>
	        	<input name="dependencies[]" type="hidden" value="<%=d.task_num%>">

        <% end %>

      </fieldset>

			<% unless @task.dependants.empty? %>
	      <fieldset id="task_dependants" style="padding-right:0;">
	        <legend><%=_ "Depended on by"%></legend>

	        <% @task.dependants.each do |d| %>

	        <div id="dep_<%=d.id%>">

<% if d.done? %><% else %><% end %><%= link_to_task(d) %>

	        <% end %>

	      </fieldset>
			<% end %>

      <% if @task.attachments.size > 0 %>
      <fieldset id="task_attachments">
        <legend><%=_ "Attachments" %></legend>

        <% for file in @task.attachments %>
        <%= link_to _(''), {:controller => 'project_files', :action => 'destroy', :id => file.id}, :confirm => _("Really delete %s?", file.name) %>
        <%= link_to h(file.name), {:controller => 'project_files', :action => 'download', :id => file.id} %> (<%=number_to_human_size(file.file_size)%>)

        <% end %>
      </fieldset>
      <% end %>


ActionItem725: fixing HTML

ActionItem725: fixing HTML

<p> <%= language_chooser %> </p>
<%= footer %>

<p> <%= language_chooser %> <p/>
<%= footer %>


Fix file size.  (closes #324)


Cleaned up regex checkbox.

Cleaned up regex checkbox.

<%= error_messages_for 'censor_rule' %>

  <%=_("Applies to")%>
  <% unless info_request.nil? %>
    <%= request_link(info_request)%>
    <%= request_admin_link(info_request, "(admin)", "btn btn-info")%>
    <%= hidden_field 'censor_rule', 'info_request_id', { :value => info_request.id } %>
  <% end %>
  <% unless user.nil? %>
    <%= user_link(user) %>
    <%= user_admin_link(user, "admin", "btn btn-info") %>
    <%= hidden_field 'censor_rule', 'user_id', { :value => user.id } %>
<% end %>

  Is it regexp replacement?

    <%= check_box 'censor_rule', 'regexp' %>

      Leave unchecked if you are not sure about this

  Text

    <%= text_field 'censor_rule', 'text', :class => "span3" %>

      that you want to remove, case sensitive

  Replacement

    <%= text_field 'censor_rule', 'replacement', :class => "span3"  %>

      put it in [square brackets], e.g. [personal information removed]. applies to text in emails and HTML conversions of binaries; binaries themselves must stay the same length and the replacement is just a bunch of 'x's

  Comment for this edit

    <%= text_area 'censor_rule', 'last_edit_comment', :rows => 2, :class => "span6"  %>

      put purpose of the rule, and why the change

Warning and notes:

 This does replace text in binary files, but for
      most formats only in a naive way. It works well on surprisingly many Word documents. Notably
      it doesn't even do UCS-2 (unicode sometimes used in Word). There is also special code
      which works on some PDFs. Please carefully check all attachments have
      changed in the way you expect, and haven't become corrupted.

You may need to manually rebuild the search index afterwards. You can redact
      things by individual request or by user by adding the censor rule from the
      appropriate page.  If you need to redact across a whole
      authority, it will be easy enough to make code changes to add it, so do ask.

<%= error_messages_for 'censor_rule' %>

  <%=_("Applies to")%>
  <% unless info_request.nil? %>
    <%= request_link(info_request)%>
    <%= request_admin_link(info_request, "(admin)", "btn btn-info")%>
    <%= hidden_field 'censor_rule', 'info_request_id', { :value => info_request.id } %>
  <% end %>
  <% unless user.nil? %>
    <%= user_link(user) %>
    <%= user_admin_link(user, "admin", "btn btn-info") %>
    <%= hidden_field 'censor_rule', 'user_id', { :value => user.id } %>
<% end %>

Is it regexp replacement? (Leave unchecked if you are not sure about this)

<%= check_box 'censor_rule', 'regexp' %>

  Is it regexp replacement?

    <%= text_field 'censor_rule', 'regexp', :class => "span3" %>

      (Leave unchecked if you are not sure about this)

  Text

    <%= text_field 'censor_rule', 'text', :class => "span3" %>

      that you want to remove, case sensitive

  Replacement

    <%= text_field 'censor_rule', 'replacement', :class => "span3"  %>

      put it in [square brackets], e.g. [personal information removed]. applies to text in emails and HTML conversions of binaries; binaries themselves must stay the same length and the replacement is just a bunch of 'x's

  Comment for this edit

    <%= text_area 'censor_rule', 'last_edit_comment', :rows => 2, :class => "span6"  %>

      put purpose of the rule, and why the change

Warning and notes:

 This does replace text in binary files, but for
      most formats only in a naive way. It works well on surprisingly many Word documents. Notably
      it doesn't even do UCS-2 (unicode sometimes used in Word). There is also special code
      which works on some PDFs. Please carefully check all attachments have
      changed in the way you expect, and haven't become corrupted.

You may need to manually rebuild the search index afterwards. You can redact
      things by individual request or by user by adding the censor rule from the
      appropriate page.  If you need to redact across a whole
      authority, it will be easy enough to make code changes to add it, so do ask.


fix htmled titles

fix htmled titles

git-svn-id: 63e5431e33a10c4701b329fb6d8e0744110cb91e@66 c2b4ead4-481d-0410-ac63-b02590f85e3f

BBC 'Have Your Say' Threads

Details	Comments	Censored

<% cache("thread_list_" + @threads.collect { |t| [t.id, t.updated_at, t.published_count, t.censored_count] }.hash.to_s) do -%>
<% @threads.each do |t| %>

<%= link_to h(unescapeHTML(t.title)), :action => :show, :id => t.bbcid %>

Started: <%= t.created_at.to_date %>, Last updated <%= t.updated_at.to_s(:long) %>

<%= t.published_count %>
<%= t.censored_count %>

<% end %>
<% end -%>

<%= render_partial 'partials/paginator', @threads_pages %>

BBC 'Have Your Say' Threads

Details	Comments	Censored

<% cache("thread_list_" + @threads.collect { |t| [t.id, t.updated_at, t.published_count, t.censored_count] }.hash.to_s) do -%>
<% @threads.each do |t| %>

<%= link_to h(t.title), :action => :show, :id => t.bbcid %>

Started: <%= t.created_at.to_date %>, Last updated <%= t.updated_at.to_s(:long) %>

<%= t.published_count %>
<%= t.censored_count %>

<% end %>
<% end -%>

<%= render_partial 'partials/paginator', @threads_pages %>


check event group present

check event group present

    Title

    <%= f.text_field :title %>

    Default text area character length

    <%= f.text_field :default_text_area_length %>

    <%= f.check_box :hidden %>
    Hide this event group and its sub elements

    <%= f.check_box :show_mpdtool %>
    Show link to mpdtool on acceptance page

    <%= f.check_box :allows_multiple_applications_with_same_form %>
    Allow multiple applications that use the same form

    <%= f.check_box :show_dates_as_distance %>
    Show dates as words ex "5 hours ago"

    Parent

    <%= f.select :parent_id, @tree_list %>

    Long description (this should should fit in a sentence like "you are applying for ..." for example "a 2007 summer project")

    <%= f.text_field :long_desc %>

    Outgoing email

    <%= f.text_field :outgoing_email %>

    <%= f.check_box :has_your_campuses %>
    Has Your Campuses Page

    <%= f.check_box :automatic_acceptance %>
    Automatically accept an application on submission if no references are required.

Upload a logo: <%= f.file_field :uploaded_data %>

  <% if @event_group && @event_group.has_logo? -%>

<%= check_box_tag :delete_logo %>Delete logo?

  <% end %>

  Title - If set, this replaces the default title "<%= Pat::CONFIG[:title] %>" in the top left of the PAT.

    <%= f.text_field :pat_title %>

  Cost Item Instructions - If set, this replaces the default instructions on the costing page.

    <%= f.text_area :cost_item_instructions, :rows => 2 %>

  Cost Item Line - If set, this replaces the default line on a cost item ("I will support raise for this item").

    <%= f.text_field :cost_item_phrase %>

  Slug - This enables a url <%= request.protocol %><%= request.host %><%= (":" + request.port.to_s) if request.port != 80 %>/register/<slug> that scopes this event group and starts the application form

     <%= request.protocol %><%= request.host %><%= (":" + request.port.to_s) if request.port != 80 %>/register/<%= f.text_field :slug %> <%- if @event_group && @event_group.slug.present? %> <%= link_to "Current slug url", request.protocol + request.host + ((":" + request.port.to_s) if request.port != 80).to_s + "/register/" + @event_group.slug %><% end %>

<% unless @event_group.nil? || @event_group.new_record? %>

Eventgroup Coordinators: <%= @event_group.eventgroup_coordinators_names %> <%= link_to 'Manage Coordinators', { :controller => :eventgroup_coordinators, :action => :list, :id => @event_group.id }, :target => :blank %> (Opens in new window)

Note: Eventgroup Coordinators for all parent EventGroups are automatically considered coordinators for this group.

<% end %>

    Title

    <%= f.text_field :title %>

    Default text area character length

    <%= f.text_field :default_text_area_length %>

    <%= f.check_box :hidden %>
    Hide this event group and its sub elements

    <%= f.check_box :show_mpdtool %>
    Show link to mpdtool on acceptance page

    <%= f.check_box :allows_multiple_applications_with_same_form %>
    Allow multiple applications that use the same form

    <%= f.check_box :show_dates_as_distance %>
    Show dates as words ex "5 hours ago"

    Parent

    <%= f.select :parent_id, @tree_list %>

    Long description (this should should fit in a sentence like "you are applying for ..." for example "a 2007 summer project")

    <%= f.text_field :long_desc %>

    Outgoing email

    <%= f.text_field :outgoing_email %>

    <%= f.check_box :has_your_campuses %>
    Has Your Campuses Page

    <%= f.check_box :automatic_acceptance %>
    Automatically accept an application on submission if no references are required.

Upload a logo: <%= f.file_field :uploaded_data %>

  <% if @event_group && @event_group.has_logo? -%>

<%= check_box_tag :delete_logo %>Delete logo?

  <% end %>

  Title - If set, this replaces the default title "<%= Pat::CONFIG[:title] %>" in the top left of the PAT.

    <%= f.text_field :pat_title %>

  Cost Item Instructions - If set, this replaces the default instructions on the costing page.

    <%= f.text_area :cost_item_instructions, :rows => 2 %>

  Cost Item Line - If set, this replaces the default line on a cost item ("I will support raise for this item").

    <%= f.text_field :cost_item_phrase %>

  Slug - This enables a url <%= request.protocol %><%= request.host %><%= (":" + request.port.to_s) if request.port != 80 %>/register/<slug> that scopes this event group and starts the application form

     <%= request.protocol %><%= request.host %><%= (":" + request.port.to_s) if request.port != 80 %>/register/<%= f.text_field :slug %> <%- if @event_group.slug.present? %> <%= link_to "Current slug url", request.protocol + request.host + ((":" + request.port.to_s) if request.port != 80).to_s + "/register/" + @event_group.slug %><% end %>

<% unless @event_group.nil? || @event_group.new_record? %>

Eventgroup Coordinators: <%= @event_group.eventgroup_coordinators_names %> <%= link_to 'Manage Coordinators', { :controller => :eventgroup_coordinators, :action => :list, :id => @event_group.id }, :target => :blank %> (Opens in new window)

Note: Eventgroup Coordinators for all parent EventGroups are automatically considered coordinators for this group.

<% end %>