Added remote new weighing task

Added remote new weighing task

Dossier on <%= @cage.name%>

Owner: <%= @cage.user ? @cage.user.name : 'NP' %>

Room: <%= @cage.room.name %>

Bats: <%= @cage.bats.count %>

<% average_bat_weight = @cage.average_bat_weight %>

Average Weight: <%= average_bat_weight %> g

Date Created: <%= nice_date @cage.date_created %>

<% if @cage.date_destroyed != nil %>

Date Destroyed: <%= nice_date @cage.date_destroyed %>

<% end %>

Current Feeding Tasks:

<%= render :partial => 'tasks/tasks_list', :locals =>{:tasks_list => nil, :tasks => @cage.tasks.feeding_tasks, :div_id => 'feeding_tasks', :single_cage_task_list => true, :manage => true} %>

[<%= link_to_remote "Add Feeding Tasks", :url => {:controller => 'tasks', :action => 'remote_new_feed_cage_task', :id => @cage, :div_id => "feeding_tasks",
                                                          :source => 'show_cage', :single_cage_task_list => true},
                                                          :update => 'add_feeding_task' %>]

[<%= link_to 'Edit multiple feeding tasks', :controller => 'tasks', :action => 'edit_multiple_feeding_tasks', :id => @cage %>]

<% @tasks = @cage.tasks.weighing_tasks %>
Current Weighing Tasks:

<%= render :partial => 'tasks/tasks_list', :locals =>{:tasks_list => nil, :tasks => @cage.tasks.weighing_tasks, :div_id => 'weighing_tasks', :single_cage_task_list => true, :manage => true} %>

  <%= link_to_remote 'Add Weighing Task', :url => {:controller => 'tasks', :action => 'remote_new_weigh_cage_task', :id => @cage, :div_id => 'weighing_tasks',
                  :single_cage_task_list => true, :source => 'show_cage'},
                  :update => 'add_weighing_task' %>

<% if @cage.bats.active.length == 0 %>
No bats are in this cage.
<% else %>
  Current Bats:

  Band
  Last Weight
  Weigh Date
  Date in
  Who
  Why
  <% for bat in @cage.bats %>
    <% cih = bat.cage_in_histories %>
    <% if cih %>
    <%      @date_in = cih[0].date %>
    <%      @sig = cih[0].user.initials %>
    <%      @why = cih[0].note %>
    <% else %>
    <%      @date_in ="" %>
    <%      @sig = "" %>
    <%      @why = "" %>
    <% end %>

    <%= link_to bat.band, :controller => 'bats', :action => 'show', :id => bat %>
    <% if bat.weights.length > 0 %>
          <%=h bat.weights.recent.weight %>
          <%=h nice_date(bat.weights.recent.date) %>
    <% else %>
          N/A
          N/A
    <% end %>
    <%=h nice_date(@date_in) %>
    <%=h @sig %>
    <%=h @why %>

  <% end %>

<% end %>

<% if @cohs.length == 0 %>
No bats were in this cage.
<% else %>
  Past Bats:

  Band
  Date in
  Who
  Date out
  Who
  <% for coh in @cohs %>

    <%=link_to coh.bat.band, :controller => 'bats', :action => 'show', :id => coh.bat %>
    <%=h nice_date(coh.cage_in_history.date) %>
    <%=h coh.cage_in_history.user.initials %>
    <%=h nice_date(coh.date) %>
    <%=h coh.user.initials %>

  <% end %>

<% end %>

<%= link_to 'Edit', :action => 'edit', :id => @cage %> |
<%= link_to 'List Current Cages', :action => 'list' %>

Dossier on <%= @cage.name%>

Owner: <%= @cage.user ? @cage.user.name : 'NP' %>

Room: <%= @cage.room.name %>

Bats: <%= @cage.bats.count %>

<% average_bat_weight = @cage.average_bat_weight %>

Average Weight: <%= average_bat_weight %> g

Date Created: <%= nice_date @cage.date_created %>

<% if @cage.date_destroyed != nil %>

Date Destroyed: <%= nice_date @cage.date_destroyed %>

<% end %>

Current Feeding Tasks:

<%= render :partial => 'tasks/tasks_list', :locals =>{:tasks_list => nil, :tasks => @cage.tasks.feeding_tasks, :div_id => 'feeding_tasks', :single_cage_task_list => true, :manage => true} %>

[<%= link_to_remote "Add Feeding Tasks", :url => {:controller => 'tasks', :action => 'remote_new_feed_cage_task', :id => @cage, :div_id => "feeding_tasks", :source => 'show_cage', :single_cage_task_list => 'true'},
                                                          :update => 'add_feeding_task' %>]

[<%= link_to 'Edit multiple feeding tasks', :controller => 'tasks', :action => 'edit_multiple_feeding_tasks', :id => @cage %>]

<% @tasks = @cage.tasks.weighing_tasks %>
Current Weighing Tasks:

<%= render :partial => 'tasks/tasks_list', :locals =>{:tasks_list => nil, :tasks => @cage.tasks.weighing_tasks, :div_id => 'weighing_tasks', :single_cage_task_list => true, :manage => true} %>

[<%= link_to 'Add weighing task', :controller => 'tasks', :action => 'new_weigh_cage_task', :id => @cage %>]

<% if @cage.bats.active.length == 0 %>
No bats are in this cage.
<% else %>
  Current Bats:

  Band
  Last Weight
  Weigh Date
  Date in
  Who
  Why
  <% for bat in @cage.bats %>
    <% cih = bat.cage_in_histories %>
    <% if cih %>
    <%      @date_in = cih[0].date %>
    <%      @sig = cih[0].user.initials %>
    <%      @why = cih[0].note %>
    <% else %>
    <%      @date_in ="" %>
    <%      @sig = "" %>
    <%      @why = "" %>
    <% end %>

    <%= link_to bat.band, :controller => 'bats', :action => 'show', :id => bat %>
    <% if bat.weights.length > 0 %>
          <%=h bat.weights.recent.weight %>
          <%=h nice_date(bat.weights.recent.date) %>
    <% else %>
          N/A
          N/A
    <% end %>
    <%=h nice_date(@date_in) %>
    <%=h @sig %>
    <%=h @why %>

  <% end %>

<% end %>

<% if @cohs.length == 0 %>
No bats were in this cage.
<% else %>
  Past Bats:

  Band
  Date in
  Who
  Date out
  Who
  <% for coh in @cohs %>

    <%=link_to coh.bat.band, :controller => 'bats', :action => 'show', :id => coh.bat %>
    <%=h nice_date(coh.cage_in_history.date) %>
    <%=h coh.cage_in_history.user.initials %>
    <%=h nice_date(coh.date) %>
    <%=h coh.user.initials %>

  <% end %>

<% end %>

<%= link_to 'Edit', :action => 'edit', :id => @cage %> |
<%= link_to 'List Current Cages', :action => 'list' %>


