fixed few small html issues with the signup form

      <%= render :partial => 'layouts/language' %>

<%= "Create Your Account"[:signup_title] %>

    <%= 'Choose your login name and your password then click "%s"'[:signup_info, 'Sign up'[:signup_button]] %>

    <% form_for(:user, :html => {:id => 'signup_form'}) do |f| -%>

        <%= f.label :login, 'Your login name'[:signup_login_name] %>

        <%= f.text_field :login %>

        <%= f.label :password, 'Your Password'[:signup_password] %>

        <%= f.password_field :password %>

        <%= f.label :password_confirmation, "Confirm Password"[:signup_confirm_password] %>

        <%= f.password_field :password_confirmation %>

      <%= call_hook :signup_form_password %>

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

        <%= f.label :email, "Your Email"[:signup_email] %>

        <%= f.text_field :email%>

        <%- unless current_site.require_user_email -%>

        <%= "Optional: used if you forget your password"[:signup_email_info] %>
        <%- end -%>

<%= submit_tag 'Sign up'[:signup_button] %>

      <%= hidden_field_tag 'redirect', params[:redirect] if params[:redirect] %>
    <%- end -%>

<%= "Usage Agreement"[:usage_agreement_heading] %>

      <%= GreenCloth.new("Usage agreement text goes here"[:usage_agreement_text]).to_html %>

      <%= render :partial => 'layouts/language' %>

<%= "Create Your Account"[:signup_title] %>

    <%= 'Choose your login name and your password then click "%s"'[:signup_info] % 'Sign up'[:signup_button] %>

    <% form_for(:user, :html => {:id => 'signup_form'}) do |f| -%>

        <%= 'Your login name'[:signup_login_name] %>

        <%= f.text_field :login %>

        <%= 'Your Password'[:signup_password]%>

        <%= f.password_field :password %>

        <%= "Confirm Password"[:signup_confirm_password] %>

        <%= f.password_field :password_confirmation %>

      <%= call_hook :signup_form_password %>

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

        <%= "Your Email"[:signup_email] %>

        <%= f.text_field :email%>
        <%- unless current_site.require_user_email -%>

        <%= "Optional: used if you forget your password"[:signup_email_info] %>
        <%- end -%>

<%= submit_tag 'Sign up'[:signup_button] %>

      <%= hidden_field_tag 'redirect', params[:redirect] if params[:redirect] %>
    <%- end -%>

<%= "Usage Agreement"[:usage_agreement_heading] %>

      <%= GreenCloth.new("Usage agreement text goes here"[:usage_agreement_text]).to_html %>


Add div around sidebars.  Closes #494

Add div around sidebars.  Closes #494

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

<% benchmark "BENCHMARK: display_plugins" do %>
  <% @sidebars.each do |sidebar| -%>
    <% benchmark "BENCHMARK: display_plugins: #{sidebar.controller}" do %>
      <div class="sidebar-node">
        <%= render_sidebar(sidebar) %>
      </div>
    <% end %>
  <% end %>
<% end %>

<% benchmark "BENCHMARK: display_plugins" do %>
  <% @sidebars.each do |sidebar| -%>
    <% benchmark "BENCHMARK: display_plugins: #{sidebar.controller}" do %>
      <%= render_sidebar(sidebar) %>
    <% end %>
  <% end %>
<% end %>


community-track: fix typo on hits

community-track: fix typo on hits

<% extend CommunityTrackPlugin::TrackHelper %>
<div class="item_card <%= category_class(track_card) %>">
  <a href="<%= url_for track_card.url %>">

      <%= track_card.category_name %>

      <%= image_tag track_card.image.public_filename if track_card.image %>

      <%= track_card.name %>

      <%= track_card_lead(track_card) %>

      <%= "#{track_card.comments_count}" %>
      <%= _('comments') %>

      <%= "#{track_card.hits}" %>
      <%= _('hits') %>

<% extend CommunityTrackPlugin::TrackHelper %>
<div class="item_card <%= category_class(track_card) %>">
  <a href="<%= url_for track_card.url %>">

      <%= track_card.category_name %>

      <%= image_tag track_card.image.public_filename if track_card.image %>

      <%= track_card.name %>

      <%= track_card_lead(track_card) %>

      <%= "#{track_card.comments_count}" %>
      <%= _('comments') %>

      <%= "#{track_card.hits}" %>
      <%= _('acessos') %>


fixed security flaw -- lack of html escape

<%
task_id      = "task_#{task.id}"
details_id   = "#{task_id}_details"
links = []
task.users.each do |user|
  if user == current_user
    links << link_to(current_user.login, me_url(:action => 'tasks', :id => nil))
  else
    links << link_to_user(user, :action => 'tasks')
  end
end
%>

      <%= "#{links.join(', ')}:" if links.any? %>
      <% if task.description.any? -%>
        <%= link_to_function task.name, "Element.toggle('#{details_id}')" %>
      <% else -%>
        <%=h task.name %>
      <% end %>

    <div class='indent task_details' id="<%=details_id%>" style='display: none'>
      <%=h task.description_html %>

<%
task_id      = "task_#{task.id}"
details_id   = "#{task_id}_details"
links = []
task.users.each do |user|
  if user == current_user
    links << link_to(current_user.login, me_url(:action => 'tasks', :id => nil))
  else
    links << link_to_user(user, :action => 'tasks')
  end
end
%>

      <%= "#{links.join(', ')}:" if links.any? %>
      <% if task.description.any? -%>
        <%= link_to_function task.name, "Element.toggle('#{details_id}')" %>
      <% else -%>
        <%= task.name %>
      <% end %>

    <div class='indent task_details' id="<%=details_id%>" style='display: none'>
      <%= task.description_html %>


less abstruse activation email notification

<%= @user.login %>, your account has been activated.  You may now start adding and browsing books:

  <%= @url %>

<%= @user.login %>, your account has been activated.  You may now start adding your plugins:

  <%= @url %>


Made it harder to overwrite another reviewers opinion on an Image.

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

<%
    @title = 'Image: ' + h(@image.unique_text_name)
    search_params = calc_search_params()
    for obs in @image.observations
        %>
        <%= link_to("About #{textilize_without_paragraph(h(obs.format_name))}",
            :controller => 'name', :action => "show_name", :id => obs.name) %>
        | <%= sprintf('Google Images' % obs.text_name) %>

    <%
    end
%>

<%= link_to 'Show Full Size', :action => 'show_original', :id => @image, :params => search_params %>
<% commercial_inquiries_ok = @image.user.commercial_email
   if commercial_inquiries_ok %>
	| <%= link_to 'Send Commercial Inquiry About Image',
        :controller => 'observer', :action => 'commercial_inquiry', :id => @image %>
<% end %>

