testing out a fix for ie js tooltip problem

git-svn-id: 295275ead0c997ff8920a9abe88dec0903829be9@531 9c008b19-a030-0410-9975-d76d301b4276

<%=
calendar({:year => @date.year, :month => @date.month}) do |d|
  cell_text = "#{d.mday}"
  cell_attrs = { :class => 'day ' }
  cell_attrs[:class] += 'todayDay ' if (d.to_date == TzTime.now.to_date)
  @events.each do |e|
    if e.date.to_date == d
      cell_text = "#{ link_to d.mday, events_path, :id => 'cal-' + d.to_date.to_s, :title => escape_single_quotes(e.title) }"
      cell_attrs[:class] += 'specialDay '
    end
  end
  [cell_text, cell_attrs]
end
%>

<script type="text/javascript">
Event.observe(window,"load",function() {
       $$("*").findAll(function(node){
         return node.getAttribute('title');
       }).each(function(node){
         new Tooltip(node,node.title);
         node.removeAttribute("title");
       });
     });
</script>

<%=
calendar({:year => @date.year, :month => @date.month}) do |d|
  cell_text = "#{d.mday}"
  cell_attrs = { :class => 'day ' }
  cell_attrs[:class] += 'todayDay ' if (d.to_date == TzTime.now.to_date)
  @events.each do |e|
    if e.date.to_date == d
      cell_text = "#{ link_to d.mday, events_path, :id => 'cal-' + d.to_date.to_s }"
      cell_attrs[:class] += 'specialDay '
    end
  end
  [cell_text, cell_attrs]
end
%>

<script type="text/javascript">
<% @events.each do |e| %>
  <%= "var my_tooltip = new Tooltip('#{'cal-' + e.date.to_date.to_s }', '#{escape_single_quotes(e.title)}')" %>
<% end %>
</script>


[ClockingIT @ Group timeline project filtering by client]

              <%=_ 'Timeline' %>

            <%
            @clients = Customer.find(:all, :conditions => ["company_id = ?", session[:user].company_id], :order => "name").collect{ |c| [c.name, c.id.to_s]}
            @projects = User.find(session[:user].id).projects.find(:all, :conditions => ["completed_at IS NULL"]).collect {|p| [p.name, p.id.to_s]}
            @users = User.find(:all, :order => "name", :conditions => ["company_id = ?", session[:user].company_id]).collect {|c| [ c.name, c.id.to_s ] }

            filter_count = 0
            %>
            <%= start_form_tag( :controller => 'timeline', :action => 'list' ) %>

            <select name="filter_date" id="filter_date" onchange="javascript:document.forms[1].submit();">
                <% @dates =  [[_("[All Time]"), "0"], [_("This Week"),"1"], [_("Last Week"),"2"],[_("This Month"),"3"],[_("Last Month"),"4"],[_("This Year"),"5"],[_("Last Year"),"6"]] %>
                <%= options_for_select @dates, params[:filter_date] %>
            </select>

            <% if @projects.size > 1 %>
            <select name="filter_project" id="filter_project" onchange="javascript:document.forms[1].submit();">
              <option value="0" class="select_default"><%= _("[Any Project]") %></option>
              <% @clients = Customer.find(:all, :conditions => ["company_id = ?", session[:user].company_id], :order => "name") %>
              <% @clients.each do |c| %>
              <% @client_projects = User.find(session[:user].id).projects.find(:all, :conditions => ["customer_id = #{c.id} AND completed_at IS NULL"], :order => "name" ) %>
              <% if @client_projects.size > 0 %>
              <option value="" disabled="disabled" class="select_heading"><%= c.name %></option>
              <% @client_projects.each do |p| %>
              <option value="<%=p.id%>" class="select_item"<%= " selected" if p.id == params[:filter_project] %>><%= p.name %></option>
              <% end %>
              <% end %>

              <% end %>

            </select>
            <% end %>

            <% if @users.size > 1 %>
            <select name="filter_user" id="filter_user" onchange="javascript:document.forms[1].submit();">
              <% @users = [[_("[Any User]"), "0"]] + @users %>
              <%= options_for_select @users, params[:filter_user] %>
            </select>
            <% end %>

            <select name="filter_status" id="filter_status" onchange="javascript:document.forms[1].submit();">
              <%
                 @status = [[_("[Any Type]"), "-1"],
                            [_("Closed"), WorkLog::TASK_COMPLETED.to_s],
                            [_("Work Log"), WorkLog::TASK_WORK_ADDED.to_s],
                            [_("Status Change"), WorkLog::TASK_REVERTED.to_s],
                            [_("Created"), WorkLog::TASK_CREATED.to_s],
                            [_("Comment"), WorkLog::TASK_COMMENT.to_s],
                            [_("Modified"), WorkLog::TASK_MODIFIED.to_s]
                           ]

              %>
              <%= options_for_select @status, params[:filter_status] %>
            </select>

            <%= end_form_tag %>

              <% offset = "#{@logs.size}" if @offset == 0
                 offset = "#{@offset + 1} - #{@offset + 100}" if @offset > 0
                 offset = "#{@offset + 1} - #{@count}" if (@offset + 100 > @count && @count > 0)
              %>

              <%= link_to(_('[Prev]'), { :action => 'list', :page => params[:page].to_i - 1, :filter_status => params[:filter_status], :filter_user => params[:filter_user],
                          :filter_project => params[:filter_project], :filter_date => params[:filter_date] }) if (@offset > 0) %>
              <%= offset %> <%=_ 'of' %> <%= @count %> <%=_ 'entries..' %>
              <%= link_to('[Next]', { :action => 'list', :page => params[:page].to_i + 1, :filter_status => params[:filter_status], :filter_user => params[:filter_user],
                          :filter_project => params[:filter_project], :filter_date => params[:filter_date]}) if (@offset+100 < @count) %>

                <%
            day = 0
            for log in @logs
              if day != tz.utc_to_local(log.started_at).day
                day = tz.utc_to_local(log.started_at).day
                %>

                <%= tz.utc_to_local(log.started_at).strftime("%A, %d %B %Y") %>

            <% end %>
            <%= render_partial 'activities/log_row', { :log => log } %>
          <% end %>

              <%=_ 'Timeline' %>

            <%
            @clients = Customer.find(:all, :conditions => ["company_id = ?", session[:user].company_id], :order => "name").collect{ |c| [c.name, c.id.to_s]}
            @projects = User.find(session[:user].id).projects.find(:all, :conditions => ["completed_at IS NULL"]).collect {|p| [p.name, p.id.to_s]}
            @users = User.find(:all, :order => "name", :conditions => ["company_id = ?", session[:user].company_id]).collect {|c| [ c.name, c.id.to_s ] }

            filter_count = 0
            %>
            <%= start_form_tag( :controller => 'timeline', :action => 'list' ) %>

            <select name="filter_date" id="filter_date" onchange="javascript:document.forms[1].submit();">
                <% @dates =  [[_("[All Time]"), "0"], [_("This Week"),"1"], [_("Last Week"),"2"],[_("This Month"),"3"],[_("Last Month"),"4"],[_("This Year"),"5"],[_("Last Year"),"6"]] %>
                <%= options_for_select @dates, params[:filter_date] %>
            </select>

            <% if @projects.size > 1 %>
            <select name="filter_project" id="filter_project" onchange="javascript:document.forms[1].submit();">
              <% @projects = [[_("[Any Project]"), "0"]] + @projects  %>
              <%= options_for_select @projects, params[:filter_project] %>
            </select>
            <% end %>

            <% if @users.size > 1 %>
            <select name="filter_user" id="filter_user" onchange="javascript:document.forms[1].submit();">
              <% @users = [[_("[Any User]"), "0"]] + @users %>
              <%= options_for_select @users, params[:filter_user] %>
            </select>
            <% end %>

            <select name="filter_status" id="filter_status" onchange="javascript:document.forms[1].submit();">
              <%
                 @status = [[_("[Any Type]"), "-1"],
                            [_("Closed"), WorkLog::TASK_COMPLETED.to_s],
                            [_("Work Log"), WorkLog::TASK_WORK_ADDED.to_s],
                            [_("Status Change"), WorkLog::TASK_REVERTED.to_s],
                            [_("Created"), WorkLog::TASK_CREATED.to_s],
                            [_("Comment"), WorkLog::TASK_COMMENT.to_s],
                            [_("Modified"), WorkLog::TASK_MODIFIED.to_s]
                           ]

              %>
              <%= options_for_select @status, params[:filter_status] %>
            </select>

            <%= end_form_tag %>

              <% offset = "#{@logs.size}" if @offset == 0
                 offset = "#{@offset + 1} - #{@offset + 100}" if @offset > 0
                 offset = "#{@offset + 1} - #{@count}" if (@offset + 100 > @count && @count > 0)
              %>

              <%= link_to(_('[Prev]'), { :action => 'list', :page => params[:page].to_i - 1, :filter_status => params[:filter_status], :filter_user => params[:filter_user],
                          :filter_project => params[:filter_project], :filter_date => params[:filter_date] }) if (@offset > 0) %>
              <%= offset %> <%=_ 'of' %> <%= @count %> <%=_ 'entries..' %>
              <%= link_to('[Next]', { :action => 'list', :page => params[:page].to_i + 1, :filter_status => params[:filter_status], :filter_user => params[:filter_user],
                          :filter_project => params[:filter_project], :filter_date => params[:filter_date]}) if (@offset+100 < @count) %>

                <%
            day = 0
            for log in @logs
              if day != tz.utc_to_local(log.started_at).day
                day = tz.utc_to_local(log.started_at).day
                %>

                <%= tz.utc_to_local(log.started_at).strftime("%A, %d %B %Y") %>

            <% end %>
            <%= render_partial 'activities/log_row', { :log => log } %>
          <% end %>


