moved checkbox to better location

moved checkbox to better location

'<%= @assignment.title %>' turn-ins for '<%= @student.display_name %>'

Course: <%= @course.title %> (<%= @course.term.semester%>)

<%= link_to 'Back to all students', :controller => '/instructor/turnins', :course => @course, :assignment => @assignment %>

<% if @assignment.team_project %>

Project Team Details

<%= image_tag 'group.png' %>This is a group project, turn-ins are shared.

  <% if @team.nil? %>
    This student is NOT assigned to a project group.
  <% else %>
    This student is a member of <%= @team.name %> (<%= @team.team_id %>), all members:

		         <% for tm in @team.team_members %>

<%= tm.user.display_name %> - <%= tm.user.email %>

		         <% end %>

  <% end %>

<% end %>

Turn-in Set

<% if @display_turnin %>

<% if @display_turnin.id == @current_turnin.id %>

This is the student's most recent turn-in set.

<% else %>

This is NOT the student's final turn-in set.  You most likely do not want to grade these files.

<% end %>

Turn-in set

Originally Submitted: <%= @display_turnin.created_at.to_formatted_s(:friendly_date) %>

Last Updated: <%= @display_turnin.updated_at.to_formatted_s(:friendly_date) %>

Download entire turn-in set: <%= link_to 'as tar file', :action => 'download_set', :id => @display_turnin.id %>

<% if @display_turnin.id == @current_turnin.id && @current_turnin.user_turnin_files.size == 1 && @turnins.size > 1 %>

This student's current turn-in set does not have any files in it, and there are previous turn-in sets.  You may <%= link_to 'rollback to the previous turn-in set', :action => 'rollback', :id => @student %>

<% end %>

<% parent_spaces = Hash.new
   parent_spaces[0.to_s] = 0
   any_java = @display_turnin.any_java_files?
%>

    File
	Date
	<% if @assignment.programming %>
	  Main?
	  <% if any_java %>
	    Clean Java?
	    Instructor
 Override?
	  <% end %>
	<% end %>
	Download
	Review / Comment
	<% if @team %>
	  Submitter
	<% end %>

<% count = 0 %>
<% previous_tif = nil %>
<% for @tif in @display_turnin.user_turnin_files %>
  <% count = count.next
     odd = "odd"
     odd = "even" if count.even?
   %>
  <tr class="<%=odd%> hover" id="user_turnin_file_<%=@tif.id%>">

    <%

       if @tif.directory_entry
	     parent_spaces[@tif.id.to_s] = parent_spaces[@tif.directory_parent.to_s] + 1
       end %>

    <% spaces = ''
       if @tif.directory_entry
         upper = parent_spaces[@tif.id.to_s] - 1
       else
	     upper = parent_spaces[@tif.directory_parent.to_s]
       end
       1.upto(upper*3) { |i| spaces = " #{spaces}" }
     %>

      <%= spaces %>
      <%= image_tag "#{@tif.icon}", :align => 'absmiddle' %>
      <%=h @tif.filename %>

     <%= @tif.created_at.to_formatted_s(:short) %>
    <% if @assignment.programming %>

      	<% if @tif.main %>
	      <%= image_tag 'accept.png' %> Current
	    <% elsif @tif.main_candidate && ! (@display_turnin.sealed || @display_turnin.finalized) %>
	      <%= image_tag 'add.png' %> Candidate
	         </acronym>
	    <% end %>

	   <% if any_java %>

		  <% if @tif.extension.eql?('java') ## will need to expand later w/ other languages %>
		    <% if @tif.gradable %>
		      <%= image_tag 'accept.png' %>
		    <% else %>
		      <%= image_tag 'cross.png' %> <%= link_to_function "Details", visual_effect(:toggle_appear, "dirty_details_#{@tif.id}" ) %>
		    <% end %>
		  <% end %>

		  <% if @tif.extension.eql?('java') ## will need to expand later w/ other languages %>
		    <% if ! @tif.gradable %>
		      <% if @tif.gradable_override %>
		        <%= image_tag 'accept.png' %> Yes
		      <% else %>
		        <%= image_tag 'cross.png' %> No
		      <% end %>
		    <% end %>
		  <% end %>

	  <% end %>

    <% end %>

     <% if @tif.directory_entry %>
       <s>Download</s>
     <% else %>
       <%= link_to 'Download', :action => 'download_file', :id => @tif.id %>
     <% end %>

      <% if @tif.directory_entry %>

      <% else %>
        <% if @tif.is_text_file? %>
          <%= link_to 'View/Comment', :action => 'view_file', :course => @course, :assignment => @assignment, :student => @student, :id => @tif %>
        <% else %>
          <%= link_to 'Download', :action => 'download_file', :course => @course, :assignment => @assignment, :student => @student, :id => @tif %>
        <% end %>
      <% end %>

    <% if @team %>

      <%= @tif.user.display_name %>

    <% end %>

  <% if any_java && @tif.extension.eql?('java') && !@tif.gradable %>
    <tr style="display: none;" id="dirty_details_<%=@tif.id%>">

Can not AutoGrade your assignment because '<%= @tif.filename %>' it contains the following disallowed strings.

<% unless @tif.gradable_message.nil? %><%= @tif.gradable_message.to_html %><% end %>

  <% end %>

  <% previous_tif = @tif %>
<% end %>

<% else %>

No files submitted

<% end %>

<% if !@assignment.auto_grade_setting.nil? && @assignment.auto_grade_setting.io_check? ## Only kind of autograde supported %>

AutoGrade Results

<%= link_to "View I/O Check results for #{@student.display_name}.", :course => @course, :assignment => @assignment, :student => @student, :action => 'view_io_tests' %> From this screen you can also re-run the automatic tests.

<% elsif @assignment.auto_grade && !@assignment.auto_grade_setting.nil? && @assignment.auto_grade_setting.check_style? %>

PMD Control

<%= image_tag 'flag_green.png' %><%= link_to 'Re-run PMD checks for the current turn-in set.', :course => @course, :assignment => @assignment, :student => @student, :action => 'io_retest' %>

<% end %>

Grade

<% unless @grade_item %>

Warning - this assignment is not connected with an entry in the GradeBook.

<% else %>

  <%= start_form_tag :action => 'submit_grade', :id => @student, :course => @course, :assignment => @assignment %>
    <%= error_messages_for 'grade_entry' %>

You can enter general assignment comments here.   You also have the ability to comment on individual files below as well as to make annotations tied to specific line numbers for text files.   If you enter a negative point value, the student's grade for this assignment will be deleted (including the comments entered below). Leaving the points value blank, results in a score of zero.

Points:
	  <%= text_field 'grade_entry', 'points', :size => 10  %> / <%= sprintf("%0.1f", @grade_item.points ) %>

General comments:

                <% if @assignment.team_project && !@team.nil? %>
                        <%= check_box_tag( 'apply_to_team', true, @apply_to_team )%> Apply grade and comments to all team members.

                <% end %>

      <%= text_area 'grade_entry', 'comment', "cols" => 90, "rows" => 12, :class=>'short'  %>

      <%= link_to_function "More room to type", "Form.Element.toggleHeight(this, 'grade_entry_comment'); return false;", :class => 'bottab more' %>

