removed me tabs that dont yet work

removed me tabs that dont yet work

<%= Formy.tabs do |f|
  f.tab do |t|
    t.label 'Inbox'
    t.link url_for(:action => 'inbox')
    t.selected params[:action] == 'inbox' || params[:action] == 'index'
  end
# f.tab do |t|
#   t.label 'Dashboard'
#   t.link url_for(:action => 'dash')
#   t.selected params[:action] == 'dash'
# end
  f.tab do |t|
    t.label 'Tasks'
    t.link url_for(:action => 'tasks')
    t.selected params[:action] == 'tasks'
  end
# f.tab do |t|
#   t.label 'Calendar'
#   t.link url_for(:action => 'calendar')
#   t.selected params[:action] == 'calendar'
# end
  f.tab do |t|
    t.label 'Search'
    t.link url_for(:action => 'search')
    t.selected params[:action] == 'search'
  end
  f.tab do |t|
    t.label 'My Profile'
    t.link url_for(:action => 'edit')
    t.selected params[:action] == 'edit'
  end
end
%>

<%= Formy.tabs do |f|
  f.tab do |t|
    t.label 'Inbox'
    t.link url_for(:action => 'inbox')
    t.selected params[:action] == 'inbox' || params[:action] == 'index'
  end
  f.tab do |t|
    t.label 'Dashboard'
    t.link url_for(:action => 'dash')
    t.selected params[:action] == 'dash'
  end
  f.tab do |t|
    t.label 'Tasks'
    t.link url_for(:action => 'tasks')
    t.selected params[:action] == 'tasks'
  end
  f.tab do |t|
    t.label 'Calendar'
    t.link url_for(:action => 'calendar')
    t.selected params[:action] == 'calendar'
  end
  f.tab do |t|
    t.label 'Search'
    t.link url_for(:action => 'search')
    t.selected params[:action] == 'search'
  end
  f.tab do |t|
    t.label 'My Profile'
    t.link url_for(:action => 'edit')
    t.selected params[:action] == 'edit'
  end
end
%>


we were pointing to lipid in our logo

we were pointing to lipid in our logo

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

  <title>CruiseControl.rb</title>
  <%= stylesheet_link_tag 'cruisecontrol', :media => 'all' %>
  <%= javascript_include_tag :defaults %>

  <%= link_to image_tag("cc_logo.png"), "http://cruisecontrolrb.rubyforge.org/" %>

<%= @breadcrumbs %>

version : <%= CruiseControl::VERSION::STRING %>

        <%= yield :left_side %>

        <%= yield %>

    <%= link_to image_tag("tw_dev_logo.gif"), "http://www.thoughtworks.com/" %>
    <%= image_tag "shim.gif" %>

  <title>CruiseControl.rb</title>
  <%= stylesheet_link_tag 'cruisecontrol', :media => 'all' %>
  <%= javascript_include_tag :defaults %>

  <%= link_to image_tag("cc_logo.png"), "http://lipid.rubyforge.org/" %>

<%= @breadcrumbs %>

version : <%= CruiseControl::VERSION::STRING %>

        <%= yield :left_side %>

        <%= yield %>

    <%= link_to image_tag("tw_dev_logo.gif"), "http://www.thoughtworks.com/" %>
    <%= image_tag "shim.gif" %>


view fix

view fix

Assignment: <%= @assignment.title %>

Course: <%= @course.title %>

Feedback for <%= @user.display_name %>

<%= link_to 'Back to my turn-ins', :controller => 'turnins', :course => @course, :assignment => @assignment %> | <%= link_to 'Back to assignment', :controller => 'assignments', :course => @course, :id => @assignment, :action => 'view', :assignment => nil %>

<% if @grade_item %>
  <% if @grade_entry.nil? %>

No grade has been submitted.

  <% else %>

Your grade: <%= sprintf("%.1f",@grade_entry.points) %> out of <%= sprintf("%.1f",@grade_item.points) %> possible points

Instructor Comments:

        <%= @feedback_html %>

  <% end %>

<% elsif !@assignment.released%>

<%= image_tag 'flag_red.png' %>Grades and instructor feedback are not yet available.
    <% if @assignment.auto_grade && !@assignment.auto_grade_setting.nil? && @assignment.auto_grade_setting.any_student_grade? %>

Scroll down for results from the AutoGrader.
    <% end%>

<% end %>

<% if @current_turnin %>

 <% if @assignment.auto_grade && !@assignment.auto_grade_setting.nil? && @assignment.auto_grade_setting.io_check? %>

AutoGrade Results

   <% if ! @current_turnin.safe_for_autograde? %>

<%= image_tag 'flag_red.png' %> This turn-in set is not considered safe for automatic execution, an instructor needs to review the files first.

   <% end %>

Output diff key:

Extra text, not appearing in expected output.

Text missing from the expected output.

Text that is in the same position, but is different form expected output.

   <% if @assignment.auto_grade && !@assignment.auto_grade_setting.nil? && (@assignment.auto_grade_setting.student_io_check || @assignment.released) %>

     <% io_count = 0  %>

     <% for check in @assignment.io_checks %>
       <% if check.student_level || @assignment.released %>
         <% show_input = check.show_input && @assignment.released
            span = 2
            span += 1 if show_input
          %>

<th colspan="<%=span%>"><%= image_tag 'map.png' %> I/O Check: '<%= check.name %>'

	         <% if show_input %>
	           Test Input
	         <% else %>
	           Expected Output
	         <% end %>
	         Your Output
		       <% unless @student_io_check[check.id].nil? %>
		       :: Match Percentage <%= sprintf( "%.2f", @student_io_check[check.id].match_percent ) %>%

		         <% if 100 - @student_io_check[check.id].match_percent < check.tolerance %>
		           <%= image_tag 'accept.png' %>Pass
		         <% else %>
		           <%= image_tag 'cancel.png' %>Failure
		         <% end %>

		         (<%= link_to_function( "toggle raw/diff", "Element.toggle('student_check_#{check.id}_diff');Element.toggle('student_check_#{check.id}_raw');" ) %>)

		       <% end %>

			 <% if show_input %>
	           <%= check.input.to_html %>
	         <% else %>

			       <%= check.output.to_html %>

	         <% end %>

			  <div id="student_check_<%=check.id%>_diff">
				 <% if @student_io_check[check.id].nil? %>
				   <%= image_tag 'flag_red.png' %>No output found for this test.
				 <% else %>
		  		    <%= @student_io_check[check.id].diff_report.non_span_space_convert %>
				 <% end %>