This commit fixes a broken link.  Now person landing page sidebar, send message link goes to the message_page controller, instead of incorrectly going to the (no-longer existing) message controller.

<% if @is_contact -%>
<%= link_to 'remove from my contacts', {:controller => 'contact', :action => 'remove', :id => @user} %>
<% elsif logged_in? and !current_user.contacts.include?(@user) -%>
<%= link_to 'add to my contacts', url_for(:controller => 'contact', :action => 'add', :id => @user) %>
<% end -%>

<%= link_to 'send message', {:controller => 'tool/message_page', :action => 'create', :to => @user.login}, :method => 'get' if @user%>

  <%= link_to 'tasks', url_for_user(@user, :action => 'tasks') if @user %>

<% if @is_contact -%>
<%= link_to 'remove from my contacts', {:controller => 'contact', :action => 'remove', :id => @user} %>
<% elsif logged_in? and !current_user.contacts.include?(@user) -%>
<%= link_to 'add to my contacts', url_for(:controller => 'contact', :action => 'add', :id => @user) %>
<% end -%>

<%= link_to 'send message', {:controller => 'tool/message', :action => 'create', :to => @user.login}, :method => 'get' if @user%>

  <%= link_to 'tasks', url_for_user(@user, :action => 'tasks') if @user %>


that quick fix was too quick.  rolling back to previous broken stuff. the true fix must be deep in the recent changes elijah made.

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

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <%= favicon %>
  <title><%=h title_from_context %></title>
  <link rel="stylesheet" href="/bundles/<%=CSS_VERSION%>/base.css" type="text/css" media="screen" charset="utf-8" />
  <%= stylesheet_link_tag stylesheet if stylesheet %>

  <% if need_extra_javascript? %><% end %>

<body class="<%=body_class||=''%>">

 <%= render 'layouts/menu' %>

<% if banner -%>

  <%= render :partial => banner %>

<% end -%>

    <%= display_messages %>

  <%= yield %>

    get involved |
    bugs |
    feature requests |
    help

  <% if SVN_REVISION -%>
    crabgrass r<%= SVN_REVISION %>
  <% end -%>

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

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <%= favicon %>
  <title><%=h title_from_context %></title>
  <link rel="stylesheet" href="/bundles/<%=CSS_VERSION%>/base.css" type="text/css" media="screen" charset="utf-8" />
  <%= stylesheet_link_tag stylesheet if stylesheet %>

  <% if need_extra_javascript? %><% end %>

<body class="<%=body_class||=''%>">

 <%= render 'layouts/menu' %>

<% if false and banner #to be debugged in the future...  something is wrong with group.banner var-%>

  <%= render :partial => banner %>

<% end -%>

    <%= display_messages %>

  <%= yield %>

    get involved |
    bugs |
    feature requests |
    help

  <% if SVN_REVISION -%>
    crabgrass r<%= SVN_REVISION %>
  <% end -%>


ActionItem64: fckcustom.js must not be loaded in header

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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <%= javascript_include_tag :defaults %>
    <%= design_all_header_tags %>
    <%= javascript_include_tag 'cms' %>
    <% if params[:controller] == 'cms' %>
      <%= stylesheet_link_tag 'cms' %>
      <%= javascript_include_tag 'fckeditor/fckeditor.js' %>
    <% end %>
    <%= stylesheet_link_tag 'common' %>

    <%= stylesheet_link_tag 'menu' %>
    <%= javascript_include_tag 'menu' %>

    <% unless flash[:notice].nil? %>

        <%= flash[:notice] %>

          <%=  link_to_function( content_tag(:span, _('Close') ), visual_effect(:fade, "notice", :duration => 0.5), :id => 'button_close_notice' ) %>

    <% end %>

    <%= image_tag 'loading.gif', :id => 'spinner', :style => "display:none; float:right;", :alt => _('Image for Loading...') %>

    <div id="wrap" class='category<%= category_color %>'>
      <div id='noosfero_bar' class='category<%= category_color %>'>

          Acessibilidade
          Central de Buscas
          Ir para conteúdo

          <%= render :file => 'shared/categories_menu' %>

          <form action="" method="GET">
            <input type='text' name='q' value='sua busca aqui ...'>
            <input type='submit' value='Buscar'>
          </form>

          <%= header %>

        <% if @category %>

            <%= @category.full_name %>

        <% end %>

        <% if params[:controller] == 'cms' %>

            <%= yield %>

        <% else %>
          <%= design_display(yield) %>
        <% end %>

        <%= footer %>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <%= javascript_include_tag :defaults %>
    <%= design_all_header_tags %>
    <%= javascript_include_tag 'cms' %>
    <% if params[:controller] == 'cms' %>
      <%= stylesheet_link_tag 'cms' %>
      <%= javascript_include_tag 'fckeditor/fckeditor.js' %>
      <%= javascript_include_tag 'fckcustom' %>
    <% end %>
    <%= stylesheet_link_tag 'common' %>

    <%= stylesheet_link_tag 'menu' %>
    <%= javascript_include_tag 'menu' %>

    <% unless flash[:notice].nil? %>

        <%= flash[:notice] %>

          <%=  link_to_function( content_tag(:span, _('Close') ), visual_effect(:fade, "notice", :duration => 0.5), :id => 'button_close_notice' ) %>

    <% end %>

    <%= image_tag 'loading.gif', :id => 'spinner', :style => "display:none; float:right;", :alt => _('Image for Loading...') %>

    <div id="wrap" class='category<%= category_color %>'>
      <div id='noosfero_bar' class='category<%= category_color %>'>

          Acessibilidade
          Central de Buscas
          Ir para conteúdo

          <%= render :file => 'shared/categories_menu' %>

          <form action="" method="GET">
            <input type='text' name='q' value='sua busca aqui ...'>
            <input type='submit' value='Buscar'>
          </form>

          <%= header %>

        <% if @category %>

            <%= @category.full_name %>

        <% end %>

        <% if params[:controller] == 'cms' %>

            <%= yield %>

        <% else %>
          <%= design_display(yield) %>
        <% end %>

        <%= footer %>