<%= submit_tag "Submit Grade and Comments" %>

  <%= end_form_tag %>

<% end %>

Assignment Journals

<% if !@assignment.team_project || @team.nil? %>

	<% if @journals.size == 0 %>

This student has not submitted any journal entries.

	<% else %>

Reported Time: <%= pluralize(@days,'day') %>, <%= pluralize(@hours,'hour') %>, <%= pluralize(@minutes,'minute') %>.

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

   <% count = 0 %>
   <% for journal in @journals %>
	<% count = count.next
	     odd = "odd"
	     odd = "even" if count.even?
	   %>
 	 <%= render :partial => "journal", :locals => { :odd => odd, :journal => journal } %>
   <% end %>

  <% end %>

<% else %>

Displaying Journal entries for all team members

  <% for tm in @team.team_members %>

Journals for <%= tm.user.display_name %>

	<% if @team_journals[tm.user.id].nil? || @team_journals[tm.user.id].size == 0 %>

     This student has not submitted any journal entries.

	<% else %>

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

      <% count = 0 %>
      <% for journal in @team_journals[tm.user.id] %>
        <% count = count.next
	     odd = "odd"
	     odd = "even" if count.even?
	     %>
 	     <%= render :partial => "journal", :locals => { :odd => odd, :journal => journal } %>
      <% end %>

	<% end %>

  <% end %>

<% end %>

Previous Turn-in sets (read-only)

Previous turn-in sets for <%= @student.display_name %>.   By selecting these previous turn-in sets you can view the files and AutoGrade reports to see how students progressed during development.  Any comments entered on previous turn-in sets are ultimately available to students as they browse their own turn-in history.

<% if @assignment.auto_grade %>
 <% unless @assignment.auto_grade_setting.nil? %>
  <% if @assignment.auto_grade_setting.student_style || @assignment.auto_grade_setting.student_io_check || @assignment.auto_grade_setting.student_autograde %>

<%= image_tag 'information.png' %> This assignment has automatic grading enabled and is limited to <%= @app['turnin_limit'] %> submissions per day.

<%= @student.display_name %> has finalized <%= @today_count %> turn-in sets today, and may finalize <%= @remaining_count %>  more turn-in sets today.   If the student requires additional turn-in sets, you may reopen the most recent turn-in set, allowing them to submit additional turn-in sets in a single day.

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

    #
    Previous Set
    <% if @team %>Creator	<% end %>
    View
    Archived
    Finalized
    Controls

<% count = @turnins.size + 1 %>
<% for ut in @turnins %>
  <% count = count - 1
     odd = "odd"
     odd = "even" if count.even?
   %>
  <tr class="<%=odd%> hover" id="user_turnin_<%=ut.id%>">
    <%= count %>
    <%=h ut.updated_at.to_formatted_s(:long) %>
      <% if ut.id == @current_turnin.id %>current <%end%>

    <% if @team %><%= ut.user.display_name %>	<% end %>
    <%= link_to 'View', :action => 'view_student', :course => @course, :assignment => @assignment, :id => @student, :ut => ut.id %>
    <% if ut.sealed %> <%= image_tag 'accept.png' %> <% else %> <%= image_tag 'cross.png' %> <% end %>
    <% if ut.finalized %> <%= image_tag 'accept.png' %> <% else %> <%= image_tag 'cross.png' %> <% end %>
    <td id="reopen_<%= ut.id %>">
	  <% if @current_turnin.id == ut.id && ut.finalized %>
	    <%= link_to  'Reopen (unfinalized)', :controller => '/instructor/turnins', :action => 'unfinalize', :course => @course.id, :assignment => @assignment, :id => @student %>
	  <% elsif @current_turnin.id == ut.id %>
	    Most recent turn-in - but not finalized.
	  <% else %>
	    --
	  <% end %>

<% end %>

'<%= @assignment.title %>' turn-ins for '<%= @student.display_name %>'

Course: <%= @course.title %> (<%= @course.term.semester%>)

<%= link_to 'Back to all students', :controller => '/instructor/turnins', :course => @course, :assignment => @assignment %>

<% if @assignment.team_project %>

Project Team Details

<%= image_tag 'group.png' %>This is a group project, turn-ins are shared.

  <% if @team.nil? %>
    This student is NOT assigned to a project group.
  <% else %>
    This student is a member of <%= @team.name %> (<%= @team.team_id %>), all members:

		         <% for tm in @team.team_members %>

<%= tm.user.display_name %> - <%= tm.user.email %>

		         <% end %>

  <% end %>

<% end %>

Turn-in Set

<% if @display_turnin %>

<% if @display_turnin.id == @current_turnin.id %>

This is the student's most recent turn-in set.

<% else %>

This is NOT the student's final turn-in set.  You most likely do not want to grade these files.

<% end %>

Turn-in set

Originally Submitted: <%= @display_turnin.created_at.to_formatted_s(:friendly_date) %>

Last Updated: <%= @display_turnin.updated_at.to_formatted_s(:friendly_date) %>

Download entire turn-in set: <%= link_to 'as tar file', :action => 'download_set', :id => @display_turnin.id %>

<% if @display_turnin.id == @current_turnin.id && @current_turnin.user_turnin_files.size == 1 && @turnins.size > 1 %>

This student's current turn-in set does not have any files in it, and there are previous turn-in sets.  You may <%= link_to 'rollback to the previous turn-in set', :action => 'rollback', :id => @student %>

<% end %>

<% parent_spaces = Hash.new
   parent_spaces[0.to_s] = 0
   any_java = @display_turnin.any_java_files?
%>

    File
	Date
	<% if @assignment.programming %>
	  Main?
	  <% if any_java %>
	    Clean Java?
	    Instructor
 Override?
	  <% end %>
	<% end %>
	Download
	Review / Comment
	<% if @team %>
	  Submitter
	<% end %>