Viewing Diff Output.

			  <div id="student_check_<%=check.id%>_raw" style="display:none;">
				 <% if @student_io_check[check.id].nil? %>
				   <%= image_tag 'flag_red.png' %>No output found for this test.
				 <% else %>
		  		    <%= @student_io_check[check.id].output.to_html %>
				 <% end %>

Viewing Raw Output.

       <% end %>
     <% end %>

   <% else %>

<%= image_tag 'flag_yellow.png' %>Automatic grading by way of output verification is enabled for this assignment, but the results are hidden until the grades and instructor comments are released.

   <% end %>

 <% end %>

Turned in files

 Jump to file

 <% for utf in @current_turnin.user_turnin_files %>
  <% unless utf.directory_entry? %>
    <% if FileManager.is_text_file( utf.extension ) %>

<a href="#file_<%=utf.id%>"> <%= image_tag utf.icon %> <%= utf.full_filename( @directories ) %>

    <% else %>

<%= image_tag utf.icon %> <%= utf.full_filename( @directories ) %> (<%= link_to "download", :action => 'download_file', :id => utf.id %>)

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

  <% for utf in @current_turnin.user_turnin_files %>
   <% if FileManager.is_text_file( utf.extension ) %>

    <%= image_tag utf.icon %>
    <% if utf.directory_entry? %>Directory:
    <% else %>File:
    <% end %><a name="file_<%=utf.id%>"><%= utf.full_filename( @directories ) %>
        <%= image_tag 'arrow_up.png' %>

	<% if utf.directory_entry? %>

Directory entry

	<% else %>
	  <% directory = @current_turnin.get_dir( @app['external_dir'] )
	     directory = @current_turnin.get_team_dir( @app['external_dir'], @team ) unless @team.nil?
	     lines = FileManager.format_file( @app['enscript_command'], "#{directory}#{utf.full_filename( @directories )}", utf.extension )
	     comment_hash = Hash.new
	     comment_hash = utf.file_comments_hash if @assignment.released
	     style_hash = Hash.new
	     style_hash = utf.file_style_hash if @assignment.auto_grade && !@assignment.auto_grade_setting.nil? && ( @assignment.auto_grade_setting.student_style || @assignment.released)
	   %>

	   <% line_num = 0 %>

	     <% for line in lines %>
	       <% line_num = line_num.next %>
	       <% numbers = line_num.to_s
	          numbers.size.upto(8) { |x| numbers = " #{numbers}" } %>
	       <%= numbers %>: <%= line %>

	       <% if comment_hash[line_num] %>

	Instructor comment on line <%=line_num%>

	<%= comment_hash[line_num].comments.to_html %>

	       <% end %>
	       <% if style_hash[line_num] %>
	          <% for fs in style_hash[line_num] %>

		           PMD Code Style: From line <%= fs.begin_line %>:<%= fs.begin_column %> to line <%= fs.end_line %>:<%= fs.end_column %>

<%= fs.message %>

Explanation: <%= fs.style_check.description rescue "unknown" %>

<%= link_to_function "View Example: #{image_tag 'folder_bug.png'}", visual_effect(:toggle_appear, "example_#{fs.id}" )  %>

				       <div class="code_example" id="example_<%=fs.id%>" style="display: none;">
					     <%= fs.style_check.example rescue "no example available" %>

	          <% end %>
	       <% end %>

	     <% end %>

	<% end %>
   <% end ## if text file %>
  <% end ## for loop %>

<% else %>

No turn-in found

<% end %>

Assignment: <%= @assignment.title %>

Course: <%= @course.title %>

Feedback for <%= @user.display_name %>

<%= link_to 'Back to my turn-ins', :controller => 'turnins', :course => @course, :assignment => @assignment %> | <%= link_to 'Back to assignment', :controller => 'assignments', :course => @course, :id => @assignment, :action => 'view', :assignment => nil %>

<% if @grade_item %>
  <% if @grade_entry.nil? %>

No grade has been submitted.

  <% else %>

Your grade: <%= sprintf("%.1f",@grade_entry.points) %> out of <%= sprintf("%.1f",@grade_item.points) %> possible points

Instructor Comments:

        <%= @feedback_html %>

  <% end %>

<% elsif !@assignment.released%>

<%= image_tag 'flag_red.png' %>Grades and instructor feedback are not yet available.
    <% if @assignment.auto_grade && !@assignment.auto_grade_setting.nil? && @assignment.auto_grade_setting.any_student_grade? %>

Scroll down for results from the AutoGrader.
    <% end%>

<% end %>

<% if @current_turnin %>

 <% if @assignment.auto_grade && !@assignment.auto_grade_setting.nil? && @assignment.auto_grade_setting.io_check? %>

AutoGrade Results

   <% if ! @current_turnin.safe_for_autograde? %>

<%= image_tag 'flag_red.png' %> This turn-in set is not considered safe for automatic execution, an instructor needs to review the files first.

   <% end %>

Output diff key:

Extra text, not appearing in expected output.

Text missing from the expected output.

Text that is in the same position, but is different form expected output.

   <% if @assignment.auto_grade && !@assignment.auto_grade_setting.nil? && (@assignment.auto_grade_setting.student_io_check || @assignment.released) %>

     <% io_count = 0  %>

     <% for check in @assignment.io_checks %>
       <% if check.student_level || @assignment.released %>
         <% show_input = check.show_input && @assignment.released
            span = 2
            span += 1 if show_input
          %>

<th colspan="<%=span%>"><%= image_tag 'map.png' %> I/O Check: '<%= check.name %>'

	         <% if show_input %>
	           Test Input
	         <% else %>
	           Expected Output
	         <% end %>
	         Your Output
		       <% unless @student_io_check[check.id].nil? %>
		       :: Match Percentage <%= sprintf( "%.2f", @student_io_check[check.id].match_percent ) %>%

		         <% if 100 - @student_io_check[check.id].match_percent < check.tolerance %>
		           <%= image_tag 'accept.png' %>Pass
		         <% else %>
		           <%= image_tag 'cancel.png' %>Failure
		         <% end %>

		         (<%= link_to_function( "toggle raw/diff", "Element.toggle('student_check_#{check.id}_diff');Element.toggle('student_check_#{check.id}_raw');" ) %>)

		       <% end %>

			 <% if show_input %>
	           <%= check.input.to_html %>
	         <% else %>

			       <%= check.output.to_html %>

	         <% end %>

			  <div id="student_check_<%=check.id%>_diff">
				 <% if @student_io_check[check.id].nil? %>
				   <%= image_tag 'flag_red.png' %>No output found for this test.
				 <% else %>
		  		    <%= @student_io_check[check.id].diff_report.non_span_space_convert %>
				 <% end %>