Fixed nesting bug in del.icio.us sidebar (closes #306 again) [ryanabrams at gmail.com]

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

<% if @delicious -%>

<a href="http://<%= @delicious.title %>" alt="<%= @delicious.title %>"><%= @delicious.title %>

    <% (@sb_config['groupdate'] ? @delicious.days : [{ :container => @delicious.items }]).each do |group| -%>

      <% if @sb_config['groupdate'] -%>
      <%= group[:date].to_s.to_date.strftime("%b %d") %>
      <% end -%>
      <% for item in group[:container] %>

        <a href="<%= item.link %>" title="<%= item.title%>"><%= item.title %>
        <% if @sb_config['description'] -%>

<%= @sb_config['desclink'] ? item.description_link : item.description %>
        <% end -%>

      <% end -%>

    <% end -%>

<% end -%>

<% if @delicious -%>

<a href="http://<%= @delicious.title %>" alt="<%= @delicious.title %>"><%= @delicious.title %>

    <% (@sb_config['groupdate'] ? @delicious.days : [{ :container => @delicious.items }]).each do |group| -%>

      <% if @sb_config['groupdate'] -%>
      <%= group[:date].to_s.to_date.strftime("%b %d") %>
      <% end -%>
      <% for item in group[:container] %>

        <a href="<%= item.link %>" title="<%= item.title%>"><%= item.title %>
        <% if @sb_config['description'] -%>

<%= @sb_config['desclink'] ? item.description_link : item.description %>
        <% end %>

      <% end %>
    <% end -%>

<% end -%>


Add request URL to FB sharing button

Add request URL to FB sharing button

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

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

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

        <% tweet_link = "http://twitter.com/share?url=#{h(request.url)}&via=#{h(MySociety::Config.get('TWITTER_USERNAME', ''))}&text='#{h(@info_request.title)}'&related=#{_('alaveteli_foi:The software that runs {{site_name}}', :site_name => h(site_name))}" %>
        <%= link_to '', tweet_link %>
        <%= link_to _("Tweet this request"), tweet_link %>

        <iframe src="//www.facebook.com/plugins/like.php?href=<%=h(request.url)%>&send=false&layout=standard&width=200&show_faces=false&action=like&colorscheme=light&font=verdana&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:35px;" allowTransparency="true">

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

    <% view_cache :ttl => 1.day.to_i, :tag => ['similar', @info_request.id, I18n.locale] do %>
     <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>

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

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

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

        <% end %>

     <% end %>
    <% end %>

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

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

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

        <% tweet_link = "http://twitter.com/share?url=#{h(request.url)}&via=#{h(MySociety::Config.get('TWITTER_USERNAME', ''))}&text='#{h(@info_request.title)}'&related=#{_('alaveteli_foi:The software that runs {{site_name}}', :site_name => h(site_name))}" %>
        <%= link_to '', tweet_link %>
        <%= link_to _("Tweet this request"), tweet_link %>

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

    <% view_cache :ttl => 1.day.to_i, :tag => ['similar', @info_request.id, I18n.locale] do %>
     <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>

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

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

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

        <% end %>

     <% end %>
    <% end %>


git-svn-id: https://riposte.googlecode.com/svn/trunk@49 c93d8143-eb44-0410-8798-7b17b0fd9f9b

<% unless @today.empty? %>

Today's Comments

    <% @today.each do |comment| %>

        <a href="<%= comment.url %>"><%= h(comment.title) %> by
        <% if comment.author_url.empty? %>
          <%= h(comment.author) %>
        <% else %>
          <a href="<%= h(comment.author_url) %>" rel="nofollow">
            <%= h(comment.author) %>

        <% end %>
        on <%= comment.created_at(Riposte::Config::TIMESTAMP_SHORT) %>

          attached to
          <a href="<%= comment.post.url %>">
            <%= h(comment.post.title) %>

    <% end %>

<% end %>

<% unless @ancient.empty? %>

Ancient History

    <% @ancient.each do |comment| %>

        <a href="<%= comment.url %>"><%= h(comment.title) %> by
        <% if comment.author_url.empty? %>
          <%= h(comment.author) %>
        <% else %>
          <a href="<%= h(comment.author_url) %>" rel="nofollow">
            <%= h(comment.author) %>

        <% end %>
        on <%= comment.created_at(Riposte::Config::TIMESTAMP_SHORT) %>

          attached to
          <a href="<%= comment.post.url %>">
            <%= h(comment.post.title) %>

    <% end %>

<% end %>

<% if @today.empty? && @ancient.empty? %>

Recent Comments

It's been pretty quiet around here.

<% end %>


pages: No caption quick fix

pages: No caption quick fix

<%
	page_title       "Editing “" + @page.name.to_s + "”"
	page_description "Editing " + [@page.ancestors,@page].flatten.map{ |a| link_to a.name, edit_admin_page_path( :id => a, :language => @language ) }.join( " » " )
	if PagesCore.config( :localizations )
		page_description_links "In " + @available_languages.map{ |l| link_to_unless_current( Language.name_for_code( l ), hash_for_edit_admin_page_path( :id => @page, :language => l ) ) }.join( link_separator )
	end
%>

<%# #### SIDEBAR ########################################################### %>

<% sidebar do %>

About this page

		This page was last modified <%= time_ago_in_words @page.updated_at %> ago by
		<%= link_to @page.author.realname, admin_user_path( @page.author ) %>.

<% end %>

<%# #### EDIT AREA ######################################################### %>

<% form_for 'page', @page, :url => admin_page_url( :id => @page, :language => @language ), :html => { :class => :edit_page, :id => 'page-form', :method => :put, :multipart => true } do |f| %>

	<%# #### CONTENT #### %>
	<% content_tab "Content" do %>
		<%= labelled_field f.text_field( :name, :class => 'text page_title' ), "Page title",
			:errors      => @page.errors[:name],
			:description => "This is the name of the page, and it will also be the name of the link to this page."
		%>
		<%= labelled_field f.text_field( :headline, :class => 'text page_title' ), "Headline",
			:errors      => @page.errors[:headline],
			:description => "Optional, use if the headline should differ from the page name."
		%>
		<%= labelled_field f.text_area( :body, :id => 'compose-body' ), "Body",
			:errors      => @page.errors[:body]
		%>
		<%= labelled_field f.text_area( :excerpt, :rows => 5, :id => 'compose-teaser' ), "Teaser",
			:errors      => @page.errors[:excerpt]
		%>
		<%= labelled_field f.select( :status, Page.status_labels_for_options ), "Status",
			:errors      => @page.errors[:status]
		%>
	<% end %>
	<%= content_tab "Content" %>

	<%# #### PRESENTATION #### %>
	<% content_tab "Presentation" do %>
		<%= labelled_field f.select( :template, available_templates_for_select ), "Template",
			:errors      => @page.errors[:template]
		%>
		<%= labelled_field f.file_field( :image ), "Image",
			:errors      => @page.errors[:template],
			:description => "The template you have selected allows you to attach an image, which will be scaled and positioned to fit the design."
		%>
		<%= labelled_field text_field_tag('page_image_description', (@page.image.description rescue ""), :size => 48 ), "Caption" %>
		<% if @page.image %>

				<%= dynamic_image_tag @page.image, :size => '400x300', :crop => false %>

				<%= link_to "Delete image", delete_presentation_image_admin_page_path(:language => @language, :id => @page), :method => :delete, :class => :delete, :confirm => "Are you sure? There is no undo" %>

		<% end %>
		<% if @page.image && PagesCore.config( :page_image_is_linkable ) %>
			<%= labelled_field f.text_field( :image_link ), "Image link (including http://)",
				:errors      => @page.errors[:image_link]
			%>
		<% end %>
	<% end %>
	<%= content_tab "Presentation" %>

	<%# #### CATEGORIZATION #### %>
	<% content_tab "Categorization" do %>

Categories

		<% if @categories.length > 0 %>

				<% @categories.each do |category| %>
					<%= check_box_tag "category[#{category.id}]", "1", (@page.categories.include?(category) ? true : false) %><%= category.name %>

				<% end %>

		<% else %>

No categories have been added yet.

		<% end %>
		<%= labelled_field f.text_field( :tag_list, :class => 'text' ), "Tags",
			:errors      => @page.errors[:tag_list]
		%>
	<% end %>
	<%= content_tab "Categorization" %>

	<%# #### ADDITIONAL IMAGES #### %>
	<% if PagesCore.config( :page_additional_images ) %>
		<% content_tab "Additional images" do %>
			<% unless @page.images.empty? %>

						Image

						Caption

					<% @page.images.each do |image| %>

						<%= dynamic_image_tag image, :size => '100x100' %>

							<div id="image-caption-<%= image.id %>"><%= ( image.byline? ) image.byline : "No caption" %>

							<%= link_to "Delete", delete_image_admin_page_path( :id => @page, :image_id => image, :language => @language, :show_tab => 'additional images' ), :class => :delete, :confirm => 'Are you sure?' %>

<% end %>

			<% else %>

No images added yet.

			<% end %>

				Click on the caption text to edit it.

				<%= link_to_function "Add image", "Element.show('new-image');", :class => :create %>

		<% end %>
		<%= content_tab "Additional images" %>
	<% end %>

	<%# #### FILES #### %>
	<% if PagesCore.config( :page_files ) %>
		<% content_tab "Files" do %>
			<% if @page.files? %>

					<% @page.files.each do |file| %>
						<li id="file_<%= file.id %>">
							<%= image_tag 'admin/drag-handle.gif', :class => :handle, :plugin => :pages %>
							<%= file.name %> – <%= link_to file.filename, page_file_path( @language, @page, file ) %>
							(<%= link_to "Delete", admin_page_file_path( @language, @page, file ), :class => :delete, :method => :delete, :confirm => 'Are you sure? There is no undo.' %>)

					<% end %>

				<%= sortable_element 'filelist', :url => reorder_admin_page_files_path( @language, @page ), :handle => 'handle' %>
			<% else %>

No files added yet.

			<% end %>

				<%= link_to_function "Add new file", "Element.show('new-file');", :class => :create %>

		<% end %>
		<%= content_tab "Files" %>
	<% end %>

	<%# #### COMMENTS #### %>
	<% content_tab "Comments" do %>
		<%= labelled_field f.check_box( :comments_allowed ), "Comments allowed",
			:errors      => @page.errors[:comments_allowed],
			:check_box_description => "Comments are allowed on this page"
		%>
		<% if @page.comments.count > 0 %>

				<% @page.comments.each do |c| %>

							<%= c.name %>

							<% if c.email? %><%= mail_to c.email, c.email %>
<% end %>
							<% if c.url? %><%= link_to c.url, c.url %>
<% end %>

						<%= c.body %>

							<%= time_ago_in_words c.created_at %> ago

							from <%= c.remote_ip %>

							<%= link_to "Delete", delete_comment_admin_page_url( :id => @page, :comment_id => c, :language => @language ), :confirm => 'Are you sure?', :class => :delete %>

				<% end %>

		<% else %>

No comments added.

		<% end %>
	<% end %>
	<%= content_tab "Comments" %>

	<%# #### ADVANCED OPTIONS #### %>
	<% content_tab "Options" do %>
		<%= labelled_field (
				f.datetime_select( 'published_at' ) + "  by  " + f.select( 'user_id', @authors.collect { |a| [a.realname, a.id] } )
			),
			"Published",
			:errors      => @page.errors[:published_at]
		%>
		<%= labelled_field f.select( :content_order, [ ['Manually','position'], ['Newest first','published_at DESC'] ] ), "Order subpages",
			:errors      => @page.errors[:content_order]
		%>

			Options
			<%= f.check_box(:feed_enabled) %> Enable RSS feed for items below this page

			<%= f.check_box(:news_page) %> This is a news page

		<%= labelled_field f.text_area( :redirect_to, :rows => 4 ), "Redirect/Link",
			:errors      => @page.errors[:redirect_to]
		%>
	<% end %>
	<%= content_tab "Options" %>

		<%= button_to_function "Preview formatting", 'showPreview()' %>
		<%= pages_button_to "Save changes" %>

<% end %>

<%# #### UPLOAD IMAGE #### %>

Upload new image

	<% form_for 'image', @new_image, :url => add_image_admin_page_url( :id => @page, :language => @language ), :html => { :method => :post, :multipart => true } do |f| %>
		<%= labelled_field f.file_field( :imagefile ), "File",
			:errors      => @new_image.errors[:imagefile]
		%>
		<%# labelled_field f.text_field( :name, :size => 48 ), "Title",
			:errors      => @new_image.errors[:name]
		%>
		<%= labelled_field f.text_field( :byline, :size => 48 ), "Caption",
			:errors      => @new_image.errors[:byline]
		%>

			<%= submit_tag "Upload" %> or
			<%= link_to_function "Cancel", "Element.hide('new-image');", :class => :cancel %>

	<% end %>

<%# #### UPLOAD FILE #### %>
<% if PagesCore.config( :page_files ) %>

Upload new file

		<% form_for( ( @new_file = PageFile.new ), :url => admin_page_files_path( @language, @page ), :html => { :multipart => true } ) do |f| %>
			<%= labelled_field f.text_field( :name, :size => 48 ), "Name",
				:errors      => @new_file.errors[:name]
			%>
			<%= labelled_field f.text_field( :description, :size => 48 ), "Description",
				:errors      => @new_file.errors[:name]
			%>
			<%= labelled_field f.file_field( :file ), "File",
				:errors      => @new_file.errors[:file]
			%>

				<%= submit_tag "Upload" %> or <%= link_to_function "Cancel", "Element.hide('new-file');", :class => :cancel %>

		<% end %>

<% end %>

<%
	page_title       "Editing “" + @page.name.to_s + "”"
	page_description "Editing " + [@page.ancestors,@page].flatten.map{ |a| link_to a.name, edit_admin_page_path( :id => a, :language => @language ) }.join( " » " )
	if PagesCore.config( :localizations )
		page_description_links "In " + @available_languages.map{ |l| link_to_unless_current( Language.name_for_code( l ), hash_for_edit_admin_page_path( :id => @page, :language => l ) ) }.join( link_separator )
	end
%>

<%# #### SIDEBAR ########################################################### %>

<% sidebar do %>

About this page

		This page was last modified <%= time_ago_in_words @page.updated_at %> ago by
		<%= link_to @page.author.realname, admin_user_path( @page.author ) %>.

<% end %>

<%# #### EDIT AREA ######################################################### %>

<% form_for 'page', @page, :url => admin_page_url( :id => @page, :language => @language ), :html => { :class => :edit_page, :id => 'page-form', :method => :put, :multipart => true } do |f| %>

	<%# #### CONTENT #### %>
	<% content_tab "Content" do %>
		<%= labelled_field f.text_field( :name, :class => 'text page_title' ), "Page title",
			:errors      => @page.errors[:name],
			:description => "This is the name of the page, and it will also be the name of the link to this page."
		%>
		<%= labelled_field f.text_field( :headline, :class => 'text page_title' ), "Headline",
			:errors      => @page.errors[:headline],
			:description => "Optional, use if the headline should differ from the page name."
		%>
		<%= labelled_field f.text_area( :body, :id => 'compose-body' ), "Body",
			:errors      => @page.errors[:body]
		%>
		<%= labelled_field f.text_area( :excerpt, :rows => 5, :id => 'compose-teaser' ), "Teaser",
			:errors      => @page.errors[:excerpt]
		%>
		<%= labelled_field f.select( :status, Page.status_labels_for_options ), "Status",
			:errors      => @page.errors[:status]
		%>
	<% end %>
	<%= content_tab "Content" %>

	<%# #### PRESENTATION #### %>
	<% content_tab "Presentation" do %>
		<%= labelled_field f.select( :template, available_templates_for_select ), "Template",
			:errors      => @page.errors[:template]
		%>
		<%= labelled_field f.file_field( :image ), "Image",
			:errors      => @page.errors[:template],
			:description => "The template you have selected allows you to attach an image, which will be scaled and positioned to fit the design."
		%>
		<%= labelled_field text_field_tag('page_image_description', (@page.image.description rescue ""), :size => 48 ), "Caption" %>
		<% if @page.image %>

				<%= dynamic_image_tag @page.image, :size => '400x300', :crop => false %>

				<%= link_to "Delete image", delete_presentation_image_admin_page_path(:language => @language, :id => @page), :method => :delete, :class => :delete, :confirm => "Are you sure? There is no undo" %>

		<% end %>
		<% if @page.image && PagesCore.config( :page_image_is_linkable ) %>
			<%= labelled_field f.text_field( :image_link ), "Image link (including http://)",
				:errors      => @page.errors[:image_link]
			%>
		<% end %>
	<% end %>
	<%= content_tab "Presentation" %>

	<%# #### CATEGORIZATION #### %>
	<% content_tab "Categorization" do %>

Categories

		<% if @categories.length > 0 %>

				<% @categories.each do |category| %>
					<%= check_box_tag "category[#{category.id}]", "1", (@page.categories.include?(category) ? true : false) %><%= category.name %>

				<% end %>

		<% else %>

No categories have been added yet.

		<% end %>
		<%= labelled_field f.text_field( :tag_list, :class => 'text' ), "Tags",
			:errors      => @page.errors[:tag_list]
		%>
	<% end %>
	<%= content_tab "Categorization" %>

	<%# #### ADDITIONAL IMAGES #### %>
	<% if PagesCore.config( :page_additional_images ) %>
		<% content_tab "Additional images" do %>
			<% unless @page.images.empty? %>

						Image

						Caption

					<% @page.images.each do |image| %>

						<%= dynamic_image_tag image, :size => '100x100' %>

							<div id="image-caption-<%= image.id %>"><%= image.byline %>

							<%= link_to "Delete", delete_image_admin_page_path( :id => @page, :image_id => image, :language => @language, :show_tab => 'additional images' ), :class => :delete, :confirm => 'Are you sure?' %>

<% end %>

			<% else %>

No images added yet.

			<% end %>

				Click on the caption text to edit it.

				<%= link_to_function "Add image", "Element.show('new-image');", :class => :create %>

		<% end %>
		<%= content_tab "Additional images" %>
	<% end %>

	<%# #### FILES #### %>
	<% if PagesCore.config( :page_files ) %>
		<% content_tab "Files" do %>
			<% if @page.files? %>

					<% @page.files.each do |file| %>
						<li id="file_<%= file.id %>">
							<%= image_tag 'admin/drag-handle.gif', :class => :handle, :plugin => :pages %>
							<%= file.name %> – <%= link_to file.filename, page_file_path( @language, @page, file ) %>
							(<%= link_to "Delete", admin_page_file_path( @language, @page, file ), :class => :delete, :method => :delete, :confirm => 'Are you sure? There is no undo.' %>)

					<% end %>

				<%= sortable_element 'filelist', :url => reorder_admin_page_files_path( @language, @page ), :handle => 'handle' %>
			<% else %>

No files added yet.

			<% end %>

				<%= link_to_function "Add new file", "Element.show('new-file');", :class => :create %>

		<% end %>
		<%= content_tab "Files" %>
	<% end %>

	<%# #### COMMENTS #### %>
	<% content_tab "Comments" do %>
		<%= labelled_field f.check_box( :comments_allowed ), "Comments allowed",
			:errors      => @page.errors[:comments_allowed],
			:check_box_description => "Comments are allowed on this page"
		%>
		<% if @page.comments.count > 0 %>

				<% @page.comments.each do |c| %>

							<%= c.name %>

							<% if c.email? %><%= mail_to c.email, c.email %>
<% end %>
							<% if c.url? %><%= link_to c.url, c.url %>
<% end %>

						<%= c.body %>

							<%= time_ago_in_words c.created_at %> ago

							from <%= c.remote_ip %>

							<%= link_to "Delete", delete_comment_admin_page_url( :id => @page, :comment_id => c, :language => @language ), :confirm => 'Are you sure?', :class => :delete %>

				<% end %>

		<% else %>

No comments added.

		<% end %>
	<% end %>
	<%= content_tab "Comments" %>

	<%# #### ADVANCED OPTIONS #### %>
	<% content_tab "Options" do %>
		<%= labelled_field (
				f.datetime_select( 'published_at' ) + "  by  " + f.select( 'user_id', @authors.collect { |a| [a.realname, a.id] } )
			),
			"Published",
			:errors      => @page.errors[:published_at]
		%>
		<%= labelled_field f.select( :content_order, [ ['Manually','position'], ['Newest first','published_at DESC'] ] ), "Order subpages",
			:errors      => @page.errors[:content_order]
		%>

			Options
			<%= f.check_box(:feed_enabled) %> Enable RSS feed for items below this page

			<%= f.check_box(:news_page) %> This is a news page

		<%= labelled_field f.text_area( :redirect_to, :rows => 4 ), "Redirect/Link",
			:errors      => @page.errors[:redirect_to]
		%>
	<% end %>
	<%= content_tab "Options" %>

		<%= button_to_function "Preview formatting", 'showPreview()' %>
		<%= pages_button_to "Save changes" %>

<% end %>

<%# #### UPLOAD IMAGE #### %>

Upload new image

	<% form_for 'image', @new_image, :url => add_image_admin_page_url( :id => @page, :language => @language ), :html => { :method => :post, :multipart => true } do |f| %>
		<%= labelled_field f.file_field( :imagefile ), "File",
			:errors      => @new_image.errors[:imagefile]
		%>
		<%# labelled_field f.text_field( :name, :size => 48 ), "Title",
			:errors      => @new_image.errors[:name]
		%>
		<%= labelled_field f.text_field( :byline, :size => 48 ), "Caption",
			:errors      => @new_image.errors[:byline]
		%>

			<%= submit_tag "Upload" %> or
			<%= link_to_function "Cancel", "Element.hide('new-image');", :class => :cancel %>

	<% end %>

<%# #### UPLOAD FILE #### %>
<% if PagesCore.config( :page_files ) %>

Upload new file

		<% form_for( ( @new_file = PageFile.new ), :url => admin_page_files_path( @language, @page ), :html => { :multipart => true } ) do |f| %>
			<%= labelled_field f.text_field( :name, :size => 48 ), "Name",
				:errors      => @new_file.errors[:name]
			%>
			<%= labelled_field f.text_field( :description, :size => 48 ), "Description",
				:errors      => @new_file.errors[:name]
			%>
			<%= labelled_field f.file_field( :file ), "File",
				:errors      => @new_file.errors[:file]
			%>

				<%= submit_tag "Upload" %> or <%= link_to_function "Cancel", "Element.hide('new-file');", :class => :cancel %>

		<% end %>

<% end %>


Add missing </p>

Add missing </p>

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

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

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

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

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

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

     <% if @info_request.attention_requested %>

<%= ('The site administrators have reviewed this request and consider it to be suitable for the website.') %>

     <% else %>

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

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

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

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

     <% tweet_link = "http://twitter.com/share?url=#{h(request.url)}&via=#{h(MySociety::Config.get('TWITTER_USERNAME', ''))}&text='#{h(@info_request.title)}'&related=#{_('alaveteli_foi:The software that runs {{site_name}}', :site_name => h(site_name))}" %>
        <%= link_to '', tweet_link %>
        <%= link_to _("Tweet this request"), tweet_link %>

        <%= link_to '', "http://wordpress.com/"%>
        <%= link_to _("Start your own blog"), "http://wordpress.com/"%>

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

    <% view_cache :ttl => 1.day.to_i, :tag => ['similar', @info_request.id, I18n.locale] do %>
     <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>

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

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

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

        <% end %>

     <% end %>
    <% end %>

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

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


replaced hardcoded / with Configuration.default_page in the header

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

      <%= link_to 'Documentation', document_path %>

    <%= link_to image_tag("cruise_logo.png"), Configuration.default_page %>

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

<%= h flash[:notice] %>

  <% end -%>

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

      <%= link_to 'Documentation', document_path %>

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

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

<%= h flash[:notice] %>

  <% end -%>


Fix use of tinymce on enterprise homepage

<%= render :file => 'shared/tiny_mce' %>

<%= labelled_form_field(_('Text'), text_area(:article, 'body', :cols => 40, :style => 'width:99%', :class => 'mceEditor')) %>

<%= render :file => 'shared/tiny_mce' %>

<%= labelled_form_field(_('Text'), text_area(:article, 'body', :cols => 40, :style => 'width:99%')) %>


WDTK-77 Make it clear the initial request is always free and you have to agree to charges so we don't put people off

<% @title = "Making requests" %>

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

<%= @title %> #

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

It can be hard to untangle government's complicated structured, and work out
who knows the information that you want. Here are a few tips:

Browse or search <%= site_name %> looking for similar requests to yours.

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

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

Don't worry excessively about getting the right authority. If you get it
wrong, they will transfer your request to the correct authority for you.

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

Who can make a request? #

Any person, of any nationality, anywhere in the world, however young or old can make a request under Federal Australian Freedom of Information (FOI) law.

The Freedom of Information Act simply says that "every person has a legally enforceable right to obtain access in accordance with this Act". A "person" can also be a body corporate, such as a company.

See the Attorney General's department FOI Guidelines – Fundamental principles and procedures - section 3.2 for more.

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

At the moment we aim to cover all Australian Federal public authorities. We plan to add State and Local Government authorities soon.

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 (new state or local government region etc.) of public authority to the site, we'd love
to hear from you too.

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

<%= site_name %> lets you make requests for information to a range of
organisations:

 Those formally subject to the FOI Act

 Those which choose to voluntarily comply with the FOI Act

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

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

Why must I keep my request focused?#

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

arguments about your cause

statements that could defame or insult others

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

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

Does it cost me anything to make a request?#

  Making an FOI request is always free. A public body may choose to impose
  certain charges to provide the information but they can only charge you if
  you have specifically agreed in advance to pay.

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

The latest version of the FOI Act (s 3(4)) makes it clear that

… functions and powers given by this Act are to be performed and exercised, as far as possible, to facilitate and promote public access to information, promptly and at the lowest reasonable cost.

Sometimes an authority will refuse your request, saying that the cost
of handling it exceeds a level that would detriment their day to day work. At this point you can refine your
request. e.g. it would be much cheaper for an authority to tell you the amount
spent on marshmallows in the past year than in the past ten years.

How quickly will I get a response? #

  By law, the public authority must keep you informed about the progress of your FOI request.

  Within 14 days after they receive your request they must give you
  written acknowledgement and within 30 days they
  must provide you with either the documents you have asked for or a written
  decision on your request.

  For various reasons,
  this timeframe can be extended.

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

What if I never get a response?#

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

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

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

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

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

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

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

Authorities often add legal boilerplate about the
Commonwealth Copyright Adminstration, which at first glance implies you may not
be able do anything with the information. This is likely to be incorrect as the latest Statement of IP Principles for Australian Government Agencies explictly encourages reuse.

Consistent with the need for free and open re-use and adaptation, public sector
information should be licensed by agencies under the Creative Commons BY standard
as the default.

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

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

Have a look at the
Freedom of Information guidelines
pages on the Information Commissioner's website.

Can I request information about myself? #

No. Requests made using <%= site_name %> are public, made under the Freedom of
Information Act, and cannot help you find information about a private
individual.

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

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

<%= site_name %> 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.

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

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

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

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

How do you moderate request annotations? #

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

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

Next, read about your privacy -->

<% @title = "Making requests" %>

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

<%= @title %> #

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

It can be hard to untangle government's complicated structured, and work out
who knows the information that you want. Here are a few tips:

Browse or search <%= site_name %> looking for similar requests to yours.

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

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

Don't worry excessively about getting the right authority. If you get it
wrong, they will transfer your request to the correct authority for you.

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

Who can make a request? #

Any person, of any nationality, anywhere in the world, however young or old can make a request under Federal Australian Freedom of Information (FOI) law.

The Freedom of Information Act simply says that "every person has a legally enforceable right to obtain access in accordance with this Act". A "person" can also be a body corporate, such as a company.

See the Attorney General's department FOI Guidelines – Fundamental principles and procedures - section 3.2 for more.

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

At the moment we aim to cover all Australian Federal public authorities. We plan to add State and Local Government authorities soon.

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 (new state or local government region etc.) of public authority to the site, we'd love
to hear from you too.

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

<%= site_name %> lets you make requests for information to a range of
organisations:

 Those formally subject to the FOI Act

 Those which choose to voluntarily comply with the FOI Act

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

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

Why must I keep my request focused?#

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

arguments about your cause

statements that could defame or insult others

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

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

Does it cost me anything to make a request?#

Making an FOI request is nearly always free.

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

The latest version of the FOI Act (s 3(4)) makes it clear that

… functions and powers given by this Act are to be performed and exercised, as far as possible, to facilitate and promote public access to information, promptly and at the lowest reasonable cost.

Sometimes an authority will refuse your request, saying that the cost
of handling it exceeds a level that would detriment their day to day work. At this point you can refine your
request. e.g. it would be much cheaper for an authority to tell you the amount
spent on marshmallows in the past year than in the past ten years.

How quickly will I get a response? #

  By law, the public authority must keep you informed about the progress of your FOI request.

  Within 14 days after they receive your request they must give you
  written acknowledgement and within 30 days they
  must provide you with either the documents you have asked for or a written
  decision on your request.

  For various reasons,
  this timeframe can be extended.

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

What if I never get a response?#

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

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

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

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

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

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

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

Authorities often add legal boilerplate about the
Commonwealth Copyright Adminstration, which at first glance implies you may not
be able do anything with the information. This is likely to be incorrect as the latest Statement of IP Principles for Australian Government Agencies explictly encourages reuse.

Consistent with the need for free and open re-use and adaptation, public sector
information should be licensed by agencies under the Creative Commons BY standard
as the default.

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

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

Have a look at the
Freedom of Information guidelines
pages on the Information Commissioner's website.

Can I request information about myself? #

No. Requests made using <%= site_name %> are public, made under the Freedom of
Information Act, and cannot help you find information about a private
individual.

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

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

<%= site_name %> 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.

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

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

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

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

How do you moderate request annotations? #

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

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

Next, read about your privacy -->


Don't disable task type radio buttons for new tasks

<%= 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 => "nolabel" %>
        <%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %>
<%=_ 'Send notification emails' %>

	<% else %>
        <%= submit_tag _("Save"), :class => "nolabel" %> <%=_ 'and' %>

        <%
 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 %>

<%= 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

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

             selected_project = @project.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

%>

       <%= owner_string %>

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

      </fieldset>

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

        <% disabled = (perms['prioritize'].nil? || @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']  %>

      <% 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]", "1h" %>
<% 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_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="<%=_("Enter task numbers, separated by commas. Type text to search.")%>" 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| %>

        <div id="dep_<%=d.id%>" style="clear:both;">

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

        <% if perms['prioritize'].empty? %>

<a href="#" onclick="javascript:new Element.remove('dep_<%=d.id%>'); false;" ><img src="/images/delete.png" border="0" title="<%=_ 'Remove dependency'%>" class="tooltip">

        <% end %>
        <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%>" style="clear:both;">

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

        <% end %>

      </fieldset>

<% end %>

      <fieldset id="task_notify" style="padding-right:0;">
        <legend><%=_ 'Notification' %></legend>
        <%= _"Name / Email" %><input type="text" size="12" name="watchers[]" id="notification-input">

      </fieldset>

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

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

        <% 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 => "nolabel" %>
        <%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %>
<%=_ 'Send notification emails' %>

	<% else %>
        <%= submit_tag _("Save"), :class => "nolabel" %> <%=_ 'and' %>

        <%
 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 %>

<%= 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

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

             selected_project = @project.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

%>

       <%= owner_string %>

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

      </fieldset>

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

        <% disabled = perms['prioritize'].nil? ? "" : "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']  %>

      <% 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]", "1h" %>