Reduce messages for /bodies searches (ones from front page where you are finding body) in the case where you are on the second page,

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

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

<%=@title%>

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

<% if @bodies && (@page == 1 || @xapian_bodies.results.size > 0) %>

Next, select the public authority you'd like to make the request from.

Can't find it?  <%= link_to "Browse all", list_public_bodies_default %> or
            ask us to add it.

<% end %>

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

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

<% end %>

<% if !@query.nil? %>

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

<% end %>

<% if @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %>

No public authorities found

    <% if @spelling_correction %>

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

    <% end %>

<%=link_to "Browse all", list_public_bodies_default %> or ask us to add one.

<% end %>

<% if @total_hits == 0 %>

<%=@title %>

<% end %>

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

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

    <% end %>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<% if @show_tips %>

Search tips

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

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

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

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

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

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

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

commented_by:tony_bowden to search annotations made by <%= link_to "Tony Bowden", show_user_url(:url_name => 'tony_bowden') %>, typing the name as in the URL.

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

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

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

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

status:waiting_response	 Waiting for the public authority to reply

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

status:rejected	 The request was rejected by the public authority

status:partially_successful	 Some of the information requested has been received

status:successful	 All of the information requested has been received

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

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

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

<% end %>

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

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

<%=@title%>

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

<% if @bodies %>

Next, select the public authority you'd like to make the request from.

Can't find it?  <%= link_to "Browse all", list_public_bodies_default %> or
            ask us to add it.

<% end %>

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

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

<% end %>

<% if not @query.nil? %>

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

<% end %>

<% if @bodies && !@query.nil? && @xapian_bodies.results.size == 0 %>

No public authorities found

    <% if @spelling_correction %>

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

    <% end %>

<%=link_to "Browse all", list_public_bodies_default %> or ask us to add one.

<% end %>

<% if @total_hits == 0 %>

<%=@title %>

<% end %>

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

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

    <% end %>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<% if @show_tips %>

Search tips

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

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

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

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

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

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

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

commented_by:tony_bowden to search annotations made by <%= link_to "Tony Bowden", show_user_url(:url_name => 'tony_bowden') %>, typing the name as in the URL.

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

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

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

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

status:waiting_response	 Waiting for the public authority to reply

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

status:rejected	 The request was rejected by the public authority

status:partially_successful	 Some of the information requested has been received

status:successful	 All of the information requested has been received

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

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

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

<% end %>


Show some text for the profile link if there isn't any

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

<% if @site_template -%>

<% else -%>

<% end -%>

  <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
  <%= stylesheet_link_tag "thickbox" %>
  <%= stylesheet_link_tag "jquery-ui" %>
  <%= stylesheet_link_tag 'global.css' %>
  <%= javascript_include_tag "jquery", "thickbox", "jquery-ui" %>
  <%= javascript_include_tag "application" %>
  <% if @rss_url %>
    <link rel="alternate" title="RSS Feed" href="<%=@rss_url%>" type="application/rss+xml"/>
  <% end %>

  <% if not @site_template.themeroller_css.blank? -%>
    <%= stylesheet_link_tag "#{site_template_url(@site_template)}/themeroller.css" %>
  <% else -%>
    <%= stylesheet_link_tag 'themeroller-default.css' %>
  <% end -%>
  <% if not @site_template.css.blank? -%>

  <% end -%>
  <title><%= page_title %></title>

<% if not @site_template.header.blank? -%>
  <%= @site_template.header %>
<% end -%>

<% if not @hide_chrome -%>

<%= page_title %>

          <% if @context and @context.parent -%>

Part of
              <%= link_to @context.parent.fullname, :controller => params[:controller], :context => @context.parent.id %>

          <% end -%>

<%= link_to "Home", :controller => :main, :action => :index %>

<%= link_to "My Events", :controller => :agenda, :action => :index %>

            <% if @context and @context.schedules.count(:conditions => ["published = ?", true]) == 1 -%>

<%= link_to "Event Schedule", schedule_path(@context.schedules[0]) %>

            <% elsif @context and @context.schedules.count(:conditions => ["published = ?", true]) > 1 -%>

<%= link_to "Event Schedules", schedules_path %>

            <% end -%>
            <% if can?(:edit, @context) -%>

Administration »

		  «

<%= link_to "Events", events_path %>

  		    <% if @context -%>

<%= link_to "Attendees", :controller => "agenda", :action => "attendees" %>

		    <% end -%>

<%= link_to "Locations", locations_path %>

<%= link_to "Site Templates", site_templates_path %>

<%= link_to "Schedules", schedules_path %>

					<% if person_signed_in? && current_person.admin? -%>

<%= link_to "Virtual Sites", virtual_sites_path %>

					<% end -%>

            <% end -%>

          	<% if person_signed_in? -%>
		        <%= link_to (current_person.name.presence || "My profile"), profile_path %>
		        |
		        <%= link_to "Log out", destroy_person_session_path %>
			<% else -%>

Log in

				<%= link_to "Click here to log into this site.", new_person_session_path %>
			<% end -%>

<% end -%>

<% if flash[:alert].present? -%>

	<%=h flash[:alert] %>

<% end -%>

<% if flash[:error_messages].present? -%>

There were some errors processing your request:

      <% flash[:error_messages].each do |msg| -%>

<%= msg%>

      <% end -%>

<% end -%>

  <%= @content_for_layout %>

<% if not @site_template.footer.blank? -%>
  <%= @site_template.footer %>
<% end -%>

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

<% if @site_template -%>

<% else -%>

<% end -%>

  <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
  <%= stylesheet_link_tag "thickbox" %>
  <%= stylesheet_link_tag "jquery-ui" %>
  <%= stylesheet_link_tag 'global.css' %>
  <%= javascript_include_tag "jquery", "thickbox", "jquery-ui" %>
  <%= javascript_include_tag "application" %>
  <% if @rss_url %>
    <link rel="alternate" title="RSS Feed" href="<%=@rss_url%>" type="application/rss+xml"/>
  <% end %>

  <% if not @site_template.themeroller_css.blank? -%>
    <%= stylesheet_link_tag "#{site_template_url(@site_template)}/themeroller.css" %>
  <% else -%>
    <%= stylesheet_link_tag 'themeroller-default.css' %>
  <% end -%>
  <% if not @site_template.css.blank? -%>

  <% end -%>
  <title><%= page_title %></title>

<% if not @site_template.header.blank? -%>
  <%= @site_template.header %>
<% end -%>

<% if not @hide_chrome -%>

<%= page_title %>

          <% if @context and @context.parent -%>

Part of
              <%= link_to @context.parent.fullname, :controller => params[:controller], :context => @context.parent.id %>

          <% end -%>

<%= link_to "Home", :controller => :main, :action => :index %>

<%= link_to "My Events", :controller => :agenda, :action => :index %>

            <% if @context and @context.schedules.count(:conditions => ["published = ?", true]) == 1 -%>

<%= link_to "Event Schedule", schedule_path(@context.schedules[0]) %>

            <% elsif @context and @context.schedules.count(:conditions => ["published = ?", true]) > 1 -%>

<%= link_to "Event Schedules", schedules_path %>

            <% end -%>
            <% if can?(:edit, @context) -%>

Administration »

		  «

<%= link_to "Events", events_path %>

  		    <% if @context -%>

<%= link_to "Attendees", :controller => "agenda", :action => "attendees" %>

		    <% end -%>

<%= link_to "Locations", locations_path %>

<%= link_to "Site Templates", site_templates_path %>

<%= link_to "Schedules", schedules_path %>

					<% if person_signed_in? && current_person.admin? -%>

<%= link_to "Virtual Sites", virtual_sites_path %>

					<% end -%>

            <% end -%>

          	<% if person_signed_in? -%>
		        <%= link_to current_person.name, profile_path %>
		        |
		        <%= link_to "Log out", destroy_person_session_path %>
			<% else -%>

Log in

				<%= link_to "Click here to log into this site.", new_person_session_path %>
			<% end -%>

<% end -%>

<% if flash[:alert].present? -%>

	<%=h flash[:alert] %>

<% end -%>

<% if flash[:error_messages].present? -%>