Viewing Diff Output.

			  <div id="student_check_<%=check.id%>_raw" style="display:none;">
				 <% if @student_io_check[check.id].nil? %>
				   <%= image_tag 'flag_red.png' %>No output found for this test.
				 <% else %>
		  		    <%= @student_io_check[check.id].output.to_html %>
				 <% end %>

Viewing Raw Output.

       <% end %>
     <% end %>

   <% else %>

<%= image_tag 'flag_yellow.png' %>Automatic grading by way of output verification is enabled for this assignment, but the results are hidden until the grades and instructor comments are released.

   <% end %>

 <% end %>

Turned in files

 Jump to file

 <% for utf in @current_turnin.user_turnin_files %>
  <% unless utf.directory_entry? %>
    <% if FileManager.is_text_file( utf.extension ) %>

<a href="#file_<%=utf.id%>"> <%= image_tag utf.icon %> <%= utf.full_filename( @directories ) %>

    <% else %>

<%= image_tag utf.icon %> <%= utf.full_filename( @directories ) %> (<%= link_to "download", :action => 'download_file', :id => utf.id %>)

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

  <% for utf in @current_turnin.user_turnin_files %>
   <% if FileManager.is_text_file( utf.extension ) %>

    <%= image_tag utf.icon %>
    <% if utf.directory_entry? %>Directory:
    <% else %>File:
    <% end %><a name="file_<%=utf.id%>"><%= utf.full_filename( @directories ) %>
        <%= image_tag 'arrow_up.png' %>

	<% if utf.directory_entry? %>

Directory entry

	<% else %>
	  <% directory = @current_turnin.get_dir( @app['external_dir'] )
	     directory = @current_turnin.get_team_dir( @app['external_dir'], @team ) unless @team.nil?
	     lines = FileManager.format_file( @app['enscript_command'], "#{directory}#{utf.full_filename( @directories )}", utf.extension )
	     comment_hash = Hash.new
	     comment_hash = utf.file_comments_hash if @assignment.released
	     style_hash = Hash.new
	     style_hash = utf.file_style_hash if @assignment.auto_grade && !@assignment.auto_grade_setting.nil? && ( @assignment.auto_grade_setting.student_style || @assignment.released)
	   %>

	   <% line_num = 0 %>

	     <% for line in lines %>
	       <% line_num = line_num.next %>
	       <% numbers = line_num.to_s
	          numbers.size.upto(8) { |x| numbers = " #{numbers}" } %>
	       <%= numbers %>: <%= line %>

	       <% if comment_hash[line_num] %>

	Instructor comment on line <%=line_num%>

	<%= comment_hash[line_num].comments.to_html %>

	       <% end %>
	       <% if style_hash[line_num] %>
	          <% for fs in style_hash[line_num] %>

		           PMD Code Style: From line <%= fs.begin_line %>:<%= fs.begin_column %> to line <%= fs.end_line %>:<%= fs.end_column %>

<%= fs.message %>

Explanation: <%= fs.style_check.description %>

<%= link_to_function "View Example: #{image_tag 'folder_bug.png'}", visual_effect(:toggle_appear, "example_#{fs.id}" )  %>

				       <div class="code_example" id="example_<%=fs.id%>" style="display: none;">
					     <%= fs.style_check.example %>

	          <% end %>
	       <% end %>

	     <% end %>

	<% end %>
   <% end ## if text file %>
  <% end ## for loop %>

<% else %>

No turn-in found

<% end %>


show released items

show released items

Assignment: <%= @assignment.title %>

Course: <%= @course.title %>

Feedback for <%= @user.display_name %>

<%= link_to 'Back to my turn-ins', :controller => 'turnins', :course => @course, :assignment => @assignment %> | <%= link_to 'Back to assignment', :controller => 'assignments', :course => @course, :id => @assignment, :action => 'view', :assignment => nil %>

<% if @grade_item %>
  <% if @grade_entry.nil? %>

No grade has been submitted.

  <% else %>

Your grade: <%= sprintf("%.1f",@grade_entry.points) %> out of <%= sprintf("%.1f",@grade_item.points) %> possible points

Instructor Comments:

        <%= @feedback_html %>

  <% end %>

<% elsif !@assignment.released%>

<%= image_tag 'flag_red' %>Grades and instructor feedback are not yet available.
    <% if @assignment.auto_grade_setting.any_student_grade? %>

Scroll down for results from the AutoGrader.
    <% end%>

<% end %>

<% if @current_turnin %>

 <% if @assignment.auto_grade_setting.io_check? %>

AutoGrade Results

   <% if ! @current_turnin.safe_for_autograde? %>

<%= image_tag 'flag_red' %> This turn-in set is not considered safe for automatic execution, an instructor needs to review the files first.

   <% end %>

Output diff key:

Extra text, not appearing in expected output.

Text missing from the expected output.

Text that is in the same position, but is different form expected output.

   <% if @assignment.auto_grade_setting.student_io_check || @assignment.released %>

     <% io_count = 0  %>

     <% for check in @assignment.io_checks %>
       <% if check.student_level || @assignment.released %>
         <% show_input = check.show_input && @assignment.released
            span = 2
            span += 1 if show_input
          %>

<th colspan="<%=span%>"><%= image_tag 'map' %> I/O Check: '<%= check.name %>'

	         <% if show_input %>
	           Test Input
	         <% else %>
	           Expected Output
	         <% end %>
	         Your Output
		       <% unless @student_io_check[check.id].nil? %>
		       :: Match Percentage <%= sprintf( "%.2f", @student_io_check[check.id].match_percent ) %>%

		         <% if 100 - @student_io_check[check.id].match_percent < check.tolerance %>
		           <%= image_tag 'accept' %>Pass
		         <% else %>
		           <%= image_tag 'cancel' %>Failure
		         <% end %>

		       <% end %>

			 <% if show_input %>
	           <%= check.input.to_html %>
	         <% else %>

			     <%= check.output.to_html %>

	         <% end %>

			 <% if @student_io_check[check.id].nil? %>

			   <%= image_tag 'flag_red' %>No output found for this test.

			 <% else %>

	  		      <%= @student_io_check[check.id].diff_report.newline_to_break %>

			 <% end %>

       <% end %>
     <% end %>

   <% else %>