<% 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_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="<%=_("Enter task numbers, separated by commas. Type text to search.")%>" 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| %>

        <div id="dep_<%=d.id%>" style="clear:both;">

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

        <% if perms['prioritize'].empty? %>

<a href="#" onclick="javascript:new Element.remove('dep_<%=d.id%>'); false;" ><img src="/images/delete.png" border="0" title="<%=_ 'Remove dependency'%>" class="tooltip">

        <% end %>
        <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%>" style="clear:both;">

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

        <% end %>

      </fieldset>

<% end %>

      <fieldset id="task_notify" style="padding-right:0;">
        <legend><%=_ 'Notification' %></legend>
        <%= _"Name / Email" %><input type="text" size="12" name="watchers[]" id="notification-input">

      </fieldset>

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

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

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


some usability improvements

some usability improvements

<!DOCTYPE html>

    <meta charset="utf-8" />
    <%= csrf_meta_tag %>
    <title>Walkrr</title>
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" rel="stylesheet" />
    <%= stylesheet_link_tag 'application' %>

    <%= javascript_include_tag :all, :cache => true %>

        <%= button_to_function "new", "walk.pathEditor.newPath();"%>
        <%= button_to_function "delete", "walk.pathEditor.deletePath();" %>
        <%= button_to_function "clear", "walk.pathEditor.deleteAll();" %>
        <%= button_to_function "elevation", "walk.requestElevation();" %>
        <%= form_tag({:action => "import"}, {:id => "import_form", :multipart => true, :target => "import_frame", :style => "display: inline;"}) do %>
          <%= file_field_tag "file" %>
          <%= button_to_function "import", "walk.importFile();"%>
        <% end %>
        Now editing...0m