<% count = 0 %>
<% previous_tif = nil %>
<% for @tif in @display_turnin.user_turnin_files %>
  <% count = count.next
     odd = "odd"
     odd = "even" if count.even?
   %>
  <tr class="<%=odd%> hover" id="user_turnin_file_<%=@tif.id%>">

    <%

       if @tif.directory_entry
	     parent_spaces[@tif.id.to_s] = parent_spaces[@tif.directory_parent.to_s] + 1
       end %>

    <% spaces = ''
       if @tif.directory_entry
         upper = parent_spaces[@tif.id.to_s] - 1
       else
	     upper = parent_spaces[@tif.directory_parent.to_s]
       end
       1.upto(upper*3) { |i| spaces = " #{spaces}" }
     %>

      <%= spaces %>
      <%= image_tag "#{@tif.icon}", :align => 'absmiddle' %>
      <%=h @tif.filename %>

     <%= @tif.created_at.to_formatted_s(:short) %>
    <% if @assignment.programming %>

      	<% if @tif.main %>
	      <%= image_tag 'accept.png' %> Current
	    <% elsif @tif.main_candidate && ! (@display_turnin.sealed || @display_turnin.finalized) %>
	      <%= image_tag 'add.png' %> Candidate
	         </acronym>
	    <% end %>

	   <% if any_java %>

		  <% if @tif.extension.eql?('java') ## will need to expand later w/ other languages %>
		    <% if @tif.gradable %>
		      <%= image_tag 'accept.png' %>
		    <% else %>
		      <%= image_tag 'cross.png' %> <%= link_to_function "Details", visual_effect(:toggle_appear, "dirty_details_#{@tif.id}" ) %>
		    <% end %>
		  <% end %>

		  <% if @tif.extension.eql?('java') ## will need to expand later w/ other languages %>
		    <% if ! @tif.gradable %>
		      <% if @tif.gradable_override %>
		        <%= image_tag 'accept.png' %> Yes
		      <% else %>
		        <%= image_tag 'cross.png' %> No
		      <% end %>
		    <% end %>
		  <% end %>

	  <% end %>

    <% end %>

     <% if @tif.directory_entry %>
       <s>Download</s>
     <% else %>
       <%= link_to 'Download', :action => 'download_file', :id => @tif.id %>
     <% end %>

      <% if @tif.directory_entry %>

      <% else %>
        <% if @tif.is_text_file? %>
          <%= link_to 'View/Comment', :action => 'view_file', :course => @course, :assignment => @assignment, :student => @student, :id => @tif %>
        <% else %>
          <%= link_to 'Download', :action => 'download_file', :course => @course, :assignment => @assignment, :student => @student, :id => @tif %>
        <% end %>
      <% end %>

    <% if @team %>

      <%= @tif.user.display_name %>

    <% end %>

  <% if any_java && @tif.extension.eql?('java') && !@tif.gradable %>
    <tr style="display: none;" id="dirty_details_<%=@tif.id%>">

Can not AutoGrade your assignment because '<%= @tif.filename %>' it contains the following disallowed strings.

<% unless @tif.gradable_message.nil? %><%= @tif.gradable_message.to_html %><% end %>

  <% end %>

  <% previous_tif = @tif %>
<% end %>

<% else %>

No files submitted

<% end %>

<% if !@assignment.auto_grade_setting.nil? && @assignment.auto_grade_setting.io_check? ## Only kind of autograde supported %>

AutoGrade Results

<%= link_to "View I/O Check results for #{@student.display_name}.", :course => @course, :assignment => @assignment, :student => @student, :action => 'view_io_tests' %> From this screen you can also re-run the automatic tests.

<% elsif @assignment.auto_grade && !@assignment.auto_grade_setting.nil? && @assignment.auto_grade_setting.check_style? %>

PMD Control

<%= image_tag 'flag_green.png' %><%= link_to 'Re-run PMD checks for the current turn-in set.', :course => @course, :assignment => @assignment, :student => @student, :action => 'io_retest' %>

<% end %>

Grade

<% unless @grade_item %>

Warning - this assignment is not connected with an entry in the GradeBook.

<% else %>

  <%= start_form_tag :action => 'submit_grade', :id => @student, :course => @course, :assignment => @assignment %>
    <%= error_messages_for 'grade_entry' %>

You can enter general assignment comments here.   You also have the ability to comment on individual files below as well as to make annotations tied to specific line numbers for text files.   If you enter a negative point value, the student's grade for this assignment will be deleted (including the comments entered below). Leaving the points value blank, results in a score of zero.

Points:
	  <%= text_field 'grade_entry', 'points', :size => 10  %> / <%= sprintf("%0.1f", @grade_item.points ) %>

General comments:

      <%= text_area 'grade_entry', 'comment', "cols" => 90, "rows" => 12, :class=>'short'  %>

      <%= link_to_function "More room to type", "Form.Element.toggleHeight(this, 'grade_entry_comment'); return false;", :class => 'bottab more' %>

		<% if @assignment.team_project && !@team.nil? %>

<%= check_box_tag( 'apply_to_team', true, @apply_to_team )%> Apply grade and comments to all team members.

		<% end %>

<%= submit_tag "Submit Grade and Comments" %>

  <%= end_form_tag %>

<% end %>

Assignment Journals

<% if !@assignment.team_project || @team.nil? %>

	<% if @journals.size == 0 %>

This student has not submitted any journal entries.

	<% else %>

Reported Time: <%= pluralize(@days,'day') %>, <%= pluralize(@hours,'hour') %>, <%= pluralize(@minutes,'minute') %>.

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

   <% count = 0 %>
   <% for journal in @journals %>
	<% count = count.next
	     odd = "odd"
	     odd = "even" if count.even?
	   %>
 	 <%= render :partial => "journal", :locals => { :odd => odd, :journal => journal } %>
   <% end %>

  <% end %>

<% else %>

Displaying Journal entries for all team members

  <% for tm in @team.team_members %>

Journals for <%= tm.user.display_name %>

	<% if @team_journals[tm.user.id].nil? || @team_journals[tm.user.id].size == 0 %>

     This student has not submitted any journal entries.

	<% else %>

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

      <% count = 0 %>
      <% for journal in @team_journals[tm.user.id] %>
        <% count = count.next
	     odd = "odd"
	     odd = "even" if count.even?
	     %>
 	     <%= render :partial => "journal", :locals => { :odd => odd, :journal => journal } %>
      <% end %>

	<% end %>

  <% end %>

<% end %>

Previous Turn-in sets (read-only)

Previous turn-in sets for <%= @student.display_name %>.   By selecting these previous turn-in sets you can view the files and AutoGrade reports to see how students progressed during development.  Any comments entered on previous turn-in sets are ultimately available to students as they browse their own turn-in history.

<% if @assignment.auto_grade %>
 <% unless @assignment.auto_grade_setting.nil? %>
  <% if @assignment.auto_grade_setting.student_style || @assignment.auto_grade_setting.student_io_check || @assignment.auto_grade_setting.student_autograde %>

<%= image_tag 'information.png' %> This assignment has automatic grading enabled and is limited to <%= @app['turnin_limit'] %> submissions per day.

<%= @student.display_name %> has finalized <%= @today_count %> turn-in sets today, and may finalize <%= @remaining_count %>  more turn-in sets today.   If the student requires additional turn-in sets, you may reopen the most recent turn-in set, allowing them to submit additional turn-in sets in a single day.

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

    #
    Previous Set
    <% if @team %>Creator	<% end %>
    View
    Archived
    Finalized
    Controls

<% count = @turnins.size + 1 %>
<% for ut in @turnins %>
  <% count = count - 1
     odd = "odd"
     odd = "even" if count.even?
   %>
  <tr class="<%=odd%> hover" id="user_turnin_<%=ut.id%>">
    <%= count %>
    <%=h ut.updated_at.to_formatted_s(:long) %>
      <% if ut.id == @current_turnin.id %>current <%end%>

    <% if @team %><%= ut.user.display_name %>	<% end %>
    <%= link_to 'View', :action => 'view_student', :course => @course, :assignment => @assignment, :id => @student, :ut => ut.id %>
    <% if ut.sealed %> <%= image_tag 'accept.png' %> <% else %> <%= image_tag 'cross.png' %> <% end %>
    <% if ut.finalized %> <%= image_tag 'accept.png' %> <% else %> <%= image_tag 'cross.png' %> <% end %>
    <td id="reopen_<%= ut.id %>">
	  <% if @current_turnin.id == ut.id && ut.finalized %>
	    <%= link_to  'Reopen (unfinalized)', :controller => '/instructor/turnins', :action => 'unfinalize', :course => @course.id, :assignment => @assignment, :id => @student %>
	  <% elsif @current_turnin.id == ut.id %>
	    Most recent turn-in - but not finalized.
	  <% else %>
	    --
	  <% end %>