There were some errors processing your request:

      <% flash[:error_messages].each do |msg| -%>

<%= msg%>

      <% end -%>

<% end -%>

  <%= @content_for_layout %>

<% if not @site_template.footer.blank? -%>
  <%= @site_template.footer %>
<% end -%>


Remove Steve's gratuitous insult.

Remove Steve's gratuitous insult.

Confirm a user account

Press the confirm button below to activate your account.

<form method="post">
<input type="hidden" name="confirm_string" value="<%= params[:confirm_string] %>">
<input type="submit" name="confirm_action" value="Confrm">
</form>


diff-article-version: add radio_button_tag in versions' list and add
button to show differences between article versions

AI2822

<%= article_title(@page, :no_link => true) %>

<%= _('This is the list of all versions of this content. Select a version to see it and then revert to it.') %>.

  <% @versions.each do |v| %>

      <%= radio_button_tag :first, "#{v.version}" %>
      <%= radio_button_tag :end, "#{v.version}" %>
      <%= link_to(_("Version #{v.version}"), @page.url.merge(:version => v.version)) %>
      <%= @page.version == v.version ? _('(current)') : '' %>
      <%= _('by %{author}') % {:author => link_to(@page.author_name(v.version), @page.author_url)} %>

<%= show_time(v.updated_at) %>

  <% end %>

<%= button_to "Show differences between selected versions", :id => "diff-versions",
      :class => "diff-versions", :method => :get %>
<%= pagination_links @versions, :param_name => 'npage' %>


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

  <title>User: <%= controller.action_name %></title>
  <%= stylesheet_link_tag 'scaffold' %>

<%= flash[:notice] %>

<%= @content_for_layout %>


Use raw for date picker.

Use raw for date picker.