<%= link_to('Prev', :action => 'prev_image', :id => @image.id, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
| <%= link_to('Next', :action => 'next_image', :id => @image.id, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>

Image: <%= textilize_without_paragraph(h(@image.unique_format_name)) %>

Copyright ©<%= @image.when.year %> <%= user_link(@image.user, @image.copyright_holder) %>

        <%= link_to(image_tag("640/#{@image.id}.jpg"),
        	:action => 'show_original', :id => @image.id, :params => search_params) %>

        <%= render :partial => "shared/form_#{@image.license.form_name}" %>

<% if check_permission(@image.user_id) %>
	<%= link_to 'Edit Image', :action => 'edit_image', :id => @image %>
	| <%= link_to 'Destroy', { :action => 'destroy_image', :id => @image },
                  :confirm => "Are you sure?" %>
<% end %>

  Quality: <%= @image.quality.to_sym.l %>
  <% if @image.reviewer %>

      (<%= "#{:show_image_reviewed_by.l}: #{user_link(@image.reviewer, @image.reviewer.login)}" %>)

  <% end %>
  <% if @is_reviewer
       is_reviewed = (@image.quality != :unreviewed)
       if is_reviewed %>

<%= link_to('Next', :action => 'next_image',
                       :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
       <% end %>

<%= link_to(:low.l, :action => 'set_image_quality', :value => :low,
                     :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
    <% unless is_reviewed %>
      | <%= link_to(:low_and_next.l, :action => 'set_image_quality', :value => :low, :next => true,
                    :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
    <% end %>

<%= link_to(:medium.l, :action => 'set_image_quality', :value => :medium,
                     :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
    <% unless is_reviewed %>
      | <%= link_to(:medium_and_next.l, :action => 'set_image_quality', :value => :medium, :next => true,
                    :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
    <% end %>

<%= link_to(:high.l, :action => 'set_image_quality', :value => :high,
                     :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
    <% unless is_reviewed %>
      | <%= link_to(:high_and_next.l, :action => 'set_image_quality', :value => :high, :next => true,
                    :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
    <% end %>
  <% end %>

When: <%= @image.when %>

Observations:

    <% for observation in @image.observations
      text = '' + textilize_without_paragraph(h(observation.unique_format_name))
      if observation.notes != ''
          text += '
Notes: %s...' % observation.notes[0..15]
      end
      len = observation.comments.length
      if len > 0
          text += '<span class="HelpNote"
%s comments' % len
      end
      text += '' %>
      <%= link_to(text, :controller => 'observer',
          :action => 'show_observation', :id => observation.id, :params => search_params) %>

    <% end %>

<% if @image.notes && @image.notes.to_s != "" %>
  Notes:

  <%= textilize(sanitize(@image.notes.to_s)) %>
<% end %>

Image created: <%= @image.created %>

Last modified: <%= @image.modified %>

<%
    @title = 'Image: ' + h(@image.unique_text_name)
    search_params = calc_search_params()
    for obs in @image.observations
        %>
        <%= link_to("About #{textilize_without_paragraph(h(obs.format_name))}",
            :controller => 'name', :action => "show_name", :id => obs.name) %>
        | <%= sprintf('Google Images' % obs.text_name) %>

    <%
    end
%>

<%= link_to 'Show Full Size', :action => 'show_original', :id => @image, :params => search_params %>
<% commercial_inquiries_ok = @image.user.commercial_email
   if commercial_inquiries_ok %>
	| <%= link_to 'Send Commercial Inquiry About Image',
        :controller => 'observer', :action => 'commercial_inquiry', :id => @image %>
<% end %>

<%= link_to('Prev', :action => 'prev_image', :id => @image.id, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
| <%= link_to('Next', :action => 'next_image', :id => @image.id, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>

Image: <%= textilize_without_paragraph(h(@image.unique_format_name)) %>

Copyright ©<%= @image.when.year %> <%= user_link(@image.user, @image.copyright_holder) %>

        <%= link_to(image_tag("640/#{@image.id}.jpg"),
        	:action => 'show_original', :id => @image.id, :params => search_params) %>

        <%= render :partial => "shared/form_#{@image.license.form_name}" %>

<% if check_permission(@image.user_id) %>
	<%= link_to 'Edit Image', :action => 'edit_image', :id => @image %>
	| <%= link_to 'Destroy', { :action => 'destroy_image', :id => @image },
                  :confirm => "Are you sure?" %>
<% end %>

  Quality: <%= @image.quality.to_sym.l %>
  <% if @image.reviewer %>

      (<%= "#{:show_image_reviewed_by.l}: #{user_link(@image.reviewer, @image.reviewer.login)}" %>)

  <% end %>
  <% if @is_reviewer %>

<%= link_to(:low.l, :action => 'set_image_quality', :value => :low,
                     :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
    | <%= link_to(:low_and_next.l, :action => 'set_image_quality', :value => :low, :next => true,
                  :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>

<%= link_to(:medium.l, :action => 'set_image_quality', :value => :medium,
                     :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
    | <%= link_to(:medium_and_next.l, :action => 'set_image_quality', :value => :medium, :next => true,
                  :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>

<%= link_to(:high.l, :action => 'set_image_quality', :value => :high,
                     :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
    | <%= link_to(:high_and_next.l, :action => 'set_image_quality', :value => :high, :next => true,
                  :id => @image, :seq_key => @seq_key, :search_seq => @search_seq, :obs => @obs) %>
  <% end %>

When: <%= @image.when %>

Observations:

    <% for observation in @image.observations
      text = '' + textilize_without_paragraph(h(observation.unique_format_name))
      if observation.notes != ''
          text += '
Notes: %s...' % observation.notes[0..15]
      end
      len = observation.comments.length
      if len > 0
          text += '<span class="HelpNote"
%s comments' % len
      end
      text += '' %>
      <%= link_to(text, :controller => 'observer',
          :action => 'show_observation', :id => observation.id, :params => search_params) %>

    <% end %>

<% if @image.notes && @image.notes.to_s != "" %>
  Notes:

  <%= textilize(sanitize(@image.notes.to_s)) %>
<% end %>

Image created: <%= @image.created %>

Last modified: <%= @image.modified %>


Add code ass a test to see if this view is being used.

<%= l(:label_revision) %> <%= format_revision(@rev_to) + ':' if @rev_to %><%= format_revision(@rev) %> <%=h @path %>

<% link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => @rev}, :caption => "Return to overview" if params[:rev] %>
<% link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => @rev_to}, :caption => "Return to overview" if params[:rev_to] %>

<% form_tag({:path => to_path_param(@path)}, :method => 'get') do %>
  <%= hidden_field_tag('rev', params[:rev]) if params[:rev] %>
  <%= hidden_field_tag('rev_to', params[:rev_to]) if params[:rev_to] %>

<%= l(:label_view_diff) %>
  <%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %>

<% end %>

<% cache(@cache_key) do -%>
<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
<% end -%>

<% other_formats_links do |f| %>
	<%= f.link_to 'Diff', :url => params, :caption => 'Unified diff' %>
<% end %>

<% html_title(with_leading_slash(@path), 'Diff') -%>

<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>


If there’s a unique guess as to the correct info request an incoming message should be associated with, prepopulate the "move" form with it.

<% form_tag '../redeliver_incoming' do %>

      id or url_title of request:
      <% if @info_requests && @info_requests.size == 1 %>
        <%= text_field_tag 'url_title', @info_requests[0].url_title, { :size => 20 } %>
      <% else %>
        <%= text_field_tag 'url_title', "", { :size => 20 } %>
      <% end %>
      <%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id %>
      <%= submit_tag "Redeliver to another request" %>

<% end %>

<%= link_to 'FOI officer upload URL', '../generate_upload_url/' + incoming_message.info_request.id.to_s + "?incoming_message_id=" + incoming_message.id.to_s %>

<% form_tag '../destroy_incoming' do %>

      <%= hidden_field_tag 'incoming_message_id', incoming_message.id %>
      Warning, this is permanent! --->
      <%= submit_tag "Destroy message" %>

<% end %>

<% form_tag '../redeliver_incoming' do %>

      id or url_title of request:
      <%= text_field_tag 'url_title', "", { :size => 20 } %>
      <%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id %>
      <%= submit_tag "Redeliver to another request" %>

<% end %>

<%= link_to 'FOI officer upload URL', '../generate_upload_url/' + incoming_message.info_request.id.to_s + "?incoming_message_id=" + incoming_message.id.to_s %>

<% form_tag '../destroy_incoming' do %>

      <%= hidden_field_tag 'incoming_message_id', incoming_message.id %>
      Warning, this is permanent! --->
      <%= submit_tag "Destroy message" %>

<% end %>


Add bold version of Maven Pro

Add bold version of Maven Pro

<%= stylesheet_link_tag "/alavetelitheme/stylesheets/custom" %>
<link href='http://fonts.googleapis.com/css?family=Maven+Pro:400,700|Actor' rel='stylesheet' type='text/css'>

<%= stylesheet_link_tag "/alavetelitheme/stylesheets/custom" %>
<link href='http://fonts.googleapis.com/css?family=Maven+Pro|Actor' rel='stylesheet' type='text/css'>


Commit patch for #717 - add title text to flickr images in sidebar

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

<% if @flickr -%>

<%= @flickr.title  %> (<%= link_to "flickr", @flickr.link %>)

<% for pic in @flickr.choose(@sb_config['count'].to_i) -%>
  <div class="flickr<%= @sb_config['format']%>"><%= case @sb_config['format']
          when 'square':
            link_to image_tag(pic.square, :alt => pic.title, :title => pic.title),pic.link
          when 'rectangle':
            link_to image_tag(pic.thumb, :alt => pic.title, :title => pic.title),pic.link
          end
 %>

  <% end -%>

<% end -%>

<% if @flickr -%>

<%= @flickr.title  %> (<%= link_to "flickr", @flickr.link %>)

<% for pic in @flickr.choose(@sb_config['count'].to_i) -%>
  <div class="flickr<%= @sb_config['format']%>"><%= case @sb_config['format']
          when 'square':
            link_to image_tag(pic.square, :alt => pic.title),pic.link
          when 'rectangle':
            link_to image_tag(pic.thumb, :alt => pic.title),pic.link
          end
 %>

  <% end -%>

<% end -%>


single task list now displays the users on one line, separated with a comma

<% # You need to pass a local variable called 'manage' that is true or false %>
<% # i.e. like <%= render :partial => 'task_list', :locals => {:task_list => nil, :task => task, 'manage' => true} %> %>

<% # if true, the partial will also display edit and destroy buttons %>

  <% if task.internal_description == 'medical' && (!same_type_task_list) %>
		<%= link_to task.medical_treatment.medical_problem.bat.band, :controller => 'bats', :action => 'show', :id => task.medical_treatment.medical_problem.bat %>

    <% if task.medical_treatment.medical_problem.bat.cage %>
      <%= link_to task.medical_treatment.medical_problem.bat.cage.name, :controller => 'cages', :action => :show, :id => task.medical_treatment.medical_problem.bat.cage %>
    <% else %>
      -
    <% end %>

    <%= link_to task.medical_treatment.medical_problem.title, :controller => 'medical_problems', :action => 'show', :id => task.medical_treatment.medical_problem %>
  <% end %>

  <% if !same_type_task_list %>

      <%= task.title %>

  <% end %>

	<% if task.room_id %>
		<%= task.room.name %>
	<% elsif task.general_task? %>

	<% end %>

			<% if task.animal_care == true %>
				Animal Care
			<% else %>
				<% for user in task.users %>
					<%= user.initials %><%= (user != task.users.last) ? "," : "" %>
				<% end %>
			<% end %>

	<% if task.internal_description == 'feed' %>
		<%=h task.food %>g
		<%=h task.dish_num.to_s + " " + task.dish_type.to_s %>
		<% cage = Cage.find(task.cage_id) %>

		<% if cage.bats.length > 0 %>
			<% average = task.food / cage.bats.length %>
			<%= (("%.0" + 1.to_s + "f") % average).to_f %> g
		<% end %>

	<% end %>

      <%= task.repeat_code == 0 ? "Daily" : '' %>
      <%= task.repeat_code == 1 ? "Every Sunday" : '' %>
      <%= task.repeat_code == 2 ? "Every Monday" : '' %>
      <%= task.repeat_code == 3 ? "Every Tuesday" : '' %>
      <%= task.repeat_code == 4 ? "Every Wednesday" : '' %>
      <%= task.repeat_code == 5 ? "Every Thursday" : '' %>
      <%= task.repeat_code == 6 ? "Every Friday" : '' %>
      <%= task.repeat_code == 7 ? "Every Saturday" : '' %>

    <% if task.done_by_schedule %>
       <%= nice_date(task.last_done_date) %>
    <% else %>
      <% if manage %>
        <% if task.doable %>
          <% if task.internal_description == "feed" %>
            [<%= link_to_remote 'Just Fed', :url => {
            :controller => 'tasks', :action => 'done', :id => task, :sorted_by => sorted_by,
            :ids => tasks, :div_id => div_id,  :same_type_task_list => same_type_task_list,
						:manage => manage},
            :update => div_id%>]
          <% elsif task.cage_id == nil && task.medical_treatment_id == nil %>
						[<%= link_to_remote 'Just Done', :url => {
            :controller => 'tasks', :action => 'done', :id => task, :sorted_by => sorted_by,
            :ids => tasks, :div_id => div_id,  :same_type_task_list => same_type_task_list,
						:manage => manage},
            :update => div_id %>]
          <% elsif task.internal_description == "weigh" %>
              [<%= link_to 'Weigh Cage', :controller => 'cages', :action => 'weigh_cage', :id => task.cage %>]
          <% elsif task.internal_description == "medical" %>
              [<%= link_to 'Do Treatment', :controller => 'tasks', :action => 'do_medical_task', :id => task %>]
          <% end %>
        <% else %>
          <warning>Not done on schedule</warning>
        <% end %>
      <% else %>
        <warning>Not done on schedule</warning>
      <% end %>
    <% end %>

		<% if (task.internal_description != 'medical') %>
		<%=h task.notes %>
		<% end %>

    <%= link_to 'Show', :controller => 'tasks', :action => 'show', :id => task %>

    <% if manage %>
    <%= link_to 'Edit',  :controller => 'tasks', :action => 'edit', :id => task %>
    <%= link_to_remote 'Destroy', :url => {
				:controller => 'tasks', :action => 'destroy', :id => task, :ids => tasks, :div_id => div_id,
				:same_type_task_list => same_type_task_list, :sorted_by => sorted_by, :manage => manage},
				:confirm => 'Are you sure?', :method => :post, :update => div_id %>
    <% end %>

<% # You need to pass a local variable called 'manage' that is true or false %>
<% # i.e. like <%= render :partial => 'task_list', :locals => {:task_list => nil, :task => task, 'manage' => true} %> %>

<% # if true, the partial will also display edit and destroy buttons %>

  <% if task.internal_description == 'medical' && (!same_type_task_list) %>
		<%= link_to task.medical_treatment.medical_problem.bat.band, :controller => 'bats', :action => 'show', :id => task.medical_treatment.medical_problem.bat %>

    <% if task.medical_treatment.medical_problem.bat.cage %>
      <%= link_to task.medical_treatment.medical_problem.bat.cage.name, :controller => 'cages', :action => :show, :id => task.medical_treatment.medical_problem.bat.cage %>
    <% else %>
      -
    <% end %>

    <%= link_to task.medical_treatment.medical_problem.title, :controller => 'medical_problems', :action => 'show', :id => task.medical_treatment.medical_problem %>
  <% end %>

  <% if !same_type_task_list %>

      <%= task.title %>

  <% end %>

	<% if task.room_id %>
		<%= task.room.name %>
	<% elsif task.general_task? %>

	<% end %>

			<% if task.animal_care == true %>
				Animal Care
			<% else %>
				<% for user in task.users %>
					<%= user.initials %>

				<% end %>
			<% end %>

	<% if task.internal_description == 'feed' %>
		<%=h task.food %>g
		<%=h task.dish_num.to_s + " " + task.dish_type.to_s %>
		<% cage = Cage.find(task.cage_id) %>

		<% if cage.bats.length > 0 %>
			<% average = task.food / cage.bats.length %>
			<%= (("%.0" + 1.to_s + "f") % average).to_f %> g
		<% end %>

	<% end %>

      <%= task.repeat_code == 0 ? "Daily" : '' %>
      <%= task.repeat_code == 1 ? "Every Sunday" : '' %>
      <%= task.repeat_code == 2 ? "Every Monday" : '' %>
      <%= task.repeat_code == 3 ? "Every Tuesday" : '' %>
      <%= task.repeat_code == 4 ? "Every Wednesday" : '' %>
      <%= task.repeat_code == 5 ? "Every Thursday" : '' %>
      <%= task.repeat_code == 6 ? "Every Friday" : '' %>
      <%= task.repeat_code == 7 ? "Every Saturday" : '' %>

    <% if task.done_by_schedule %>
       <%= nice_date(task.last_done_date) %>
    <% else %>
      <% if manage %>
        <% if task.doable %>
          <% if task.internal_description == "feed" %>
            [<%= link_to_remote 'Just Fed', :url => {
            :controller => 'tasks', :action => 'done', :id => task, :sorted_by => sorted_by,
            :ids => tasks, :div_id => div_id,  :same_type_task_list => same_type_task_list,
						:manage => manage},
            :update => div_id%>]
          <% elsif task.cage_id == nil && task.medical_treatment_id == nil %>
						[<%= link_to_remote 'Just Done', :url => {
            :controller => 'tasks', :action => 'done', :id => task, :sorted_by => sorted_by,
            :ids => tasks, :div_id => div_id,  :same_type_task_list => same_type_task_list,
						:manage => manage},
            :update => div_id %>]
          <% elsif task.internal_description == "weigh" %>
              [<%= link_to 'Weigh Cage', :controller => 'cages', :action => 'weigh_cage', :id => task.cage %>]
          <% elsif task.internal_description == "medical" %>
              [<%= link_to 'Do Treatment', :controller => 'tasks', :action => 'do_medical_task', :id => task %>]
          <% end %>
        <% else %>
          <warning>Not done on schedule</warning>
        <% end %>
      <% else %>
        <warning>Not done on schedule</warning>
      <% end %>
    <% end %>

		<% if (task.internal_description != 'medical') %>
		<%=h task.notes %>
		<% end %>

    <%= link_to 'Show', :controller => 'tasks', :action => 'show', :id => task %>

    <% if manage %>
    <%= link_to 'Edit',  :controller => 'tasks', :action => 'edit', :id => task %>
    <%= link_to_remote 'Destroy', :url => {
				:controller => 'tasks', :action => 'destroy', :id => task, :ids => tasks, :div_id => div_id,
				:same_type_task_list => same_type_task_list, :sorted_by => sorted_by, :manage => manage},
				:confirm => 'Are you sure?', :method => :post, :update => div_id %>
    <% end %>


added comment on code left only for reference in development

<% if @relation %>

<%=t("madb_define_link", { :vars => { 'parent' => t(@relation.parent.name,{ :scope => "account"}), 'child' => t(@relation.child.name, { :scope => "account"} ) }})%>

<%else%>

<%=t("madb_define_new_link", { :vars => { 'entity' => t(@source.name,{ :scope => "account"}) }})%>

<%end%>
<% if params["action"]=="edit_link" %>
<%= help_info("madb_help_info_admin_entities_edit_link")%>
<% else %>
<%= help_info("madb_help_info_admin_entities_define_link")%>
<% end %>

<% if false %>

      <% form_tag({:action => "add_link"} , {:onsubmit => "return check_link_form();"}) do -%>
      <%= form_hidden_fields( :source_id => @source_id, "relation[#{@this_side}]" => @source_id) %>
      <% if @relation %>
        <input type="hidden" name="relation_id" value="<%= @relation.id %>">
      <% end -%>

        <%=t("madb_"+@other_side_name+"_entity")%>  :

        <select <%= @relation ? 'disabled="disabled"' : '' %> name="relation[<%=@other_side%>]">
            <% entities_for_select = @entities.collect{|e| [t(e.name,:scope => "account"), e.id]  } %>
            <%# options_from_collection_for_select(@entities, "id","name", @relation ? @relation.send("#{@other_side}"):nil)
            %>
          <%= options_for_select(entities_for_select, @relation ? @relation.send("#{@other_side}"):nil)%>
      </select>

        <%= t("madb_from_parent_to_child_relation_name", {:vars => { "parent_entity" => t(@parent_entity,:scope => "account"), "child_entity" => t(@child_entity ,:scope => "account")}})%>:	 <%= text_field("relation","from_parent_to_child_name")%>

        <%= t("madb_from_child_to_parent_relation_name", :vars => { "parent_entity" => t(@parent_entity,:scope => "account"), "child_entity" => t(@child_entity ,:scope => "account")})%>:	 <%= text_field("relation","from_child_to_parent_name")%>

        <%= t("madb_can_one_child_entity_have_several_parents_question", :vars => { "parent_entity" => t(@parent_entity,:scope => "account"), "child_entity" => t(@child_entity ,:scope => "account")}) %> :
        <select <%= @parent_side_edit ? '' : 'disabled="disabled" '  %> name="relation[parent_side_type_id]">
            <% parent_ddl_options = @relation_types.collect{|rt| rt.name=="one" ? [ t("madb_no_only_one_parent"), rt.id ] : [ t("madb_yes_multiple_parent"), rt.id ] }%>
            <%# options_from_collection_for_select(@relation_types, "id","name", (@relation ? @relation.parent_side_type_id : nil))
            %>
            <%= options_for_select(parent_ddl_options,(@relation ? @relation.parent_side_type_id : nil))%>
      </select>

        <%= t("madb_can_one_parent_entity_have_several_children_question", :vars => { "parent_entity" => t(@parent_entity, :scope => "account"), "child_entity" => t(@child_entity ,:scope => "account")}) %>:	<select  <%= @child_side_edit ? '' : 'disabled="disabled" ' %> name="relation[child_side_type_id]">
            <% child_ddl_options = @relation_types.collect{|rt| rt.name=="one" ? [ t("madb_no_only_one_child"), rt.id ] : [ t("madb_yes_multiple_child"), rt.id ] }%>
      <%# options_from_collection_for_select(@relation_types, "id","name", (@relation ? @relation.child_side_type_id : nil))%>
            <%= options_for_select(child_ddl_options,(@relation ? @relation.child_side_type_id : nil))%>
      </select>

        <%= submit_tag t("madb_submit")%>
        <% if request.env["HTTP_REFERER"] %>
          <%=link_to t("madb_cancel"),request.env["HTTP_REFERER"] %>
        <% end %>
      </form>

      <% end %>

    <% end %>

<% this_side = @this_side.gsub(/_id/,"") %>


added the HTML5 logo to the title page

added the HTML5 logo to the title page

<!DOCTYPE html>

  <meta charset="utf-8"/>
  <title><%= title %></title>
  <link href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono" rel="stylesheet" type="text/css"/>

  <link href="css/rocks.css" rel="stylesheet" type="text/css"/>

  <% css_files.each do |css_file| %>
    <link href="<%= css_file %>" rel="stylesheet" type="text/css"/>
  <% end %>

<%= title %>

          Press →, scroll, or swipe to advance

          Options

            <input type="checkbox" id="toggle-size"/>

              Grow

            <input type="checkbox" id="toggle-transitions" checked/>

              Transitions

            <input type="checkbox" id="toggle-gradients" checked/>

              Gradients

            <input type="checkbox" id="toggle-counter" checked/>

              Slide numbers

          Made with Keydown

    <% slides.each do |slide| %>
      <%= slide.to_html %>
    <% end %>

<% js_files.each do |js_file| %>

<% end %>

<!DOCTYPE html>

  <meta charset="utf-8"/>
  <title><%= title %></title>
  <link href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono" rel="stylesheet" type="text/css"/>

  <link href="css/rocks.css" rel="stylesheet" type="text/css"/>

  <% css_files.each do |css_file| %>
    <link href="<%= css_file %>" rel="stylesheet" type="text/css"/>
  <% end %>

<%= title %>

          Press →, scroll, or swipe to advance

          Options

            <input type="checkbox" id="toggle-size" />

              Grow

            <input type="checkbox" id="toggle-transitions" checked/>

              Transitions

            <input type="checkbox" id="toggle-gradients" checked/>

              Gradients

            <input type="checkbox" id="toggle-counter" checked/>

              Slide numbers

          Made with Keydown

    <% slides.each do |slide| %>
      <%= slide.to_html %>
    <% end %>

<% js_files.each do |js_file| %>

<% end %>


fix spacing of ruby to silence warnings

fix spacing of ruby to silence warnings

<% @title = h(@display_user.name) + " - Freedom of Information requests" %>

<% if (@same_name_users.size >= 1) %>

<%= _('There is more than one person who uses this site and has this name.
    One of them is shown below, you may mean a different one:')%> <% for @same_name_user in @same_name_users %>
        <%= user_link(@same_name_user) %>
    <% end %>
<% end%>

<% if @is_you && @undescribed_requests.size > 0 %>

<%= _('Please go to the following requests, and let us
        know if there was information in the recent responses to them.')%>

        <% for undescribed_request in @undescribed_requests %>

<%=request_link(undescribed_request)%>

        <% end %>

      <%= _('Thanks very much - this will help others find useful stuff. We\'ll
            also, if you need it, give advice on what to do next about your
            requests.')%>

<% end %>

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

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

<%= _('On this page')%>

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

<%= _('Annotations')%>
      <% if @is_you %>

<%= _('Email subscriptions')%>
      <% end %>

        <% if @display_user.profile_photo %>
            <% if @is_you %>
            <a href="<%= set_profile_photo_url() %>">
            <% end %>
                <img src="<%= get_profile_photo_url(:url_name => @display_user.url_name) %>" alt="">
            <% if @is_you %>

            <% end %>
        <% else %>
            <% if @is_you %>

                    <%= link_to _('Set your profile photo'), set_profile_photo_url() %>

            <% end %>
        <% end %>

 <%= h(@display_user.name) + (@is_you ? _(" (you)") : "") %>

       <%= _('Joined {{site_name}} in', :site_name=>site_name) %> <%= year_from_date(@display_user.created_at) %>
        <% if !@user.nil? && @user.admin_page_links? %>
        (<%= link_to "admin", user_admin_url(@display_user) %>)
        <% end %>

        <%= link_to _('Send message to ') + h(@display_user.name), contact_user_url(:id => @display_user.id) %>
        <% if @is_you %>
            (<%= _('just to see how it works')%>)
        <% end %>

    <% if @display_user.public_banned? %>

					<%= _('This user has been banned from {{site_name}} ', :site_name=>site_name)%>

               <%= _('They have been given the following explanation:')%>

                <%= @display_user.can_fail_html %>

    <% end %>

    <% if !@display_user.get_about_me_for_html_display.empty? || @is_you %>

            <%= @display_user.get_about_me_for_html_display %>
            <% if @is_you %>
                (<%= link_to _("edit text about you"), set_profile_about_me_url() %>)
            <% end %>

    <% end %>

    <% if @is_you %>

            <% if @display_user.profile_photo %>
                <%= link_to _('Change profile photo'), set_profile_photo_url() %> |
            <% end %>
            <%= link_to _('Change your password'), signchangepassword_url() %> |
            <%= link_to _('Change your email'), signchangeemail_url() %>

    <% end %>

    <% if not @is_you %>

           <%= _('Sign in to change password, subscriptions and more ({{user_name}} only)',:user_name=>h(@display_user.name)) % [signin_url(:r => request.request_uri)]%>

    <% end %>

            <% form_tag(show_user_url, :method => "get", :id=>"search_form") do %>

	      <%= text_field_tag(:user_query, params[:user_query]) %>
	      <% if @is_you %>
               <%= submit_tag(_("Search your contributions")) %>
	      <% else %>
               <%= submit_tag(_("Search contributions by this person")) %>
	      <% end %>

	    <% end %>

    <% if !@xapian_requests.nil? %>
        <% if @xapian_requests.results.empty? %>
            <% if @page == 1 %>

<%= @is_you ? 'Freedom of Information requests made by you' : 'Freedom of Information requests made by this person' %> <%= @match_phrase %>

<%= @is_you ? _('You have made no Freedom of Information requests using this site.') : _('This person has made no Freedom of Information requests using this site.') %>
		<%= @page_desc %>
            <% end %>
        <% else %>

                <%= @is_you ? n_('Your %d Freedom of Information request', 'Your %d Freedom of Information requests', @xapian_requests.results.size) % @xapian_requests.results.size  : n_('This person\'s %d Freedom of Information request', 'This person\'s %d Freedom of Information requests', @xapian_requests.results.size) % @xapian_requests.results.size %>

                <%= @match_phrase %>
		<%= @page_desc %>

            <% 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, @per_page, @display_user.info_requests.size) %>
        <% end %>
    <% else %>

<%= @is_you ? _('Freedom of Information requests made by you') : _('Freedom of Information requests made by this person') %>

<%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests this person has made.')%>

    <% end %>

    <% if !@xapian_comments.nil? %>
        <% if @xapian_comments.results.empty? %>
            <% if @page == 1 %>

<%= @is_you ? _('Your annotations') : _('This person\'s annotations') %>
                <%= @match_phrase %>

<%= _('None made.')%>

            <% end %>
        <% else %>

                <%= @is_you ? n_('Your %d annotation', 'Your %d annotations', @display_user.visible_comments.size) % @display_user.visible_comments.size : n_('This person\'s %d annotation', 'This person\'s %d annotations', @display_user.visible_comments.size) % @display_user.visible_comments.size %>

                <%= @page_desc %>

            <% for result in @xapian_comments.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, @per_page, @display_user.visible_comments.size) %>
        <% end %>
    <% end %>

    <% if @is_you %>
        <% if @track_things.empty? %>

 <%= _('Your email subscriptions')%>

<%= _('None made.')%>

        <% else %>

 Your <%=pluralize(@track_things.size, _('email subscription')) %>

            <% if @track_things_grouped.size == 1 %>
                <% form_tag({:controller => 'track', :action => 'delete_all_type'}, :class => "feed_form") do %>

                        <%=TrackThing.track_type_description(@track_things[0].track_type)%>
                        <%= hidden_field_tag 'track_type', @track_things[0].track_type %>
                        <%= hidden_field_tag 'user', @display_user.id %>
                        <%= hidden_field_tag 'r', request.request_uri %>
                        <% if @track_things.size > 1 %>
                            <%= submit_tag _('unsubscribe all') %>
                        <% end %>

                <% end %>
            <% end %>
            <% for track_type, track_things in @track_things_grouped %>
                <% if @track_things_grouped.size > 1 %>
                    <% form_tag({:controller => 'track', :action => 'delete_all_type'}, :class => "feed_form") do %>

                            <%=TrackThing.track_type_description(track_type)%>
                            <%= hidden_field_tag 'track_type', track_type %>
                            <%= hidden_field_tag 'user', @display_user.id %>
                            <%= hidden_field_tag 'r', request.request_uri %>
                            <% if track_things.size > 1 %>
                                <%= submit_tag _('unsubscribe all')%>
                            <% end %>

                    <% end %>
                <% end %>

                <% for track_thing in track_things %>

                        <% form_tag({:controller => 'track', :action => 'update', :track_id => track_thing.id}, :class => "feed_form") do %>

                                <%= track_thing.params[:list_description] %>
                                <%= hidden_field_tag 'track_medium', "delete", { :id => 'track_medium_' + track_thing.id.to_s } %>
                                <%= hidden_field_tag 'r', request.request_uri, { :id => 'r_' + track_thing.id.to_s }  %>
                                <%= submit_tag _('unsubscribe') %>

                        <% end %>

                <% end %>

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

<% @title = h(@display_user.name) + " - Freedom of Information requests" %>

<% if (@same_name_users.size >= 1) %>

<%= _('There is more than one person who uses this site and has this name.
    One of them is shown below, you may mean a different one:')%> <% for @same_name_user in @same_name_users %>
        <%= user_link(@same_name_user) %>
    <% end %>
<% end%>

<% if @is_you && @undescribed_requests.size > 0 %>

<%= _('Please go to the following requests, and let us
        know if there was information in the recent responses to them.')%>

        <% for undescribed_request in @undescribed_requests %>

<%=request_link(undescribed_request)%>

        <% end %>

      <%= _('Thanks very much - this will help others find useful stuff. We\'ll
            also, if you need it, give advice on what to do next about your
            requests.')%>

<% end %>

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

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

<%= _('On this page')%>

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

<%= _('Annotations')%>
      <% if @is_you %>

<%= _('Email subscriptions')%>
      <% end %>

        <% if @display_user.profile_photo %>
            <% if @is_you %>
            <a href="<%= set_profile_photo_url() %>">
            <% end %>
                <img src="<%= get_profile_photo_url(:url_name => @display_user.url_name) %>" alt="">
            <% if @is_you %>

            <% end %>
        <% else %>
            <% if @is_you %>

                    <%= link_to _('Set your profile photo'), set_profile_photo_url() %>

            <% end %>
        <% end %>

 <%= h(@display_user.name) + (@is_you ? _(" (you)") : "") %>

       <%= _('Joined {{site_name}} in', :site_name=>site_name) %> <%= year_from_date(@display_user.created_at) %>
        <% if !@user.nil? && @user.admin_page_links? %>
        (<%= link_to "admin", user_admin_url(@display_user) %>)
        <% end %>

        <%= link_to _('Send message to ') + h(@display_user.name), contact_user_url(:id => @display_user.id) %>
        <% if @is_you %>
            (<%= _('just to see how it works')%>)
        <% end %>

    <% if @display_user.public_banned? %>

					<%= _('This user has been banned from {{site_name}} ', :site_name=>site_name)%>

               <%= _('They have been given the following explanation:')%>

                <%= @display_user.can_fail_html %>

    <% end %>

    <% if !@display_user.get_about_me_for_html_display.empty? || @is_you %>

            <%= @display_user.get_about_me_for_html_display %>
            <% if @is_you %>
                (<%= link_to _("edit text about you"), set_profile_about_me_url() %>)
            <% end %>

    <% end %>

    <% if @is_you %>

            <% if @display_user.profile_photo %>
                <%= link_to _('Change profile photo'), set_profile_photo_url() %> |
            <% end %>
            <%= link_to _('Change your password'), signchangepassword_url() %> |
            <%= link_to _('Change your email'), signchangeemail_url() %>

    <% end %>

    <% if not @is_you %>

           <%= _('Sign in to change password, subscriptions and more ({{user_name}} only)',:user_name=>h(@display_user.name)) % [signin_url(:r => request.request_uri)]%>

    <% end %>

            <% form_tag(show_user_url, :method => "get", :id=>"search_form") do %>

	      <%= text_field_tag(:user_query, params[:user_query]) %>
	      <% if @is_you %>
               <%= submit_tag(_("Search your contributions")) %>
	      <% else %>
               <%= submit_tag(_("Search contributions by this person")) %>
	      <% end %>

	    <% end %>

    <% if !@xapian_requests.nil? %>
        <% if @xapian_requests.results.empty? %>
            <% if @page == 1 %>

<%= @is_you ? 'Freedom of Information requests made by you' : 'Freedom of Information requests made by this person' %> <%= @match_phrase %>

<%= @is_you ? _('You have made no Freedom of Information requests using this site.') : _('This person has made no Freedom of Information requests using this site.') %>
		<%= @page_desc %>
            <% end %>
        <% else %>

                <%= @is_you ? n_('Your %d Freedom of Information request', 'Your %d Freedom of Information requests', @xapian_requests.results.size) % @xapian_requests.results.size  : n_('This person\'s %d Freedom of Information request', 'This person\'s %d Freedom of Information requests', @xapian_requests.results.size) % @xapian_requests.results.size %>

                <%= @match_phrase %>
		<%= @page_desc %>

            <% 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, @per_page, @display_user.info_requests.size) %>
        <% end %>
    <% else %>

<%= @is_you ? _('Freedom of Information requests made by you') : _('Freedom of Information requests made by this person') %>

<%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests this person has made.')%>

    <% end %>

    <% if !@xapian_comments.nil? %>
        <% if @xapian_comments.results.empty? %>
            <% if @page == 1 %>

<%= @is_you ? _('Your annotations') : _('This person\'s annotations') %>
                <%= @match_phrase %>

<%= _('None made.')%>

            <% end %>
        <% else %>

                <%= @is_you ? n_('Your %d annotation', 'Your %d annotations', @display_user.visible_comments.size) % @display_user.visible_comments.size : n_('This person\'s %d annotation', 'This person\'s %d annotations', @display_user.visible_comments.size) % @display_user.visible_comments.size %>

                <%= @page_desc %>

            <% for result in @xapian_comments.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, @per_page, @display_user.visible_comments.size) %>
        <% end %>
    <% end %>

    <% if @is_you %>
        <% if @track_things.empty? %>

 <%= _('Your email subscriptions')%>

<%= _('None made.')%>

        <% else %>

 Your <%=pluralize(@track_things.size, _('email subscription')) %>

            <% if @track_things_grouped.size == 1 %>
                <% form_tag ({:controller => 'track', :action => 'delete_all_type'}, :class => "feed_form") do %>

                        <%=TrackThing.track_type_description(@track_things[0].track_type)%>
                        <%= hidden_field_tag 'track_type', @track_things[0].track_type %>
                        <%= hidden_field_tag 'user', @display_user.id %>
                        <%= hidden_field_tag 'r', request.request_uri %>
                        <% if @track_things.size > 1 %>
                            <%= submit_tag _('unsubscribe all') %>
                        <% end %>

                <% end %>
            <% end %>
            <% for track_type, track_things in @track_things_grouped %>
                <% if @track_things_grouped.size > 1 %>
                    <% form_tag ({:controller => 'track', :action => 'delete_all_type'}, :class => "feed_form") do %>

                            <%=TrackThing.track_type_description(track_type)%>
                            <%= hidden_field_tag 'track_type', track_type %>
                            <%= hidden_field_tag 'user', @display_user.id %>
                            <%= hidden_field_tag 'r', request.request_uri %>
                            <% if track_things.size > 1 %>
                                <%= submit_tag _('unsubscribe all')%>
                            <% end %>

                    <% end %>
                <% end %>

                <% for track_thing in track_things %>

                        <% form_tag ({:controller => 'track', :action => 'update', :track_id => track_thing.id}, :class => "feed_form") do %>

                                <%= track_thing.params[:list_description] %>
                                <%= hidden_field_tag 'track_medium', "delete", { :id => 'track_medium_' + track_thing.id.to_s } %>
                                <%= hidden_field_tag 'r', request.request_uri, { :id => 'r_' + track_thing.id.to_s }  %>
                                <%= submit_tag _('unsubscribe') %>

                        <% end %>

                <% end %>

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


Adjust date in sign-in block

Adjust date in sign-in block

<% if @post_redirect.reason_params[:user_name] %>
    <% @title = "Sign in" %>

        <% if @post_redirect.reason_params[:web].empty? %>
            <%= _('Please sign in as ')%><%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>.
        <% else %>
            <%= @post_redirect.reason_params[:web] %>,
             <%= _('please sign in as ')%><%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>.
        <% end %>

    <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => true } %>

<% else %>
    <% @title = _('Sign in or make a new account') %>

Sign in

          <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => false } %>

          - or -

            <% if !params[:happy].nil? %>

Sign up

                <%= render :partial => 'signup' %>
            <% else %>

Sign up

Hi. We just went live and are currently making sure everything works as expected by allowing only a limited number of users for the first few days.

We expect to be fully open by October 10th.

Please send us an email at team@asktheeu.org if you would like to have early access.

            <% end %>

<% end %>

<% if @post_redirect.reason_params[:user_name] %>
    <% @title = "Sign in" %>

        <% if @post_redirect.reason_params[:web].empty? %>
            <%= _('Please sign in as ')%><%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>.
        <% else %>
            <%= @post_redirect.reason_params[:web] %>,
             <%= _('please sign in as ')%><%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>.
        <% end %>

    <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => true } %>

<% else %>
    <% @title = _('Sign in or make a new account') %>

Sign in

          <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => false } %>

          - or -

            <% if !params[:happy].nil? %>

Sign up

                <%= render :partial => 'signup' %>
            <% else %>

Sign up

Hi. We just went live and are currently making sure everything works as expected by allowing only a limited number of users for the first few days.

We expect to be fully open by October 3rd.

Please send us an email at team@asktheeu.org if you would like to have early access.

            <% end %>

<% end %>


ideas for the next 3 features

ideas for the next 3 features

<% # ========================================================================
   # PuyoPuyo.Board Unit Test
   # ========================================================================
%>
<% content_for('final') do %>

<script>

Test.context("PuyoPuyo.Board",{

    setup: function() {
	PuyoPuyo.Board.setDimensions(4, 6);

	this.ticker = {
	    running: false,
	    start: function() {
		this.running = true;
	    },
	    stop: function() {
		this.running = false;
	    }
	};

	this.colorProvider = {
	    firstColor: PuyoPuyo.Game.Red,
	    secondColor: PuyoPuyo.Game.Blue,
	    popFirstColor: function() {
		return this.firstColor;
	    },
	    popSecondColor: function() {
		return this.secondColor;
	    }
	};

	this.board = PuyoPuyo.Board.create({ticker: this.ticker, colorProvider: this.colorProvider});

	this.board.shouldBe = function(fixture, stringRows, message) {
            var board = this;
            PuyoPuyo.TestsHelpers.assertStringRows(fixture, stringRows, PuyoPuyo.Board.RowCount, PuyoPuyo.Board.ColCount, function(c,r) { return board.cellState(c,r); }, message);
	};

	this.board.shouldChangeWhen = function(that, actionName, message) {
	    var beforeBoardTime = this.get('time');
	    var result = this[actionName]();
	    var afterBoardTime = this.get('time');
	    that.assertNotIdentical(beforeBoardTime, afterBoardTime, message + " : board time not updated");
	    return result;
	};

	this.board.shouldNotChangeWhen = function(that, actionName, message) {
	    var beforeBoardTime = this.get('time');
	    var result = this[actionName]();
	    var afterBoardTime = this.get('time');
	    that.assertIdentical(beforeBoardTime, afterBoardTime, message + " : board time updated");
	    return result;
	};

	this.board.shouldChangeToWhen = function(that, actionName, stringRows, message) {
	    var result = this.shouldChangeWhen(that, actionName, message);
	    this.shouldBe(that, stringRows, message + " : board different");
	    return result;
	};

	/***
          Allows to specify test sequences from left to right instead of top to bottom.
        */
	this.board.shouldFollow = function(that, actionNames, allStringRows) {
	    var board = this;
	    var steps = [];
	    var count = actionNames.length;
	    for(var i = 0; i < count; ++i) {
		steps[i] = { actionName: actionNames[i],
			     message: "step "+i+" : "+actionNames[i]};
	    }
            var stringRows = PuyoPuyo.TestsHelpers.transpose(that, allStringRows, count);

	    for(var i = 0; i < steps.length; ++i) {
		if (stringRows[i] === idem) {
		    this.shouldNotChangeWhen(that, steps[i].actionName, steps[i].message);
		}
		else {
		    this.shouldChangeToWhen(that, steps[i].actionName, stringRows[i], steps[i].message);
		}
	    }
	};

	this.board.startWithBoard = function(stringRows) {
	    this.start(PuyoPuyo.TestsHelpers.newCoordMap(stringRows));
	};
        this.board.tickN = function(n) {
            for(var i = 0; i < n; ++i) {
                this.tick();
            }
        };
    },

    teardown: function() {
	delete(this.board);
    },

    "The board's playing property should change with start and stop": function() {
	assertNotNull(board);
	false.shouldEqual(board.get('playing'));

	board.start();
	true.shouldEqual(board.get('playing'));

	board.abort();
	false.shouldEqual(board.get('playing'));
    },

    "The ticker should be started with the board": function() {
	false.shouldEqual(ticker.running);

	board.start();
	true.shouldEqual(ticker.running);

	board.abort();
	false.shouldEqual(ticker.running);
    },

    "The board should start empty": function() {
	board.shouldFollow(["start"],
			   ["    ",
			    "    ",
			    "    ",
			    "    ",
			    "    ",
			    "    "]);
    },

    "A piece should appear at first tick and move down at each tick.": function() {
	board.start();
	board.shouldFollow(["tick", "tick", "tick", "tick", "tick", "tick"],
			   [" rb ", "    ", "    ", "    ", "    ", "    ",
			    "    ", " rb ", "    ", "    ", "    ", "    ",
			    "    ", "    ", " rb ", "    ", "    ", "    ",
			    "    ", "    ", "    ", " rb ", "    ", "    ",
			    "    ", "    ", "    ", "    ", " rb ", "    ",
			    "    ", "    ", "    ", "    ", "    ", " rb "]);
    },

    "A new game should be started after an abort.": function() {
	board.start();
	board.tick();

	board.shouldFollow(["tick", "abort", "start"],
			   ["    ",  idem,   "    ",
			    " rb ",  idem,   "    ",
			    "    ",  idem,   "    ",
			    "    ",  idem,   "    ",
			    "    ",  idem,   "    ",
			    "    ",  idem,   "    "]);
    },

    "New pieces should have colors from colorProvider.": function() {
	this.colorProvider.firstColor = PuyoPuyo.Game.Purple;
	this.colorProvider.secondColor = PuyoPuyo.Game.Yellow;

	board.start();
	board.shouldChangeToWhen("tick",
				 [" py ",
				  "    ",
				  "    ",
				  "    ",
				  "    ",
				  "    "]);
    },

    "A piece should move with left and right": function() {
	board.start();
	board.shouldFollow(["tick", "left", "right"],
			   [" rb ", "rb  ", " rb ",
			    "    ", "    ", "    ",
			    "    ", "    ", "    ",
			    "    ", "    ", "    ",
			    "    ", "    ", "    ",
			    "    ", "    ", "    "]);
    },

    "A piece should rotate": function() {
	board.start();
	board.tick();
	board.shouldFollow(["tick", "rotate", "rotate", "rotate", "rotate"],
			   ["    ", " b  ",   "    ",   "    ",   "    ",
			    " rb ", " r  ",   "br  ",   " r  ",   " rb ",
			    "    ", "    ",   "    ",   " b  ",   "    ",
			    "    ", "    ",   "    ",   "    ",   "    ",
			    "    ", "    ",   "    ",   "    ",   "    ",
			    "    ", "    ",   "    ",   "    ",   "    "]);
    },

    "A piece should anti rotate": function() {
	board.start();
	board.tick();
	board.shouldFollow(["tick", "antiRotate", "antiRotate", "antiRotate", "antiRotate"],
			   ["    ", "    ",       "    ",       " b  ",       "    ",
			    " rb ", " r  ",       "br  ",       " r  ",       " rb ",
			    "    ", " b  ",       "    ",       "    ",       "    ",
			    "    ", "    ",       "    ",       "    ",       "    ",
			    "    ", "    ",       "    ",       "    ",       "    ",
			    "    ", "    ",       "    ",       "    ",       "    "]);
    },

    "It should not be possible to move a piece outside the board": function() {
	board.start();
	board.shouldFollow(["tick", "left", "left", "right", "right", "right",],
			   [" rb ", "rb  ", idem,   " rb ",  "  rb",  idem,
			    "    ", "    ", idem,   "    ",  "    ",  idem,
			    "    ", "    ", idem,   "    ",  "    ",  idem,
			    "    ", "    ", idem,   "    ",  "    ",  idem,
			    "    ", "    ", idem,   "    ",  "    ",  idem,
			    "    ", "    ", idem,   "    ",  "    ",  idem]);
    },

    "A new piece should appear when the previous one gets blocked at the bottom of the board": function() {
	board.start();
        board.tickN(PuyoPuyo.Board.MaxRow + 1);
	board.shouldBe(["    ",
			"    ",
			"    ",
			"    ",
			"    ",
			" rb "],
		      "initialy");

	board.shouldFollow(["tick", "tick"],
			   ["    ", " rb ",
			    "    ", "    ",
			    "    ", "    ",
			    "    ", "    ",
			    "    ", "    ",
			    " rb ", " rb "]);
    },

    "Blocked piece should pile on top of each other.": function() {
	board.startWithBoard(["    ",
			      "    ",
			      "    ",
			      "    ",
			      "    ",
			      " yp "]);
        board.tickN(PuyoPuyo.Board.MaxRow -1);
	board.shouldBe(["    ",
			"    ",
			"    ",
			" rb ",
			"    ",
			" yp "],
		      "initialy");

	board.shouldFollow(["tick", "tick"],
			   ["    ", "    ",
			    "    ", "    ",
			    "    ", "    ",
			    "    ", "    ",
			    " rb ", " rb ",
			    " yp ", " yp "]);
    },

    "Puyos of vertical pieces should be blocked on top of each other.": function() {
	board.start();
        board.tickN(PuyoPuyo.Board.MaxRow);
	board.antiRotate();
	board.shouldBe(["    ",
			"    ",
			"    ",
			"    ",
			" r  ",
			" b  "],
		      "initialy");

	board.shouldFollow(["tick"],
			   ["    ",
			    "    ",
			    "    ",
			    "    ",
			    " r  ",
			    " b  "]);
    },

    "Blocked beans should follow the law of gravity": function() {
	board.startWithBoard(["    ",
			      "    ",
			      "    ",
			      "    ",
			      "    ",
			      "yp  "]);
        board.tickN(PuyoPuyo.Board.MaxRow);
	board.shouldBe(["    ",
			"    ",
			"    ",
			"    ",
			" rb ",
			"yp  "],
		      "initialy");

	board.shouldFollow(["tick"],
			   ["    ",
			    "    ",
			    "    ",
			    "    ",
			    " r  ",
			    "ypb "]);
    },

    "Pieces should drop at the bottom.": function() {
	board.start();
	board.shouldFollow(["tick", "drop", "tick", "drop"],
			   [" rb ", "    ", " rb ", "    ",
			    "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", " rb ",
			    "    ", " rb ", " rb ", " rb "]);
    },

    "Pieces should follow the law of gravity when droped.": function() {
	board.start();
	board.shouldFollow(["tick", "drop", "tick", "right", "drop"],
			   [" rb ", "    ", " rb ", "  rb",  "    ",
			    "    ", "    ", "    ", "    ",  "    ",
			    "    ", "    ", "    ", "    ",  "    ",
			    "    ", "    ", "    ", "    ",  "    ",
			    "    ", "    ", "    ", "    ",  "  r ",
			    "    ", " rb ", " rb ", " rb ",  " rbb"]);
    },

    "When grouped by 4 or more, beans of the same color should disappear": function() {
	this.colorProvider.firstColor = PuyoPuyo.Game.Red;
	this.colorProvider.secondColor = PuyoPuyo.Game.Red;

        board.start();
	board.shouldFollow(["tick", "drop", "tick", "drop", "tick", "tick"],
			   [" rr ", "    ", " rr ", "    ", "    ", " rr ",
			    "    ", "    ", "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", " rr ", "    ", "    ",
			    "    ", " rr ", " rr ", " rr ", "    ", "    "]);
    },

    "If blocking the piece several groups, all should disappear": function() {
	board.startWithBoard(["    ",
			      "    ",
			      "    ",
			      "r  b",
			      "r  b",
			      "r  b"]);
	board.shouldFollow(["tick", "drop", "tick"],
			   [" rb ", "    ", "    ",
			    "    ", "    ", "    ",
			    "    ", "    ", "    ",
			    "r  b", "r  b", "    ",
			    "r  b", "r  b", "    ",
			    "r  b", "rrbb", "    "]);
    },

    "Pieces on top of a disappearing group should fall": function() {
	board.startWithBoard(["    ",
			      "p   ",
			      "y   ",
			      "b   ",
			      "r   ",
			      "r   "]);
	this.colorProvider.firstColor = PuyoPuyo.Game.Red;
	this.colorProvider.secondColor = PuyoPuyo.Game.Red;

	board.shouldFollow(["tick", "drop", "tick", "tick"],
			   [" rr ", "    ", "    ", "    ",
			    "p   ", "p   ", "p   ", "    ",
			    "y   ", "y   ", "y   ", "    ",
			    "b   ", "b   ", "b   ", "p   ",
			    "r   ", "r   ", "    ", "y   ",
			    "r   ", "rrr ", "    ", "b   "]);
    },

    "Disappearing beans should cascade": function() {
	board.startWithBoard(["    ",
			      "    ",
			      " r  ",
			      " r  ",
			      "rb  ",
			      "rb  "]);
	this.colorProvider.firstColor = PuyoPuyo.Game.Blue;
	this.colorProvider.secondColor = PuyoPuyo.Game.Blue;

	board.shouldFollow(["tick", "right","drop", "tick", "tick", "tick"],
			   [" bb ", "  bb", "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", "    ", "    ", "    ",
			    " r  ", " r  ", " r  ", " r  ", "    ", "    ",
			    " r  ", " r  ", " r  ", " r  ", "    ", "    ",
			    "rb  ", "rb  ", "rb  ", "r   ", "rr  ", "    ",
			    "rb  ", "rb  ", "rbbb", "r   ", "rr  ", "    "]);
    },

    "Game should be lost when there is no place for new pieces": function() {
	board.startWithBoard([" rr ",
			      " bb ",
			      " rr ",
			      " bb ",
			      " rr ",
			      " bb "]);
	true.shouldEqual(board.get('playing'));

	board.tick();
	false.shouldEqual(board.get('playing'));
    }
/*
    "Timer should be notified about playing and colapsing phases": function() {
        fail("not yet implemented");
    }

    "Text to display the game status"
    "Score"

*/
}) ;

if (window.main && (appMain = main)) main = null ;

</script>

<% end %>

<% # ========================================================================
   # PuyoPuyo.Board Unit Test
   # ========================================================================
%>
<% content_for('final') do %>

<script>

Test.context("PuyoPuyo.Board",{

    setup: function() {
	PuyoPuyo.Board.setDimensions(4, 6);

	this.ticker = {
	    running: false,
	    start: function() {
		this.running = true;
	    },
	    stop: function() {
		this.running = false;
	    }
	};

	this.colorProvider = {
	    firstColor: PuyoPuyo.Game.Red,
	    secondColor: PuyoPuyo.Game.Blue,
	    popFirstColor: function() {
		return this.firstColor;
	    },
	    popSecondColor: function() {
		return this.secondColor;
	    }
	};

	this.board = PuyoPuyo.Board.create({ticker: this.ticker, colorProvider: this.colorProvider});

	this.board.shouldBe = function(fixture, stringRows, message) {
            var board = this;
            PuyoPuyo.TestsHelpers.assertStringRows(fixture, stringRows, PuyoPuyo.Board.RowCount, PuyoPuyo.Board.ColCount, function(c,r) { return board.cellState(c,r); }, message);
	};

	this.board.shouldChangeWhen = function(that, actionName, message) {
	    var beforeBoardTime = this.get('time');
	    var result = this[actionName]();
	    var afterBoardTime = this.get('time');
	    that.assertNotIdentical(beforeBoardTime, afterBoardTime, message + " : board time not updated");
	    return result;
	};

	this.board.shouldNotChangeWhen = function(that, actionName, message) {
	    var beforeBoardTime = this.get('time');
	    var result = this[actionName]();
	    var afterBoardTime = this.get('time');
	    that.assertIdentical(beforeBoardTime, afterBoardTime, message + " : board time updated");
	    return result;
	};

	this.board.shouldChangeToWhen = function(that, actionName, stringRows, message) {
	    var result = this.shouldChangeWhen(that, actionName, message);
	    this.shouldBe(that, stringRows, message + " : board different");
	    return result;
	};

	/***
          Allows to specify test sequences from left to right instead of top to bottom.
        */
	this.board.shouldFollow = function(that, actionNames, allStringRows) {
	    var board = this;
	    var steps = [];
	    var count = actionNames.length;
	    for(var i = 0; i < count; ++i) {
		steps[i] = { actionName: actionNames[i],
			     message: "step "+i+" : "+actionNames[i]};
	    }
            var stringRows = PuyoPuyo.TestsHelpers.transpose(that, allStringRows, count);

	    for(var i = 0; i < steps.length; ++i) {
		if (stringRows[i] === idem) {
		    this.shouldNotChangeWhen(that, steps[i].actionName, steps[i].message);
		}
		else {
		    this.shouldChangeToWhen(that, steps[i].actionName, stringRows[i], steps[i].message);
		}
	    }
	};

	this.board.startWithBoard = function(stringRows) {
	    this.start(PuyoPuyo.TestsHelpers.newCoordMap(stringRows));
	};
        this.board.tickN = function(n) {
            for(var i = 0; i < n; ++i) {
                this.tick();
            }
        };
    },

    teardown: function() {
	delete(this.board);
    },

    "The board's playing property should change with start and stop": function() {
	assertNotNull(board);
	false.shouldEqual(board.get('playing'));

	board.start();
	true.shouldEqual(board.get('playing'));

	board.abort();
	false.shouldEqual(board.get('playing'));
    },

    "The ticker should be started with the board": function() {
	false.shouldEqual(ticker.running);

	board.start();
	true.shouldEqual(ticker.running);

	board.abort();
	false.shouldEqual(ticker.running);
    },

    "The board should start empty": function() {
	board.shouldFollow(["start"],
			   ["    ",
			    "    ",
			    "    ",
			    "    ",
			    "    ",
			    "    "]);
    },

    "A piece should appear at first tick and move down at each tick.": function() {
	board.start();
	board.shouldFollow(["tick", "tick", "tick", "tick", "tick", "tick"],
			   [" rb ", "    ", "    ", "    ", "    ", "    ",
			    "    ", " rb ", "    ", "    ", "    ", "    ",
			    "    ", "    ", " rb ", "    ", "    ", "    ",
			    "    ", "    ", "    ", " rb ", "    ", "    ",
			    "    ", "    ", "    ", "    ", " rb ", "    ",
			    "    ", "    ", "    ", "    ", "    ", " rb "]);
    },

    "A new game should be started after an abort.": function() {
	board.start();
	board.tick();

	board.shouldFollow(["tick", "abort", "start"],
			   ["    ",  idem,   "    ",
			    " rb ",  idem,   "    ",
			    "    ",  idem,   "    ",
			    "    ",  idem,   "    ",
			    "    ",  idem,   "    ",
			    "    ",  idem,   "    "]);
    },

    "New pieces should have colors from colorProvider.": function() {
	this.colorProvider.firstColor = PuyoPuyo.Game.Purple;
	this.colorProvider.secondColor = PuyoPuyo.Game.Yellow;

	board.start();
	board.shouldChangeToWhen("tick",
				 [" py ",
				  "    ",
				  "    ",
				  "    ",
				  "    ",
				  "    "]);
    },

    "A piece should move with left and right": function() {
	board.start();
	board.shouldFollow(["tick", "left", "right"],
			   [" rb ", "rb  ", " rb ",
			    "    ", "    ", "    ",
			    "    ", "    ", "    ",
			    "    ", "    ", "    ",
			    "    ", "    ", "    ",
			    "    ", "    ", "    "]);
    },

    "A piece should rotate": function() {
	board.start();
	board.tick();
	board.shouldFollow(["tick", "rotate", "rotate", "rotate", "rotate"],
			   ["    ", " b  ",   "    ",   "    ",   "    ",
			    " rb ", " r  ",   "br  ",   " r  ",   " rb ",
			    "    ", "    ",   "    ",   " b  ",   "    ",
			    "    ", "    ",   "    ",   "    ",   "    ",
			    "    ", "    ",   "    ",   "    ",   "    ",
			    "    ", "    ",   "    ",   "    ",   "    "]);
    },

    "A piece should anti rotate": function() {
	board.start();
	board.tick();
	board.shouldFollow(["tick", "antiRotate", "antiRotate", "antiRotate", "antiRotate"],
			   ["    ", "    ",       "    ",       " b  ",       "    ",
			    " rb ", " r  ",       "br  ",       " r  ",       " rb ",
			    "    ", " b  ",       "    ",       "    ",       "    ",
			    "    ", "    ",       "    ",       "    ",       "    ",
			    "    ", "    ",       "    ",       "    ",       "    ",
			    "    ", "    ",       "    ",       "    ",       "    "]);
    },

    "It should not be possible to move a piece outside the board": function() {
	board.start();
	board.shouldFollow(["tick", "left", "left", "right", "right", "right",],
			   [" rb ", "rb  ", idem,   " rb ",  "  rb",  idem,
			    "    ", "    ", idem,   "    ",  "    ",  idem,
			    "    ", "    ", idem,   "    ",  "    ",  idem,
			    "    ", "    ", idem,   "    ",  "    ",  idem,
			    "    ", "    ", idem,   "    ",  "    ",  idem,
			    "    ", "    ", idem,   "    ",  "    ",  idem]);
    },

    "A new piece should appear when the previous one gets blocked at the bottom of the board": function() {
	board.start();
        board.tickN(PuyoPuyo.Board.MaxRow + 1);
	board.shouldBe(["    ",
			"    ",
			"    ",
			"    ",
			"    ",
			" rb "],
		      "initialy");

	board.shouldFollow(["tick", "tick"],
			   ["    ", " rb ",
			    "    ", "    ",
			    "    ", "    ",
			    "    ", "    ",
			    "    ", "    ",
			    " rb ", " rb "]);
    },

    "Blocked piece should pile on top of each other.": function() {
	board.startWithBoard(["    ",
			      "    ",
			      "    ",
			      "    ",
			      "    ",
			      " yp "]);
        board.tickN(PuyoPuyo.Board.MaxRow -1);
	board.shouldBe(["    ",
			"    ",
			"    ",
			" rb ",
			"    ",
			" yp "],
		      "initialy");

	board.shouldFollow(["tick", "tick"],
			   ["    ", "    ",
			    "    ", "    ",
			    "    ", "    ",
			    "    ", "    ",
			    " rb ", " rb ",
			    " yp ", " yp "]);
    },

    "Puyos of vertical pieces should be blocked on top of each other.": function() {
	board.start();
        board.tickN(PuyoPuyo.Board.MaxRow);
	board.antiRotate();
	board.shouldBe(["    ",
			"    ",
			"    ",
			"    ",
			" r  ",
			" b  "],
		      "initialy");

	board.shouldFollow(["tick"],
			   ["    ",
			    "    ",
			    "    ",
			    "    ",
			    " r  ",
			    " b  "]);
    },

    "Blocked beans should follow the law of gravity": function() {
	board.startWithBoard(["    ",
			      "    ",
			      "    ",
			      "    ",
			      "    ",
			      "yp  "]);
        board.tickN(PuyoPuyo.Board.MaxRow);
	board.shouldBe(["    ",
			"    ",
			"    ",
			"    ",
			" rb ",
			"yp  "],
		      "initialy");

	board.shouldFollow(["tick"],
			   ["    ",
			    "    ",
			    "    ",
			    "    ",
			    " r  ",
			    "ypb "]);
    },

    "Pieces should drop at the bottom.": function() {
	board.start();
	board.shouldFollow(["tick", "drop", "tick", "drop"],
			   [" rb ", "    ", " rb ", "    ",
			    "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", " rb ",
			    "    ", " rb ", " rb ", " rb "]);
    },

    "Pieces should follow the law of gravity when droped.": function() {
	board.start();
	board.shouldFollow(["tick", "drop", "tick", "right", "drop"],
			   [" rb ", "    ", " rb ", "  rb",  "    ",
			    "    ", "    ", "    ", "    ",  "    ",
			    "    ", "    ", "    ", "    ",  "    ",
			    "    ", "    ", "    ", "    ",  "    ",
			    "    ", "    ", "    ", "    ",  "  r ",
			    "    ", " rb ", " rb ", " rb ",  " rbb"]);
    },

    "When grouped by 4 or more, beans of the same color should disappear": function() {
	this.colorProvider.firstColor = PuyoPuyo.Game.Red;
	this.colorProvider.secondColor = PuyoPuyo.Game.Red;

        board.start();
	board.shouldFollow(["tick", "drop", "tick", "drop", "tick", "tick"],
			   [" rr ", "    ", " rr ", "    ", "    ", " rr ",
			    "    ", "    ", "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", " rr ", "    ", "    ",
			    "    ", " rr ", " rr ", " rr ", "    ", "    "]);
    },

    "If blocking the piece several groups, all should disappear": function() {
	board.startWithBoard(["    ",
			      "    ",
			      "    ",
			      "r  b",
			      "r  b",
			      "r  b"]);
	board.shouldFollow(["tick", "drop", "tick"],
			   [" rb ", "    ", "    ",
			    "    ", "    ", "    ",
			    "    ", "    ", "    ",
			    "r  b", "r  b", "    ",
			    "r  b", "r  b", "    ",
			    "r  b", "rrbb", "    "]);
    },

    "Pieces on top of a disappearing group should fall": function() {
	board.startWithBoard(["    ",
			      "p   ",
			      "y   ",
			      "b   ",
			      "r   ",
			      "r   "]);
	this.colorProvider.firstColor = PuyoPuyo.Game.Red;
	this.colorProvider.secondColor = PuyoPuyo.Game.Red;

	board.shouldFollow(["tick", "drop", "tick", "tick"],
			   [" rr ", "    ", "    ", "    ",
			    "p   ", "p   ", "p   ", "    ",
			    "y   ", "y   ", "y   ", "    ",
			    "b   ", "b   ", "b   ", "p   ",
			    "r   ", "r   ", "    ", "y   ",
			    "r   ", "rrr ", "    ", "b   "]);
    },

    "Disappearing beans should cascade": function() {
	board.startWithBoard(["    ",
			      "    ",
			      " r  ",
			      " r  ",
			      "rb  ",
			      "rb  "]);
	this.colorProvider.firstColor = PuyoPuyo.Game.Blue;
	this.colorProvider.secondColor = PuyoPuyo.Game.Blue;

	board.shouldFollow(["tick", "right","drop", "tick", "tick", "tick"],
			   [" bb ", "  bb", "    ", "    ", "    ", "    ",
			    "    ", "    ", "    ", "    ", "    ", "    ",
			    " r  ", " r  ", " r  ", " r  ", "    ", "    ",
			    " r  ", " r  ", " r  ", " r  ", "    ", "    ",
			    "rb  ", "rb  ", "rb  ", "r   ", "rr  ", "    ",
			    "rb  ", "rb  ", "rbbb", "r   ", "rr  ", "    "]);
    },

    "Game should be lost when there is no place for new pieces": function() {
	board.startWithBoard([" rr ",
			      " bb ",
			      " rr ",
			      " bb ",
			      " rr ",
			      " bb "]);
	true.shouldEqual(board.get('playing'));

	board.tick();
	false.shouldEqual(board.get('playing'));
    }
/*
    "Timer should be notified about playing and colapsing phases": function() {
        fail("not yet implemented");
    }

*/
}) ;

if (window.main && (appMain = main)) main = null ;

</script>

<% end %>


Conditional link to admin page for comment

<div class="comment_in_request" id="comment-<%=comment.id.to_s%>">

        <%= comment.user ? user_link(comment.user) : 'You' %>
        left an annotation (<%= simple_date(comment.created_at || Time.now) %>)

<%= comment.get_body_for_html_display %>

        <% if !comment.id.nil? %>
            <%= link_to "Link to this", comment_url(comment) %>
            <% if !@user.nil? && @user.admin_page_links? %>
                | <%= link_to "Admin", admin_url("request/edit_comment/" + comment.id.to_s) %>
            <% end %>

        <% end %>

<div class="comment_in_request" id="comment-<%=comment.id.to_s%>">

        <%= comment.user ? user_link(comment.user) : 'You' %>
        left an annotation (<%= simple_date(comment.created_at || Time.now) %>)

<%= comment.get_body_for_html_display %>

        <% if !comment.id.nil? %>
            <%= link_to "Link to this", comment_url(comment) %>

        <% end %>


Remove table things, that accidentally came over from WTT

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

<% if @existing_request %>

    <%= user_or_you_capital_link(@existing_request.user) %> already
    created the same request on <%=simple_date(@existing_request.created_at)%>.
    You can either view the <a href="<%=request_url(@existing_request)%>">existing request,
    or edit the details below to make a new but similar request.

<% end %>

<%= foi_error_messages_for :info_request, :outgoing_message %>

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

Read this before writing your Freedom of Information request

Use a search engine first to check that the information isn't already published.

Write your request in simple, precise language.
    <% if @info_request.public_body.info_requests.size > 0 %>

Browse <%= link_to "other requests", public_body_url(@info_request.public_body)  %>
        to '<%= h(@info_request.public_body.name) %>'
        for examples of how to word your request.

    <% else %>

Browse <%= link_to "other requests", request_list_url %> for examples of how to word your request.

    <% end %>

Keep it focussed, if you ask for everything it might cost too much
    and you might get nothing.

Top tip: Ask for a particular document you have seen mentioned elsewhere.

This site is public, everything you type (except your email address) and any response will be published.

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

        Summary:
        <%= f.text_field :title, :size => 50 %>

        (a one line summary of the information you are requesting,
        e.g. 'Crime statistics by ward level for Wales')

    <% fields_for :outgoing_message do |o| %>

        Your request:
        <%= o.text_area :body, :rows => 20, :cols => 60 %>

    <% end %>

        Privacy warning: All information that you enter, except
        for your email address, will be displayed publically on this website. Any
        response you get will also be published.

        <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
        <%= hidden_field_tag(:submitted_new_request, 1 ) %>
        <%= hidden_field_tag(:preview, 1 ) %>
        <%= submit_tag "Preview your public request" %>

<% end %>


バグフィックス

バグフィックス

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

    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <title>Walkrr</title>
    <%= stylesheet_link_tag 'le-frog/jquery-ui-1.7.2.custom' %>
    <%= stylesheet_link_tag 'application' %>

    <%= javascript_include_tag 'jquery' %>
    <%= javascript_include_tag 'jquery-ui-1.7.2.custom.min' %>
    <%= javascript_include_tag 'jrails' %>
    <%= javascript_include_tag 'application' %>

        <%= button_to_function "new", "walk.newPath();" , {}, {:class => "button"}%>
        <%= button_to_function "edit", "walk.draw();" , {}, {:class => "button"}%>
        <%= button_to_function "redraw", "walk.recreate();" , {}, {:class => "button"}%>
        <%= button_to_function "delete", "walk.deletePath();", {}, {:class => "button"}%>
        <%= button_to_function "clear", "walk.deleteAll();", {}, {:class => "button"}%>
        <% form_tag({:action => "import"}, {:id => "import_form", :multipart => true, :target => "import_frame"}) do %>
          <%= file_field_tag "file" %>
          <%= button_to_function "import", "walk.importFile();", {}, {:class => "button"}%>
        <% end %>
        length:0m

search

create

          <%= hidden_field_tag "latitude" %>
          <%= hidden_field_tag "longitude" %>
          <%= hidden_field_tag 'search_path' %>

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

            distance<%= text_field_tag "distance","0.5" %>

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

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

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

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

          <%= button_to_remote "search", {:submit => "search_form", :before => "walk.setLatLng();walk.retrievePointsFromPath('#search_path')", :method => 'get', :url => { :action => "search" }}, {:class => "button"} %>

date
          <%= text_field_tag 'date' %>

            start
            <%= text_field_tag 'start'  %>

            end
            <%= text_field_tag 'end'  %>

          <%= hidden_field_tag 'create_path'  %>
          <%= button_to_remote "create", {:submit => "create_form", :before => "walk.retrievePointsFromPath('#create_path');", :url => { :action => "create" }}, {:class => "button"} %>

      <% form_tag({:action => "export_file"}, {:id => "export_form"}) do %>

          <%= button_to_remote "delete", {:submit => "tbody", :url => { :action => "destroy" }}, {:class => "button"} %>
          <%= select_tag "type",
            options_for_select([["kml","kml"], ["xmps","xmps"]]) %>
          <%= button_to_function "export", "$('#export_form').submit();", {}, {:class => "button"}%>

      <% end %>

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

    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <title>Walkrr</title>
    <%= stylesheet_link_tag 'le-frog/jquery-ui-1.7.2.custom.min' %>
    <%= stylesheet_link_tag 'application' %>

    <%= javascript_include_tag 'jquery' %>
    <%= javascript_include_tag 'jquery-ui-1.7.2.custom.min' %>
    <%= javascript_include_tag 'jrails' %>

        <%= button_to_function "new", "walk.newPath();" , {}, {:class => "button"}%>
        <%= button_to_function "edit", "walk.draw();" , {}, {:class => "button"}%>
        <%= button_to_function "redraw", "walk.recreate();" , {}, {:class => "button"}%>
        <%= button_to_function "delete", "walk.deletePath();", {}, {:class => "button"}%>
        <%= button_to_function "clear", "walk.deleteAll();", {}, {:class => "button"}%>
        <% form_tag({:action => "import"}, {:id => "import_form", :multipart => true, :target => "import_frame"}) do %>
          <%= file_field_tag "file" %>
          <%= button_to_function "import", "walk.importFile();", {}, {:class => "button"}%>
        <% end %>
        length:0m

search

create

          <%= hidden_field_tag "latitude" %>
          <%= hidden_field_tag "longitude" %>
          <%= hidden_field_tag 'search_path' %>

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

            distance<%= text_field_tag "distance","0.5" %>

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

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

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

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

          <%= button_to_remote "search", {:submit => "search_form", :before => "walk.setLatLng();walk.retrievePointsFromPath('#search_path')", :method => 'get', :url => { :action => "search" }}, {:class => "button"} %>

date
          <%= text_field_tag 'date' %>

            start
            <%= text_field_tag 'start'  %>

            end
            <%= text_field_tag 'end'  %>

          <%= hidden_field_tag 'create_path'  %>
          <%= button_to_remote "create", {:submit => "create_form", :before => "walk.retrievePointsFromPath('#create_path');", :url => { :action => "create" }}, {:class => "button"} %>

      <% form_tag({:action => "export_file"}, {:id => "export_form"}) do %>

          <%= button_to_remote "delete", {:submit => "tbody", :url => { :action => "destroy" }}, {:class => "button"} %>
          <%= select_tag "type",
            options_for_select([["kml","kml"], ["xmps","xmps"]]) %>
          <%= button_to_function "export", "$('#export_form').submit();", {}, {:class => "button"}%>

      <% end %>


farojournalen: Oops

farojournalen: Oops

<%= @comment.name %> has made a comment on <%= @page.name %>:

<%= @comment.body %>

From IP address: <%= @comment.remote_ip %>

<%= @url %>

<%= @comment.name %> has made a comment on <%= @page.name %>:

<%= @comment.body %>

From IP address: <%= @comment.remote_up %>

<%= @url %>


Added an exclusive div to extra-content on product visualization

(ActionItem1970)

  <%= render :partial => 'manage_products/display_category' %>

    <%= render :partial => 'manage_products/display_name' %>

      <%= render :partial => 'manage_products/display_image' %>

      <% extra_content = @plugins.map(:product_info_extras, @product).collect { |content| instance_eval(&content) } %>
      <%= extra_content.join("\n") %>

      <%= render :partial => 'manage_products/display_info' %>

  <% unless !@allowed_user && (@product.description.blank? && @product.inputs.empty?) %>
    <div class='ui-tabs' id='product-<%= @product.id %>-tabs'>

        <% if !@product.description.blank? || @allowed_user %>

<%= _('Description') %>

        <% end %>
        <% if !@product.inputs.empty? || @allowed_user %>

<%= _('Inputs and raw material') %>

        <% end %>

        <%= render :partial => 'manage_products/display_description' %>

        <%= render :partial => 'manage_products/display_inputs' %>

  <% end %>

    <%= render :partial => 'manage_products/display_price_details' %>
    <%= render :partial => 'manage_products/price_details_button' %>

<% button_bar do %>
  <%= button :back, _('Back to the product listing'), :controller => 'catalog', :action => 'index' %>
  <%= button :delete, _('Remove product or service'), {:action => 'destroy', :id => @product}, :class => 'requires-permission-manage_products', :style => 'display:none;' %>
<% end %>

  <%= render :partial => 'manage_products/display_category' %>

    <%= render :partial => 'manage_products/display_name' %>

      <%= render :partial => 'manage_products/display_image' %>

      <%= render :partial => 'manage_products/display_info' %>
      <% extra_content = @plugins.map(:product_info_extras, @product).collect { |content| instance_eval(&content) } %>
      <%= extra_content.join("\n") %>

  <% unless !@allowed_user && (@product.description.blank? && @product.inputs.empty?) %>
    <div class='ui-tabs' id='product-<%= @product.id %>-tabs'>

        <% if !@product.description.blank? || @allowed_user %>

<%= _('Description') %>

        <% end %>
        <% if !@product.inputs.empty? || @allowed_user %>

<%= _('Inputs and raw material') %>

        <% end %>

        <%= render :partial => 'manage_products/display_description' %>

        <%= render :partial => 'manage_products/display_inputs' %>

  <% end %>

    <%= render :partial => 'manage_products/display_price_details' %>
    <%= render :partial => 'manage_products/price_details_button' %>

<% button_bar do %>
  <%= button :back, _('Back to the product listing'), :controller => 'catalog', :action => 'index' %>
  <%= button :delete, _('Remove product or service'), {:action => 'destroy', :id => @product}, :class => 'requires-permission-manage_products', :style => 'display:none;' %>
<% end %>


Removed MyChores Mobile as it is not working and probably will not be working for a while yet.

<% @heading="MyChores" %>
<% @extraheading = "- Easily track household chores and recurring tasks with workload lists, calendars and email notifications." %>
<% @h1class='home' %>

<% @links = [] %>
<% if session[:person].nil? %>
  <% @links += [{:url => "/admin/login", :title => "Login", :accesskey => "l"}] %>
  <% @links += [{:url => "/admin/register", :title => "Register", :accesskey => "r"}] %>
<% else %>
  <% @links += [{:url => "/admin/logout", :title => "Logout", :accesskey => "l"}] %>
<% end %>
<% @links += [{:url => "/home/tour", :title => "Take a tour", :accesskey => "t"}] %>
<% @links += [{:url => "/questions", :title => "FAQ", :accesskey => "f"}] %>
<% @links += [{:url => "/home/privacy", :title => "Privacy", :accesskey => "p"}] %>

Non-CSS browser? Try MyChores Mobile

        <% if session[:person].nil? %>

            Register for free

            (you can leave at any time)

        <% end %>

          Set up your schedule and tick off your tasks

          Work as a team to get things done

          Track your progress with statistics

          Access through any browser and receive email reminders

          Print out your personal to-do list

          Integrate using RSS and iCalendar feeds

          Update Twitter and/or receive Twitter notifications

          Login using OpenID

Statistics

<%= image_tag(@thirty_day_chart.to_url, :alt => "Tasks completed in the last 28 days", :title => "Tasks completed in the last 28 days", :size => "150x20") %>

<%= @numpeople %> people

<%= @donetoday %> task<%= 's' unless @donetoday == 1 %> done today

<%= @doneyesterday %> task<%= 's' unless @doneyesterday == 1 %> done yesterday

<%= @donethismonth %> task<%= 's' unless @donethismonth == 1 %> done this month

      <% unless @bulletin.nil? -%>

News (updated <%= formatted_date(@bulletin.created_on) %>)

          <%= textilize_without_paragraph(@bulletin.message) %>
          <% unless @bulletin.link.nil? %>
            <a href='<%= @bulletin.link %>'>Read more ...
          <% end %>

      <% end -%>

      <% unless @testimonial.nil? -%>

Testimonials

        <%= textilize(@testimonial.short_message) %>
      <% end -%>

<% @heading="MyChores" %>
<% @extraheading = "- Easily track household chores and recurring tasks with workload lists, calendars and email notifications." %>
<% @h1class='home' %>

<% @links = [] %>
<% if session[:person].nil? %>
  <% @links += [{:url => "/admin/login", :title => "Login", :accesskey => "l"}] %>
  <% @links += [{:url => "/admin/register", :title => "Register", :accesskey => "r"}] %>
<% else %>
  <% @links += [{:url => "/admin/logout", :title => "Logout", :accesskey => "l"}] %>
<% end %>
<% @links += [{:url => "/home/tour", :title => "Take a tour", :accesskey => "t"}] %>
<% @links += [{:url => "/questions", :title => "FAQ", :accesskey => "f"}] %>
<% @links += [{:url => "/home/privacy", :title => "Privacy", :accesskey => "p"}] %>

Non-CSS browser? Try MyChores Mobile

        <% if session[:person].nil? %>

            Register for free

            (you can leave at any time)

        <% end %>

          Set up your schedule and tick off your tasks

          Work as a team to get things done

          Track your progress with statistics

          Access through any browser and receive email reminders

          Print out your personal to-do list

          Use on the go with MyChores Mobile

          Integrate using RSS and iCalendar feeds

          Update Twitter and/or receive Twitter notifications

          Login using OpenID

Statistics

<%= image_tag(@thirty_day_chart.to_url, :alt => "Tasks completed in the last 28 days", :title => "Tasks completed in the last 28 days", :size => "150x20") %>

<%= @numpeople %> people

<%= @donetoday %> task<%= 's' unless @donetoday == 1 %> done today

<%= @doneyesterday %> task<%= 's' unless @doneyesterday == 1 %> done yesterday

<%= @donethismonth %> task<%= 's' unless @donethismonth == 1 %> done this month

      <% unless @bulletin.nil? -%>

News (updated <%= formatted_date(@bulletin.created_on) %>)

          <%= textilize_without_paragraph(@bulletin.message) %>
          <% unless @bulletin.link.nil? %>
            <a href='<%= @bulletin.link %>'>Read more ...
          <% end %>

      <% end -%>

      <% unless @testimonial.nil? -%>

Testimonials

        <%= textilize(@testimonial.short_message) %>
      <% end -%>


git-svn-id: svn://beonebody.org/onebody/trunk@225 88fc0095-4724-0410-ab6c-c99dba55acc4

Shares

<%= render :partial => 'shares/subnav' %>

  <%= SITE_TITLE %> is a place to connect and share inspirational
  Bible verses, good
  recipes, and more. From here, you can
  browse through the collection of things our members have shared
  and add some of your own!

    <%= link_to image_tag('event.medium.gif', :alt => 'Events', :class => 'no-border') + '
Events', {:controller => 'events'}, :style => 'text-decoration:none;' %>
    <%= link_to image_tag('camera.gif', :alt => 'Pictures', :class => 'no-border') + '
Pictures', {:controller => 'pictures'}, :style => 'text-decoration:none;' %>
    <%= link_to image_tag('bible.gif', :alt => 'Bible Verses', :class => 'no-border') + '
Verses', {:controller => 'verses'}, :style => 'text-decoration:none;' %>
    <%= link_to image_tag('recipe.gif', :alt => 'Recipes', :class => 'no-border') + '
Recipes', {:controller => 'recipes'}, :style => 'text-decoration:none;' %>

<% last_day = nil %>
<% @shares.each_with_index do |share, index| %>
  <% if last_day.nil? or share.created_at.strftime('%Y-%m-%d') != last_day.strftime('%Y-%m-%d') %>

<%= Date.parse(share.created_at.strftime('%Y-%m-%d')).human_day %>

    <% last_day = share.created_at %>
  <% end %>
  <div style="margin:5px 0 5px 15px;padding:5px;<%= index % 2 == 0 ? 'background-color:#eee;' : '' %>">
    <% if share.is_a? Picture %>
      <%= link_to image_tag(url_for(:controller => 'pictures', :action => 'photo', :id => "#{share.id}.small.jpg"), :alt => 'click to enlarge'),
        {:controller => 'pictures', :action => 'view', :id => share}, :title => 'click to enlarge' %>
    <% elsif share.is_a? Verse %>
      <%= render :partial => 'verses/verse', :locals => {:verse => share} %>
    <% elsif share.is_a? Recipe %>
      <%= render :partial => 'recipes/recipe', :locals => {:recipe => share} %>
    <% elsif share.is_a? Event %>
      <%= render :partial => 'events/event', :locals => {:event => share} %>
    <% elsif share.is_a? Comment %>
      <%= render :partial => 'comments/comment', :locals => {:comment => share} %>
    <% elsif share.is_a? NewsItem %>
      <%= render :partial => 'news/news_item', :locals => {:news_item => share} %>
    <% elsif share.is_a? Publication %>
      <%= render :partial => 'publications/publication', :locals => {:publication => share} %>
    <% end %>

<% end %>

Shares

<%= render :partial => 'shares/subnav' %>

  <%= SITE_TITLE %> is a place to connect and share inspirational
  Bible verses, good
  recipes, and more. From here, you can
  browse through the collection of things our members have shared
  and add some of your own!

    <%= link_to image_tag('event.medium.gif', :alt => 'Events', :class => 'no-border') + '
Events', {:controller => 'events'}, :style => 'text-decoration:none;' %>
    <%= link_to image_tag('camera.gif', :alt => 'Pictures', :class => 'no-border') + '
Pictures', {:controller => 'pictures'}, :style => 'text-decoration:none;' %>
    <%= link_to image_tag('bible.gif', :alt => 'Bible Verses', :class => 'no-border') + '
Verses', {:controller => 'verses'}, :style => 'text-decoration:none;' %>
    <%= link_to image_tag('recipe.gif', :alt => 'Recipes', :class => 'no-border') + '
Recipes', {:controller => 'recipes'}, :style => 'text-decoration:none;' %>

Recent Shares

<% last_day = nil %>
<% @shares.each do |share| %>
  <% if last_day.nil? or share.created_at.strftime('%Y-%m-%d') != last_day.strftime('%Y-%m-%d') %>

      <%= Date.parse(share.created_at.strftime('%Y-%m-%d')).human_day %>

    <% last_day = share.created_at %>
  <% end %>
  <% if share.is_a? Picture %>
    <%= link_to image_tag(url_for(:controller => 'pictures', :action => 'photo', :id => "#{share.id}.small.jpg"), :alt => 'click to enlarge', :style => 'float:left;margin:10px;'),
      {:controller => 'pictures', :action => 'view', :id => share}, :title => 'click to enlarge' %>
  <% elsif share.is_a? Verse %>

<%= render :partial => 'verses/verse', :locals => {:verse => share} %>

  <% elsif share.is_a? Recipe %>

<%= render :partial => 'recipes/recipe', :locals => {:recipe => share} %>

  <% elsif share.is_a? Event %>

<%= render :partial => 'events/event', :locals => {:event => share} %>

  <% elsif share.is_a? Comment %>

<%= render :partial => 'comments/comment', :locals => {:comment => share} %>

  <% elsif share.is_a? NewsItem %>

<%= render :partial => 'news/news_item', :locals => {:news_item => share} %>

  <% elsif share.is_a? Publication %>

<%= render :partial => 'publications/publication', :locals => {:publication => share} %>

  <% end %>
<% end %>