fixed check on payment processor for remember

<% if f.object.reference_card && processor.processor_handler != 'shop/paypal_payment_processor' %>

    <input type='radio' id='payment_<%= processor.id %>_type_reference' name='payment[<%= processor.id %>][type]' value='reference' <%= "checked='checked'" if f.object.type == 'reference' %> />
    <label for='payment_<%= processor.id %>_type_reference'> Pay using card on file: <%= f.object.reference_card %>

     <input type='radio'  id='payment_<%= processor.id %>_type_standard'  name='payment[<%= processor.id %>][type]' value='standard' <%= "checked='checked'" if f.object.type == 'standard' %>

      <label for='payment_<%= processor.id %>_type_standard'>Or Pay with:

<% end -%>

<% if !f.object.reference_card || processor.processor_handler == 'shop/paypal_payment_processor' %>

  <input type='hidden'  name='payment[<%= processor.id %>][type]' value='standard' />
    Pay with:

<% else -%>

<% end -%>

      <input class="radio_button" id="payment[<%= processor.id %>]_card_type_visa" name="payment[<%= processor.id %>][card_type]" type="radio" value="visa" <%= "checked='checked'" if f.object.card_type == 'visa' %> />

      Visa

    <input class="radio_button" id="payment[<%= processor.id %>]_card_type_mastercard" name="payment[<%= processor.id %>][card_type]" type="radio" value="master" <%= "checked='checked'" if f.object.card_type == 'master' %> />

      Mastercard

    <input class="radio_button" id="payment[<%= processor.id %>]_card_type_amex" name="payment[<%= processor.id %>][card_type]" type="radio" value="american_express" <%= "checked='checked'" if f.object.card_type == 'american_express' %> />

      Amex

  Card Number:

    <%= f.text_field :cc, :size => 20 %> CVC: <%= f.text_field :cvc, :size => 3 %>

    Expiration:

    Month <%= f.select :exp_month, (1..12).to_a.collect { |mon| mon.to_s } %> Year <%= f.select :exp_year, (Time.now.strftime("%Y").to_i..Time.now.strftime("%Y").to_i+15).to_a.collect { |yr| yr.to_s } %>

<% if processor.processor_handler != 'shop/paypal_payment_processor'%>

  <%= f.check_box :remember %>
    <% if admin -%>
        Remember this card information  for future administrative transactions
 (it will not be visible to the user)
    <% else -%>
        Remember this card information for future transactions
    <% end -%>

<% end -%>

<% if f.object.reference_card && processor.processor_handler != 'shop/paypal_payment_processor'%>

<% end -%>

<% if f.object.reference_card && processor.processor_handler != 'shop/test_payment_processor' %>

    <input type='radio' id='payment_<%= processor.id %>_type_reference' name='payment[<%= processor.id %>][type]' value='reference' <%= "checked='checked'" if f.object.type == 'reference' %> />
    <label for='payment_<%= processor.id %>_type_reference'> Pay using card on file: <%= f.object.reference_card %>

     <input type='radio'  id='payment_<%= processor.id %>_type_standard'  name='payment[<%= processor.id %>][type]' value='standard' <%= "checked='checked'" if f.object.type == 'standard' %>

      <label for='payment_<%= processor.id %>_type_standard'>Or Pay with:

<% end -%>

<% if !f.object.reference_card || processor.processor_handler == 'shop/test_payment_processor' %>

  <input type='hidden'  name='payment[<%= processor.id %>][type]' value='standard' />
    Pay with:

<% else -%>

<% end -%>

      <input class="radio_button" id="payment[<%= processor.id %>]_card_type_visa" name="payment[<%= processor.id %>][card_type]" type="radio" value="visa" <%= "checked='checked'" if f.object.card_type == 'visa' %> />

      Visa

    <input class="radio_button" id="payment[<%= processor.id %>]_card_type_mastercard" name="payment[<%= processor.id %>][card_type]" type="radio" value="master" <%= "checked='checked'" if f.object.card_type == 'master' %> />

      Mastercard

    <input class="radio_button" id="payment[<%= processor.id %>]_card_type_amex" name="payment[<%= processor.id %>][card_type]" type="radio" value="american_express" <%= "checked='checked'" if f.object.card_type == 'american_express' %> />

      Amex

  Card Number:

    <%= f.text_field :cc, :size => 20 %> CVC: <%= f.text_field :cvc, :size => 3 %>

    Expiration:

    Month <%= f.select :exp_month, (1..12).to_a.collect { |mon| mon.to_s } %> Year <%= f.select :exp_year, (Time.now.strftime("%Y").to_i..Time.now.strftime("%Y").to_i+15).to_a.collect { |yr| yr.to_s } %>

<% if processor.processor_handler != 'shop/test_payment_processor'%>

  <%= f.check_box :remember %>
    <% if admin -%>
        Remember this card information  for future administrative transactions
 (it will not be visible to the user)
    <% else -%>
        Remember this card information for future transactions
    <% end -%>

<% end -%>

<% if f.object.reference_card && processor.processor_handler != 'shop/test_payment_processor'%>

<% end -%>


Extend functionally to organizations

Extend functionally to organizations

<div<%= user && " class='logged-in'" %>>

    <% if @page.allow_edit?(user) && !remove_content_button(:edit) %>
      <% content = content_tag('span', label_for_edit_article(@page)) %>
      <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }) %>
      <%= expirable_button @page, :edit, content, url %>
    <% end %>

    <% if @page != profile.home_page && !@page.has_posts?  && @page.allow_delete?(user) && !remove_content_button(:delete)%>
      <% content = content_tag( 'span', _('Delete') ) %>
      <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'destroy', :id => @page.id}) %>
      <% options = {:method => :post, :confirm => delete_article_message(@page)} %>
      <%= expirable_button @page, :delete, content, url, options %>
    <% end %>

    <% if !@page.folder? && @page.allow_spread?(user) && !remove_content_button(:spread) %>
      <% content = content_tag( 'span', _('Spread this') ) %>
      <% url = nil %>
      <% if profile.kind_of?(Person) %>
        <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page.id }) %>
      <% elsif profile.organization? && environment.portal_community %>
        <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'publish_on_portal_community', :id => @page.id }) %>
      <% end %>
      <%= expirable_button @page, :spread, content, url if url %>
    <% end %>

    <% if !@page.gallery? && (@page.allow_create?(user) || (@page.parent && @page.parent.allow_create?(user))) %>
      <% if @page.translatable? && !@page.native_translation.language.blank? && !remove_content_button(:locale) %>
        <% content = _('Add translation') %>
        <% parent_id = (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)) %>
        <% url = profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => parent_id, :type => @page.type, :article => { :translation_of_id => @page.native_translation.id })%>
        <%= expirable_button @page, :locale, content, url %>
      <% end %>

      <%= colorbox_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)))) unless remove_content_button(:new) %>
    <% end %>

    <% if @page.accept_uploads? && @page.allow_create?(user) %>
      <%= button('upload-file', _('Upload files'), profile.admin_url.merge(:controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent))) unless remove_content_button(:upload)%>
    <% end %>

    <% if !@page.allow_create?(user) && profile.organization? && (@page.blog? || @page.parent && @page.parent.blog?) && !remove_content_button(:suggest) %>
      <% content = content_tag( 'span', _('Suggest an article') ) %>
      <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'suggest_an_article'}) %>
      <% options = {:id => 'suggest-article-link'} %>
      <%= expirable_button @page, :suggest, content, url, options %>
    <% end %>

    <% if @page.display_versions? %>
      <%= button(:clock, _('All versions'), {:controller => 'content_viewer', :profile => profile.identifier, :action => 'article_versions'}, :id => 'article-versions-link') %>
    <% end %>

    <%= plugins_article_toolbar_actions %>

    <%= report_abuse(profile, :link, @page) %>

    <% if @page.blog? and !@page.image.nil? %>

<%= image_tag(@page.image.public_filename())%>

    <% end %>
    <%= link_to(image_tag('icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %>
    <%= @plugins.dispatch(:article_header_extra_contents, @page).collect { |content| instance_eval(&content) }.join("") %>
    <%= article_title(@page, :no_link => true) %>
    <%= article_translations(@page) %>

<div<%= user && " class='logged-in'" %>>

    <% if @page.allow_edit?(user) && !remove_content_button(:edit) %>
      <% content = content_tag('span', label_for_edit_article(@page)) %>
      <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }) %>
      <%= expirable_button @page, :edit, content, url %>
    <% end %>

    <% if @page != profile.home_page && !@page.has_posts?  && @page.allow_delete?(user) && !remove_content_button(:delete)%>
      <% content = content_tag( 'span', _('Delete') ) %>
      <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'destroy', :id => @page.id}) %>
      <% options = {:method => :post, :confirm => delete_article_message(@page)} %>
      <%= expirable_button @page, :delete, content, url, options %>
    <% end %>

    <% if !@page.folder? && @page.allow_spread?(user) && !remove_content_button(:spread) %>
      <% content = content_tag( 'span', _('Spread this') ) %>
      <% url = nil %>
      <% if profile.kind_of?(Person) %>
        <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page.id }) %>
      <% elsif profile.kind_of?(Community) && environment.portal_community %>
        <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'publish_on_portal_community', :id => @page.id }) %>
      <% end %>
      <%= expirable_button @page, :spread, content, url if url %>
    <% end %>

    <% if !@page.gallery? && (@page.allow_create?(user) || (@page.parent && @page.parent.allow_create?(user))) %>
      <% if @page.translatable? && !@page.native_translation.language.blank? && !remove_content_button(:locale) %>
        <% content = _('Add translation') %>
        <% parent_id = (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)) %>
        <% url = profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => parent_id, :type => @page.type, :article => { :translation_of_id => @page.native_translation.id })%>
        <%= expirable_button @page, :locale, content, url %>
      <% end %>

      <%= colorbox_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)))) unless remove_content_button(:new) %>
    <% end %>

    <% if @page.accept_uploads? && @page.allow_create?(user) %>
      <%= button('upload-file', _('Upload files'), profile.admin_url.merge(:controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent))) unless remove_content_button(:upload)%>
    <% end %>

    <% if !@page.allow_create?(user) && profile.community? && (@page.blog? || @page.parent && @page.parent.blog?) && !remove_content_button(:suggest) %>
      <% content = content_tag( 'span', _('Suggest an article') ) %>
      <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'suggest_an_article'}) %>
      <% options = {:id => 'suggest-article-link'} %>
      <%= expirable_button @page, :suggest, content, url, options %>
    <% end %>

    <% if @page.display_versions? %>
      <%= button(:clock, _('All versions'), {:controller => 'content_viewer', :profile => profile.identifier, :action => 'article_versions'}, :id => 'article-versions-link') %>
    <% end %>

    <%= plugins_article_toolbar_actions %>

    <%= report_abuse(profile, :link, @page) %>

    <% if @page.blog? and !@page.image.nil? %>