<% end %>


ActionItem561: adding a template specific for articles

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

<%= search_page_title( _('Articles'), { :query => @query,
                                      :category => @category ? @category.name : nil,
                                      :total_results => @total_results,
                                      :region => @region ? @region.name : nil,
                                      :distance => @radius } ) %>

<%= render :partial => 'search_form', :locals => { :form_title => @query.blank? ? _('Search') : _("Refine your search"), :simple_search => true } %>

<%# FIXME ARMENGUE %>
<%= display_results(false) %>

<%= pagination_links @results.values.first %>

<br style="clear:both" />


moved checkbox to better location

moved checkbox to better location

'<%= @assignment.title %>' turn-ins for '<%= @student.display_name %>'

Course: <%= @course.title %> (<%= @course.term.semester%>)

<%= link_to 'Back to all students', :controller => '/instructor/turnins', :course => @course, :assignment => @assignment %>

<% if @assignment.team_project %>

Project Team Details

<%= image_tag 'group.png' %>This is a group project, turn-ins are shared.

  <% if @team.nil? %>
    This student is NOT assigned to a project group.
  <% else %>
    This student is a member of <%= @team.name %> (<%= @team.team_id %>), all members:

		         <% for tm in @team.team_members %>

<%= tm.user.display_name %> - <%= tm.user.email %>

		         <% end %>

  <% end %>

<% end %>

Turn-in Set

<% if @display_turnin %>

<% if @display_turnin.id == @current_turnin.id %>

This is the student's most recent turn-in set.

<% else %>

This is NOT the student's final turn-in set.  You most likely do not want to grade these files.

<% end %>

Turn-in set

Originally Submitted: <%= @display_turnin.created_at.to_formatted_s(:friendly_date) %>

Last Updated: <%= @display_turnin.updated_at.to_formatted_s(:friendly_date) %>

Download entire turn-in set: <%= link_to 'as tar file', :action => 'download_set', :id => @display_turnin.id %>

<% if @display_turnin.id == @current_turnin.id && @current_turnin.user_turnin_files.size == 1 && @turnins.size > 1 %>

This student's current turn-in set does not have any files in it, and there are previous turn-in sets.  You may <%= link_to 'rollback to the previous turn-in set', :action => 'rollback', :id => @student %>

<% end %>

<% parent_spaces = Hash.new
   parent_spaces[0.to_s] = 0
   any_java = @display_turnin.any_java_files?
%>

    File
	Date
	<% if @assignment.programming %>
	  Main?
	  <% if any_java %>
	    Clean Java?
	    Instructor
 Override?
	  <% end %>
	<% end %>
	Download
	Review / Comment
	<% if @team %>
	  Submitter
	<% end %>

<% count = 0 %>
<% previous_tif = nil %>
<% for @tif in @display_turnin.user_turnin_files %>
  <% count = count.next
     odd = "odd"
     odd = "even" if count.even?
   %>
  <tr class="<%=odd%> hover" id="user_turnin_file_<%=@tif.id%>">

    <%

       if @tif.directory_entry
	     parent_spaces[@tif.id.to_s] = parent_spaces[@tif.directory_parent.to_s] + 1
       end %>

    <% spaces = ''
       if @tif.directory_entry
         upper = parent_spaces[@tif.id.to_s] - 1
       else
	     upper = parent_spaces[@tif.directory_parent.to_s]
       end
       1.upto(upper*3) { |i| spaces = " #{spaces}" }
     %>

      <%= spaces %>
      <%= image_tag "#{@tif.icon}", :align => 'absmiddle' %>
      <%=h @tif.filename %>

     <%= @tif.created_at.to_formatted_s(:short) %>
    <% if @assignment.programming %>

      	<% if @tif.main %>
	      <%= image_tag 'accept.png' %> Current
	    <% elsif @tif.main_candidate && ! (@display_turnin.sealed || @display_turnin.finalized) %>
	      <%= image_tag 'add.png' %> Candidate
	         </acronym>
	    <% end %>

	   <% if any_java %>

		  <% if @tif.extension.eql?('java') ## will need to expand later w/ other languages %>
		    <% if @tif.gradable %>
		      <%= image_tag 'accept.png' %>
		    <% else %>
		      <%= image_tag 'cross.png' %> <%= link_to_function "Details", visual_effect(:toggle_appear, "dirty_details_#{@tif.id}" ) %>
		    <% end %>
		  <% end %>

		  <% if @tif.extension.eql?('java') ## will need to expand later w/ other languages %>
		    <% if ! @tif.gradable %>
		      <% if @tif.gradable_override %>
		        <%= image_tag 'accept.png' %> Yes
		      <% else %>
		        <%= image_tag 'cross.png' %> No
		      <% end %>
		    <% end %>
		  <% end %>

	  <% end %>

    <% end %>

     <% if @tif.directory_entry %>
       <s>Download</s>
     <% else %>
       <%= link_to 'Download', :action => 'download_file', :id => @tif.id %>
     <% end %>

      <% if @tif.directory_entry %>

      <% else %>
        <% if @tif.is_text_file? %>
          <%= link_to 'View/Comment', :action => 'view_file', :course => @course, :assignment => @assignment, :student => @student, :id => @tif %>
        <% else %>
          <%= link_to 'Download', :action => 'download_file', :course => @course, :assignment => @assignment, :student => @student, :id => @tif %>
        <% end %>
      <% end %>

    <% if @team %>

      <%= @tif.user.display_name %>

    <% end %>

  <% if any_java && @tif.extension.eql?('java') && !@tif.gradable %>
    <tr style="display: none;" id="dirty_details_<%=@tif.id%>">

Can not AutoGrade your assignment because '<%= @tif.filename %>' it contains the following disallowed strings.

<% unless @tif.gradable_message.nil? %><%= @tif.gradable_message.to_html %><% end %>

  <% end %>

  <% previous_tif = @tif %>
<% end %>

<% else %>

No files submitted

<% end %>

<% if !@assignment.auto_grade_setting.nil? && @assignment.auto_grade_setting.io_check? ## Only kind of autograde supported %>

AutoGrade Results

<%= link_to "View I/O Check results for #{@student.display_name}.", :course => @course, :assignment => @assignment, :student => @student, :action => 'view_io_tests' %> From this screen you can also re-run the automatic tests.

<% elsif @assignment.auto_grade && !@assignment.auto_grade_setting.nil? && @assignment.auto_grade_setting.check_style? %>

PMD Control

<%= image_tag 'flag_green.png' %><%= link_to 'Re-run PMD checks for the current turn-in set.', :course => @course, :assignment => @assignment, :student => @student, :action => 'io_retest' %>