search

create

        <%= form_tag({:action => 'search'}, {:id => 'search_form', :remote => true, :method => 'GET'}) do  %>
          <%= hidden_field_tag "latitude" %>
          <%= hidden_field_tag "longitude" %>
          <%= hidden_field_tag "radius" %>
          <%= hidden_field_tag "areas" %>
          <%= hidden_field_tag 'search_path' %>

            <%= radio_button_tag :condition, "neighbor"%>neighbor
            <%= radio_button_tag :condition, "areas"%>areas
            <%= radio_button_tag :condition, "cross"%>cross
            <%= radio_button_tag :condition, "all", "checked"%>all

    <%#

            areas
            <%= select_tag "areas", options_for_select(@areas), {:multiple => true, :size =>5, :name => 'areas[]'} >

 %>

            date
            <%= select_tag "year",
              options_for_select(@year_opts)%> /
            <%= select_tag "month",
              options_for_select(@month_opts)%>

            order
            <%= select_tag "order",
              options_for_select([["new first","date desc"], ["old first","date"],
                ["long first","length desc"], ["short first","length"],
                ["east first","xmax(PATH) desc"], ["west first","xmin(PATH)"],
                ["south first","ymin(PATH)"],["north first","ymax(PATH) desc"]])%>

            per page<%= text_field_tag "per_page","20" %>

          <%= submit_tag "search", :disable_with => "searching" %>
          <%= button_to_function 'reset', 'walk.resetSearch()' %>
        <% end %>
        <%= form_tag({:action => 'create'}, {:id => 'create_form', :remote => true }) do  %>