<%= image_tag 'flag_yellow' %>Automatic grading by way of output verification is enabled for this assignment, but the results are hidden until the grades and instructor comments are released.

   <% end %>

 <% end %>

Turned in files

 Jump to file

 <% for utf in @current_turnin.user_turnin_files %>
  <% unless utf.directory_entry? %>

<a href="#file_<%=utf.id%>"> <%= image_tag utf.icon %> <%= utf.full_filename( @directories ) %>

  <% end %>
 <% end %>

  <% for utf in @current_turnin.user_turnin_files %>

    <%= image_tag utf.icon %>
    <% if utf.directory_entry? %>Directory:
    <% else %>File:
    <% end %><a name="file_<%=utf.id%>"><%= utf.full_filename( @directories ) %>
        <%= image_tag 'arrow_up' %>

	<% if utf.directory_entry? %>

Directory entry

	<% else %>
	  <% directory = @current_turnin.get_dir( @app['external_dir'] )
	     lines = FileManager.format_file( @app['enscript_command'], "#{directory}#{utf.full_filename( @directories )}", utf.extension )
	     comment_hash = Hash.new
	     comment_hash = utf.file_comments_hash if @assignment.released
	     style_hash = Hash.new
	     style_hash = utf.file_style_hash if @assignment.auto_grade_setting.student_style || @assignment.released
	   %>

	   <% line_num = 0 %>

	     <% for line in lines %>
	       <% line_num = line_num.next %>
	       <% numbers = line_num.to_s
	          numbers.size.upto(8) { |x| numbers = " #{numbers}" } %>
	       <%= numbers %>: <%= line %>

	       <% if comment_hash[line_num] %>

	Instructor comment on line <%=line_num%>

	<%= comment_hash[line_num].comments.to_html %>

	       <% end %>
	       <% if style_hash[line_num] %>
	          <% for fs in style_hash[line_num] %>

		           PMD Code Style: From line <%= fs.begin_line %>:<%= fs.begin_column %> to line <%= fs.end_line %>:<%= fs.end_column %>

<%= fs.message %>

Explanation: <%= fs.style_check.description %>

<%= link_to_function "View Example: #{image_tag 'folder_bug'}", visual_effect(:toggle_appear, "example_#{fs.id}" )  %>

				       <div class="code_example" id="example_<%=fs.id%>" style="display: none;">
					     <%= fs.style_check.example %>

	          <% end %>
	       <% end %>

	     <% end %>

	<% end %>

  <% end %>

<% else %>

No turn-in found

<% end %>

Assignment: <%= @assignment.title %>

Course: <%= @course.title %>

Feedback for <%= @user.display_name %>

<%= link_to 'Back to my turn-ins', :controller => 'turnins', :course => @course, :assignment => @assignment %> | <%= link_to 'Back to assignment', :controller => 'assignments', :course => @course, :id => @assignment, :action => 'view', :assignment => nil %>

<% if @grade_item %>
  <% if @grade_entry.nil? %>

No grade has been submitted.

  <% else %>

Your grade: <%= sprintf("%.1f",@grade_entry.points) %> out of <%= sprintf("%.1f",@grade_item.points) %> possible points

Instructor Comments:

        <%= @feedback_html %>

  <% end %>

<% elsif !@assignment.released%>

<%= image_tag 'flag_red' %>Grades and instructor feedback are not yet available.
    <% if @assignment.auto_grade_setting.any_student_grade? %>

Scroll down for results from the AutoGrader.
    <% end%>

<% end %>

<% if @current_turnin %>

 <% if @assignment.auto_grade_setting.io_check? %>

AutoGrade Results

   <% if ! @current_turnin.safe_for_autograde? %>

<%= image_tag 'flag_red' %> This turn-in set is not considered safe for automatic execution, an instructor needs to review the files first.

   <% end %>

Output diff key:

Extra text, not appearing in expected output.

Text missing from the expected output.

Text that is in the same position, but is different form expected output.

   <% if @assignment.auto_grade_setting.student_io_check || @assignment.released %>

     <% io_count = 0  %>

     <% for check in @assignment.io_checks %>
       <% if check.student_level %>
         <% show_input = check.show_input && @assignment.released
            span = 2
            span += 1 if show_input
          %>

<th colspan="<%=span%>"><%= image_tag 'map' %> I/O Check: '<%= check.name %>'

	         <% if show_input %>
	           Test Input
	         <% else %>
	           Expected Output
	         <% end %>
	         Your Output
		       <% unless @student_io_check[check.id].nil? %>
		       :: Match Percentage <%= sprintf( "%.2f", @student_io_check[check.id].match_percent ) %>%

		         <% if 100 - @student_io_check[check.id].match_percent < check.tolerance %>
		           <%= image_tag 'accept' %>Pass
		         <% else %>
		           <%= image_tag 'cancel' %>Failure
		         <% end %>

		       <% end %>

			 <% if show_input %>
	           <%= check.input.to_html %>
	         <% else %>

			     <%= check.output.to_html %>

	         <% end %>

			 <% if @student_io_check[check.id].nil? %>

			   <%= image_tag 'flag_red' %>No output found for this test.

			 <% else %>

	  		      <%= @student_io_check[check.id].diff_report.newline_to_break %>

			 <% end %>

       <% end %>
     <% end %>

   <% else %>

<%= image_tag 'flag_yellow' %>Automatic grading by way of output verification is enabled for this assignment, but the results are hidden until the grades and instructor comments are released.

   <% end %>

 <% end %>

Turned in files

 Jump to file

 <% for utf in @current_turnin.user_turnin_files %>
  <% unless utf.directory_entry? %>

<a href="#file_<%=utf.id%>"> <%= image_tag utf.icon %> <%= utf.full_filename( @directories ) %>

  <% end %>
 <% end %>

  <% for utf in @current_turnin.user_turnin_files %>

    <%= image_tag utf.icon %>
    <% if utf.directory_entry? %>Directory:
    <% else %>File:
    <% end %><a name="file_<%=utf.id%>"><%= utf.full_filename( @directories ) %>
        <%= image_tag 'arrow_up' %>

	<% if utf.directory_entry? %>