<% end %>

Grade

<% unless @grade_item %>

Warning - this assignment is not connected with an entry in the GradeBook.

<% else %>

  <%= start_form_tag :action => 'submit_grade', :id => @student, :course => @course, :assignment => @assignment %>
    <%= error_messages_for 'grade_entry' %>

You can enter general assignment comments here.   You also have the ability to comment on individual files below as well as to make annotations tied to specific line numbers for text files.   If you enter a negative point value, the student's grade for this assignment will be deleted (including the comments entered below). Leaving the points value blank, results in a score of zero.

Points:
	  <%= text_field 'grade_entry', 'points', :size => 10  %> / <%= sprintf("%0.1f", @grade_item.points ) %>

General comments:

                <% if @assignment.team_project && !@team.nil? %>
                        <%= check_box_tag( 'apply_to_team', true, @apply_to_team )%> Apply grade and comments to all team members.

                <% end %>

      <%= text_area 'grade_entry', 'comment', "cols" => 90, "rows" => 12, :class=>'short'  %>

      <%= link_to_function "More room to type", "Form.Element.toggleHeight(this, 'grade_entry_comment'); return false;", :class => 'bottab more' %>

<%= submit_tag "Submit Grade and Comments" %>

  <%= end_form_tag %>

<% end %>

Assignment Journals

<% if !@assignment.team_project || @team.nil? %>

	<% if @journals.size == 0 %>

This student has not submitted any journal entries.

	<% else %>

Reported Time: <%= pluralize(@days,'day') %>, <%= pluralize(@hours,'hour') %>, <%= pluralize(@minutes,'minute') %>.

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

   <% count = 0 %>
   <% for journal in @journals %>
	<% count = count.next
	     odd = "odd"
	     odd = "even" if count.even?
	   %>
 	 <%= render :partial => "journal", :locals => { :odd => odd, :journal => journal } %>
   <% end %>

  <% end %>

<% else %>

Displaying Journal entries for all team members

  <% for tm in @team.team_members %>

Journals for <%= tm.user.display_name %>

	<% if @team_journals[tm.user.id].nil? || @team_journals[tm.user.id].size == 0 %>

     This student has not submitted any journal entries.

	<% else %>

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

      <% count = 0 %>
      <% for journal in @team_journals[tm.user.id] %>
        <% count = count.next
	     odd = "odd"
	     odd = "even" if count.even?
	     %>
 	     <%= render :partial => "journal", :locals => { :odd => odd, :journal => journal } %>
      <% end %>

	<% end %>

  <% end %>

<% end %>

Previous Turn-in sets (read-only)

Previous turn-in sets for <%= @student.display_name %>.   By selecting these previous turn-in sets you can view the files and AutoGrade reports to see how students progressed during development.  Any comments entered on previous turn-in sets are ultimately available to students as they browse their own turn-in history.

<% if @assignment.auto_grade %>
 <% unless @assignment.auto_grade_setting.nil? %>
  <% if @assignment.auto_grade_setting.student_style || @assignment.auto_grade_setting.student_io_check || @assignment.auto_grade_setting.student_autograde %>

<%= image_tag 'information.png' %> This assignment has automatic grading enabled and is limited to <%= @app['turnin_limit'] %> submissions per day.

<%= @student.display_name %> has finalized <%= @today_count %> turn-in sets today, and may finalize <%= @remaining_count %>  more turn-in sets today.   If the student requires additional turn-in sets, you may reopen the most recent turn-in set, allowing them to submit additional turn-in sets in a single day.

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

    #
    Previous Set
    <% if @team %>Creator	<% end %>
    View
    Archived
    Finalized
    Controls

<% count = @turnins.size + 1 %>
<% for ut in @turnins %>
  <% count = count - 1
     odd = "odd"
     odd = "even" if count.even?
   %>
  <tr class="<%=odd%> hover" id="user_turnin_<%=ut.id%>">
    <%= count %>
    <%=h ut.updated_at.to_formatted_s(:long) %>
      <% if ut.id == @current_turnin.id %>current <%end%>

    <% if @team %><%= ut.user.display_name %>	<% end %>
    <%= link_to 'View', :action => 'view_student', :course => @course, :assignment => @assignment, :id => @student, :ut => ut.id %>
    <% if ut.sealed %> <%= image_tag 'accept.png' %> <% else %> <%= image_tag 'cross.png' %> <% end %>
    <% if ut.finalized %> <%= image_tag 'accept.png' %> <% else %> <%= image_tag 'cross.png' %> <% end %>
    <td id="reopen_<%= ut.id %>">
	  <% if @current_turnin.id == ut.id && ut.finalized %>
	    <%= link_to  'Reopen (unfinalized)', :controller => '/instructor/turnins', :action => 'unfinalize', :course => @course.id, :assignment => @assignment, :id => @student %>
	  <% elsif @current_turnin.id == ut.id %>
	    Most recent turn-in - but not finalized.
	  <% else %>
	    --
	  <% end %>

<% end %>


trying to get avatars/headers uploads to work (x7)

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

<%= error_messages_for :header %>

<% form_for(:header, :url => headers_url, :html => { :multipart => true }) do |f| -%>

New Header

<%= f.file_field :uploaded_data %>

Headers must be images smaller than 50kb, and should be sized 760x200px.

Description (optional)

<%= f.text_area :description, :rows => '4', :style => 'width:66%;' %>

<%= submit_tag "Upload", :disable_with => "Upload" %> or <%= link_to 'Cancel', headers_path %>

<% end %>

	<%= link_to 'Home', home_path %> » <%= link_to 'Headers', headers_path %> » New Header

<%= error_messages_for :header %>

<% form_for(:header, :url => headers, :html => { :multipart => true }) do |f| -%>

New Header

<%= f.file_field :uploaded_data %>

Headers must be images smaller than 50kb, and should be sized 760x200px.

Description (optional)

<%= f.text_area :description, :rows => '4', :style => 'width:66%;' %>

<%= submit_tag "Upload", :disable_with => "Upload" %> or <%= link_to 'Cancel', headers_path %>

<% end %>

	<%= link_to 'Home', home_path %> » <%= link_to 'Headers', headers_path %> » New Header


Fix bad merge of d88b79d1aa24a78ed95255a37a0403d7e3c0117e

<% @title = "Summary" %>

<%=@title%>

<%=@public_body_count%> public authorities

        <%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages,
        <%=@incoming_message_count%> incoming messages

<%=@user_count%> users, <%=@track_thing_count%> tracked things

<%=@comment_count%> annotations