date
          <%= text_field_tag 'date' %>

            start
            <%= text_field_tag 'start'  %>

            end
            <%= text_field_tag 'end'  %>

          <%= hidden_field_tag 'create_path'  %>
          <%= submit_tag "create", :disable_with => "creating" %>
        <% end %>

      <%= form_tag("", {:id => "results_form"}) do %>

          <%= button_to_function "check all", "$('input[name=id[]]').attr('checked', true);", {}%>
          <%= button_to_function "reset", "$('input[name=id[]]').attr('checked', false);", {}%>
          <%= submit_tag "show", {:onclick => "$('#results_form').attr('action', '#{url_for(:action => :show)}');$('#results_form').attr('data-remote', true);"} %>
          <%= submit_tag "export", {:onclick => "$('#results_form').attr('action', '#{url_for(:action => :export_file)}');$('#results_form').removeAttr('data-remote');"} %>
          <%= submit_tag "delete", {:confirm => "Are you sure to delete?", :onclick => "$('#results_form').attr('action', '#{url_for(:action => :destroy)}');$('#results_form').attr('data-remote', true);"} %>

      <% end %>

<!DOCTYPE html>

    <meta charset="utf-8" />
    <%= csrf_meta_tag %>
    <title>Walkrr</title>
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" rel="stylesheet" />
    <%= stylesheet_link_tag 'application' %>

    <%= javascript_include_tag :all, :cache => true %>

        <%= button_to_function "new", "walk.pathEditor.newPath();" , {}, {:class => "button"}%>
        <%= button_to_function "delete", "walk.pathEditor.deletePath();", {}, {:class => "button"}%>
        <%= button_to_function "clear", "walk.pathEditor.deleteAll();", {}, {:class => "button"}%>
        <%= button_to_function "elevation", "walk.requestElevation();", {}, {:class => "button"}%>
        <%= form_tag({:action => "import"}, {:id => "import_form", :multipart => true, :target => "import_frame", :style => "display: inline;"}) do %>
          <%= file_field_tag "file" %>
          <%= button_to_function "import", "walk.importFile();", {}, {:class => "button"}%>
        <% end %>
        Now editing...0m