<%= image_tag(@page.image.public_filename())%>

    <% end %>
    <%= link_to(image_tag('icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %>
    <%= @plugins.dispatch(:article_header_extra_contents, @page).collect { |content| instance_eval(&content) }.join("") %>
    <%= article_title(@page, :no_link => true) %>
    <%= article_translations(@page) %>


image icon added for calendars

image icon added for calendars

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

Number of rounds of review:
        <input type="text" id="assignment_helper_no_of_reviews" name="assignment_helper[no_of_reviews]" maxlength="5" size="5" value="1" onchange="addElement();" />
        <input type="button" name="selectButton" value="Edit" onclick="addElement();" />

               Deadline
               Date & time
               Submission allowed
               Review allowed

               Resubmission allowed
               Rereview allowed
               Review of review allowed

                   Submission deadline

                    <input type="text" id="submit_deadline_due_at" name ="submit_deadline[due_at]"/>

                   <%= select('submit_deadline', 'submission_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>3 )%>

                   <%= select('submit_deadline', 'review_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   <%= select('submit_deadline', 'resubmission_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   <%= select('submit_deadline', 'rereview_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   <%= select('submit_deadline', 'review_of_review_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   <input name="deadlineTitle0" size=10	maxlength=10 value="Submission deadline" type="hidden"/>Review deadline

                   <input type="text" id="review_deadline_due_at" name ="review_deadline[due_at]"/>

                   <%= select('review_deadline', 'submission_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>2 )%>

                   <%= select('review_deadline', 'review_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>3 )%>

                   <%= select('review_deadline', 'resubmission_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   <%= select('review_deadline', 'rereview_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   <%= select('review_deadline', 'review_of_review_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   Review-of-review deadline

                  <input type="text" id="reviewofreview_deadline_due_at" name ="reviewofreview_deadline[due_at]"/>

                   <%= select('reviewofreview_deadline', 'submission_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>2 )%>

                   <%= select('reviewofreview_deadline', 'review_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>2 )%>

                   <%= select('reviewofreview_deadline', 'resubmission_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>2 )%>

                   <%= select('reviewofreview_deadline', 'rereview_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>2 )%>

                   <%= select('reviewofreview_deadline', 'review_of_review_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>3 )%>

Number of rounds of review:
        <input type="text" id="assignment_helper_no_of_reviews" name="assignment_helper[no_of_reviews]" maxlength="5" size="5" value="1" onchange="addElement();" />
        <input type="button" name="selectButton" value="Edit" onclick="addElement();" />

               Deadline
               Date & time
               Submission allowed
               Review allowed

               Resubmission allowed
               Rereview allowed
               Review of review allowed

                   Submission deadline

                    <input type="text" id="submit_deadline_due_at" name ="submit_deadline[due_at]" onClick="NewCal('submit_deadline_due_at','YYYYMMDD',true,24); return false;"/>

                   <%= select('submit_deadline', 'submission_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>3 )%>

                   <%= select('submit_deadline', 'review_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   <%= select('submit_deadline', 'resubmission_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   <%= select('submit_deadline', 'rereview_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   <%= select('submit_deadline', 'review_of_review_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   <input name="deadlineTitle0" size=10	maxlength=10 value="Submission deadline" type="hidden"/>Review deadline

                   <input type="text" id="review_deadline_due_at" name ="review_deadline[due_at]" onClick="NewCal('review_deadline_due_at','YYYYMMDD',true,24); return false;"/>

                   <%= select('review_deadline', 'submission_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>2 )%>

                   <%= select('review_deadline', 'review_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>3 )%>

                   <%= select('review_deadline', 'resubmission_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   <%= select('review_deadline', 'rereview_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   <%= select('review_deadline', 'review_of_review_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>1 )%>

                   Review-of-review deadline

                  <input type="text" id="reviewofreview_deadline_due_at" name ="reviewofreview_deadline[due_at]" onClick="NewCal('reviewofreview_deadline_due_at','YYYYMMDD',true,24); return false;"/>

                   <%= select('reviewofreview_deadline', 'submission_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>2 )%>

                   <%= select('reviewofreview_deadline', 'review_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>2 )%>

                   <%= select('reviewofreview_deadline', 'resubmission_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>2 )%>

                   <%= select('reviewofreview_deadline', 'rereview_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>2 )%>

                   <%= select('reviewofreview_deadline', 'review_of_review_allowed_id', [ ['No', 1],['Late', 2],['OK', 3]],:selected =>3 )%>


Add NaPTAN code if available

Add NaPTAN code if available

Dear <%= raw @recipient_models.map{ |recipient| recipient.name }.to_sentence %>,
<%- if @recipient_models.size > 1 %>

[ This email has been sent to both councils covering the location of the problem;
please ignore it if you're not the correct council to deal with the issue,
or let us know so we can add the information to our system. ]
<%- end %>
<%- if @missing_recipient_models.size > 0 %>

[ We realise this problem might be the responsibility of
<%= raw @missing_recipient_models.map{ |recipient| recipient.name }.to_sentence %>; however, we don't
currently have any contact details for them. If you know of an appropriate contact address,
please do get in touch. ]
<%- end %>

A user of FixMyTransport has submitted the following report of a problem <%= at_the_location(@problem.location) %>
that they believe might require your attention.

<%- if MySociety::Config.getbool('SITE_VISIBLE', true) %>
To view a map of the precise location of this issue, or to provide an update on the problem,
please visit the following link:

<%= raw @problem_link %>
<%- end %>

----------

Name: <%= raw @problem.reporter_name %>

Email: <%= raw @problem.reply_email %>

<%- if !@problem.reporter_phone.blank? && !@problem.campaign %>
Phone: <%= raw @problem.reporter_phone %>

<%- end %>
Subject: <%= raw @problem.subject %>

Details: <%= raw @problem.description %>

Location name: <%= raw @problem.location.name %>

<%- if @problem.location.is_a? Stop and !@problem.location.atco_code.blank? %>
Location ATCO code: <%= raw @problem.location.atco_code %>

<%- end %>
<%- if @problem.location.is_a? Stop and !@problem.location.plate_code.blank? %>
Plate code: <%= raw @problem.location.plate_code %>

<%- end %>
<%- if @problem.location.is_a? Stop and !@problem.location.naptan_code.blank? %>
NaPTAN code: <%= raw @problem.location.naptan_code %>

<%- end %>

<%- if @problem.location.is_a? Stop and !@problem.location.landmark.blank? %>
Landmark: <%= raw @problem.location.landmark %>

<%- end %>
<%- if @problem.location.is_a? Stop and !@problem.location.street.blank? %>
Street: <%= raw @problem.location.street %>

<%- end %>
<%- if @problem.location.is_a? Stop and !@problem.location.crossing.blank? %>
Crossing: <%= raw @problem.location.crossing %>

<%- end %>
<%- if @problem.location.is_a? Stop and !@problem.location.indicator.blank? %>
Indicator: <%= raw @problem.location.indicator %>

<%- end %>
<%- if @problem.location.is_a? Stop and !@problem.location.bearing.blank? %>
Bearing: <%= raw @problem.location.bearing %>

<%- end %>
<%- if @problem.location.respond_to?(:easting) %>
Easting: <%= raw @problem.location.easting %>

<%- end %>
<%- if @problem.location.respond_to?(:northing) %>
Northing: <%= raw @problem.location.northing %>

<%- end %>

----------

<%- if @problem.campaign %>
Replies to this email will be public.

<%- else %>
Replies to this email will go to the user who submitted the problem.

<%- end %>
Yours,
The FixMyTransport team

<%- if MySociety::Config.getbool('SITE_VISIBLE', true) %>

[ This message was sent via FixMyTransport, a project of UKCOD, registered charity number 1076346.
If there is a more appropriate email address for messages about this type of problem, please let us know
by visiting <<%= raw @feedback_link %>>. This will help improve the service for people travelling. We also
welcome any other feedback you may have. ]

<%- else %>

[ This message was sent via FixMyTransport, a project of UKCOD, registered charity number 1076346.
If there is a more appropriate email address for messages about this type of problem, please let us know
by emailing <%=MySociety::Config.get('CONTACT_EMAIL', 'contact@localhost')%>. This will help improve the
service for people travelling. We also welcome any other feedback you may have. ]

<%- end %>

Dear <%= raw @recipient_models.map{ |recipient| recipient.name }.to_sentence %>,
<%- if @recipient_models.size > 1 %>

[ This email has been sent to both councils covering the location of the problem;
please ignore it if you're not the correct council to deal with the issue,
or let us know so we can add the information to our system. ]
<%- end %>
<%- if @missing_recipient_models.size > 0 %>

[ We realise this problem might be the responsibility of
<%= raw @missing_recipient_models.map{ |recipient| recipient.name }.to_sentence %>; however, we don't
currently have any contact details for them. If you know of an appropriate contact address,
please do get in touch. ]
<%- end %>

A user of FixMyTransport has submitted the following report of a problem <%= at_the_location(@problem.location) %>
that they believe might require your attention.

<%- if MySociety::Config.getbool('SITE_VISIBLE', true) %>
To view a map of the precise location of this issue, or to provide an update on the problem,
please visit the following link:

<%= raw @problem_link %>
<%- end %>

----------

Name: <%= raw @problem.reporter_name %>

Email: <%= raw @problem.reply_email %>

<%- if !@problem.reporter_phone.blank? && !@problem.campaign %>
Phone: <%= raw @problem.reporter_phone %>

<%- end %>
Subject: <%= raw @problem.subject %>

Details: <%= raw @problem.description %>

Location name: <%= raw @problem.location.name %>

<%- if @problem.location.is_a? Stop and !@problem.location.atco_code.blank? %>
Location ATCO code: <%= raw @problem.location.atco_code %>

<%- end %>
<%- if @problem.location.is_a? Stop and !@problem.location.plate_code.blank? %>
Plate code: <%= raw @problem.location.plate_code %>

<%- end %>
<%- if @problem.location.is_a? Stop and !@problem.location.landmark.blank? %>
Landmark: <%= raw @problem.location.landmark %>

<%- end %>
<%- if @problem.location.is_a? Stop and !@problem.location.street.blank? %>
Street: <%= raw @problem.location.street %>

<%- end %>
<%- if @problem.location.is_a? Stop and !@problem.location.crossing.blank? %>
Crossing: <%= raw @problem.location.crossing %>

<%- end %>
<%- if @problem.location.is_a? Stop and !@problem.location.indicator.blank? %>
Indicator: <%= raw @problem.location.indicator %>

<%- end %>
<%- if @problem.location.is_a? Stop and !@problem.location.bearing.blank? %>
Bearing: <%= raw @problem.location.bearing %>

<%- end %>
<%- if @problem.location.respond_to?(:easting) %>
Easting: <%= raw @problem.location.easting %>

<%- end %>
<%- if @problem.location.respond_to?(:northing) %>
Northing: <%= raw @problem.location.northing %>

<%- end %>

----------

<%- if @problem.campaign %>
Replies to this email will be public.

<%- else %>
Replies to this email will go to the user who submitted the problem.

<%- end %>
Yours,
The FixMyTransport team

<%- if MySociety::Config.getbool('SITE_VISIBLE', true) %>

[ This message was sent via FixMyTransport, a project of UKCOD, registered charity number 1076346.
If there is a more appropriate email address for messages about this type of problem, please let us know
by visiting <<%= raw @feedback_link %>>. This will help improve the service for people travelling. We also
welcome any other feedback you may have. ]

<%- else %>

[ This message was sent via FixMyTransport, a project of UKCOD, registered charity number 1076346.
If there is a more appropriate email address for messages about this type of problem, please let us know
by emailing <%=MySociety::Config.get('CONTACT_EMAIL', 'contact@localhost')%>. This will help improve the
service for people travelling. We also welcome any other feedback you may have. ]

<%- end %>


Clicking "Do Treatment" hadn't been switched over to the tasks from the medical_care_actions

<% # 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' %>
    <%= task.medical_problem.title %>
  <% end %>

  <% if !single_cage_task_list %>

      <%= task.title %>

  <% end %>

      <% for user in task.users %>
      <%= user.name %>

      <% 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 == true %>
        <% if task.doable %>
          <% if task.internal_description == "feed" %>
            <% label = 'Just Fed' %>
          <% else %>
            <% label = 'Just Done' %>
          <% end %>
          [<%= link_to_remote label, :url => {
            :controller => 'tasks', :action => 'done', :id => task,
            :ids => tasks, :div_id => div_id,  :single_cage_task_list => single_cage_task_list},
            :update => div_id%>]
        <% else %>
          <warning>Not done on schedule</warning>
        <% end %>
      <% else %>
        <warning>Not done on schedule</warning>
      <% end %>
    <% end %>

    <%= task.notes %>

    <% if task.internal_description == "weigh" %>

    <%= link_to 'Weigh Cage', :controller => 'cages', :action => 'weigh_cage', :id => task.cage %>

    <% end %>
    <% if task.internal_description == "medical" %>

    <%= link_to 'Do Treatment', :controller => 'tasks', :action => 'do_medical_task', :id => task %>

    <% end %>
    <%= link_to 'Show', :controller => 'tasks', :action => 'show', :id => task %>
    <% if manage == true %>
    <%= 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,  :single_cage_task_list => single_cage_task_list}, :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' %>
    <%= task.medical_problem.title %>
  <% end %>

  <% if !single_cage_task_list %>

      <%= task.title %>

  <% end %>

      <% for user in task.users %>
      <%= user.name %>

      <% 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 == true %>
        <% if task.doable %>
          <% if task.internal_description == "feed" %>
            <% label = 'Just Fed' %>
          <% else %>
            <% label = 'Just Done' %>
          <% end %>
          [<%= link_to_remote label, :url => {
            :controller => 'tasks', :action => 'done', :id => task,
            :ids => tasks, :div_id => div_id,  :single_cage_task_list => single_cage_task_list},
            :update => div_id%>]
        <% else %>
          <warning>Not done on schedule</warning>
        <% end %>
      <% else %>
        <warning>Not done on schedule</warning>
      <% end %>
    <% end %>

    <%= task.notes %>

    <% if task.internal_description == "weigh" %>

    <%= link_to 'Weigh Cage', :controller => 'cages', :action => 'weigh_cage', :id => task.cage %>

    <% end %>
    <% if task.internal_description == "medical" %>

    <%= link_to 'Do Treatment', :controller => 'medical_care_actions', :action => 'new', :id => task.medical_problem %>

    <% end %>
    <%= link_to 'Show', :controller => 'tasks', :action => 'show', :id => task %>
    <% if manage == true %>
    <%= 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,  :single_cage_task_list => single_cage_task_list}, :confirm => 'Are you sure?', :method => :post, :update => div_id %>
    <% end %>


remove the big download button (not clear its a download rather than a trend, or downvote button)

    <% if resource.is_downloadable? && versioned_resource.contains_downloadable_items? && can_download_asset?(resource, params[:code])%>

        <% path = polymorphic_path(resource,:version=>versioned_resource.version,:action=>:download,:code=>params[:code]) %>
        <%= link_to simple_image_tag_for_key("big_download"),path %>

    <% end -%>

        Views: <%= count_actions(resource,"show") -%>
        <% if ["DataFile","Model","Sop", "Presentation"].include?(resource.class.name) && versioned_resource.contains_downloadable_items? -%>

                Downloads: <%= count_actions(resource,"download") -%>
          <% end -%>

          Created: <%= date_as_string(resource.created_at,true) -%>

        <% unless resource.created_at == resource.updated_at -%>

                Last updated: <%= date_as_string(resource.updated_at,true) -%>

        <% end -%>
        <% unless @last_used_before_now.blank? -%>

                Last used: <%= date_as_string(@last_used_before_now,true) -%>

        <% end -%>


fix bug with new project local

fix bug with new project local

<% @project ||= @show_projects.first -%>

<%= your_project.title %>

<%= render :remote, :controller => 'reports', :action => :project_stats, :project_id => your_project.id %>

<%
@user.set_project(your_project)

title = ""
if @user.is_eventgroup_coordinator?
    title += ", Projects Coordinator"
end
if @user.is_project_director?
    title += ", Project Director"
end
if @user.is_project_administrator?
    title += ", Project Administrator"
end
if @user.is_support_coach?
    title += ", Support Coach"
end
if @user.is_project_staff?
    title += ", Project Staff"
end
if @user.is_processor?
    title += ", Processor"
end

%>

<%= "#{@user.viewer.name}#{title}" %>

<% if @user.is_support_coach? || @user.is_atleast_project_staff(your_project) %>
    <%= render :partial => "support_coach_list", :locals => { :project => your_project } %>
<% end %>

<% if !@user.is_student? %>
  <%
    cache(:controller => 'main', :action => 'your_projects', :section => 'Acceptance',
          :project_id => your_project.id, :role => @user.roles_wrt_project(your_project)) do
  %>

Accepted pile:

	      <%= render :partial => "accepted_pile", :locals => { :project => your_project } %>

  <% end %>

    <% @can_evaluate = @user.is_eventgroup_coordinator? || @user.is_processor? %>
    <% appln_includes = [ :references, { :viewer => { :persons => :campuses } }, :preference1, :profiles ]
       @processor_list = Applying.find_all_by_project_id your_project.id,
         :include => [
          :project,
          :appln,
          { :locked_by => :persons }
        ]
    %>

Processor's pile:

      <%= render :partial => "processor_pile", :locals => { :project => your_project } %>

  <%
    cache(:controller => 'main', :action => 'your_projects', :section => 'StaffProfile',
          :project_id => your_project.id, :role => @user.roles_wrt_project(your_project)) do
  %>

Staff:

        <%= render :partial => "staff_pile", :locals => { :project => your_project } %>

  <% end %>

  <%
    cache(:controller => 'main', :action => 'your_projects', :section => 'Withdrawn',
          :project_id => your_project.id, :role => @user.roles_wrt_project(your_project)) do
  %>

    <% if @user.is_eventgroup_coordinator? || @user.is_processor? %>

Withdrawn pile:

        <%= render :partial => "withdrawn_pile", :locals => {:project => your_project }%>

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

<% @project ||= @show_projects.first -%>

<%= your_project.title %>

<%= render :remote, :controller => 'reports', :action => :project_stats, :project_id => your_project.id %>

<%
@user.set_project(your_project)

title = ""
if @user.is_eventgroup_coordinator?
    title += ", Projects Coordinator"
end
if @user.is_project_director?
    title += ", Project Director"
end
if @user.is_project_administrator?
    title += ", Project Administrator"
end
if @user.is_support_coach?
    title += ", Support Coach"
end
if @user.is_project_staff?
    title += ", Project Staff"
end
if @user.is_processor?
    title += ", Processor"
end

%>

<%= "#{@user.viewer.name}#{title}" %>

<% if @user.is_support_coach? || @user.is_atleast_project_staff(your_project) %>
    <%= render :partial => "support_coach_list", :locals => { :project => your_project } %>
<% end %>

<% if !@user.is_student? %>
  <%
    cache(:controller => 'main', :action => 'your_projects', :section => 'Acceptance',
          :project_id => your_project.id, :role => @user.roles_wrt_project(your_project)) do
  %>

Accepted pile:

	      <%= render :partial => "accepted_pile", :locals => { :project => your_project } %>

  <% end %>

    <% @can_evaluate = @user.is_eventgroup_coordinator? || @user.is_processor? %>
    <% appln_includes = [ :references, { :viewer => { :persons => :campuses } }, :preference1, :profiles ]
       @processor_list = Applying.find_all_by_project_id your_project.id,
         :include => [
          :project,
          :appln,
          { :locked_by => :persons }
        ]
    %>

Processor's pile:

      <%= render :partial => "processor_pile", :locals => { :project => your_project } %>

  <%
    cache(:controller => 'main', :action => 'your_projects', :section => 'StaffProfile',
          :project_id => your_project.id, :role => @user.roles_wrt_project(your_project)) do
  %>

Staff:

        <%= render :partial => "staff_pile", :locals => { :project => project } %>

  <% end %>

  <%
    cache(:controller => 'main', :action => 'your_projects', :section => 'Withdrawn',
          :project_id => your_project.id, :role => @user.roles_wrt_project(your_project)) do
  %>

    <% if @user.is_eventgroup_coordinator? || @user.is_processor? %>

Withdrawn pile:

        <%= render :partial => "withdrawn_pile", :locals => {:project => your_project }%>

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


New Project -> New

New Project -> New

<%= current_user.company.name %> <%=_ 'Projects' %>

<%= link_to _('New'), :action => 'new' %>

      <% client = nil
      for @project in @projects
        if client != @project.customer_id
      %>
      <%= "
" unless client.nil? %>
      <% client = @project.customer_id %>
      <div id="<%=@project.customer.dom_id%>" class="client-block">

<%= "#{h(@project.customer.name)}" %>

      <% end %>

      <%= render :partial => "project" %>
      <% end %>

<%= current_user.company.name %> <%=_ 'Projects' %>

<%= link_to _('New Project'), :action => 'new' %>

      <% client = nil
      for @project in @projects
        if client != @project.customer_id
      %>
      <%= "
" unless client.nil? %>
      <% client = @project.customer_id %>
      <div id="<%=@project.customer.dom_id%>" class="client-block">

<%= "#{h(@project.customer.name)}" %>

      <% end %>

      <%= render :partial => "project" %>
      <% end %>


Fixed javascript for switching profile types

<% if flash[:notice] %>

<%= flash[:notice] %>

<% end -%>

 <% if @matching_profile_types.count > 1 %>

    <%= select_tag :profile_type_id, options_for_select(@matching_profile_types, @current_profile_type_id),
        :onchange => "ProfileData.changeType(this.value);" %>

<% end -%>
<% ajax_tabs ['View','Edit'] , @editing_profile ? 'Edit' : 'View' do |t| %>
  <% t.tab do -%>

      <%= render(:partial => 'display_profile') %>

  <% end -%>
  <% t.tab do -%>

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

  <% end -%>
<% end %>

<% if flash[:notice] %>

<%= flash[:notice] %>

<% end -%>

 <% if @matching_profile_types.count > 1 %>

    <%= select_tag :profile_type, options_for_select(@matching_profile_types, @current_profile_type_id),
        :html => { :onchange => "ProfileData.changeType(this.value);" } %>

<% end -%>
<% ajax_tabs ['View','Edit'] , @editing_profile ? 'Edit' : 'View' do |t| %>
  <% t.tab do -%>

      <%= render(:partial => 'display_profile') %>

  <% end -%>
  <% t.tab do -%>

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

  <% end -%>
<% end %>


Adaptacion de politica de privacidad a Uruguay

<% @title = "Política de privacidad" %>

Política de privacidad

En cumplimiento de la Ley 18331 sobre  Protección de Datos de Carácter Personal, le informamos de que los datos personales que nos suministre a través de la activación de su cuenta en quesabes.org pasarán a formar parte de una base de datos que registraremos frente a las autoridades competentes. Sus datos de carácter personal serán utilizados para la gestión y administración de la plataforma consistente en la posibilidad de realizar solicitudes de acceso a la información a administraciones pública uruguaya, así como para la puesta en contacto entre los miembros de la misma.

Asimismo le informamos que puede ejercitar sus derechos de acceso, rectificación, cancelación y oposición. Para ejercer cualquiera de estos derechos contactar con:

El usuario acepta y consiente expresamente que sus datos de carácter personal, en este caso su nombre, sean públicos y aparezcan accesibles a través de la web. En ningún caso la dirección de correo electrónico será accesible por ningún tercero ni se hará pública en la web.

El Usuario garantiza que los datos personales facilitados son veraces y se hace responsable de informar sobre cualquier modificación en los mismos. El Usuario será el único responsable de cualquier daño o perjuicio, directo o indirecto, que pudiera ocasionar a los responsables de quesabes.org o a cualquier tercero a causa de la cumplimentación de los formularios con datos falsos, inexactos, incompletos o no actualizados. En el caso de que deban incluirse datos de carácter personal referentes a personas físicas distintas de la que cumplimenta el presente formulario deberá, con carácter previo a su inclusión, informarles de los extremos contenidos en los párrafos anteriores.

quesabes.org ha adoptado las medidas necesarias para evitar la alteración, pérdida, tratamiento o acceso no autorizado de los datos personales, habida cuenta en todo momento del estado de la tecnología, no obstante, el usuario debe ser consciente de que las medidas de seguridad en Internet no son inexpugnables.

Esta página web utiliza Google Analytics, un servicio analítico de web prestado por Google, Inc., una compañía de Delaware cuya oficina principal está en 1600 Amphitheatre Parkway, Mountain View (California), CA 94043, Estados Unidos ("Google"). Google Analytics utiliza "cookies", que son archivos de texto ubicados en su ordenador, para ayudar al website a analizar el uso que hacen los usuarios del sitio web. La información que genera la cookie acerca de su uso del website (incluyendo su dirección IP) será directamente transmitida y archivada por Google en los servidores de Estados Unidos. Google usará esta información por cuenta nuestra con el propósito de seguir la pista de su uso del website, recopilando informes de la actividad del website y prestando otros servicios relacionados con la actividad del website y el uso de Internet. Google podrá transmitir dicha información a terceros cuando así se lo requiera la legislación, o cuando dichos terceros procesen la información por cuenta de Google. Google no asociará su dirección IP con ningún otro dato del que disponga Google. Puede Usted rechazar el tratamiento de los datos o la información rechazando el uso de cookies mediante la selección de la configuración apropiada de su navegador, sin embargo, debe Usted saber que si lo hace puede ser que no pueda usar la plena funcionabilidad de este website. Al utilizar este website Usted consiente el tratamiento de información acerca de Usted por Google en la forma y para los fines arriba indicados.

(Esta Política de Privacidad está basada en la creada por <a href="www.tuderechoasaber.es"Tu Derecho a saber
 y se encuentra en consonancia con las normas legales sobre privacidad en el Uruguay.

<% @title = "Política de privacidad" %>

Política de privacidad

En cumplimiento de la Ley Orgánica 15/1999, de 13 de diciembre, de Protección de Datos de Carácter Personal, le informamos de que los datos personales que nos suministre a través de la activación de su cuenta en tuderechoasaber.es pasarán a formar parte de un fichero titularidad de ACCESS INFO EUROPE. Sus datos de carácter personal serán utilizados para la gestión y administración de la plataforma consistente en la posibilidad de realizar solicitudes de acceso a la información a administraciones públicas españolas, así como para la puesta en contacto entre los miembros de la misma.

Access Info Europe es una organización de derechos humanos sin ánimo de lucro registrada en España ante el Ministerio del Interior (referencia 587828) y ante el registro de Transparencia de la Unión Europea (referencia 49931835063-67).

Access Info Europe promueve y protege el derecho de acceso a la información en Europa como herramienta para la defensa de nuestras libertades civiles y los derechos humanos, para facilitar la participación pública en la toma de decisiones, y para exigir que el gobierno rinda cuentas.

Asimismo le informamos que puede ejercitar sus derechos de acceso, rectificación, cancelación y oposición. Para ejercer cualquiera de estos derechos contactar con:

Para cualquier duda o consulta contacte con AIE en:

            Access Info Europe

            Calle Príncipe de Anglona 5, bajo derecha, 28005 Madrid, España

            Teléfono: 913665344

            Email:  info@access-info.org

El usuario acepta y consiente expresamente que sus datos de carácter personal, en este caso su nombre, sean públicos y aparezcan accesibles a través de la web. En ningún caso la dirección de correo electrónico será accesible por ningún tercero ni se hará pública en la web.

El Usuario garantiza que los datos personales facilitados son veraces y se hace responsable de informar sobre cualquier modificación en los mismos. El Usuario será el único responsable de cualquier daño o perjuicio, directo o indirecto, que pudiera ocasionar a los responsables de tuderechoasaber.es o a cualquier tercero a causa de la cumplimentación de los formularios con datos falsos, inexactos, incompletos o no actualizados. En el caso de que deban incluirse datos de carácter personal referentes a personas físicas distintas de la que cumplimenta el presente formulario deberá, con carácter previo a su inclusión, informarles de los extremos contenidos en los párrafos anteriores.

tuderechoasaber.es ha adoptado las medidas necesarias para evitar la alteración, pérdida, tratamiento o acceso no autorizado de los datos personales, habida cuenta en todo momento del estado de la tecnología, no obstante, el usuario debe ser consciente de que las medidas de seguridad en Internet no son inexpugnables.

Esta página web utiliza Google Analytics, un servicio analítico de web prestado por Google, Inc., una compañía de Delaware cuya oficina principal está en 1600 Amphitheatre Parkway, Mountain View (California), CA 94043, Estados Unidos ("Google"). Google Analytics utiliza "cookies", que son archivos de texto ubicados en su ordenador, para ayudar al website a analizar el uso que hacen los usuarios del sitio web. La información que genera la cookie acerca de su uso del website (incluyendo su dirección IP) será directamente transmitida y archivada por Google en los servidores de Estados Unidos. Google usará esta información por cuenta nuestra con el propósito de seguir la pista de su uso del website, recopilando informes de la actividad del website y prestando otros servicios relacionados con la actividad del website y el uso de Internet. Google podrá transmitir dicha información a terceros cuando así se lo requiera la legislación, o cuando dichos terceros procesen la información por cuenta de Google. Google no asociará su dirección IP con ningún otro dato del que disponga Google. Puede Usted rechazar el tratamiento de los datos o la información rechazando el uso de cookies mediante la selección de la configuración apropiada de su navegador, sin embargo, debe Usted saber que si lo hace puede ser que no pueda usar la plena funcionabilidad de este website. Al utilizar este website Usted consiente el tratamiento de información acerca de Usted por Google en la forma y para los fines arriba indicados.

(Esta Política de Privacidad está basada en la creada por la Fundación Fuentes Abiertas para Goteo, bajo licencia Creative Commons.)


Remove "Images" header from photographs sidebar.

<% photographs = CortexReaver::Photograph.recent.viewable_by(user).all %>
<% if photographs.size > 0 %>

      <% photographs.each do |photograph| %>
        <li class="photo thumb" id="photograph_<%= photograph.name %>">
          <a href="<%= photograph.url %>">
            <img src="<%= photograph.thumbnail_public_path %>" alt="<%=attr_h photograph.title %>" />

      <% end %>

<% end %>

<% photographs = CortexReaver::Photograph.recent.viewable_by(user).all %>
<% if photographs.size > 0 %>

Images

      <% photographs.each do |photograph| %>
        <li class="photo thumb" id="photograph_<%= photograph.name %>">
          <a href="<%= photograph.url %>">
            <img src="<%= photograph.thumbnail_public_path %>" alt="<%=attr_h photograph.title %>" />

      <% end %>

<% end %>


Mark links as html safe now escaping is done automatically.

        <%= link_to ''.html_safe, "http://helpmeinvestigate.com/"%>
        <%= link_to 'Get help investigating', "http://helpmeinvestigate.com/"%>

        <%= link_to ''.html_safe, "http://www.writetothem.com"%>
        <%= link_to 'Write to your politician', "http://www.writetothem.com"%>

        <%= link_to ''.html_safe, "http://www.pledgebank.com"%>
        <%= link_to 'Pledge with others', "http://www.pledgebank.com"%>

        <%= link_to '', "http://helpmeinvestigate.com/"%>
        <%= link_to 'Get help investigating', "http://helpmeinvestigate.com/"%>

        <%= link_to '', "http://www.writetothem.com"%>
        <%= link_to 'Write to your politician', "http://www.writetothem.com"%>

        <%= link_to '', "http://www.pledgebank.com"%>
        <%= link_to 'Pledge with others', "http://www.pledgebank.com"%>


added autofocus javascript for group/subgroup creation.  there is a better way to do things, but i haven't totally figured out what it is yet.

<% if @parent -%>
  <% @group_type = 'committee'.t -%>

New committee for group <%= @parent.name %>

<% else %>
  <% @group_type = 'group'.t -%>

New group

<% end %>

<% form_tag :action => 'create' do -%>

  <%= hidden_field_tag('parent_id', @parent.id) if @parent %>

    Name
This name how you will refer to this group in links and URLs. It must only contain alphanumeric characters.

    <% if @parent -%>
      <%= @parent.name + "+" %><%= text_field 'group', 'short_name' %>

    <% else -%>
      <%= text_field 'group', 'name' %>

    <% end -%>

      Full name

      A descriptive name used for display

    <%= text_field 'group', 'full_name'  %>

      Summary

      <%= 'Brief information regarding this %s.' / @group_type %>

    <%= text_field 'group', 'summary'  %>

  <%= submit_tag "Create" %>

<% end -%>


cleanup.

cleanup.

git-svn-id: d766b2a131eb5d649bacb6a45bc0bcd899bdfdb3@245 c938ebee-df10-0410-95fc-be8c4b0ebdd5

<% if @flash[:notice] || @flash[:notice].to_s != ""%>

<%=@flash[:notice]%>

<% end %>

        支出

      <% for summary in @expenses_summaries %>

        <%= summary.name %>
        <%= @expenses_sum != 0 ?
          (summary.sum * 100.0 / @expenses_sum).round : 0%>%
        <%= number_with_delimiter(summary.sum)%>

      <% end %>

          収入

        <% for summary in @incomes_summaries %>

          <%= summary.name %>
          <%= @incomes_sum != 0 ?
        (summary.sum * 100.0 / @incomes_sum).round : 0 %>%
          <%= number_with_delimiter(summary.sum)%>

        <% end %>

        支出合計
        <%= number_with_delimiter(@expenses_sum)%>

          収入合計
          <%= number_with_delimiter(@incomes_sum)%>

    <%= pie_graph(@expenses_summaries, nil, 'name', 'sum', @expenses_sum) %>

    <%= pie_graph(@incomes_summaries, nil, 'name', 'sum', @incomes_sum) %>

    <div class="<%= @profit >= 0 ? "profit" : "loss" %>">
      <%= @profit >= 0 ? "利益" : "損失" %>合計
      <%= number_with_delimiter(@profit.abs)%>円

        資産減少

      <% for summary in @asset_minus_summaries %>

        <%= summary.account.name %>
        -<%= number_with_delimiter(summary.diff.abs)%>

      <% end %>

        資産増加

      <% for summary in @asset_plus_summaries %>

        <%= summary.account.name %>
        +<%= number_with_delimiter(summary.diff)%>

      <% end %>

        減少合計
        -<%= number_with_delimiter(@assets_minus_sum.abs)%>

        増加合計
        +<%= number_with_delimiter(@assets_plus_sum)%>


Elseif to elsif!

Elseif to elsif!

Add feeding task(s) for <%= @cage.name %>

Cage owner: <%=h @cage.user.name %>

Bats in cage: <%=h @cage.bats.length %>

<% if @cage.bats.length > 0 %>
<% average = @cage.average_bat_weight %>

Average Weight: <%= average %> g

<% end %>

<%= render :partial => 'cages/feeding_tasks', :locals => {:cage => @cage} %>

Add Feeding Tasks:

<%= form_remote_tag(:update => "cage_tasks_list",
                       :url => { :controller => 'tasks', :action => 'create_feed_cage_task', :id => @cage },
                       :position => "replace") %>

Fed by

<%= select_tag("users[]", options_from_collection_for_select(@users, "id", "name"),
:multiple => true) %>

On days

<%= select_tag("days[]",
options_for_select([
["Daily", 0],
["Every Monday", 2],
["Every Tuesday", 3],
["Every Wednesday", 4],
["Every Thursday", 5],
["Every Friday", 6],
["Every Saturday", 7],
["Every Sunday", 1]
]),
:multiple => true) %>

*note: Any feeding task that takes place on Saturday/Sunday and is assigned to General Animal Care will automatically be assigned to Weekend/Holiday Care and will appear on the <%= link_to 'weekend care page', :controller => 'main', :action => 'weekend_care'%>.
Any feeding task that takes place during Monday-Friday and is assigned to the Weekend/Holiday Care will automatically be assigned to General Animal Care.

<% if @cage.bats.length > 0 %>
<% if (average < 20) && (average > 14) %>
<% suggested_amount = 1.5 * @cage.bats.length %>
<% elsif average > 20 %>
<% suggested_amount = 2.0 * @cage.bats.length %>
<% else %>
<% suggested_amount = 2.0 * @cage.bats.length %>
<% end %>
<% end %>

Food amount

<%= text_field 'task', 'food', :size => 1, :autocomplete => 'off', :value => suggested_amount %> g

<% if @cage.bats.length > 0 %>
Suggested amount (E. fuscus): <%=h suggested_amount %> g (<%=h suggested_amount/@cage.bats.length %> g per bat) based on average weight of bats in cage.
<% end %>

Dish Type

<%= select_tag("task[dish_type]", options_for_select([["Small","Small"],["Medium","Medium"], ["Long","Long"],["Metal tray","Metal tray"]])) %>

Number of dishes

<%= text_field 'task', 'dish_num', :size => 1, :autocomplete => 'off' %>

<%= submit_tag "Add task(s) for " + @cage.name %>
<%= end_form_tag %>

<%= button_to 'Done', :controller => 'cages', :action => 'show', :id => @cage %>

Add feeding task(s) for <%= @cage.name %>

Cage owner: <%=h @cage.user.name %>

Bats in cage: <%=h @cage.bats.length %>

<% if @cage.bats.length > 0 %>
<% average = @cage.average_bat_weight %>

Average Weight: <%= average %> g

<% end %>

<%= render :partial => 'cages/feeding_tasks', :locals => {:cage => @cage} %>

Add Feeding Tasks:

<%= form_remote_tag(:update => "cage_tasks_list",
                       :url => { :controller => 'tasks', :action => 'create_feed_cage_task', :id => @cage },
                       :position => "replace") %>

Fed by

<%= select_tag("users[]", options_from_collection_for_select(@users, "id", "name"),
:multiple => true) %>

On days

<%= select_tag("days[]",
options_for_select([
["Daily", 0],
["Every Monday", 2],
["Every Tuesday", 3],
["Every Wednesday", 4],
["Every Thursday", 5],
["Every Friday", 6],
["Every Saturday", 7],
["Every Sunday", 1]
]),
:multiple => true) %>

*note: Any feeding task that takes place on Saturday/Sunday and is assigned to General Animal Care will automatically be assigned to Weekend/Holiday Care and will appear on the <%= link_to 'weekend care page', :controller => 'main', :action => 'weekend_care'%>.
Any feeding task that takes place during Monday-Friday and is assigned to the Weekend/Holiday Care will automatically be assigned to General Animal Care.

<% if @cage.bats.length > 0 %>
<% if (average < 20) && (average > 14) %>
<% suggested_amount = 1.5 * @cage.bats.length %>
<% elseif average > 20 %>
<% suggested_amount = 2.0 * @cage.bats.length %>
<% else %>
<% suggested_amount = 2.0 * @cage.bats.length %>
<% end %>
<% end %>

Food amount

<%= text_field 'task', 'food', :size => 1, :autocomplete => 'off', :value => suggested_amount %> g

<% if @cage.bats.length > 0 %>
Suggested amount (E. fuscus): <%=h suggested_amount %> g (<%=h suggested_amount/@cage.bats.length %> g per bat) based on average weight of bats in cage.
<% end %>

Dish Type

<%= select_tag("task[dish_type]", options_for_select([["Small","Small"],["Medium","Medium"], ["Long","Long"],["Metal tray","Metal tray"]])) %>

Number of dishes

<%= text_field 'task', 'dish_num', :size => 1, :autocomplete => 'off' %>

<%= submit_tag "Add task(s) for " + @cage.name %>
<%= end_form_tag %>

<%= button_to 'Done', :controller => 'cages', :action => 'show', :id => @cage %>


fixed _form_attribute.rhtml so it doesn't pass text-related options to a non-textual input

git-svn-id: b2ff2946fad280430023ee7ead77858f96a610fa@46 561dde7e-7729-0410-be8e-ef83869d6c7d

<% # should we pass in :name on our own? %>
<% scope ||= nil %>
<% record ||= nil %>
<% object = record.nil? ? :record : record %>
<% name = scope.nil? ? "record[#{column.name}]" : "#{scope}[#{column.name}]" %>

<label for="<%= "record_#{column.name}" %>"><%= column.label %>
<%= if override_form_field?(column)
  send(override_form_field(column), object)
elsif is_file_column?(column, record)
  file_column_field('record', column.name)
elsif !column.association.nil? and column.ui_type == :select
  select(object, column.name, column.association.klass.find(:all).collect {|r| [r.to_label, r.id]}, {}, { :name => name })
else
  options = { :name => name }
  text_options = options.merge( :autocomplete => "off", :size => 20, :class => 'text-input' )
  if column.virtual?
    text_field(object, column.name, text_options)
  elsif [:text, :string, :integer, :float, :decimal].include?(column.column.type)
    input(object, column.name, text_options)
  else
    input(object, column.name, options)
  end
end
-%>

<% if column.description -%>

<%= column.description %>

<% end -%>

<% # should we pass in :name on our own? %>
<% scope ||= nil %>
<% record ||= nil %>
<% object = record.nil? ? :record : record %>
<% name = scope.nil? ? "record[#{column.name}]" : "#{scope}[#{column.name}]" %>

<label for="<%= "record_#{column.name}" %>"><%= column.label %>
<% if override_form_field?(column) -%>
	<%= send(override_form_field(column), object) %>
<% elsif !column.association.nil? and column.ui_type == :select -%>
  <%= select(object, column.name, column.association.klass.find(:all).collect {|r| [r.to_label, r.id]}, {}, { :name => name }) %>
<% elsif column.virtual? -%>
  <%= text_field(object, column.name, { :autocomplete => "off", :size => 20, :class => 'text-input', :name => name }) %>
<% else -%>
  <%= input(object, column.name, { :autocomplete => "off", :size => 20, :class => 'text-input', :name => name }) %>
<% end -%>

<% if column.description -%>

<%= column.description %>

<% end -%>


formatting changes for release branch

formatting changes for release branch

<% @page_title = 'Admin: Categories' %>

<%= render "shared/admin/tabs" %>

<%= ASSOCIATION.short_name %>

      <%= render :partial => "category", :collection => @category.children.sort %>

Unknown

      <% for category in @unknowns %>
        <div class="category" id="category_<%= category.id %>"><%= category.name %>

        <%= draggable_element("category_#{category.id}", :revert => true, :ghosting => true) %>
      <% end %>

<%= drop_receiving_element("association_category", :url => {:action => 'add_child', :parent_id => @category.id}) %>
<%= drop_receiving_element("association_category_td", :url => {:action => 'add_child', :parent_id => @category.id}) %>
<%= drop_receiving_element("unknown_category", :url => {:action => 'add_child'}) %>
<%= drop_receiving_element("unknown_category_td", :url => {:action => 'add_child'}) %>


Fix error in Admin page when showing body with missing name (closes #140)

<% @title = "Public authority - " + h(@public_body.name) %>

<%=@title%>

<%
   columns = PublicBody.content_columns + [] # force dup
   columns.delete_if {|c| ['last_edit_comment'].include?(c.name)}

   for column in columns %>
  <%= column.human_name %>:
  <% if column.name == 'home_page' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name))  %>
  <% elsif column.name == 'request_email' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), "mailto:#{@public_body.send(column.name)}")  %>
      <% if !@public_body.is_requestable? %>
          (not requestable due to: <%=h @public_body.not_requestable_reason %><% if @public_body.is_followupable? %>; but followupable<% end %>)
      <% end %>
  <% else %>
      <%=h @public_body.send(column.name) %>
  <% end %>

<% end %>
Calculated home page:
<% if !@public_body.calculated_home_page.nil? %>
    <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
<% else %>
    *unknown*
<% end %>

Tags: <%= render :partial => 'tags', :locals => { :body => @public_body} %>

    <%=
        # url_name can be missing if the name hasn't been set for this locale
        if !@public_body.url_name.nil?
            link_to 'Public page', main_url(public_body_url(@public_body))
        else
            'Public page not available'
        end
    %>
    | <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>

History

Updated at
<%
    history_columns = PublicBody.content_columns + [] # force dup
    history_columns.delete_if {|c| ['created_at', 'updated_at', 'first_letter'].include?(c.name)}
    for column in history_columns %>
  <%= column.human_name %>
<% end %>

<%# There may be an option to versions() to specify order, but I can't find it. TB 2009-03-09 %>
<% for historic_public_body in @public_body.reverse_sorted_versions %>
      <tr class="<%= cycle('odd', 'even') %>">
      <%=h historic_public_body.updated_at %>
    <% for column in history_columns %>
      <%
        value = h(historic_public_body.send(column.name))
        if column.name == 'last_edit_comment'
            value = historic_public_body.last_edit_comment_for_html_display
        end
        # Highlight entries which have changed since previous version
        changed = (!['version', 'last_edit_editor', 'last_edit_comment'].include?(column.name)) && ((historic_public_body.send(column.name) != @public_body.sorted_versions[historic_public_body.version - 2].send(column.name)) || (historic_public_body.version == 1)) %>
      <td <%= changed ? ' class="entry_changed" ': '' %> >
      <%=value%>

    <% end %>

<% end %>

Requests

<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @public_body.info_requests } %>

Track things

<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @public_body.track_things } %>

<% @title = "Public authority - " + h(@public_body.name) %>

<%=@title%>

<%
   columns = PublicBody.content_columns + [] # force dup
   columns.delete_if {|c| ['last_edit_comment'].include?(c.name)}

   for column in columns %>
  <%= column.human_name %>:
  <% if column.name == 'home_page' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name))  %>
  <% elsif column.name == 'request_email' and !column.name.empty? %>
    <%= link_to(h(@public_body.send(column.name)), "mailto:" + @public_body.send(column.name))  %>
      <% if !@public_body.is_requestable? %>
          (not requestable due to: <%=h @public_body.not_requestable_reason %><% if @public_body.is_followupable? %>; but followupable<% end %>)
      <% end %>
  <% else %>
      <%=h @public_body.send(column.name) %>
  <% end %>

<% end %>
Calculated home page:
<% if !@public_body.calculated_home_page.nil? %>
    <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
<% else %>
    *unknown*
<% end %>

Tags: <%= render :partial => 'tags', :locals => { :body => @public_body} %>

    <%= link_to 'Public page', main_url(public_body_url(@public_body)) %>
    | <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>

History

Updated at
<%
    history_columns = PublicBody.content_columns + [] # force dup
    history_columns.delete_if {|c| ['created_at', 'updated_at', 'first_letter'].include?(c.name)}
    for column in history_columns %>
  <%= column.human_name %>
<% end %>

<%# There may be an option to versions() to specify order, but I can't find it. TB 2009-03-09 %>
<% for historic_public_body in @public_body.reverse_sorted_versions %>
      <tr class="<%= cycle('odd', 'even') %>">
      <%=h historic_public_body.updated_at %>
    <% for column in history_columns %>
      <%
        value = h(historic_public_body.send(column.name))
        if column.name == 'last_edit_comment'
            value = historic_public_body.last_edit_comment_for_html_display
        end
        # Highlight entries which have changed since previous version
        changed = (!['version', 'last_edit_editor', 'last_edit_comment'].include?(column.name)) && ((historic_public_body.send(column.name) != @public_body.sorted_versions[historic_public_body.version - 2].send(column.name)) || (historic_public_body.version == 1)) %>
      <td <%= changed ? ' class="entry_changed" ': '' %> >
      <%=value%>

    <% end %>

<% end %>

Requests

<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @public_body.info_requests } %>

Track things

<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @public_body.track_things } %>


• forgot the extra layer of escaping required, since the result ends in a double quoted string that goes through the JavaScript parser

git-svn-id: 9fca28a9e7d3964546c091feb010dd68a90643f0@6691 dfb7d73b-c2ec-0310-8fea-fb051d288c6d

		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

		<title>Install a Plugin</title>

					<img src="file://<%= File.join(TextMate.bundle_support, 'images') %>/rails.png" width="43" height="56" id="rails-image">

Plugin Search

						<form id="search-form" onsubmit="Plugin.search(this.search.value); return false;">
							<input type="text" name="search" id="search" />
							<input type="submit" value="Go" />
						</form>

				Install the TextMate Footnotes Plugin


Add edit link to comment list on page edit screen. [#199 state:resolved]

<tr class="<%= "approved" if comment.approved? %>">

    <a name="comment_<%= comment.id %>">

      Posted <%= comment.created_at.to_formatted_s(:long) %>
      by <%= comment.author %>
      on <%= link_to(h(comment.page.title), comment.page.url) %>

    <h4 class="rating rating-<%= comment.rating %>"><%= comment.author_email %>

<%= comment.content_html %>

      <%= link_to_remote_with_spinner '↑',
          :url => sort_admin_comment_path(comment, :how => 'move_higher'),
          :method => :put,
          :id => "move_higher_#{comment.id}" %>
      <%= link_to_remote_with_spinner '↓',
          :url => sort_admin_comment_path(comment, :how => 'move_lower'),
          :method => :put,
          :id => "move_lower_#{comment.id}" %>
      <%= link_to "edit", edit_admin_comment_path(comment) %>


Reverted to Rails/Prototype/Scriptalicous drag and drop

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

	    <% for racer in @racers %>

<%= racer.name %>

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

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

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

	      <% end %>

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

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

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

<%= racer.name %>

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

          <% end %>

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


Added simple fix to force users' browsers to refresh stylesheet when we make changes to it.

<!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" />
  <%= auto_discovery_link_tag(:rss, {:controller => 'observer', :action  =>  'rss'}, {:title => :app_rss.l}) %>
  <title><%= :app_title.l %>: <%= if @title.nil? then controller.action_name else @title.strip_html end %></title>
  <%= "<link rel=\"SHORTCUT ICON\" href=\"#{HTTP_DOMAIN}/favicon.ico\" />"%>

  <%= check_if_user_turned_javascript_on %>

  <%=
    css = nil
    if is_in_admin_mode?
      css = 'Admin'
    elsif is_robot?
      css = 'Agaricus'
    else
      if CSS.member?(controller.action_name)
        css = controller.action_name
      else
        unless @user.nil?
          css = @user.theme
        end
      end
      unless CSS.member?(css)
        css = CSS[rand(CSS.length)]
      end
    end
    stylesheet_link_tag('general.css?v=1', "#{css}.css?v=1")
  %>

  <%= sort_javascript_includes.map {|m| javascript_include_tag(m)} %>

  <% if @header %>
    <%= @header %>
  <% end %>

  <% if is_in_admin_mode? %>

      DANGER: You are in administrator mode. Proceed with caution.

  <% end %>

                <%= link_to(@page_title || :app_banner.t, :controller => 'observer', :action => 'index') %>

                <%= link_to(:app_intro.t, :controller => 'observer', :action => 'intro') %>

                <%= link_to(:app_how_to_use.t, :controller => 'observer', :action => 'how_to_use') %>

                <%= link_to(:app_how_to_help.t, :controller => 'observer', :action => 'how_to_help') %>

                <%= link_to(:app_send_a_comment.t, :controller => 'observer', :action => 'ask_webmaster_question') %>

                <%= link_to(:app_index_a_z.t, :controller => 'name', :action => 'observation_index') %>

                <%= link_to(:app_list_locations.t, :controller => 'location', :action => 'list_locations') %>

                <%= link_to(:app_list_projects.t, :controller => 'project', :action => 'list_projects') %>

                <%= :app_latest.t %>:

                <%= indent + link_to(:app_latest_changes.t, :controller => 'observer', :action => 'list_rss_logs') %>

                <%= indent + link_to(:app_newest_images.t, :controller => 'image', :action => 'list_images') %>

                <%= indent + link_to(:app_comments.t, :controller => 'comment', :action => 'list_comments') %>

                <%= indent + link_to(:app_news.t, :controller => 'observer', :action => 'news') %>

                <%= :app_observations_left.t %>:

                <%= indent + link_to(:app_create_observation.t, :controller => 'observer', :action => 'create_observation') %>

                <%= indent + link_to(:app_sort_by_date_obs.t, :controller => 'observer', :action => 'list_observations') %>

                <%= :app_species_list.t %>:

                <%= indent + link_to(:app_create_list.t, :controller => 'species_list', :action => 'name_lister') %>

                <%= indent + link_to(:app_sort_by_date_spl.t, :controller => 'species_list', :action => 'list_species_lists') %>

                <%= indent + link_to(:app_sort_by_title.t, :controller => 'species_list', :action => 'species_lists_by_title') %>

                <% if @user.nil? %>
                  <%= :app_account.t %>:

                  <%= indent + link_to(:app_login.t, :controller => 'account', :action => 'login') %>

                  <%= indent + link_to(:app_create_account.t, :controller => 'account', :action => 'signup') %>

                <% else %>
                  <%= :app_current_user.t %>:

                  <%= indent + h(@user.login) %>

                  <%= indent + link_to(:app_comments_for_you.t, :controller => 'comment', :action => 'show_comments_for_user', :id => @user.id) %>

                  <%= indent + link_to(:app_your_observations.t, :controller => 'observer', :action => 'observations_by_user', :id => @user.id) %>

                  <%= indent + link_to(:app_your_interests.t, :controller => 'interest', :action => 'list_interests') %>

                  <%= indent + link_to(:app_your_summary.t, :controller => 'observer', :action => 'show_user', :id => @user.id) %>

                  <%= indent + link_to(:app_preferences.t, :controller => 'account', :action => 'prefs') %>

                  <%= indent + link_to(:app_join_mailing_list.t, 'http://lists.mushroomobserver.org/listinfo.cgi/general-mushroomobserver.org') %>

                  <%= indent + link_to(:app_logout.t, :controller => 'account', :action => 'logout_user') %>

                  <% if @user.admin %>

                    <%= :app_admin.t %>:

                    <% if is_in_admin_mode? %>
                      <%= indent + link_to(:app_users.t, :controller => 'observer', :action => 'users_by_name') %>

                      <%= indent + link_to(:app_email_all_users.t, :controller => 'observer', :action => 'email_features') %>

                      <%= indent + link_to(:app_add_to_group.t, :controller => 'account', :action => 'add_user_to_group') %>

                      <%= indent + link_to(:app_turn_admin_off.t, :controller => 'account', :action => 'turn_admin_off') %>

                    <% else %>
                      <%= indent + link_to(:app_turn_admin_on.t, :controller => 'account', :action => 'turn_admin_on') %>

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

                <%= :app_languages.t %>:

                <% for locale in all_locales %>
                  <%= indent + link_to(locale.sub('-','_').to_sym.t, h(reload_with_args(:user_locale => locale))) %>

                <% end %>

                <%= link_to(:app_contributors.t, :controller => 'observer', :action => 'users_by_contribution') %>

                <%= link_to(:app_site_stats.t, :controller => 'observer', :action => 'show_site_stats') %>

                <%= link_to(:translators_note_title.t, :controller => 'observer', :action => 'translators_note') %>

                  <%= link_to(:app_colors_from.t(:theme => css), :controller => 'observer', :action => 'color_themes') %>

                  <%= :app_powered_by.t %>:

                  Ruby on Rails

                  <%= :app_preferred_browser.t %>:

                  FireFox
                  <% if @invalid.nil? %>

                  <% end %>

              <% form_tag(:controller => 'observer', :action => 'pattern_search') do %>
                <%= :app_find.t %>:
                  <%= text_field(:search, :pattern, :size => 30,
                                 :value => session[:pattern])%>
                <%= options = [
                  [ :OBSERVATIONS.l, :observation ],
                  [ :IMAGES.l, :image ],
                  [ :NAMES.l, :name ],
                  [ :LOCATIONS.l, :location ],
                  [ :SPECIES_LISTS.l, :species_list ],
                  [ :COMMENTS.l, :comment ],
                  [ :USERS.l, :user ],
                  [ :PROJECTS.l, :project ],
                  [ :app_search_google.l, :google ],
                ]
                select(:search, :type, options,
                       :selected => session[:search_type] || :observation) %>
                <%= submit_tag :app_search.l %>
                <% if (DEVELOPMENT || is_reviewer?) && query_params != {} %>
                  <%= link_to(:app_refine_search.l.nowrap, :controller => 'observer',
                              :action => 'refine_search',
                              :params => query_params) %> |
                <% end %>
                <%= link_to(:app_advanced_search.l.nowrap, :controller => 'observer',
                            :action => 'advanced_search_form') %>
              <% end %>

            <% if @timer_start %>

                <%= @timer_end ||= Time.now
                secs = '%.2f' % (@timer_end.to_f - @timer_start.to_f)
                @timer_start = nil
                if @num_results
                  '(' + :app_index_timer.t(:seconds => secs,
                                           :num => @num_results.to_i) + ')'
                else
                  '(' + :app_timer.t(:seconds => secs) + ')'
                end %>

            <% end %>

              <% if flash_notices? %>
                  <% boxify(flash_notice_level) do %>
                    <%= flash_get_notices %>
                  <% end %>
              <% end
              flash_clear %>

            <% if @right_tabs %>

                <%= @right_tabs.join('
') %>

            <% end %>

              <%= no_session = !session_working?
              no_javascript = !javascript_enabled? && session[:js_override] != :off
              no_ajax       = can_do_ajax? == false && javascript_enabled? && session[:js_override] != :on
              no_browser    = can_do_ajax? == nil   && javascript_enabled? && session[:js_override] != :on
              if no_session || no_javascript || no_ajax || no_browser
                new_tab_set do
                  add_tab(:app_no_session.t,    :controller => 'observer', :action => 'no_session')    if no_session
                  add_tab(:app_no_javascript.t, :controller => 'observer', :action => 'no_javascript') if no_javascript
                  add_tab(:app_no_ajax.t,       :controller => 'observer', :action => 'no_ajax')       if no_ajax
                  add_tab(:app_no_browser.t,    :controller => 'observer', :action => 'no_browser')    if no_browser
                end
              end
              render_tab_sets %>

<%= @title %>

            <%= @content_for_layout %>

            <% if Locale.code.to_s != 'en-US' %>

                <%= :app_translators_credit.tpl %>

            <% end %>

  <% if @javascripts && @javascripts.include?('cached_auto_complete') %>

      <%= image_tag('indicator.gif') %>

  <% 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" />
  <%= auto_discovery_link_tag(:rss, {:controller => 'observer', :action  =>  'rss'}, {:title => :app_rss.l}) %>
  <title><%= :app_title.l %>: <%= if @title.nil? then controller.action_name else @title.strip_html end %></title>
  <%= "<link rel=\"SHORTCUT ICON\" href=\"#{HTTP_DOMAIN}/favicon.ico\" />"%>

  <%= check_if_user_turned_javascript_on %>

  <%=
    css = nil
    if is_in_admin_mode?
      css = 'Admin'
    elsif is_robot?
      css = 'Agaricus'
    else
      if CSS.member?(controller.action_name)
        css = controller.action_name
      else
        unless @user.nil?
          css = @user.theme
        end
      end
      unless CSS.member?(css)
        css = CSS[rand(CSS.length)]
      end
    end
    stylesheet_link_tag 'general', css
  %>

  <%= sort_javascript_includes.map {|m| javascript_include_tag(m)} %>

  <% if @header %>
    <%= @header %>
  <% end %>

  <% if is_in_admin_mode? %>

      DANGER: You are in administrator mode. Proceed with caution.

  <% end %>

                <%= link_to(@page_title || :app_banner.t, :controller => 'observer', :action => 'index') %>

                <%= link_to(:app_intro.t, :controller => 'observer', :action => 'intro') %>

                <%= link_to(:app_how_to_use.t, :controller => 'observer', :action => 'how_to_use') %>

                <%= link_to(:app_how_to_help.t, :controller => 'observer', :action => 'how_to_help') %>

                <%= link_to(:app_send_a_comment.t, :controller => 'observer', :action => 'ask_webmaster_question') %>

                <%= link_to(:app_index_a_z.t, :controller => 'name', :action => 'observation_index') %>

                <%= link_to(:app_list_locations.t, :controller => 'location', :action => 'list_locations') %>

                <%= link_to(:app_list_projects.t, :controller => 'project', :action => 'list_projects') %>

                <%= :app_latest.t %>:

                <%= indent + link_to(:app_latest_changes.t, :controller => 'observer', :action => 'list_rss_logs') %>

                <%= indent + link_to(:app_newest_images.t, :controller => 'image', :action => 'list_images') %>

                <%= indent + link_to(:app_comments.t, :controller => 'comment', :action => 'list_comments') %>

                <%= indent + link_to(:app_news.t, :controller => 'observer', :action => 'news') %>

                <%= :app_observations_left.t %>:

                <%= indent + link_to(:app_create_observation.t, :controller => 'observer', :action => 'create_observation') %>

                <%= indent + link_to(:app_sort_by_date_obs.t, :controller => 'observer', :action => 'list_observations') %>

                <%= :app_species_list.t %>:

                <%= indent + link_to(:app_create_list.t, :controller => 'species_list', :action => 'name_lister') %>

                <%= indent + link_to(:app_sort_by_date_spl.t, :controller => 'species_list', :action => 'list_species_lists') %>

                <%= indent + link_to(:app_sort_by_title.t, :controller => 'species_list', :action => 'species_lists_by_title') %>

                <% if @user.nil? %>
                  <%= :app_account.t %>:

                  <%= indent + link_to(:app_login.t, :controller => 'account', :action => 'login') %>

                  <%= indent + link_to(:app_create_account.t, :controller => 'account', :action => 'signup') %>

                <% else %>
                  <%= :app_current_user.t %>:

                  <%= indent + h(@user.login) %>

                  <%= indent + link_to(:app_comments_for_you.t, :controller => 'comment', :action => 'show_comments_for_user', :id => @user.id) %>

                  <%= indent + link_to(:app_your_observations.t, :controller => 'observer', :action => 'observations_by_user', :id => @user.id) %>

                  <%= indent + link_to(:app_your_interests.t, :controller => 'interest', :action => 'list_interests') %>

                  <%= indent + link_to(:app_your_summary.t, :controller => 'observer', :action => 'show_user', :id => @user.id) %>

                  <%= indent + link_to(:app_preferences.t, :controller => 'account', :action => 'prefs') %>

                  <%= indent + link_to(:app_join_mailing_list.t, 'http://lists.mushroomobserver.org/listinfo.cgi/general-mushroomobserver.org') %>

                  <%= indent + link_to(:app_logout.t, :controller => 'account', :action => 'logout_user') %>

                  <% if @user.admin %>

                    <%= :app_admin.t %>:

                    <% if is_in_admin_mode? %>
                      <%= indent + link_to(:app_users.t, :controller => 'observer', :action => 'users_by_name') %>

                      <%= indent + link_to(:app_email_all_users.t, :controller => 'observer', :action => 'email_features') %>

                      <%= indent + link_to(:app_add_to_group.t, :controller => 'account', :action => 'add_user_to_group') %>

                      <%= indent + link_to(:app_turn_admin_off.t, :controller => 'account', :action => 'turn_admin_off') %>

                    <% else %>
                      <%= indent + link_to(:app_turn_admin_on.t, :controller => 'account', :action => 'turn_admin_on') %>

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

                <%= :app_languages.t %>:

                <% for locale in all_locales %>
                  <%= indent + link_to(locale.sub('-','_').to_sym.t, h(reload_with_args(:user_locale => locale))) %>

                <% end %>

                <%= link_to(:app_contributors.t, :controller => 'observer', :action => 'users_by_contribution') %>

                <%= link_to(:app_site_stats.t, :controller => 'observer', :action => 'show_site_stats') %>

                <%= link_to(:translators_note_title.t, :controller => 'observer', :action => 'translators_note') %>

                  <%= link_to(:app_colors_from.t(:theme => css), :controller => 'observer', :action => 'color_themes') %>

                  <%= :app_powered_by.t %>:

                  Ruby on Rails

                  <%= :app_preferred_browser.t %>:

                  FireFox
                  <% if @invalid.nil? %>

                  <% end %>

              <% form_tag(:controller => 'observer', :action => 'pattern_search') do %>
                <%= :app_find.t %>:
                  <%= text_field(:search, :pattern, :size => 30,
                                 :value => session[:pattern])%>
                <%= options = [
                  [ :OBSERVATIONS.l, :observation ],
                  [ :IMAGES.l, :image ],
                  [ :NAMES.l, :name ],
                  [ :LOCATIONS.l, :location ],
                  [ :SPECIES_LISTS.l, :species_list ],
                  [ :COMMENTS.l, :comment ],
                  [ :USERS.l, :user ],
                  [ :PROJECTS.l, :project ],
                  [ :app_search_google.l, :google ],
                ]
                select(:search, :type, options,
                       :selected => session[:search_type] || :observation) %>
                <%= submit_tag :app_search.l %>
                <% if (DEVELOPMENT || is_reviewer?) && query_params != {} %>
                  <%= link_to(:app_refine_search.l.nowrap, :controller => 'observer',
                              :action => 'refine_search',
                              :params => query_params) %> |
                <% end %>
                <%= link_to(:app_advanced_search.l.nowrap, :controller => 'observer',
                            :action => 'advanced_search_form') %>
              <% end %>

            <% if @timer_start %>

                <%= @timer_end ||= Time.now
                secs = '%.2f' % (@timer_end.to_f - @timer_start.to_f)
                @timer_start = nil
                if @num_results
                  '(' + :app_index_timer.t(:seconds => secs,
                                           :num => @num_results.to_i) + ')'
                else
                  '(' + :app_timer.t(:seconds => secs) + ')'
                end %>

            <% end %>

              <% if flash_notices? %>
                  <% boxify(flash_notice_level) do %>
                    <%= flash_get_notices %>
                  <% end %>
              <% end
              flash_clear %>

            <% if @right_tabs %>

                <%= @right_tabs.join('
') %>

            <% end %>

              <%= no_session = !session_working?
              no_javascript = !javascript_enabled? && session[:js_override] != :off
              no_ajax       = can_do_ajax? == false && javascript_enabled? && session[:js_override] != :on
              no_browser    = can_do_ajax? == nil   && javascript_enabled? && session[:js_override] != :on
              if no_session || no_javascript || no_ajax || no_browser
                new_tab_set do
                  add_tab(:app_no_session.t,    :controller => 'observer', :action => 'no_session')    if no_session
                  add_tab(:app_no_javascript.t, :controller => 'observer', :action => 'no_javascript') if no_javascript
                  add_tab(:app_no_ajax.t,       :controller => 'observer', :action => 'no_ajax')       if no_ajax
                  add_tab(:app_no_browser.t,    :controller => 'observer', :action => 'no_browser')    if no_browser
                end
              end
              render_tab_sets %>

<%= @title %>

            <%= @content_for_layout %>

            <% if Locale.code.to_s != 'en-US' %>

                <%= :app_translators_credit.tpl %>

            <% end %>

  <% if @javascripts && @javascripts.include?('cached_auto_complete') %>

      <%= image_tag('indicator.gif') %>

  <% end %>


fixing time_zone stuff for topics/show

fixing time_zone stuff for topics/show

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

	<%= render :partial => 'topics/new' %>

	<%=h @topic.title %>

		« <%= link_to @topic.forum.name, forum_path(@topic.forum) %>
		« <%= link_to @topic.forum.category.name, category_path(@topic.forum.category) %>
		 |
		<%= @topic.private? ? 'Private' : 'Public' %><%= @topic.closed? ? ', Closed' : '' %>

		<%= link_to_remote "#{pluralize(@topic.posts_count, 'Post')} by #{pluralize(@topic.posters, 'User')}", :url => {:action => 'show_posters', :id => @topic.id} %>
		<% if @topic.last_page != 1 %>
		 |
			<%= will_paginate @posts,
					:prev_label => ' « ', :next_label => ' » ',
					:inner_window => 0, :outer_window => -1, :compact => true
					%>
		<% end %>

<% @posts.each_with_index do |post, index| index+=1 %>
	<table class="thread" cellspacing="0" id="p<%= post.id %>">

				<%= distance_of_time_in_words(post.created_at, TzTime.now, true, true) %>

					<%= link_to "#" + (index + @padding).to_s, topic_path(:anchor => 'p' + post.id.to_s) %>

<%= link_to h(post.user.login), user_path(post.user.id) %>

<%= rank_for(post.user.posts_count, post.user.admin) %>

							<%= link_to avatar_for(post.user), user_path(post.user.id) unless post.user.avatar.nil? %>

Registered: <%= post.user.created_at.strftime("%b, %Y") %>

Last visit: <%= time_ago_in_words(post.user.online_at) %>

Posts: <%= post.user.posts_count %>

						<%= bb(post.body) %>
						<% if (post.updated_at > post.created_at+5.minutes) %>

								Last edited <%= time_ago_in_words(post.updated_at) %>
								<%= 'by ' + post.editor.login unless post.editor.nil? %>

						<% end %>
						<% if !post.user.signature.blank? %>

								<%= bb(post.user.signature) %>

						<% end %>

					<% if post.user.is_online? %>
						Online
					<% else %>
						Offline
					<% end %>

					<% if can_edit?(post) %>
						<%= link_to 'Edit', edit_post_path(post) %> |
					<% end %>
					<% if logged_in? && !@topic.closed %>
						<%= link_to 'Quote', quote_post_path(post) %>
					<% end %>

<% end %>

<% if logged_in? && !@topic.closed %>
	<%= render :partial => 'posts/new' %>
<% elsif logged_in? && @topic.closed %>

This Topic is Closed

<% else %>

			<%= link_to('Login', login_path) %> or
			<%= link_to('Register', register_path) %> to post a reply

<% end %>

	<%= render :partial => 'topics/new' %>

	<%=h @topic.title %>

		« <%= link_to @topic.forum.name, forum_path(@topic.forum) %>
		« <%= link_to @topic.forum.category.name, category_path(@topic.forum.category) %>
		 |
		<%= @topic.private? ? 'Private' : 'Public' %><%= @topic.closed? ? ', Closed' : '' %>

		<%= link_to_remote "#{pluralize(@topic.posts_count, 'Post')} by #{pluralize(@topic.posters, 'User')}", :url => {:action => 'show_posters', :id => @topic.id} %>
		<% if @topic.last_page != 1 %>
		 |
			<%= will_paginate @posts,
					:prev_label => ' « ', :next_label => ' » ',
					:inner_window => 0, :outer_window => -1, :compact => true
					%>
		<% end %>

<% @posts.each_with_index do |post, index| index+=1 %>
	<table class="thread" cellspacing="0" id="p<%= post.id %>">

				<%= distance_of_time_in_words(post.created_at, TzTime.at(Time.now), true, true) %>

					<%= link_to "#" + (index + @padding).to_s, topic_path(:anchor => 'p' + post.id.to_s) %>

<%= link_to h(post.user.login), user_path(post.user.id) %>

<%= rank_for(post.user.posts_count, post.user.admin) %>

							<%= link_to avatar_for(post.user), user_path(post.user.id) unless post.user.avatar.nil? %>

Registered: <%= post.user.created_at.strftime("%b, %Y") %>

Last visit: <%= time_ago_in_words(post.user.online_at) %>

Posts: <%= post.user.posts_count %>

						<%= bb(post.body) %>
						<% if (post.updated_at > post.created_at+5.minutes) %>

								Last edited <%= time_ago_in_words(post.updated_at) %>
								<%= 'by ' + post.editor.login unless post.editor.nil? %>

						<% end %>
						<% if !post.user.signature.blank? %>

								<%= bb(post.user.signature) %>

						<% end %>

					<% if post.user.is_online? %>
						Online
					<% else %>
						Offline
					<% end %>

					<% if can_edit?(post) %>
						<%= link_to 'Edit', edit_post_path(post) %> |
					<% end %>
					<% if logged_in? && !@topic.closed %>
						<%= link_to 'Quote', quote_post_path(post) %>
					<% end %>

<% end %>

<% if logged_in? && !@topic.closed %>
	<%= render :partial => 'posts/new' %>
<% elsif logged_in? && @topic.closed %>

This Topic is Closed

<% else %>

			<%= link_to('Login', login_path) %> or
			<%= link_to('Register', register_path) %> to post a reply

<% end %>


deprecations - & -> merge in wiki/author

<%= author.name %> <%= spaced_render(:collection => construction.loci.merge(@loci), :partial => "shared/wiki/ref") %>

<%= author.name %> <%= spaced_render(:collection => construction.loci & @loci, :partial => "shared/wiki/ref") %>


ActionItem1003: removing duplicated field

<%= optional_field(@profile, 'language', f.text_field(:language)) %>
<%= optional_field(@profile, 'description', f.text_area(:description, :rows => 5)) %>


Fix del.icio.us HTML.  Closes #457

Fix del.icio.us HTML.  Closes #457

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

<%= form_tag({},{:id => 'configure_'+@sidebar.id.to_s, :class=>'configblock'}) %>
  Feed URL
  <input class="text" type="text" name="configure[feed]" value="<%=h @sidebar.staged_config['feed'] %>"/>

  Items limit
  <input class="text" type="text" name="configure[count]" value="<%=h @sidebar.staged_config['count'] %>"/>

  Group links by day
  <input type="checkbox" id="configure_<%= @sidebar.id.to_s %>_groupdate" name="configure[groupdate]" <% if @sidebar.staged_config['groupdate'] %>checked="checked"<% end %>/>

  Show Description
  <input type="checkbox" id="configure_<%= @sidebar.id.to_s %>_description" name="configure[description]" <% if @sidebar.staged_config['description'] %>checked="checked"<% end %>/>

  Allow links in Description
  <input type="checkbox" id="configure_<%= @sidebar.id.to_s %>_desclink" name="configure[desclink]" <% if @sidebar.staged_config['desclink'] %>checked="checked"<% end %>/>
<%= end_form_tag %>

<%= observe_form "configure_"+@sidebar.id.to_s,
    :url => { :action => "save_config", :id=>@sidebar.id},
    :with => 'value'
 %>

<%= form_tag({},{:id => 'configure_'+@sidebar.id.to_s, :class=>'configblock'}) %>
  Feed URL
  <input class="text" type="text" name="configure[feed]" value="<%=h @sidebar.staged_config['feed'] %>"/>

  Items limit
  <input class="text" type="text" name="configure[count]" value="<%=h @sidebar.staged_config['count'] %>"/>

  Group links by day
  <input type="checkbox" id="configure_<%= @sidebar.id.to_s %>_groupdate" name="configure[groupdate]" <% if @sidebar.staged_config['groupdate'] %>checked="checked"<% end %>>

  Show Description
  <input type="checkbox" id="configure_<%= @sidebar.id.to_s %>_description" name="configure[description]" <% if @sidebar.staged_config['description'] %>checked="checked"<% end %>>

  Allow links in Description
  <input type="checkbox" id="configure_<%= @sidebar.id.to_s %>_desclink" name="configure[desclink]" <% if @sidebar.staged_config['desclink'] %>checked="checked"<% end %>>
<%= end_form_tag %>

<%= observe_form "configure_"+@sidebar.id.to_s,
    :url => { :action => "save_config", :id=>@sidebar.id},
    :with => 'value'
 %>


Quick fix to problem with edit_species_list.

<%
  javascript_include_auto_complete
  @title = :species_list_edit_title.t(:name => @species_list.unique_format_name)

  new_tab_set do
    add_tab(:cancel_and_show.t(:type => :species_list), :action => 'show_species_list', :id => @species_list.id)
    add_tab(:species_list_upload_title.t, :action => 'upload_species_list', :id => @species_list.id)
  end
%>

<% form_tag(:action => 'edit_species_list', :id => @species_list.id) do %>
  <% if !@new_names.blank?
    val = @new_names.map {|x| CGI::escapeHTML(x)}.join('
') %>
    <input id="approved_names" name="approved_names" type="hidden"
           value="<%= val %>"/>
  <% end %>
  <% if !@deprecated_names.blank?
    val = @deprecated_names.map(&:id).join(' ') %>
    <input id="approved_deprecated_names" name="approved_deprecated_names"
           type="hidden" value="<%= val %>"/>
  <% end %>

<%= submit_tag :UPDATE.l %>

      <%= render(:partial => 'form_species_lists') %>

<% end %>

<%
  javascript_include_auto_complete
  @title = :species_list_edit_title.t(:name => @species_list.unique_format_name)

  new_tab_set do
    add_tab(:cancel_and_show.t(:type => :species_list), :action => 'show_species_list', :id => @species_list.id)
    add_tab(:species_list_upload_title.t, :action => 'upload_species_list', :id => @species_list.id)
  end
%>

<% form_tag(:action => 'edit_species_list', :id => @species_list.id) do %>
  <% if !@new_names.blank?
    val = @new_names.map {|x| CGI::escapeHTML(x)}.join('
') %>
    <input id="approved_names" id="approved_names" type="hidden"
           value="<%= val %>"/>
  <% end %>
  <% if !@deprecated_names.blank?
    val = @deprecated_names.map(&:id).join(' ') %>
    <input id="approved_deprecated_names" name="approved_deprecated_names"
           type="hidden" value="<%= val %>"/>
  <% end %>

<%= submit_tag :UPDATE.l %>

      <%= render(:partial => 'form_species_lists') %>

<% end %>