Things to do

  <% if @holding_pen_messages.size > 0 %>

        <%=@holding_pen_messages.size%><%= chevron_right %> Put misdelivered responses with the right request

            <% for message in @holding_pen_messages %>

                  <% if message.get_body_for_quoting.strip.size == 0 %>
                      <%= link_to "(no body)", admin_request_show_raw_email_path(message.raw_email_id) %>
                  <% else %>
                      <%= link_to excerpt(message.get_body_for_quoting, "", 60), admin_request_show_raw_email_path(message.raw_email_id) %>
                  <% end %>

                  <%=simple_date(message.sent_at)%>

            <% end %>

  <% end %>

  <% if @error_message_requests.size > 0 %>

        <%=@error_message_requests.size%> <%= chevron_right %>Fix these delivery and other errors

            <% for @request in @error_message_requests %>

                  <%= request_both_links(@request) %>

                  <%=simple_date(@request.info_request_events.last.created_at)%>

            <% end %>

  <% end %>

  <% if @attention_requests.size > 0 %>

        <%=@attention_requests.size%><%= chevron_right %> Review requests marked by users as requiring your attention

            <% for @request in @attention_requests %>

                  <%= request_both_links(@request) %>

                  <%=simple_date(@request.info_request_events.last.created_at)%>

            <% end %>

  <% end %>

  <% if @requires_admin_requests.size > 0 %>

        <%=@requires_admin_requests.size%><%= chevron_right %> These require administrator attention

            <% for @request in @requires_admin_requests %>

                  <%= request_both_links(@request) %>

                  <%=simple_date(@request.info_request_events.last.created_at)%>

            <% end %>

  <% end %>

  <% if @blank_contacts.size > 0 %>

        <%=@blank_contacts.size%><%= chevron_right %> Find missing FOI email for these public authorities (try phoning!)

            <% for @blank_contact in @blank_contacts %>

                  <%= public_body_both_links(@blank_contact) %>

                  <%=simple_date(@blank_contact.updated_at)%>

            <% end %>

  <% end %>

  <% if @old_unclassified.size > 0 %>

        <%=@old_unclassified.size%><%= chevron_right %> Classify responses that are still unclassified <%=InfoRequest::OLD_AGE_IN_DAYS.inspect %> after response

            <% for @request in @old_unclassified %>

                    <%= request_both_links(@request) %>

                    <%=simple_date(@request.get_last_response_event.created_at)%>

            <% end %>

  <% end %>

<% if @holding_pen_messages.size == 0 && @old_unclassified.size == 0 && @requires_admin_requests.size == 0 && @blank_contacts.size == 0 && @attention_requests.size == 0 %>

      No pending administration required.

<% end %>

<% @title = "Summary" %>

<%=@title%>

<%=@public_body_count%> public authorities

        <%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages,
        <%=@incoming_message_count%> incoming messages

<%=@user_count%> users, <%=@track_thing_count%> tracked things

<%=@comment_count%> annotations

Things to do

  <% if @holding_pen_messages.size > 0 %>

        <%=@holding_pen_messages.size%><%= chevron_right %> Put misdelivered responses with the right request

            <% for message in @holding_pen_messages %>

                  <% if message.get_body_for_quoting.strip.size == 0 %>
                      <%= link_to "(no body)", admin_request_show_raw_email_path(message.raw_email_id) %>
                  <% else %>
                      <%= link_to excerpt(message.get_body_for_quoting, "", 60), admin_request_show_raw_email_path(message.raw_email_id) %>
                  <% end %>

                  <%=simple_date(message.sent_at)%>

            <% end %>

  <% end %>

  <% if @error_message_requests.size > 0 %>

        <%=@error_message_requests.size%> <%= chevron_right %>Fix these delivery and other errors

            <% for @request in @error_message_requests %>

                  <%= request_both_links(@request) %>

                  <%=simple_date(@request.get_last_event.created_at)%>

            <% end %>

  <% end %>

  <% if @attention_requests.size > 0 %>

        <%=@attention_requests.size%><%= chevron_right %> Review requests marked by users as requiring your attention

            <% for @request in @attention_requests %>

                  <%= request_both_links(@request) %>

                  <%=simple_date(@request.get_last_event.created_at)%>

            <% end %>

  <% end %>

  <% if @requires_admin_requests.size > 0 %>

        <%=@requires_admin_requests.size%><%= chevron_right %> These require administrator attention

            <% for @request in @requires_admin_requests %>

                  <%= request_both_links(@request) %>

                  <%=simple_date(@request.get_last_event.created_at)%>

            <% end %>

  <% end %>

  <% if @blank_contacts.size > 0 %>

        <%=@blank_contacts.size%><%= chevron_right %> Find missing FOI email for these public authorities (try phoning!)

            <% for @blank_contact in @blank_contacts %>

                  <%= public_body_both_links(@blank_contact) %>

                  <%=simple_date(@blank_contact.updated_at)%>

            <% end %>

  <% end %>

  <% if @old_unclassified.size > 0 %>

        <%=@old_unclassified.size%><%= chevron_right %> Classify responses that are still unclassified <%=InfoRequest::OLD_AGE_IN_DAYS.inspect %> after response

            <% for @request in @old_unclassified %>

                    <%= request_both_links(@request) %>

                    <%=simple_date(@request.get_last_response_event.created_at)%>

            <% end %>

  <% end %>

<% if @holding_pen_messages.size == 0 && @old_unclassified.size == 0 && @requires_admin_requests.size == 0 && @blank_contacts.size == 0 && @attention_requests.size == 0 %>

      No pending administration required.

<% end %>


Added join mailing list link.