Directory entry

	<% else %>
	  <% directory = @current_turnin.get_dir( @app['external_dir'] )
	     lines = FileManager.format_file( @app['enscript_command'], "#{directory}#{utf.full_filename( @directories )}", utf.extension )
	     comment_hash = Hash.new
	     comment_hash = utf.file_comments_hash if @assignment.released
	     style_hash = Hash.new
	     style_hash = utf.file_style_hash if @assignment.auto_grade_setting.student_style || @assignment.released
	   %>

	   <% line_num = 0 %>

	     <% for line in lines %>
	       <% line_num = line_num.next %>
	       <% numbers = line_num.to_s
	          numbers.size.upto(8) { |x| numbers = " #{numbers}" } %>
	       <%= numbers %>: <%= line %>

	       <% if comment_hash[line_num] %>

	Instructor comment on line <%=line_num%>

	<%= comment_hash[line_num].comments.to_html %>

	       <% end %>
	       <% if style_hash[line_num] %>
	          <% for fs in style_hash[line_num] %>

		           PMD Code Style: From line <%= fs.begin_line %>:<%= fs.begin_column %> to line <%= fs.end_line %>:<%= fs.end_column %>

<%= fs.message %>

Explanation: <%= fs.style_check.description %>

<%= link_to_function "View Example: #{image_tag 'folder_bug'}", visual_effect(:toggle_appear, "example_#{fs.id}" )  %>

				       <div class="code_example" id="example_<%=fs.id%>" style="display: none;">
					     <%= fs.style_check.example %>

	          <% end %>
	       <% end %>

	     <% end %>

	<% end %>

  <% end %>

<% else %>

No turn-in found

<% end %>


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

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

View Review

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

	View review
	Hide review

Reviewed <%= @review.review_num_for_author %> at <%= @review.updated_at.strftime('%A %B %d %Y, %I:%M%p') %>
<%= render :partial => 'review/score1' %>
Additional Comment : <%=@review.additional_comment%>

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

View author feedback

Hide author feedback

<% @review_scores1 = Score.find(:all,:conditions =>["instance_id =? AND questionnaire_type_id = ?", review_feedback.id, QuestionnaireType.find_by_name("Author Feedback").id])
%>

Author feedback:

<%= render :partial => 'review/score1' %>
Additional Comment:
<%=review_feedback.additional_comment%>

<% end%>

View Review

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

	View review
	Hide review

Reviewed <%= @review.review_num_for_author %> at <%= @review.updated_at.strftime('%A %B %d %Y, %I:%M%p') %>
<%= render :partial => 'review/score1' %>
Additional Comment : <%=@review.additional_comment%>

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

View author feedback

Hide author feedback

<% @review_scores1 = ReviewScore.find(:all,:conditions =>["review_id =? AND questionnaire_type_id = ?", review_feedback.id, QuestionnaireType.find_by_name("Author Feedback").id])
%>

Author feedback:

<%= render :partial => 'review/score1' %>
Additional Comment:
<%=review_feedback.additional_comment%>

<% end%>