<% form_tag({:action => "signup"}, {:id => "signup_form"}) do %>
    <%= foi_error_messages_for :user_signup %>

        <%= _('Your e-mail:')%>
        <%= text_field 'user_signup', 'email', { :size => 20 } %>

        <%= _('We will not reveal your email address to anybody unless you or
        the law tell us to (details). ', :url => help_privacy_path) %>

         <%= _('Your name:')%>
        <%= text_field 'user_signup', 'name', { :size => 20 } %>

         <%= raw(_('Your name will appear publicly
        (why?)
        on this website and in search engines. If you
        are thinking of using a pseudonym, please
        read this first.') % [help_privacy_path+"#public_request", help_privacy_path+"#real_name"]) %>

        <%= _('Your address:')%>
        <%= text_area 'user_signup', 'address', { :cols => 20, :rows => 6 } %>

        <%= _('Your address will be sent to authorities when you make a request.  We will not reveal your address on the website.') %>

        <%= _('Your DOB:')%>
        <%= text_field 'user_signup', 'dob', { :size => 20, :class => 'dob-datepicker' } %>

        <%= _('Your DOB will also be sent to authorities when you make a request.  We will not reveal your DOB on the website.') %>

         <%= _('Password:')%>
        <%= password_field 'user_signup', 'password', { :size => 15 } %>

         <%= _('Password: (again)')%>
        <%= password_field 'user_signup', 'password_confirmation', { :size => 15 } %>

    <% if @request_from_foreign_country %>
    <%= recaptcha_tags %>
    <% end %>

        <%= hidden_field_tag 'token', params[:token], {:id => 'signup_token' } %>
        <%= hidden_field_tag :modal, params[:modal], {:id => 'signup_modal' } %>
        <%= submit_tag _('Sign up') %>

<% end %>


Make links in tags active in the data browser. Fixes #1855.


Reverted to Rails/Prototype/Scriptalicous drag and drop

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

<% @page_title = "Admin: Results: #{@racers.first.name}, #{@racers.last.name}" %>

	    <% for racer in @racers %>

<%= racer.name %>

	      <% for result in racer.results %>
	        <div id="result_<%= result.id %>">

	            <%= result.race.standings.date.strftime('%m/%e/%Y') %>
	            <%= result.place %>
	            <%= result.race.standings.name %> <%= result.race.name %>

		        <%= draggable_element("result_#{result.id}", :revert => true, :ghosting => true) %>

	      <% end %>

		<%= drop_receiving_element("racer_#{racer.id}", :url => {:action => 'move'}) %>
	    <% end %>

<% @page_title = "Admin: Results: #{@racers.first.name}, #{@racers.last.name}" %>

        <form name="dragDropForm" action="javscript:;">
  	    <% first_id = 'first' %>
        <% for racer in @racers %>
        <div class="yui-u <% first_id %>">

<%= racer.name %>

          <% for result in racer.results %>
            <tr class="list2" id="result_<%= result.id %>" style="cursor: move; width: 100%;">
                <%= result.race.standings.date.strftime('%m/%e/%Y') %>
                <%= result.place %>
                <%= result.race.standings.name %> <%= result.race.name %>

          <% end %>

  	    <% first_id = '' %>
        <% end %>
        </form>


Fixes tickets 1103 / 1104

Fixes tickets 1103 / 1104

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

<% @page_heading = _("Pages") %>

  <% content_for('tasks') do %>
    <%= task_show _("Show this page"), @page.id %>
  <% end %>

<%= _("Are you sure you want to delete the page")%> '<%= @page[:name] %>'?

  <% form_tag :controller => '/admin/pages', :action => 'destroy' do %>
  <%= hidden_field "page", "id" %>
  <%= confirm_delete(_("Delete this page")) %>
  <% end %>

<% @page_heading = <%= _("Pages") %>

  <% content_for('tasks') do %>
    <%= task_show _("Show this page"), @page.id %>
  <% end %>

<%= _("Are you sure you want to delete the page")%> '<%= @page[:name] %>'?

  <% form_tag :controller => '/admin/pages', :action => 'destroy' do %>
  <%= hidden_field "page", "id" %>
  <%= confirm_delete(_("Delete this page")) %>
  <% end %>


Remove this section until we're asked

Remove this section until we're asked

<% @title = "FOI officer questions" %>

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

<%= @title %> #

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

<%= site_name %> is a service run by a charity. It helps ordinary members
of the public make FOI requests, and easily track and share the responses.

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

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

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

Why are you publishing responses to FOI requests? #

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

Are the people making requests real people? #

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

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

Yes it is.

Aren't you making lots of vexatious requests? #

<%= site_name %> is not making any requests. We are sending requests on
behalf of our users, who are real people making the requests.

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

I can see a request on <%= site_name %>, but we never got it by email!#

If a request appears on the site, then we have attempted to send it to
the authority by email. Any delivery failure messages will automatically
appear on the site. You can check the address we're using with the "View FOI
email address" link which appears on the page for the authority. Contact us if there is a better address we can
use.

Requests are sometimes not delivered because they are quietly removed by
"spam filters" in the IT department of the authority. Authorities can make
sure this doesn't happen by asking their IT departments to "whitelist"
any email from @<%= MySociety::Config.get('INCOMING_EMAIL_DOMAIN', 'localhost') %>.
If you ask us we will resend any request,
and/or give technical details of delivery so an IT department can chase
up what happened to the message.

Finally, you can respond to any request from your web browser, without
needing any email, using the "respond to request" link at the bottom of
each request page.

How do you calculate the deadline shown on request pages?#

The Freedom of Information Act says:

        …the agency or Minister must…as soon as practicable but in
        any case not later than the end of the period of 30 days after the day on
        which the request is received by or on behalf of the agency or Minister,
        take all reasonable steps to enable the applicant to be notified of a
        decision on the request

      —
      (s 15(5)(b))

    And we try to be as generous as possible in our calculation of the 30 day
    timeframe.

How can I send a large file, which won't go by email?#

Instead of email, you can respond to a request directly from your web
browser, including uploading a file. To do this, choose "respond to request" at
the bottom of the request's page. Contact us if it
is too big for even that (more than, say, 50Mb).

Why do you publish the names of public servants and the text of emails? #

We consider what officers or servants do in the course of their employment
to be public information. We will only remove content in exceptional
circumstances, see our take down policy.

Do you publish email addresses or mobile phone numbers? #

To prevent spam, we automatically remove most emails and some mobile numbers from
responses to requests.  Please contact us if we've
missed one.
For technical reasons we don't always remove them from attachments, such as certain PDFs.

If you need to know what an address was that we've removed, please get in touch with us. Occasionally, an email address
forms an important part of a response and we will post it up in an obscured
form in an annotation.

What is your policy on copyright of documents?#

Our Freedom of Information law is "applicant blind", so anyone in the
world can request the same document and get a copy of it.

If you think our making a document available on the internet infringes your
copyright, you may contact us and ask us
to take it down.  However, to save tax payers' money by preventing duplicate
requests, and for good public relations, we'd advise you not to do that.

If you haven't already, read the introduction -->

Otherwise, the credits or the programmers API -->

<% @title = "FOI officer questions" %>

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

<%= @title %> #

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

<%= site_name %> is a service run by a charity. It helps ordinary members
of the public make FOI requests, and easily track and share the responses.

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

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

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

Why are you publishing responses to FOI requests? #

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

Are the people making requests real people? #

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

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

Yes it is.

Aren't you making lots of vexatious requests? #

<%= site_name %> is not making any requests. We are sending requests on
behalf of our users, who are real people making the requests.

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

I can see a request on <%= site_name %>, but we never got it by email!#

If a request appears on the site, then we have attempted to send it to
the authority by email. Any delivery failure messages will automatically
appear on the site. You can check the address we're using with the "View FOI
email address" link which appears on the page for the authority. Contact us if there is a better address we can
use.

Requests are sometimes not delivered because they are quietly removed by
"spam filters" in the IT department of the authority. Authorities can make
sure this doesn't happen by asking their IT departments to "whitelist"
any email from @<%= MySociety::Config.get('INCOMING_EMAIL_DOMAIN', 'localhost') %>.
If you ask us we will resend any request,
and/or give technical details of delivery so an IT department can chase
up what happened to the message.

Finally, you can respond to any request from your web browser, without
needing any email, using the "respond to request" link at the bottom of
each request page.

How do you calculate the deadline shown on request pages?#

The Freedom of Information Act says:

        …the agency or Minister must…as soon as practicable but in
        any case not later than the end of the period of 30 days after the day on
        which the request is received by or on behalf of the agency or Minister,
        take all reasonable steps to enable the applicant to be notified of a
        decision on the request

      —
      (s 15(5)(b))

    And we try to be as generous as possible in our calculation of the 30 day
    timeframe.

But really, how do you calculate the deadline?#

Please read the answer to the previous question first. Legally, authorities
must respond promptly to FOI requests. If they fail to do that,
it is best if they show the hard work they are doing by explaining what is
taking the extra time to do.

That said, <%= site_name %> does show the maximum legal deadline
for response on each request. Here's how we calculate it.

If the day we deliver the request by email is a working day, we count that
as "day zero", even if it was delivered late in the evening. Days end at
midnight.  We then count the next working day as "day one", and so on up to
20 working days.

If the day the request email was delivered was a non-working day, we count
the next working day as "day one". Delivery is delivery, even if it happened on
the weekend. Some authorities <a href="http://www.<%= site_name %>.com/request/policy_regarding_body_scans#incoming-1100">disagree with this, our lawyer disagrees with them.

Requesters are encouraged to mark when they have clarified
their request so the clock resets, but sometimes they get this wrong. If you
see a problem with a particular request, let us know and we'll fix it.

The date thus calculated is shown on requests with the text "By law,
Agency should normally have responded by...". There is only
one case which is not normal, see the next question about
public interest test time extensions.

If you're getting really nerdy about all this, read the detailed Office of the Australian Information Commissioner guidance.
Meanwhile, remember that the law says authorities must respond
promptly. That's really what matters.

How can I send a large file, which won't go by email?#

Instead of email, you can respond to a request directly from your web
browser, including uploading a file. To do this, choose "respond to request" at
the bottom of the request's page. Contact us if it
is too big for even that (more than, say, 50Mb).

Why do you publish the names of public servants and the text of emails? #

We consider what officers or servants do in the course of their employment
to be public information. We will only remove content in exceptional
circumstances, see our take down policy.

Do you publish email addresses or mobile phone numbers? #

To prevent spam, we automatically remove most emails and some mobile numbers from
responses to requests.  Please contact us if we've
missed one.
For technical reasons we don't always remove them from attachments, such as certain PDFs.

If you need to know what an address was that we've removed, please get in touch with us. Occasionally, an email address
forms an important part of a response and we will post it up in an obscured
form in an annotation.

What is your policy on copyright of documents?#

Our Freedom of Information law is "applicant blind", so anyone in the
world can request the same document and get a copy of it.

If you think our making a document available on the internet infringes your
copyright, you may contact us and ask us
to take it down.  However, to save tax payers' money by preventing duplicate
requests, and for good public relations, we'd advise you not to do that.

If you haven't already, read the introduction -->

Otherwise, the credits or the programmers API -->


Correctly output "similar requests" heading

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

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

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

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

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

    <% view_cache :ttl => 1.day, :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"] %>

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

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

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

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

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

    <% view_cache :ttl => 1.day, :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"] %>


Bugfix: don't error out on nil start datetime

<tr class="<%=cycle("even", "odd", :name => "agenda_rows") %>">

    <%= render :partial => "events/link", :locals => { :event => event.event } %>
    <% if event.is_waitlist -%>
      (#<%= event.event.waitlist_number(event.person) %> in waitlist)
    <% end -%>

    <% if event.start -%>
      <%= event.event.start.strftime "%B %d, %Y at %I:%M %p" %>
    <% else -%>
      (Unscheduled)
    <% end -%>

    <%= event_length event.event %>

    <%= event.event.locations.collect {|l| h(l.name)}.join(", ") %>

<tr class="<%=cycle("even", "odd", :name => "agenda_rows") %>">

    <%= render :partial => "events/link", :locals => { :event => event.event } %>
    <% if event.is_waitlist -%>
      (#<%= event.event.waitlist_number(event.person) %> in waitlist)
    <% end -%>

    <%= event.event.start.strftime "%B %d, %Y at %I:%M %p" %>

    <%= event_length event.event %>

    <%= event.event.locations.collect {|l| h(l.name)}.join(", ") %>


 * Switched ID of ordered list holding the comments from 'comments' to 'commentList'. The former seems to trigger a bug in the IE6/Win DOM which made Ajax commenting not work on that particular browser

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

<% content_for("script") do %>
function item_added() {
  new Effect.Highlight($('commentList').lastChild);
}
function item_loading() {
  $('commentform').elements[2].value = '';
  $('commentform').elements[2].focus();
}

window.onload = function() {
  if( $('commentform').elements[1].value != '' ) {
    Toggle.display('guest_url')
  }
}
<% end %>

<%= render_partial "article", @article %>

<% if @article.allow_comments > 0 -%>

<%= responses(@article.comments, "response") %> to '<%=h @article.title  %>'

    Leave a response

    <%= render_collection_of_partials "comment", @article.comments %>

<% end -%>

<% if @article.allow_pings > 0 -%>

<%= responses(@article.trackbacks, "trackback") %> to '<%=h @article.title  %>'

    Use the following link to trackback from your own site:

    <%= server_url_for :controller=>"articles", :action=>"trackback", :id=>@article.id %>

    <%= render_collection_of_partials "trackback", @article.trackbacks %>

<% end -%>

<% if @article.allow_comments > 0 -%>
<%= form_remote_tag :url => {:action => "comment", :id => @article.id}, :update=> "commentList", :position=> "bottom", :loading => 'item_loading()', :complete => "item_added()", :html=>{:id=>'commentform',:name=>'commentform'}%>

  write a comment....

        Your name

        <%= text_field "comment", "author", :size => 20 %> (leave url »)

        Your blog

        <%= text_field "comment", "url" %>

        Your message

        <%= text_area "comment", "body", "style"=> "width:300px;height:200px" %>

        <input type="submit" name="submit" value="submit" class="button" />

<% end -%>
<%= end_form_tag %>

<% content_for("script") do %>
function item_added() {
  new Effect.Highlight($('comments').lastChild);
}
function item_loading() {
  $('commentform').elements[2].value = '';
  $('commentform').elements[2].focus();
}

window.onload = function() {
  if( $('commentform').elements[1].value != '' ) {
    Toggle.display('guest_url')
  }
}
<% end %>

<%= render_partial "article", @article %>

<% if @article.allow_comments > 0 -%>

<%= responses(@article.comments, "response") %> to '<%=h @article.title  %>'

    Leave a response

    <%= render_collection_of_partials "comment", @article.comments %>

<% end -%>

<% if @article.allow_pings > 0 -%>

<%= responses(@article.trackbacks, "trackback") %> to '<%=h @article.title  %>'

    Use the following link to trackback from your own site:

    <%= server_url_for :controller=>"articles", :action=>"trackback", :id=>@article.id %>

    <%= render_collection_of_partials "trackback", @article.trackbacks %>

<% end -%>

<% if @article.allow_comments > 0 -%>
<%= form_remote_tag :url => {:action => "comment", :id => @article.id}, :update=> "comments", :position=> "bottom", :loading => 'item_loading()', :complete => "item_added()", :html=>{:id=>'commentform',:name=>'commentform'}%>

  write a comment....

        Your name

        <%= text_field "comment", "author", :size => 20 %> (leave url »)

        Your blog

        <%= text_field "comment", "url" %>

        Your message

        <%= text_area "comment", "body", "style"=> "width:300px;height:200px" %>

        <input type="submit" name="submit" value="submit" class="button" />

<% end -%>
<%= end_form_tag %>


Move comment link to the beginning of each line of the diff

  <% # iterate over lines %>
  <% chunk.lines.each do |line| %>

    <%
      best_idx = line.best_file_index
      blob = file_change_set.blobs[best_idx]
      blob_line_number = line.line_numbers[ best_idx ]
      line_id = blob + '_line_' + blob_line_number.to_s
     %>

    <tr class="diff_line" id="<%= line_id %>">
      <% if ! @review.nil? %>

          <%= link_to_remote '+', :url => {
                :controller => 'review',
                :action => 'new_comment_ajax',
                'comment[review_id]'   => @review.id,
                'comment[index_hash]'  => blob,
                'comment[line_number]' => blob_line_number
           } %>

      <% end %>
    <% # Line numbers %>
      <% line.line_numbers.each do |n| %>
        <%=h n.nil? ? "-" : n %>
      <% end %>
      <td class="<%= (line_classes line).join(" ") %>">
        <% if line.line.empty? %>

        <% else %>
          <%=h line.line.sub(/\r$/,'') %>

        <% end %>

  <% comments = comments_for_line(blob, blob_line_number) %>
  <% comments.each do |comment| %>

      <%= render_partial 'comment/show', comment %>

  <% end %>

  <% end %>

  <% # iterate over lines %>
  <% chunk.lines.each do |line| %>

    <%
      best_idx = line.best_file_index
      blob = file_change_set.blobs[best_idx]
      blob_line_number = line.line_numbers[ best_idx ]
      line_id = blob + '_line_' + blob_line_number.to_s
     %>

    <tr class="diff_line" id="<%= line_id %>">
    <% # Line numbers %>
      <% line.line_numbers.each do |n| %>
        <%=h n.nil? ? "-" : n %>
      <% end %>
      <td class="<%= (line_classes line).join(" ") %>">
        <% if line.line.empty? %>

        <% else %>
          <%=h line.line %>

        <% end %>

      <% if ! @review.nil? %>

          <%= link_to_remote '+', :url => {
                :controller => 'review',
                :action => 'new_comment_ajax',
                'comment[review_id]'   => @review.id,
                'comment[index_hash]'  => blob,
                'comment[line_number]' => blob_line_number
           } %>

      <% end %>

  <% comments = comments_for_line(blob, blob_line_number) %>
  <% comments.each do |comment| %>

      <%= render_partial 'comment/show', comment %>

  <% end %>

  <% end %>


Oops, test fixture users don't have 'created' set.

git-svn-id: bc266cc4dcdee41d9588461a87969679bbc3047f@765 7a65b82a-1d14-0410-b525-e2835e71a0b4

<%
  @title = :prefs_title.t

  new_tab_set do
    add_tab(:bulk_license_link.t,
            :controller => 'image', :action => 'license_updater')
    add_tab(:profile_link.t,
            :controller => 'account', :action => 'profile')
    add_tab(:show_user_your_notifications.t,
            :controller => 'interest', :action => 'list_interests')
    add_tab(:turn_javascript_nil_title.t,
            :controller => 'observer', :action => 'turn_javascript_nil') if session[:js_override] != nil
    add_tab(:turn_javascript_on_title.t,
            :controller => 'observer', :action => 'turn_javascript_on') if !@js
    add_tab(:turn_javascript_off_title.t,
            :controller => 'observer', :action => 'turn_javascript_off') if @js
  end
%>

<% form_for(:user, :url => { :action => :prefs }) do |form| %>

<input type="submit" value="<%= :SAVE_EDITS.l %>" class="primary" />

<%= :prefs_login.t %>:

  <%= form.text_field("login", :size => 60) %>

<%= :prefs_email.t %>:

  <%= form.text_field("email", :size => 60) %>

<%= :prefs_password_new.t %>:

  <%= form.password_field("password", :value => '', :size => 30) %>

<%= :prefs_password_confirm.t %>:

  <%= form.password_field("password_confirmation", :size => 30) %>

<%= :prefs_votes_anonymous.t %>:

  <%= values = [
    [:prefs_votes_anonymous_no.l, :no],
    [:prefs_votes_anonymous_yes.l, :yes],
  ]
  # Allow old users to granfather in old anonymous votes, but choose to go
  # public from here forward.
  if @user.created && @user.created < Time.parse(VOTE_CUTOFF)
    values << [:prefs_votes_anonymous_old.l(:cutoff => VOTE_CUTOFF), :old]
  end
  form.select(:votes_anonymous, values) %>

<%= :License.t %>:
    (<%= :prefs_license_note.t %>)

  <%= form.select(:license_id, @licenses) %>

      <%= :prefs_theme.t %>:

        <%= form.select(:theme, [[:theme_random.l, "NULL"]] + CSS) %>

      <%= :prefs_locale.t %>:

        <% locales = all_locales.map { |x| [x.sub('-','_').to_sym.t, x] } %>
        <%= form.select(:locale, locales) %>

      <%= :prefs_thumbnail_size.t %>:

        <%= form.select(:thumbnail_size, [
          [:prefs_thumbnail_small.l, :thumbnail],
          [:prefs_thumbnail_large.l, :small],
        ]) %>

      <%= :prefs_image_size.t %>:
        (<%= :prefs_image_size_help.t %>)

        <%= form.select(:image_size, [
          [:prefs_image_small.l,     :small],
          [:prefs_image_medium.l,    :medium],
          [:prefs_image_large.l,     :large],
          [:prefs_image_huge.l,      :huge],
          [:prefs_image_full_size.l, :full_size],
        ]) %>

  <%= :prefs_layout_title.t %>:

  <%= form.select(:rows, [1, 2, 3, 4, 5, 10, 20, 50]) %>
  <%= :prefs_rows_by.t %>
  <%= form.select(:columns, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) %>
  <%= :prefs_columns.t %>

  <%= form.check_box("alternate_rows") %>
  <%= :prefs_alt_row_colors.t %>

  <%= form.check_box("alternate_columns") %>
  <%= :prefs_alt_col_colors.t %>

  <%= form.check_box("vertical_layout") %>
  <%= :prefs_text_below_images.t %>

  <%= :prefs_email_comments.t %>: <%= :prefs_email_please_notify.t %>

  <%= form.check_box("email_comments_owner") %>
    <%= :prefs_email_comments_owner.t %>

  <%= form.check_box("email_comments_response") %>
    <%= :prefs_email_comments_response.t %>

  <%= form.check_box("email_comments_all") %>
    <%= :prefs_email_comments_all.t %>

  <%= :prefs_email_observations.t %>: <%= :prefs_email_please_notify.t %>

  <%= form.check_box("email_observations_consensus") %>
    <%= :prefs_email_observations_consensus.t %>

  <%= form.check_box("email_observations_naming") %>
    <%= :prefs_email_observations_naming.t %>

  <%= form.check_box("email_observations_all") %>
    <%= :prefs_email_observations_all.t %>

  <%= :prefs_email_names.t %>: <%= :prefs_email_please_notify.t %>

  <%= form.check_box("email_names_admin") %>
    <%= :prefs_email_names_admin.t %>

  <%= form.check_box("email_names_author") %>
    <%= :prefs_email_names_author.t %>

  <%= form.check_box("email_names_editor") %>
    <%= :prefs_email_names_editor.t %>

  <%= form.check_box("email_names_reviewer") %>
    <%= :prefs_email_names_reviewer.t %>

  <%= form.check_box("email_names_all") %>
    <%= :prefs_email_names_all.t %>

  <%= :prefs_email_locations.t %>: <%= :prefs_email_please_notify.t %>

  <%= form.check_box("email_locations_admin") %>
    <%= :prefs_email_locations_admin.t %>

  <%= form.check_box("email_locations_author") %>
    <%= :prefs_email_locations_author.t %>

  <%= form.check_box("email_locations_editor") %>
    <%= :prefs_email_locations_editor.t %>

  <%= form.check_box("email_locations_all") %>
    <%= :prefs_email_locations_all.t %>

  <%= :prefs_email_general.t %>: <%= :prefs_email_please_notify.t %>

  <%= form.check_box("email_general_feature") %>
    <%= :prefs_email_general_features.t %>

  <%= form.check_box("email_general_commercial") %>
    <%= :prefs_email_general_commercial.t %>

  <%= form.check_box("email_general_question") %>
    <%= :prefs_email_general_questions.t %>

  <%= :prefs_email_prefs.t %>:

  <%= form.check_box("email_html") %>
    <%= :prefs_email_html.t %>

    <%= :prefs_email_note.tp %>

<input type="submit" value="<%= :SAVE_EDITS.l %>" class="primary" />
<% end %>

<%
  @title = :prefs_title.t

  new_tab_set do
    add_tab(:bulk_license_link.t,
            :controller => 'image', :action => 'license_updater')
    add_tab(:profile_link.t,
            :controller => 'account', :action => 'profile')
    add_tab(:show_user_your_notifications.t,
            :controller => 'interest', :action => 'list_interests')
    add_tab(:turn_javascript_nil_title.t,
            :controller => 'observer', :action => 'turn_javascript_nil') if session[:js_override] != nil
    add_tab(:turn_javascript_on_title.t,
            :controller => 'observer', :action => 'turn_javascript_on') if !@js
    add_tab(:turn_javascript_off_title.t,
            :controller => 'observer', :action => 'turn_javascript_off') if @js
  end
%>

<% form_for(:user, :url => { :action => :prefs }) do |form| %>

<input type="submit" value="<%= :SAVE_EDITS.l %>" class="primary" />

<%= :prefs_login.t %>:

  <%= form.text_field("login", :size => 60) %>

<%= :prefs_email.t %>:

  <%= form.text_field("email", :size => 60) %>

<%= :prefs_password_new.t %>:

  <%= form.password_field("password", :value => '', :size => 30) %>

<%= :prefs_password_confirm.t %>:

  <%= form.password_field("password_confirmation", :size => 30) %>

<%= :prefs_votes_anonymous.t %>:

  <%= values = [
    [:prefs_votes_anonymous_no.l, :no],
    [:prefs_votes_anonymous_yes.l, :yes],
  ]
  # Allow old users to granfather in old anonymous votes, but choose to go
  # public from here forward.
  if @user.created < Time.parse(VOTE_CUTOFF)
    values << [:prefs_votes_anonymous_old.l(:cutoff => VOTE_CUTOFF), :old]
  end
  form.select(:votes_anonymous, values) %>

<%= :License.t %>:
    (<%= :prefs_license_note.t %>)

  <%= form.select(:license_id, @licenses) %>

      <%= :prefs_theme.t %>:

        <%= form.select(:theme, [[:theme_random.l, "NULL"]] + CSS) %>

      <%= :prefs_locale.t %>:

        <% locales = all_locales.map { |x| [x.sub('-','_').to_sym.t, x] } %>
        <%= form.select(:locale, locales) %>

      <%= :prefs_thumbnail_size.t %>:

        <%= form.select(:thumbnail_size, [
          [:prefs_thumbnail_small.l, :thumbnail],
          [:prefs_thumbnail_large.l, :small],
        ]) %>

      <%= :prefs_image_size.t %>:
        (<%= :prefs_image_size_help.t %>)

        <%= form.select(:image_size, [
          [:prefs_image_small.l,     :small],
          [:prefs_image_medium.l,    :medium],
          [:prefs_image_large.l,     :large],
          [:prefs_image_huge.l,      :huge],
          [:prefs_image_full_size.l, :full_size],
        ]) %>

  <%= :prefs_layout_title.t %>:

  <%= form.select(:rows, [1, 2, 3, 4, 5, 10, 20, 50]) %>
  <%= :prefs_rows_by.t %>
  <%= form.select(:columns, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) %>
  <%= :prefs_columns.t %>

  <%= form.check_box("alternate_rows") %>
  <%= :prefs_alt_row_colors.t %>

  <%= form.check_box("alternate_columns") %>
  <%= :prefs_alt_col_colors.t %>

  <%= form.check_box("vertical_layout") %>
  <%= :prefs_text_below_images.t %>

  <%= :prefs_email_comments.t %>: <%= :prefs_email_please_notify.t %>

  <%= form.check_box("email_comments_owner") %>
    <%= :prefs_email_comments_owner.t %>

  <%= form.check_box("email_comments_response") %>
    <%= :prefs_email_comments_response.t %>

  <%= form.check_box("email_comments_all") %>
    <%= :prefs_email_comments_all.t %>

  <%= :prefs_email_observations.t %>: <%= :prefs_email_please_notify.t %>

  <%= form.check_box("email_observations_consensus") %>
    <%= :prefs_email_observations_consensus.t %>

  <%= form.check_box("email_observations_naming") %>
    <%= :prefs_email_observations_naming.t %>

  <%= form.check_box("email_observations_all") %>
    <%= :prefs_email_observations_all.t %>

  <%= :prefs_email_names.t %>: <%= :prefs_email_please_notify.t %>

  <%= form.check_box("email_names_admin") %>
    <%= :prefs_email_names_admin.t %>

  <%= form.check_box("email_names_author") %>
    <%= :prefs_email_names_author.t %>

  <%= form.check_box("email_names_editor") %>
    <%= :prefs_email_names_editor.t %>

  <%= form.check_box("email_names_reviewer") %>
    <%= :prefs_email_names_reviewer.t %>

  <%= form.check_box("email_names_all") %>
    <%= :prefs_email_names_all.t %>

  <%= :prefs_email_locations.t %>: <%= :prefs_email_please_notify.t %>

  <%= form.check_box("email_locations_admin") %>
    <%= :prefs_email_locations_admin.t %>

  <%= form.check_box("email_locations_author") %>
    <%= :prefs_email_locations_author.t %>

  <%= form.check_box("email_locations_editor") %>
    <%= :prefs_email_locations_editor.t %>

  <%= form.check_box("email_locations_all") %>
    <%= :prefs_email_locations_all.t %>

  <%= :prefs_email_general.t %>: <%= :prefs_email_please_notify.t %>

  <%= form.check_box("email_general_feature") %>
    <%= :prefs_email_general_features.t %>

  <%= form.check_box("email_general_commercial") %>
    <%= :prefs_email_general_commercial.t %>

  <%= form.check_box("email_general_question") %>
    <%= :prefs_email_general_questions.t %>

  <%= :prefs_email_prefs.t %>:

  <%= form.check_box("email_html") %>
    <%= :prefs_email_html.t %>

    <%= :prefs_email_note.tp %>

<input type="submit" value="<%= :SAVE_EDITS.l %>" class="primary" />
<% end %>


Corrected trackback links.

Corrected trackback links.

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

<%= render_partial "article", @article %>

<%= responses(@article) %> to '<%=h @article.title  %>'

		You can leave a response, or <a href="<%= server_url_for :controller=>"trackback", :action=>"ping", :id=>@article.id %>">trackback from your own site.

  <%= render_collection_of_partials "comment", @article.comments %>

<%= start_form_tag :action => "comment", :id=> @article.id %>

  write a comment....

        <%= render_errors(@comment) %>

  	   	author

  	  	<%= text_field "comment", "author" %>

  	  	email

  	  	<%= text_field "comment", "email" %>

  	  	url

  	    <%= text_field "comment", "url" %>

  	  	Body

  	  	<%= text_area "comment", "body", "style"=> "width:300px;height:250px" %>

  		<input type="submit" name="submit" value="submit" class="button" />

<%= end_form_tag %>

<%= render_partial "article", @article %>

<%= responses(@article) %> to '<%=h @article.title  %>'

		You can leave a response, or <a href="<%= server_url_for :controller=>"articles", :action=>"read", :id=>@article.id %>">trackback from your own site.

  <%= render_collection_of_partials "comment", @article.comments %>

<%= start_form_tag :action => "comment", :id=> @article.id %>

  write a comment....

        <%= render_errors(@comment) %>

  	   	author

  	  	<%= text_field "comment", "author" %>

  	  	email

  	  	<%= text_field "comment", "email" %>

  	  	url

  	    <%= text_field "comment", "url" %>

  	  	Body

  	  	<%= text_area "comment", "body", "style"=> "width:300px;height:250px" %>

  		<input type="submit" name="submit" value="submit" class="button" />

<%= end_form_tag %>


Localize date header

Localize date header

              <%=_ 'Timeline' %>

            <%
            @clients = Customer.find(:all, :conditions => ["company_id = ?", current_user.company_id], :order => "name").collect{ |c| [c.name, c.id.to_s]}
            @projects = User.find(current_user.id).projects.find(:all, :conditions => ["completed_at IS NULL"]).collect {|p| [p.name, p.id.to_s]}
            @users = User.find(:all, :order => "name", :conditions => ["company_id = ?", current_user.company_id]).collect {|c| [ c.name, c.id.to_s ] }

            filter_count = 0
            %>
            <% form_tag( :controller => 'timeline', :action => 'list' ) do %>

            <select name="filter_date" id="filter_date" onchange="javascript:document.forms[1].submit();">
                <% @dates =  [[_("[All Time]"), "0"], [_("This Week"),"1"], [_("Last Week"),"2"],[_("This Month"),"3"],[_("Last Month"),"4"],[_("This Year"),"5"],[_("Last Year"),"6"]] %>
                <%= options_for_select @dates, params[:filter_date] %>
            </select>

            <% if @projects.size > 1 %>
            <select name="filter_project" id="filter_project" onchange="javascript:document.forms[1].submit();">
              <option value="0" class="select_default"><%= _("[Any Project]") %></option>
              <% @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.to_s == params[:filter_project] %>><%= p.name %></option>
                <% end %>
              </optgroup>
              <% end %>

              <% end %>

            </select>
            <% end %>

            <% if @users.size > 1 %>
            <select name="filter_user" id="filter_user" onchange="javascript:document.forms[1].submit();">
              <% @users = [[_("[Any User]"), "0"]] + @users %>
              <%= options_for_select @users, params[:filter_user] %>
            </select>
            <% end %>

            <select name="filter_status" id="filter_status" onchange="javascript:document.forms[1].submit();">
              <%
                 @status = [[_("[Any Type]"), "-1"],
                            [_("Closed"), EventLog::TASK_COMPLETED.to_s],
                            [_("Work Log"), EventLog::TASK_WORK_ADDED.to_s],
                            [_("Status Change"), EventLog::TASK_REVERTED.to_s],
                            [_("Created"), EventLog::TASK_CREATED.to_s],
                            [_("Comment"), EventLog::TASK_COMMENT.to_s],
                            [_("Modified"), EventLog::TASK_MODIFIED.to_s]]

                 @status << [_("Forum Posts"), EventLog::FORUM_NEW_POST.to_s] if current_user.company.show_forum?
                 @status << [_("Wiki Additions"), EventLog::WIKI_CREATED.to_s] if current_user.company.show_wiki?
                 @status << [_("Wiki Changes"), EventLog::WIKI_MODIFIED.to_s] if current_user.company.show_wiki?

              %>
              <%= options_for_select @status, params[:filter_status] %>
            </select>

            <% end %>

	        <%= will_paginate(@logs, { :next_label => _('Next') + ' »', :prev_label => '« ' + _('Previous') }) %>

                <%
            day = 0
            for log in @logs
              if day != tz.utc_to_local(log.started_at).day
                day = tz.utc_to_local(log.started_at).day
                %>

                <%= tz.utc_to_local(log.started_at).strftime_localized("%A, %d %B %Y") %>

            <% end %>
            <% if log.is_a? WorkLog %>
	      <%= render :partial => 'activities/log_row', :locals => { :log => log } %>
            <% else %>
              <% if log.target.is_a? WorkLog %>
  	        <%= render :partial => 'activities/log_row', :locals => { :log => log.target } %>
              <% else %>
                <%= render :partial => 'activities/other_row', :locals => {:log => log } %>
              <% end %>
            <% end %>
          <% end %>

              <%=_ 'Timeline' %>

            <%
            @clients = Customer.find(:all, :conditions => ["company_id = ?", current_user.company_id], :order => "name").collect{ |c| [c.name, c.id.to_s]}
            @projects = User.find(current_user.id).projects.find(:all, :conditions => ["completed_at IS NULL"]).collect {|p| [p.name, p.id.to_s]}
            @users = User.find(:all, :order => "name", :conditions => ["company_id = ?", current_user.company_id]).collect {|c| [ c.name, c.id.to_s ] }

            filter_count = 0
            %>
            <% form_tag( :controller => 'timeline', :action => 'list' ) do %>

            <select name="filter_date" id="filter_date" onchange="javascript:document.forms[1].submit();">
                <% @dates =  [[_("[All Time]"), "0"], [_("This Week"),"1"], [_("Last Week"),"2"],[_("This Month"),"3"],[_("Last Month"),"4"],[_("This Year"),"5"],[_("Last Year"),"6"]] %>
                <%= options_for_select @dates, params[:filter_date] %>
            </select>

            <% if @projects.size > 1 %>
            <select name="filter_project" id="filter_project" onchange="javascript:document.forms[1].submit();">
              <option value="0" class="select_default"><%= _("[Any Project]") %></option>
              <% @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.to_s == params[:filter_project] %>><%= p.name %></option>
                <% end %>
              </optgroup>
              <% end %>

              <% end %>

            </select>
            <% end %>

            <% if @users.size > 1 %>
            <select name="filter_user" id="filter_user" onchange="javascript:document.forms[1].submit();">
              <% @users = [[_("[Any User]"), "0"]] + @users %>
              <%= options_for_select @users, params[:filter_user] %>
            </select>
            <% end %>

            <select name="filter_status" id="filter_status" onchange="javascript:document.forms[1].submit();">
              <%
                 @status = [[_("[Any Type]"), "-1"],
                            [_("Closed"), EventLog::TASK_COMPLETED.to_s],
                            [_("Work Log"), EventLog::TASK_WORK_ADDED.to_s],
                            [_("Status Change"), EventLog::TASK_REVERTED.to_s],
                            [_("Created"), EventLog::TASK_CREATED.to_s],
                            [_("Comment"), EventLog::TASK_COMMENT.to_s],
                            [_("Modified"), EventLog::TASK_MODIFIED.to_s]]

                 @status << [_("Forum Posts"), EventLog::FORUM_NEW_POST.to_s] if current_user.company.show_forum?
                 @status << [_("Wiki Additions"), EventLog::WIKI_CREATED.to_s] if current_user.company.show_wiki?
                 @status << [_("Wiki Changes"), EventLog::WIKI_MODIFIED.to_s] if current_user.company.show_wiki?

              %>
              <%= options_for_select @status, params[:filter_status] %>
            </select>

            <% end %>

	        <%= will_paginate(@logs, { :next_label => _('Next') + ' »', :prev_label => '« ' + _('Previous') }) %>

                <%
            day = 0
            for log in @logs
              if day != tz.utc_to_local(log.started_at).day
                day = tz.utc_to_local(log.started_at).day
                %>

                <%= tz.utc_to_local(log.started_at).strftime("%A, %d %B %Y") %>

            <% end %>
            <% if log.is_a? WorkLog %>
	      <%= render :partial => 'activities/log_row', :locals => { :log => log } %>
            <% else %>
              <% if log.target.is_a? WorkLog %>
  	        <%= render :partial => 'activities/log_row', :locals => { :log => log.target } %>
              <% else %>
                <%= render :partial => 'activities/other_row', :locals => {:log => log } %>
              <% end %>
            <% end %>
          <% end %>


only enclose in script tag if format is not js

<%if params[:format]!='js' %>
<script type="text/javascript">
<%end %>

<% yui_block( :modules => [ "gallery-form", "madb" ], :use => [ 'gallery-form', 'anim', 'madb','event-custom']) do %>
    // Create a Field Object manually
    var fields = [ ];
    fields.push( new Y.HiddenField({
                  name:"instance_id",
                  value:"-1"}));
    <% if params["parent_id"] %>
      fields.push( new Y.HiddenField({
                    name:"parent_id",
                    value:"<%=params["parent_id"]%>"}));
    <% elsif params["child_id"] %>
      fields.push( new Y.HiddenField({
                    name:"child_id",
                    value:"<%=params["child_id"]%>"}));
    <% end %>
    fields.push( new Y.HiddenField({
                  name:"relation_id",
                  value:"<%=params["relation_id"]%>"}));
    fields.push( new Y.HiddenField({
                  name:"entity",
                  value:"<%=@entity.id%>"}));

    <%= render :partial => "entity_yui_form_fields", :locals => { :instance => @instance }  %>

            fields.push ( { type : 'submit', label : '<%= escape_javascript(t('madb_submit')) %>', id: 'commit'});
            fields.push ( {type : 'reset', label : '<%= escape_javascript(t('madb_reset'))%>'});
    Y.publish('madb:new_entity_linked', {broadcast: 2});
    Y.publish('madb:refresh_related', {broadcast: 2});
    <%= default_entity_form( :form_content_box => "#{@yui_form_id}", :success_callback =>%{ function(form,data){ Y.fire('madb:new_entity_linked', '#{@yui_form_id}', data  );    }   }, :failure_callback => %{ function(form, data){ Y.fire('madb:refresh_related', '#{@yui_form_id}'); }} , :form_action =>url_for(:action => "apply_link_to_new") , :upload => @entity.has_file_attachment_detail?) %>

    f.render();
    f.focus();
<% end %>

<%if params[:format]!='js' %>
</script>
<% end %>

<script type="text/javascript">
<% yui_block( :modules => [ "gallery-form", "madb" ], :use => [ 'gallery-form', 'anim', 'madb','event-custom']) do %>
    // Create a Field Object manually
    var fields = [ ];
    fields.push( new Y.HiddenField({
                  name:"instance_id",
                  value:"-1"}));
    <% if params["parent_id"] %>
      fields.push( new Y.HiddenField({
                    name:"parent_id",
                    value:"<%=params["parent_id"]%>"}));
    <% elsif params["child_id"] %>
      fields.push( new Y.HiddenField({
                    name:"child_id",
                    value:"<%=params["child_id"]%>"}));
    <% end %>
    fields.push( new Y.HiddenField({
                  name:"relation_id",
                  value:"<%=params["relation_id"]%>"}));
    fields.push( new Y.HiddenField({
                  name:"entity",
                  value:"<%=@entity.id%>"}));

    <%= render :partial => "entity_yui_form_fields", :locals => { :instance => @instance }  %>

            fields.push ( { type : 'submit', label : '<%= escape_javascript(t('madb_submit')) %>', id: 'commit'});
            fields.push ( {type : 'reset', label : '<%= escape_javascript(t('madb_reset'))%>'});
    Y.publish('madb:new_entity_linked', {broadcast: 2});
    Y.publish('madb:refresh_related', {broadcast: 2});
    <%= default_entity_form( :form_content_box => "#{@yui_form_id}", :success_callback =>%{ function(form,data){ Y.fire('madb:new_entity_linked', '#{@yui_form_id}', data  );    }   }, :failure_callback => %{ function(form, data){ Y.fire('madb:refresh_related', '#{@yui_form_id}'); }} , :form_action =>url_for(:action => "apply_link_to_new") , :upload => @entity.has_file_attachment_detail?) %>

    f.render();
    f.focus();
<% end %>
</script>


Update answer to Why will my name and my request appear publicly on the site?

<% @title = "Your privacy" %>

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

<%= @title %> #

Who gets to see my email address? #

We will not disclose your email address to anyone unless we are obliged to by law,
or you ask us to. This includes the public authority that you are sending a
request to.  They only get to see an email address
@<%= MySociety::Config.get('INCOMING_EMAIL_DOMAIN', 'localhost') %> which is specific to that request.

If you send a message to another user on the site, then it will reveal your
email address to them. You will be told that this is going to happen.

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

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

Why will my name and my request appear publicly on the site? #

We publish your request on the Internet so that anybody can read it and
make use of the information that you have found. We do not normally delete
requests (more details).

Your name is tangled up with your request.
It is only reasonable that we publish your name, just as we'll be publishing the name of the public servant who responds to you.

If possible please use your real name as it helps make your request look serious. It can also help people
get in touch with you to assist you with your research or to campaign with you.

If you don't want to use your real name to make a request, by law, you don't have to. See the next question if you're thinking of using a pseudonym.

Can I make an FOI request using a pseudonym? #

Yes, you can use a pseudonym. Be careful though. It might make it impossible to follow up with the Information Commisioner if you think a decision needs to be reviewed.

 The Information Commissioner FOI guidelines say that "the FOI Act does not require an applicant to disclose their identity" but that the "agency or minister should consider whether collection of information about the applicant's identity is required to assess the request".

Please do not try to impersonate someone else.

They've asked for my postal address! #

If a public authority asks you for your full, physical address, reply to them directing them to the Information Commissioner guidance on Form of Access

8.102 Subject to limited exceptions, an applicant who requests access to a document in a particular form has a right to be given access in that form (s 20(2)).
8.104 As agencies and ministers obtain greater access to new technology it is expected that they will make reasonable efforts to facilitate access to documents that have not previously been accessible in a particular form. Wherever possible access to documents by means that do not require physical inspection should be preferred.

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

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

If that doesn't work, and you want to provide your postal address privately
in order to receive the documents, mark your request as "They are going to reply by post", and it will
give you an email address to use for that purpose.

Can you delete my requests, or alter my name?  #

<%= site_name %> is a permanent, public archive of Freedom of
Information requests. Even though you may not find the response to
a request useful any more, it may be of interest to others. For this
reason, we will not delete requests.

Under exceptional circumstances we may remove or change your name
on the website, see the next question.
Similarly, we may also remove other personal information.

If you're worried about this before you make your request,
see the section on pseudonyms.

Can you take down personal information about me? #

If you see any personal information about you on the site which you'd like
us to remove or hide, then please let us know.
Specify exactly what information you believe to be problematic and why, and
where it appears on the site.

If it is sensitive personal information that has been accidentally
posted, then we will usually remove it. Normally we will only consider
requests to remove personal information which come from the individual
concerned, but for sensitive information we would appreciate anyone
pointing out anything they see.

We consider that there is a strong public interest in
retaining the names of officers or servants of public authorities. We will only
remove such names in exceptional circumstances, such as where the disclosure of
a name and position of employment would substantially risk an individual's
safety. If you are such an official and you wish to have your name removed for
such an urgent reason, you must supply us with a request to do so from your
line manager. This request must demonstrate that a risk has been perceived
which outweighs the public interest, and must demonstrate that efforts have
been made to conceal the name on the organisation's own website.

For all other requests we apply a public interest test to decide
whether information should be removed. We cannot easily edit many types of attachments (such
as PDFs, or Microsoft Word or Excel files), so we will usually ask
that authorities resend these with the personal information removed.

Learn more from the help for FOI officers -->

<% @title = "Your privacy" %>

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

<%= @title %> #

Who gets to see my email address? #

We will not disclose your email address to anyone unless we are obliged to by law,
or you ask us to. This includes the public authority that you are sending a
request to.  They only get to see an email address
@<%= MySociety::Config.get('INCOMING_EMAIL_DOMAIN', 'localhost') %> which is specific to that request.

If you send a message to another user on the site, then it will reveal your
email address to them. You will be told that this is going to happen.

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

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

Why will my name and my request appear publicly on the site? #

We publish your request on the Internet so that anybody can read it and
make use of the information that you have found. We do not normally delete
requests (more details).

Your name is tangled up with your request, so has to be published as well.
It is only fair, as we're going to publish the name of the civil servant who
writes the response to your request.  Using your real name also helps people
get in touch with you to assist you with your research or to campaign with you.

By law, you must use your real name for the request to be a valid Freedom of
Information request. See the next question for alternatives if you do not want
to publish your full name.

Can I make an FOI request using a pseudonym? #

Yes, you can use a pseudonym. Be careful though. It might make it impossible to follow up with the Information Commisioner if you think a decision needs to be reviewed.

 The Information Commissioner FOI guidelines say that "the FOI Act does not require an applicant to disclose their identity" but that the "agency or minister should consider whether collection of information about the applicant's identity is required to assess the request".

Please do not try to impersonate someone else.

They've asked for my postal address! #

If a public authority asks you for your full, physical address, reply to them directing them to the Information Commissioner guidance on Form of Access

8.102 Subject to limited exceptions, an applicant who requests access to a document in a particular form has a right to be given access in that form (s 20(2)).
8.104 As agencies and ministers obtain greater access to new technology it is expected that they will make reasonable efforts to facilitate access to documents that have not previously been accessible in a particular form. Wherever possible access to documents by means that do not require physical inspection should be preferred.

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

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

If that doesn't work, and you want to provide your postal address privately
in order to receive the documents, mark your request as "They are going to reply by post", and it will
give you an email address to use for that purpose.

Can you delete my requests, or alter my name?  #

<%= site_name %> is a permanent, public archive of Freedom of
Information requests. Even though you may not find the response to
a request useful any more, it may be of interest to others. For this
reason, we will not delete requests.

Under exceptional circumstances we may remove or change your name
on the website, see the next question.
Similarly, we may also remove other personal information.

If you're worried about this before you make your request,
see the section on pseudonyms.

Can you take down personal information about me? #

If you see any personal information about you on the site which you'd like
us to remove or hide, then please let us know.
Specify exactly what information you believe to be problematic and why, and
where it appears on the site.

If it is sensitive personal information that has been accidentally
posted, then we will usually remove it. Normally we will only consider
requests to remove personal information which come from the individual
concerned, but for sensitive information we would appreciate anyone
pointing out anything they see.

We consider that there is a strong public interest in
retaining the names of officers or servants of public authorities. We will only
remove such names in exceptional circumstances, such as where the disclosure of
a name and position of employment would substantially risk an individual's
safety. If you are such an official and you wish to have your name removed for
such an urgent reason, you must supply us with a request to do so from your
line manager. This request must demonstrate that a risk has been perceived
which outweighs the public interest, and must demonstrate that efforts have
been made to conceal the name on the organisation's own website.

For all other requests we apply a public interest test to decide
whether information should be removed. We cannot easily edit many types of attachments (such
as PDFs, or Microsoft Word or Excel files), so we will usually ask
that authorities resend these with the personal information removed.

Learn more from the help for FOI officers -->


changes made to remove constant 1 = true and replace it with true or false value

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

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

	<%= flash[:notice] %>

<% end %>

Reviews

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

Review <%=review_no%>  <%= link_to "View",{:controller => 'review', :action => 'view_review', :id => @review.id} %>
  <%= link_to "Edit",{:controller => 'review', :action => 'edit_review', :id => @review.id} %>

  <% else %>

Review <%=review_no%>  <%= link_to "Begin",{:controller => 'review', :action => 'new_review', :id => review_map.id} %>

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

<<<<<<< .mine
 <% if @can_view_review_of_review == true %>
=======
 <% if @can_view_metareview == 1 %>
>>>>>>> .r447

Reviews of reviews

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

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

  <% else %>

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

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

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

Existing reviews of reviews

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

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

  <% else %>

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

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

 <% end %>

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

	<%= flash[:notice] %>

<% end %>

Reviews

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

Review <%=review_no%>  <%= link_to "View",{:controller => 'review', :action => 'view_review', :id => @review.id} %>
  <%= link_to "Edit",{:controller => 'review', :action => 'edit_review', :id => @review.id} %>

  <% else %>

Review <%=review_no%>  <%= link_to "Begin",{:controller => 'review', :action => 'new_review', :id => review_map.id} %>

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

 <% if @can_view_metareview == 1 %>

Reviews of reviews

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

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

  <% else %>

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

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

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

Existing reviews of reviews

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

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

  <% else %>

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

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

 <% end %>