search

create

        <%= form_tag({:action => 'search'}, {:id => 'search_form', :remote => true, :method => 'GET'}) do  %>
          <%= hidden_field_tag "latitude" %>
          <%= hidden_field_tag "longitude" %>
          <%= hidden_field_tag "radius" %>
          <%= hidden_field_tag "areas" %>
          <%= hidden_field_tag 'search_path' %>

            <%= radio_button_tag :condition, "neighbor"%>neighbor
            <%= radio_button_tag :condition, "areas"%>areas
            <%= radio_button_tag :condition, "cross"%>cross
            <%= radio_button_tag :condition, "all", "checked"%>all

    <%#

            areas
            <%= select_tag "areas", options_for_select(@areas), {:multiple => true, :size =>5, :name => 'areas[]'} >

 %>

            date
            <%= select_tag "year",
              options_for_select(@year_opts)%> /
            <%= select_tag "month",
              options_for_select(@month_opts)%>

            order
            <%= select_tag "order",
              options_for_select([["new first","date desc"], ["old first","date"],
                ["long first","length desc"], ["short first","length"],
                ["east first","xmax(PATH) desc"], ["west first","xmin(PATH)"],
                ["south first","ymin(PATH)"],["north first","ymax(PATH) desc"]])%>

            per page<%= text_field_tag "per_page","20" %>

          <%= submit_tag "search", :disable_with => "searching" %>
          <%= button_to_function 'reset', 'walk.resetSearch()' %>
        <% end %>
        <%= form_tag({:action => 'create'}, {:id => 'create_form', :remote => true }) do  %>