Added join mailing list link.

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

  <META http-equiv=Content-Type content="text/html; charset=UTF-8"/>
  <%= auto_discovery_link_tag(:rss , :controller => 'observer', :action  =>  'rss') %>
  <title>Mushroom Observer: <%= if @title.nil? then controller.action_name else @title end %></title>
  <%= css = nil
	if CSS.member?(controller.action_name)
		css = controller.action_name
	else
		unless session['user'].nil?
        	css = session['user'].theme
		end
	end
	unless CSS.member?(css)
		css = CSS[rand(CSS.length)]
	end
	stylesheet_link_tag 'general', css %>
	<link REL="SHORTCUT ICON" HREF=<%= sprintf('"%s/images/favicon.ico"', DOMAIN) %> />

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

								<%= link_to('Introduction', :controller => 'observer',
								            :action => 'intro') %>

								<%= link_to('How To Use',
								            :controller => 'observer',
								            :action => 'how_to_use') %>

            					<%= link_to('Send a Comment', :controller => 'observer',
            								:action => 'ask_webmaster_question') %>

								<%= link_to('News', :controller => 'observer',
								            :action => 'news') %>

								<%= link_to('Latest Changes',
								            :controller => 'observer',
								            :action => 'list_rss_logs') %>

								<%= link_to('Index A->Z', :controller => 'observer',
								                          :action => 'name_index') %>

								Observations:

								  <%= link_to('Create Observation',
								                        :controller => 'observer',
								                        :action => 'create_observation')
								                 %>

								  <%= link_to('Sort by Date',
								                        :controller => 'observer',
								                        :action => 'list_observations') %>

								  <%= link_to('Sort by Name',
								                        :controller => 'observer',
								                        :action => 'observations_by_name')
								                 %>

								Species Lists:

								  <%= link_to('Create List',
								                        :controller => 'observer',
								                        :action => 'create_species_list')
								                 %>

								  <%= link_to('Sort by Date',
								                        :controller => 'observer',
								                        :action => 'list_species_lists')
								                 %>

								  <%= link_to('Sort by Title',
								                        :controller => 'observer',
								                        :action => 'species_lists_by_title')
								                        %>

								<%= link_to('Newest Images', :controller => 'observer',
								            :action => 'list_images') %>

								<%= link_to('Comments', :controller => 'observer',
								            :action => 'list_comments') %>

								<% if session['user'].nil? %>
								Account:

								  <%= link_to('Login', :controller => 'account',
								                        :action => 'login') %>

								  <%= link_to('Create Account',
								                        :controller => 'account',
														:action => 'signup') %>
								<% else %>
								Current user:

								  <%= h(session['user'].login) %>

								  <%= link_to('Preferences',
								                        :controller => 'account',
								                        :action => 'prefs') %>

								  Join Mailing List

								  <%= link_to('Logout',
								                        :controller => 'account',
								                        :action => 'logout') %>
									<% if session['user'].id == 0 %>

										Admin:

										  <%= link_to('Users',
										                        :controller => 'observer',
										                        :action => 'users_by_name') %>

										  <%= link_to('Email Features',
										                        :controller => 'observer',
										                        :action => 'email_features') %>

									<% end %>
								<% end %>

									<%= link_to(sprintf('Colors from %s', css),
												:controller => 'observer', :action => 'color_themes') %>

									Powered by:

									Ruby on Rails

									Preferred browser:

									FireFox

            		<% form_tag(:action => 'pattern_search',
            		                   :controller => 'observer', :id => @comment) do %>
                      Find: <%= text_field("search", "pattern", :size => 10)%>
                      <%= submit_tag 'Observations' %>
                      <%= submit_tag 'Images' %>
                      <%= submit_tag 'Locations' %>
                    <% end -%>
                    <% if flash[:notice] %>
					  <%= flash[:notice] %>

					<% end %>
					<%= @content_for_layout %>

  <META http-equiv=Content-Type content="text/html; charset=UTF-8"/>
  <%= auto_discovery_link_tag(:rss , :controller => 'observer', :action  =>  'rss') %>
  <title>Mushroom Observer: <%= if @title.nil? then controller.action_name else @title end %></title>
  <%= css = nil
	if CSS.member?(controller.action_name)
		css = controller.action_name
	else
		unless session['user'].nil?
        	css = session['user'].theme
		end
	end
	unless CSS.member?(css)
		css = CSS[rand(CSS.length)]
	end
	stylesheet_link_tag 'general', css %>
	<link REL="SHORTCUT ICON" HREF=<%= sprintf('"%s/images/favicon.ico"', DOMAIN) %> />

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

								<%= link_to('Introduction', :controller => 'observer',
								            :action => 'intro') %>

								<%= link_to('How To Use',
								            :controller => 'observer',
								            :action => 'how_to_use') %>

            					<%= link_to('Send a Comment', :controller => 'observer',
            								:action => 'ask_webmaster_question') %>

								<%= link_to('News', :controller => 'observer',
								            :action => 'news') %>

								<%= link_to('Latest Changes',
								            :controller => 'observer',
								            :action => 'list_rss_logs') %>

								<%= link_to('Index A->Z', :controller => 'observer',
								                          :action => 'name_index') %>

								Observations:

								  <%= link_to('Create Observation',
								                        :controller => 'observer',
								                        :action => 'create_observation')
								                 %>

								  <%= link_to('Sort by Date',
								                        :controller => 'observer',
								                        :action => 'list_observations') %>

								  <%= link_to('Sort by Name',
								                        :controller => 'observer',
								                        :action => 'observations_by_name')
								                 %>

								Species Lists:

								  <%= link_to('Create List',
								                        :controller => 'observer',
								                        :action => 'create_species_list')
								                 %>

								  <%= link_to('Sort by Date',
								                        :controller => 'observer',
								                        :action => 'list_species_lists')
								                 %>

								  <%= link_to('Sort by Title',
								                        :controller => 'observer',
								                        :action => 'species_lists_by_title')
								                        %>

								<%= link_to('Newest Images', :controller => 'observer',
								            :action => 'list_images') %>

								<%= link_to('Comments', :controller => 'observer',
								            :action => 'list_comments') %>

								<% if session['user'].nil? %>
								Account:

								  <%= link_to('Login', :controller => 'account',
								                        :action => 'login') %>

								  <%= link_to('Create Account',
								                        :controller => 'account',
														:action => 'signup') %>
								<% else %>
								Current user:

								  <%= h(session['user'].login) %>

								  <%= link_to('Preferences',
								                        :controller => 'account',
								                        :action => 'prefs') %>

								  <%= link_to('Logout',
								                        :controller => 'account',
								                        :action => 'logout') %>
									<% if session['user'].id == 0 %>

										Admin:

										  <%= link_to('Users',
										                        :controller => 'observer',
										                        :action => 'users_by_name') %>

										  <%= link_to('Email Features',
										                        :controller => 'observer',
										                        :action => 'email_features') %>

									<% end %>
								<% end %>

									<%= link_to(sprintf('Colors from %s', css),
												:controller => 'observer', :action => 'color_themes') %>

									Powered by:

									Ruby on Rails

									Preferred browser:

									FireFox

            		<% form_tag(:action => 'pattern_search',
            		                   :controller => 'observer', :id => @comment) do %>
                      Find: <%= text_field("search", "pattern", :size => 10)%>
                      <%= submit_tag 'Observations' %>
                      <%= submit_tag 'Images' %>
                      <%= submit_tag 'Locations' %>
                    <% end -%>
                    <% if flash[:notice] %>
					  <%= flash[:notice] %>

					<% end %>
					<%= @content_for_layout %>


Added AddThis before the text

Added AddThis before the text

<%
  if @page.parent && @page.parent.has_posts? && @page.parent.feed
    add_rss_feed_to_head(@page.parent.name, @page.parent.feed.url)
  end
%>

<div id="article" class="<%= @page.css_class_name %>">