Deprecation cleanup for rescues (closes #6339) [adam]

git-svn-id: afc9fed30c1a09d8801d1e4fbe6e01c29c67d11f@5239 5ecf4fe2-1ee6-0310-87b1-e25e094e27de

<% unless @exception.blamed_files.blank? %>
  <% if (hide = @exception.blamed_files.length > 8) %>
    Show blamed files
  <% end %>
  <pre id="blame_trace" <%='style="display:none"' if hide %>><%=h @exception.describe_blame %>

<% end %>

<% if false %>

  <% begin %>
    <%= form_tag(request.request_uri, "method" => request.method) %>
      <input type="hidden" name="BP-RETRY" value="1" />

      <% for key, values in params %>
        <% next if key == "BP-RETRY" %>
        <% for value in Array(values) %>
          <input type="hidden" name="<%= key %>" value="<%= value %>" />
        <% end %>
      <% end %>

      <input type="submit" value="Retry with Breakpoint" />
    </form>
  <% rescue Exception => e %>
    <%=h "Couldn't render breakpoint link due to #{e.class} #{e.message}" %>
  <% end %>
<% end %>

<%
  request_parameters_without_action = request.parameters.clone
  request_parameters_without_action.delete("action")
  request_parameters_without_action.delete("controller")

  request_dump  = request_parameters_without_action.inspect.gsub(/,/, ",\n")
%>

Request

Parameters: <%=h request_dump == "{}" ? "None" : request_dump %>

Show session dump

<%= debug(request.session.instance_variable_get("@data")) %>

Response

Headers: <%=h response.headers.inspect.gsub(/,/, ",\n") %>

<% unless @exception.blamed_files.blank? %>
  <% if (hide = @exception.blamed_files.length > 8) %>
    Show blamed files
  <% end %>
  <pre id="blame_trace" <%='style="display:none"' if hide %>><%=h @exception.describe_blame %>

<% end %>

<% if false %>

  <% begin %>
    <%= form_tag(@request.request_uri, "method" => @request.method) %>
      <input type="hidden" name="BP-RETRY" value="1" />

      <% for key, values in params %>
        <% next if key == "BP-RETRY" %>
        <% for value in Array(values) %>
          <input type="hidden" name="<%= key %>" value="<%= value %>" />
        <% end %>
      <% end %>

      <input type="submit" value="Retry with Breakpoint" />
    </form>
  <% rescue Exception => e %>
    <%=h "Couldn't render breakpoint link due to #{e.class} #{e.message}" %>
  <% end %>
<% end %>

<%
  request_parameters_without_action = @request.parameters.clone
  request_parameters_without_action.delete("action")
  request_parameters_without_action.delete("controller")

  request_dump  = request_parameters_without_action.inspect.gsub(/,/, ",\n")
%>

Request

Parameters: <%=h request_dump == "{}" ? "None" : request_dump %>

Show session dump

<%= debug(@request.session.instance_variable_get("@data")) %>

Response

Headers: <%=h @response.headers.inspect.gsub(/,/, ",\n") %>


Say thanks better.

Say thanks better.

<% @title = "About" %>

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

Contact Us

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

Introduction to WhatDoTheyKnow

What is WhatDoTheyKnow for?

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

How does the site work?

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

Why would I bother to do this?

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

Why would the public authority bother to reply?

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

Who makes it?

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

Making requests

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

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

How quickly will I get a response?

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

What if I'm not satisfied with the response?

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

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

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

Can I request information about myself?

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

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

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

Privacy policy

Who gets to see my email address?

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

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

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

Why will my name appear publically on the site?

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

So I can make an FOI request using a pseudonym?

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

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

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

Credit where credit is due

Which people made WhatDoTheyKnow?

Oh, nearly everyone (and maybe you too)!

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

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

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

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

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

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

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

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

You're all stars.

<% @title = "About" %>

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

Contact Us

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

Introduction to WhatDoTheyKnow

What is WhatDoTheyKnow for?

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

How does the site work?

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

Why would I bother to do this?

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

Why would the public authority bother to reply?

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

Who makes it?

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

Making requests

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

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

How quickly will I get a response?

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

What if I'm not satisfied with the response?

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

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

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

Can I request information about myself?

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

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

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

Privacy policy

Who gets to see my email address?

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

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

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

Why will my name appear publically on the site?

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

So I can make an FOI request using a pseudonym?

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

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

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

Credit where credit is due

Which people made WhatDoTheyKnow?

Oh, nearly everyone (and maybe you too)!

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

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

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

    Tom Steinberg managed to get the cash to pay for the site out of
    a dead chocolate mogul ...

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

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

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

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

You're all stars.


use a text_field for value date

use a text_field for value date

<%= error_messages_for 'booking' %>

Title

<%= text_field 'booking', 'title'  %>

Amount

<%= text_field 'booking', 'amount'  %>

Debit Account

<%= select 'booking', 'debit_account_id', Account.find_all.collect {|a| [ a.title, a.id ] }  %>

Credit Account

<%= select 'booking', 'credit_account_id', Account.find_all.collect {|a| [ a.title, a.id ] }  %>

Value date

<%= text_field 'booking', 'value_date'  %>

Comments

<%= text_area 'booking', 'comments', :cols => 40, :rows => 5  %>

Scan

<%= file_column_field "booking", "scan" %>

<%= error_messages_for 'booking' %>

Title

<%= text_field 'booking', 'title'  %>

Amount

<%= text_field 'booking', 'amount'  %>

Debit Account

<%= select 'booking', 'debit_account_id', Account.find_all.collect {|a| [ a.title, a.id ] }  %>

Credit Account

<%= select 'booking', 'credit_account_id', Account.find_all.collect {|a| [ a.title, a.id ] }  %>

Value date

<%= date_select 'booking', 'value_date'  %>

Comments

<%= text_area 'booking', 'comments', :cols => 40, :rows => 5  %>

Scan

<%= file_column_field "booking", "scan" %>


Change advanced search name to more like Google calls it.

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

<% @include_request_link_in_authority_listing = true %>

<% 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', @inputted_sortby %>
       <% if @bodies %>
           <%= hidden_field_tag 'bodies', 1 %>
       <% end %>
       <%= submit_tag "Search" %>
       <% if not @show_tips %>
             Advanced search tips
       <% end %>

<% end %>

<% if !@query.nil? %>

    <%=link_to_unless @sortby == 'relevant', "Show most relevant results first", search_url(@query, 'relevant') %>
    |
    <%=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: <%= search_link(@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: <%= search_link(@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 => 'public_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 %>

Advanced search tips

Enter words that you want to find separated by spaces, e.g. <%=search_link('climbing lane')%>

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

Use quotes when you want to find an exact phrase, e.g. <%=search_link('"Liverpool City Council"')%>

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

variety: to select type of thing to search for, see the table of varieties below.

<%=search_link('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.

<%=search_link('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.

<%=search_link('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.

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

Type <%=search_link('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.

Table of statuses

<%=search_link('status:waiting_response')%>	 Waiting for the public authority to reply

<%=search_link('status:not_held')%>	 The public authority does not have the information requested

<%=search_link('status:rejected')%>	 The request was rejected by the public authority

<%=search_link('status:partially_successful')%>	 Some of the information requested has been received

<%=search_link('status:successful')%>	 All of the information requested has been received

<%=search_link('status:waiting_clarification')%>	 The public authority would like part of the request explained

<%=search_link('status:gone_postal')%>	 The public authority would like to / has responded by post

<%=search_link('status:internal_review')%>	 Waiting for the public authority to complete an internal review of their handling of the request

<%=search_link('status:error_message')%>	 Received an error message, such as delivery failure.

<%=search_link('status:requires_admin')%>	 A strange reponse, required attention by the WhatDoTheyKnow team

<%=search_link('status:user_withdrawn')%>	 The requester has abandoned this request for some reason

Table of varieties

<%=search_link('variety:sent')%>	 Original request sent

<%=search_link('variety:followup_sent')%>	 Follow up message sent by requester

<%=search_link('variety:response')%>	 Response from a public authority

<%=search_link('variety:comment')%>	 Annotation added to request

<%=search_link('variety:authority')%>	 A public authority

<%=search_link('variety:user')%>	 A WhatDoTheyKnow user

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

<% @include_request_link_in_authority_listing = true %>

<% 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', @inputted_sortby %>
       <% if @bodies %>
           <%= hidden_field_tag 'bodies', 1 %>
       <% end %>
       <%= submit_tag "Search" %>
       <% if not @show_tips %>
             Search tips
       <% end %>

<% end %>

<% if !@query.nil? %>

    <%=link_to_unless @sortby == 'relevant', "Show most relevant results first", search_url(@query, 'relevant') %>
    |
    <%=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: <%= search_link(@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: <%= search_link(@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 => 'public_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. <%=search_link('climbing lane')%>

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

Use quotes when you want to find an exact phrase, e.g. <%=search_link('"Liverpool City Council"')%>

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

variety: to select type of thing to search for, see the table of varieties below.

<%=search_link('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.

<%=search_link('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.

<%=search_link('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.

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

Type <%=search_link('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.

Table of statuses

<%=search_link('status:waiting_response')%>	 Waiting for the public authority to reply

<%=search_link('status:not_held')%>	 The public authority does not have the information requested

<%=search_link('status:rejected')%>	 The request was rejected by the public authority

<%=search_link('status:partially_successful')%>	 Some of the information requested has been received

<%=search_link('status:successful')%>	 All of the information requested has been received

<%=search_link('status:waiting_clarification')%>	 The public authority would like part of the request explained

<%=search_link('status:gone_postal')%>	 The public authority would like to / has responded by post

<%=search_link('status:internal_review')%>	 Waiting for the public authority to complete an internal review of their handling of the request

<%=search_link('status:error_message')%>	 Received an error message, such as delivery failure.

<%=search_link('status:requires_admin')%>	 A strange reponse, required attention by the WhatDoTheyKnow team

<%=search_link('status:user_withdrawn')%>	 The requester has abandoned this request for some reason

Table of varieties

<%=search_link('variety:sent')%>	 Original request sent

<%=search_link('variety:followup_sent')%>	 Follow up message sent by requester

<%=search_link('variety:response')%>	 Response from a public authority

<%=search_link('variety:comment')%>	 Annotation added to request

<%=search_link('variety:authority')%>	 A public authority

<%=search_link('variety:user')%>	 A WhatDoTheyKnow user

<% end %>


Update quite old out of date bad token text

Please check the URL (i.e. the long code of letters and numbers) is copied
correctly from your email.

If you can't click on it in the email, you'll have to select and copy it from
the email.  Then paste it into your browser, into the place you would type the
address of any other webpage.

If you got the email more than six months ago, then this login link won't work any
more. Please try doing what you were doing from the beginning.

Please check the URL (i.e. the long code of letters and numbers) is copied
correctly from your email.

If you can't click on it in the email, you'll have to select and copy it from
the email.  Then paste it into your browser, into the place you would type the
address of any other webpage.

If you got the email more than a year ago, then this login link won't work any
more. Please try doing what you were doing from the beginning.


One thread will first finish after writing has started.

<%
  _kas.threadded_content do
    sleep 0.2
    print "1"
  end

  print "2"

  _kas.threadded_content do
    sleep 0.1

    _kas.threadded_content do
      sleep 0.1
      print "3"

      sleep 0.1

      _kas.threadded_content do
        print "4"
        sleep 0.1
        print "5"
      end

      _kas.threadded_content do
        print "6"
        print "7"
      end
    end

    print "8"
  end

  #This will first finish after the printing has starter - it should still be printed correct.
  _kas.threadded_content do
    sleep 1
    print "9"
  end

  print "10"
%>

<%
  _kas.threadded_content do
    sleep 0.2
    print "1"
  end

  print "2"

  _kas.threadded_content do
    sleep 0.1

    _kas.threadded_content do
      sleep 0.1
      print "3"

      sleep 0.1

      _kas.threadded_content do
        print "4"
        sleep 0.1
        print "5"
      end

      _kas.threadded_content do
        print "6"
        print "7"
      end
    end

    print "8"
  end

  _kas.threadded_content do
    print "9"
  end

  print "10"
%>


WDTK-77 Add a section about waiving charges

<% @title = "Making requests" %>

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

<%= @title %> #

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

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

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

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

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

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

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

Who can make a request? #

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

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

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

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

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

Please contact us with the name of the public authority and,
if you can find it, their contact email address for Freedom of Information requests.

If you'd like to help add a whole category (new state or local government region etc.) of public authority to the site, we'd love
to hear from you too.

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

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

 Those formally subject to the FOI Act

 Those which choose to voluntarily comply with the FOI Act

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

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

Why must I keep my request focused?#

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

arguments about your cause

statements that could defame or insult others

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

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

Does it cost me anything to make a request?#

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

  The
  law contains a 'lowest reasonable cost' objective, meaning that if
  the public body chooses to impose a charge it should fairly reflect the work
  involved in providing access to documents and must not be used to discourage
  you from exercising your right of access.

  If a public body decides to charge you for access to documents there are
  certain circumstances where the
  charges may be reduced or waived, such as:

Releasing the information is in the general public interest

The charges would cause you financial hardship (e.g. you're a pensioner)

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

How quickly will I get a response? #

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

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

  For various reasons,
  this timeframe can be extended.

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

What if I never get a response?#

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

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

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

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

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

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

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

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

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

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

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

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

Can I request information about myself? #

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

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

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

<%= site_name %> is currently only designed for public requests. All
responses that we receive are automatically published on the website for anyone
to read.

You should contact the public authority directly if you would like to
make a request in private.  If you're interested in buying a system which helps
you manage FOI requests in secret, then contact us.

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

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

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

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

How do you moderate request annotations? #

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

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

Next, read about your privacy -->

<% @title = "Making requests" %>

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

<%= @title %> #

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

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

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

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

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

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

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

Who can make a request? #

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

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

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

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

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

Please contact us with the name of the public authority and,
if you can find it, their contact email address for Freedom of Information requests.

If you'd like to help add a whole category (new state or local government region etc.) of public authority to the site, we'd love
to hear from you too.

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

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

 Those formally subject to the FOI Act

 Those which choose to voluntarily comply with the FOI Act

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

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

Why must I keep my request focused?#

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

arguments about your cause

statements that could defame or insult others

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

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

Does it cost me anything to make a request?#

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

  The
  law also contains a 'lowest reasonable cost' objective, meaning that if
  the public body chooses to impose a charge it should fairly reflect the work
  involved in providing access to documents and must not be used to discourage
  you from exercising your right of access.

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

How quickly will I get a response? #

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

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

  For various reasons,
  this timeframe can be extended.

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

What if I never get a response?#

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

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

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

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

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

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

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

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

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

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

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

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

Can I request information about myself? #

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

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

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

<%= site_name %> is currently only designed for public requests. All
responses that we receive are automatically published on the website for anyone
to read.

You should contact the public authority directly if you would like to
make a request in private.  If you're interested in buying a system which helps
you manage FOI requests in secret, then contact us.

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

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

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

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

How do you moderate request annotations? #

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

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

Next, read about your privacy -->


Fixed support for PHP script.

Fixed support for PHP script.

<%
  #Support for the PHP-version... Comes handy when converting PHP to Ruby...
  if !_get["path"]
    trans = {
      "picture" => "path"
    }

    if _get["edgesize"]
      _get["rounded_corners"] = (_get["edgesize"].to_f / 3.0).to_i
    end

    if _get["edgeborder"]
      if _get["edgeborder"].length == 6
        _get["border_color"] = "##{_get["edgeborder"]}"
      else
        _get["border_color"] = _get["edbeborder"]
      end
    end

    if _get["edgeborder"]
      _get["border"] = 1
    end

    trans.each do |key, val|
      _get[val] = _get[key] if _get[key]
    end
  end

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

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

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

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

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

			if time_orig > time_cache
				tmp_write = true
			end
		end
	end

	notchanged = false

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

  if notchanged
    _httpsession.resp.status = 304
    exit
  end

	if !tmp_use or tmp_write or _get["force"].to_i > 0
    pic = Magick::Image.read(_get["path"]).first
    if !pic
      print "Could not open image from '#{_get["path"]}'."
      exit
    end

    pic.format = "png"

		width = pic.columns
		height = pic.rows

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

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

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

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

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

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

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

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

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

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

      Knj::Image.rounded_corners(args)
    end

		blob_cont = pic.to_blob
	end

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

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

<%
  #Support for the PHP-version... Comes handy when converting PHP to Ruby...
  if !_get["path"]
    trans = {
      "picture" => "path",
      "edgesize" => "rounded_corners"
    }

    if _get["edgeborder"]
      if _get["edgeborder"].length == 6
        _get["border_color"] = "##{_get["edgeborder"]}"
      else
        _get["border_color"] = _get["edbeborder"]
      end
    end

    if _get["edgeborder"]
      _get["border"] = 1
    end

    trans.each do |key, val|
      _get[val] = _get[key] if _get[key]
    end
  end

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

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

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

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

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

			if time_orig > time_cache
				tmp_write = true
			end
		end
	end

	notchanged = false

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

  if notchanged
    _httpsession.resp.status = 304
    exit
  end

	if !tmp_use or tmp_write or _get["force"].to_i > 0
    pic = Magick::Image.read(_get["path"]).first
    if !pic
      print "Could not open image from '#{_get["path"]}'."
      exit
    end

    pic.format = "png"

		width = pic.columns
		height = pic.rows

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

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

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

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

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

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

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

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

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

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

      Knj::Image.rounded_corners(args)
    end

		blob_cont = pic.to_blob
	end

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

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


Add url_title to make it easy to double-check the redelivery action

<% @title = "Incoming message #{@raw_email.incoming_message.id} of FOI request '#{@raw_email.incoming_message.info_request.title}'" %>

Incoming message <%=@raw_email.incoming_message.id %>

    FOI request: <%= request_both_links(@raw_email.incoming_message.info_request) %>
    <% if @holding_pen %>

This is in the holding pen because: <%= @rejected_reason %>
        <% if @public_bodies.size > 0 %>

Guessed authority:
            <% @public_bodies.each do |public_body| %>
                <%=public_body_both_links(public_body)%>
            <% end %>
            (based on From: email domain)
        <% end %>
        <% if @info_requests.size > 0 %>

                Guessed request:
                <% @info_requests.each do |info_request|  %>

                            <a href="#info_request_<%= info_request.id %>" data-toggle="collapse">
                            <%=request_both_links(info_request)%>

                        <div class="accordion-body collapse" id="info_request_<%= info_request.id %>">

                                    Last outgoing message:
                                    <%= info_request.outgoing_messages.last.body %>

                                    Created by:
                                    <%= user_admin_link_for_request(info_request) %>

                                    Authority:

                                        <%= link_to(info_request.public_body.name, public_body_admin_url(info_request.public_body)) %>

                                    url_title:
                                    <%= info_request.url_title %>

                                This request was guessed because it has an incoming email address of <%= info_request.incoming_email %> and this incoming message was sent to <%= @raw_email.incoming_message.mail.to %>.

                <% end %>
                (based on id, not hash, in To/Cc email)

        <% end %>
    <% end %>

    <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => @raw_email.incoming_message } %>

Raw email

<%= link_to "Download", admin_request_download_raw_email_path(@raw_email) %>

<%=h(@raw_email.data).gsub(/\n/, '
').html_safe %>

<% @title = "Incoming message #{@raw_email.incoming_message.id} of FOI request '#{@raw_email.incoming_message.info_request.title}'" %>

Incoming message <%=@raw_email.incoming_message.id %>

    FOI request: <%= request_both_links(@raw_email.incoming_message.info_request) %>
    <% if @holding_pen %>

This is in the holding pen because: <%= @rejected_reason %>
        <% if @public_bodies.size > 0 %>

Guessed authority:
            <% @public_bodies.each do |public_body| %>
                <%=public_body_both_links(public_body)%>
            <% end %>
            (based on From: email domain)
        <% end %>
        <% if @info_requests.size > 0 %>

                Guessed request:
                <% @info_requests.each do |info_request|  %>

                            <a href="#info_request_<%= info_request.id %>" data-toggle="collapse">
                            <%=request_both_links(info_request)%>

                        <div class="accordion-body collapse" id="info_request_<%= info_request.id %>">

                                    Last outgoing message:
                                    <%= info_request.outgoing_messages.last.body %>

                                    Created by:
                                    <%= user_admin_link_for_request(info_request) %>

                                    Authority:

                                        <%= link_to(info_request.public_body.name, public_body_admin_url(info_request.public_body)) %>

                                This request was guessed because it has an incoming email address of <%= info_request.incoming_email %> and this incoming message was sent to <%= @raw_email.incoming_message.mail.to %>.

                <% end %>
                (based on id, not hash, in To/Cc email)

        <% end %>
    <% end %>

    <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => @raw_email.incoming_message } %>

Raw email

<%= link_to "Download", admin_request_download_raw_email_path(@raw_email) %>

<%=h(@raw_email.data).gsub(/\n/, '
').html_safe %>


Agrega portugues.

Agrega portugues.

<% @title = "Contáctanos" %>

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

Contáctanos

Nos encantaría hablar contigo. Por favor usa una de estos métodos para comunicarte con nosotros:

Correo electrónico (email)

Escribe al equipo de quesabes.org en: contacto@quesabes.org

Puedes escribirnos en ingles, francés, portugués o español. Intentamos responder a los mensajes en 24-48 horas.

Twitter

        Síguenos en Twitter:
        Sígue a @uyquesabes

<% @title = "Contáctanos" %>

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

Contáctanos

Nos encantaría hablar contigo. Por favor usa una de estos métodos para comunicarte con nosotros:

Correo electrónico (email)

Escribe al equipo de quesabes.org en: contacto@quesabes.org

Puedes escribirnos en ingles, francés, alemán o español. Intentamos responder a los mensajes en 24-48 horas.

Twitter

        Síguenos en Twitter:
        Sígue a @uyquesabes