date
          <%= text_field_tag 'date' %>

            start
            <%= text_field_tag 'start'  %>

            end
            <%= text_field_tag 'end'  %>

          <%= hidden_field_tag 'create_path'  %>
          <%= submit_tag "create", :disable_with => "creating" %>
        <% end %>

      <%= form_tag("", {:id => "results_form"}) do %>

          <%= button_to_function "check all", "$('input[name=id[]]').attr('checked', true);", {}%>
          <%= button_to_function "reset", "$('input[name=id[]]').attr('checked', false);", {}%>
          <%= submit_tag "show", {:onclick => "$('#results_form').attr('action', '#{url_for(:action => :show)}');$('#results_form').attr('data-remote', true);"} %>
          <%= submit_tag "export", {:onclick => "$('#results_form').attr('action', '#{url_for(:action => :export_file)}');$('#results_form').removeAttr('data-remote');"} %>
          <%= submit_tag "delete", {:confirm => "Are you sure to delete?", :onclick => "$('#results_form').attr('action', '#{url_for(:action => :destroy)}');$('#results_form').attr('data-remote', true);"} %>

      <% end %>


proposed treatment has a link that takes it to the detailed show page for that treatment

Showing Medical Problem

Bat: <%=h @medical_problem.bat.band %>

Title: <%=h @medical_problem.title %>

Description: <%=h @medical_problem.description %>

Date Opened: <%=h nice_date @medical_problem.date_opened %>

User Assigned: <%=h @medical_problem.user ? @medical_problem.user.name : 'General Medical Care' %>

Date Closed: <%=h nice_date @medical_problem.date_closed %>

  <% for proposed_treatment in @medical_problem.proposed_treatments %>

      Proposed Treatment: <%= link_to proposed_treatment.treatment , :controller => 'proposed_treatments', :action => 'show', :id => proposed_treatment %>

      Treatment Start Date: <%=h nice_date proposed_treatment.date_started %>

      Suggested Treatment Finish Date: <%=h nice_date proposed_treatment.date_finished %>

      Ended Treatment: <%=h nice_date proposed_treatment.date_closed %>

  <% end %>

<%= link_to 'Edit', :action => 'edit', :id => @medical_problem %> |
<%= link_to 'List Current Medical Problems', :action => 'list_current' %>

Showing Medical Problem

Bat: <%=h @medical_problem.bat.band %>

Title: <%=h @medical_problem.title %>

Description: <%=h @medical_problem.description %>

Date Opened: <%=h nice_date @medical_problem.date_opened %>

User Assigned: <%=h @medical_problem.user ? @medical_problem.user.name : 'General Medical Care' %>

Date Closed: <%=h nice_date @medical_problem.date_closed %>

  <% for proposed_treatment in @medical_problem.proposed_treatments %>

      Proposed Treatment: <%=h proposed_treatment.treatment %>

      Treatment Start Date: <%=h nice_date proposed_treatment.date_started %>

      Suggested Treatment Finish Date: <%=h nice_date proposed_treatment.date_finished %>

      Ended Treatment: <%=h nice_date proposed_treatment.date_closed %>

  <% end %>

<%= link_to 'Edit', :action => 'edit', :id => @medical_problem %> |
<%= link_to 'List Current Medical Problems', :action => 'list_current' %>