<div<%= " class='logged-in'" if user %>>
  <% if @page.allow_post_content?(user) || @page.allow_publish_content?(user) %>

      <% if @page.allow_post_content?(user) %>
        <%= link_to content_tag( 'span', label_for_edit_article(@page) ),
            profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }),
            :class => 'button with-text icon-edit' %>
        <% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %>
          <% if @page != profile.home_page && !@page.has_posts? %>
            <%= link_to content_tag( 'span', _('Delete') ),
              profile.admin_url.merge({ :controller => 'cms', :action => 'destroy', :id => @page }),
              :class => 'button with-text icon-delete' %>
          <% end %>
          <% if !environment.enabled?('disable_cms') && !@page.folder? %>
            <% if profile.kind_of?(Person) %>
              <%= link_to content_tag( 'span', _('Spread this') ),
                  profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page }),
                  :class => 'button with-text icon-spread' %>
            <% elsif profile.kind_of?(Community) && environment.portal_community %>
              <%= link_to content_tag( 'span', _('Spread this') ),
                  profile.admin_url.merge({ :controller => 'cms', :action => 'publish_on_portal_community', :id => @page }),
                  :class => 'button with-text icon-spread' %>
            <% end %>
          <% end %>
        <% end %>
      <% end %>
      <% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %>
        <% if !@page.gallery? %>
          <%= link_to _('Add translation'),
              profile.admin_url.merge(:controller => 'cms', :action => 'new',
                                      :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)),
                                      :type => @page.type, :article => { :translation_of_id => @page.native_translation.id }),
              :class => 'button with-text icon-locale' if @page.translatable? && !@page.native_translation.language.blank? %>
          <%= lightbox_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)))) %>
        <% end %>
      <% end %>
      <% if @page.accept_uploads? %>
        <%= button('upload-file', _('Upload files'), profile.admin_url.merge(:controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent))) %>
      <% end %>

  <% elsif profile.community? && (@page.blog? || @page.parent && @page.parent.blog?) %>

      <%= link_to content_tag( 'span', _('Suggest an article') ), profile.admin_url.merge({ :controller => 'cms', :action => 'suggest_an_article'}), :id => 'suggest-article-link', :class => 'button with-text icon-new' %>

  <% end %>

    <%= link_to(image_tag('icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %>
    <%= article_title(@page, :no_link => true) %>
    <%= article_translations(@page) %>

<% if !@page.tags.empty? %>

    <%= _("This article's tags:") %>
    <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tags', :id => t.name ) }.join("\n") %>

<% end %>

<% if @page.display_hits? %>

    <%= n_('Viewed one time', 'Viewed %{num} times', @page.hits) % { :num => @page.hits } %>

<% end %>

<% if @page.parent && !@page.parent.path.blank? %>

  <%= button(:back, _('Go back to %s') % @page.parent.short_title, @page.parent.url) %>

<% end %>

<%= render :partial => 'shared/disabled_enterprise' %>

<% if NOOSFERO_CONF['addthis_enabled'] %>

<% end %>

<% cache(@page.cache_key(params, user)) do %>
  <div class="<%="article-body article-body-" + @page.css_class_name %>">
    <% options = @page.image? ? {:gallery_view => true} : {} %>
    <%= article_to_html(@page, options) %>

<% end %>

<% if ! @page.categories.empty? %>

<%= _('Categories') %>

    <%= @page.categories.map {|item| link_to_category(item, false) }.join(", ") %>

<% end %>

<%= display_source_info(@page) %>

  <% if @page.accept_comments? %>
  <h3 <%= 'class="no-comments-yet"' if @comments.size == 0 %>>
    <%= number_of_comments(@page) %>

  <% if @comments_count > 1 %>

<%= _('Post a comment') %>

  <% end %>

    <%= render :partial => 'comment', :collection => @comments %>

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

  <% end %>

<%= add_zoom_to_images %>

<%
  if @page.parent && @page.parent.has_posts? && @page.parent.feed
    add_rss_feed_to_head(@page.parent.name, @page.parent.feed.url)
  end
%>

<div id="article" class="<%= @page.css_class_name %>">

<div<%= " class='logged-in'" if user %>>
  <% if @page.allow_post_content?(user) || @page.allow_publish_content?(user) %>

      <% if @page.allow_post_content?(user) %>
        <%= link_to content_tag( 'span', label_for_edit_article(@page) ),
            profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }),
            :class => 'button with-text icon-edit' %>
        <% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %>
          <% if @page != profile.home_page && !@page.has_posts? %>
            <%= link_to content_tag( 'span', _('Delete') ),
              profile.admin_url.merge({ :controller => 'cms', :action => 'destroy', :id => @page }),
              :class => 'button with-text icon-delete' %>
          <% end %>
          <% if !environment.enabled?('disable_cms') && !@page.folder? %>
            <% if profile.kind_of?(Person) %>
              <%= link_to content_tag( 'span', _('Spread this') ),
                  profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page }),
                  :class => 'button with-text icon-spread' %>
            <% elsif profile.kind_of?(Community) && environment.portal_community %>
              <%= link_to content_tag( 'span', _('Spread this') ),
                  profile.admin_url.merge({ :controller => 'cms', :action => 'publish_on_portal_community', :id => @page }),
                  :class => 'button with-text icon-spread' %>
            <% end %>
          <% end %>
        <% end %>
      <% end %>
      <% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %>
        <% if !@page.gallery? %>
          <%= link_to _('Add translation'),
              profile.admin_url.merge(:controller => 'cms', :action => 'new',
                                      :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)),
                                      :type => @page.type, :article => { :translation_of_id => @page.native_translation.id }),
              :class => 'button with-text icon-locale' if @page.translatable? && !@page.native_translation.language.blank? %>
          <%= lightbox_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)))) %>
        <% end %>
      <% end %>
      <% if @page.accept_uploads? %>
        <%= button('upload-file', _('Upload files'), profile.admin_url.merge(:controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent))) %>
      <% end %>

  <% elsif profile.community? && (@page.blog? || @page.parent && @page.parent.blog?) %>

      <%= link_to content_tag( 'span', _('Suggest an article') ), profile.admin_url.merge({ :controller => 'cms', :action => 'suggest_an_article'}), :id => 'suggest-article-link', :class => 'button with-text icon-new' %>

  <% end %>

    <%= link_to(image_tag('icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %>
    <%= article_title(@page, :no_link => true) %>
    <%= article_translations(@page) %>

<% if !@page.tags.empty? %>

    <%= _("This article's tags:") %>
    <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tags', :id => t.name ) }.join("\n") %>

<% end %>

<% if @page.display_hits? %>

    <%= n_('Viewed one time', 'Viewed %{num} times', @page.hits) % { :num => @page.hits } %>

<% end %>

<% if @page.parent && !@page.parent.path.blank? %>

  <%= button(:back, _('Go back to %s') % @page.parent.short_title, @page.parent.url) %>

<% end %>

<%= render :partial => 'shared/disabled_enterprise' %>

<% cache(@page.cache_key(params, user)) do %>
  <div class="<%="article-body article-body-" + @page.css_class_name %>">
    <% options = @page.image? ? {:gallery_view => true} : {} %>
    <%= article_to_html(@page, options) %>

<% end %>

<% if ! @page.categories.empty? %>

<%= _('Categories') %>

    <%= @page.categories.map {|item| link_to_category(item, false) }.join(", ") %>

<% end %>

<%= display_source_info(@page) %>

<% if NOOSFERO_CONF['addthis_enabled'] %>

<% end %>

  <% if @page.accept_comments? %>
  <h3 <%= 'class="no-comments-yet"' if @comments.size == 0 %>>
    <%= number_of_comments(@page) %>

  <% if @comments_count > 1 %>

<%= _('Post a comment') %>

  <% end %>

    <%= render :partial => 'comment', :collection => @comments %>

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

  <% end %>

<%= add_zoom_to_images %>


Substitute <br/> for \n in review comments

<% comment = show %>

      Comment ID #<%= comment.id %> by:
      <%=h comment.commenter %>

      On:
      <%=h comment.written_on %>

        <%=(h comment.content).gsub("\n", "
") %>

<% comment = show %>

      Comment ID #<%= comment.id %> by:
      <%=h comment.commenter %>

      On:
      <%=h comment.written_on %>

        <%=h comment.content %>