inital weight label was confusing

inital weight label was confusing

<%= error_messages_for 'bat' %>

<% if @deactivating == true %>
<%   @disable_leave_date = false %>
<%   @disable_cage = true %>
<%   @everything_else = '
' %>
<%   @leave_date = '
' %>
<% else %>
<% if @reactivating == true %>
<%   @disable_leave_date = true %>
<%   @disable_cage = false %>
<%   @everything_else = '
' %>
<%   @leave_date = '
' %>
<% else %>
<%   @disable_leave_date = true %>
<%   @disable_cage = false %>
<%   @everything_else = '
' %>
<%   @leave_date = '
' %>
<% end %>
<% end %>

<%= @everything_else %>

Band

<%= text_field 'bat', 'band', :disabled => @reactivating, :maxlength => 10, :focus => true %>

Species

<%= select_tag("bat[species_id]", options_from_collection_for_select(@species, "id", "name", (@bat.species ? @bat.species.id : '')), {:disabled => @reactivating}) %>

Gender

<%= select_tag("bat[gender]", options_for_select([["Male","M"],["Female","F"]],@bat.gender), :disabled => @reactivating) %>

Collection date

<%= date_select 'bat', 'collection_date', :disabled => @reactivating %>

Collection age

<%= select_tag("bat[collection_age]", options_for_select([["Juvenile","Juvenile"],["Adult", "Adult"]], @bat.collection_age), :disabled => @reactivating) %>

Collection place

<%= text_field 'bat', 'collection_place', :disabled => @reactivating %>

<% if @bat.vaccination_date %>
	<% show_vaccination_date_select = true %>
<% else %>
  <% show_vaccination_date_select = false %>
<% end %>

<%= render :partial=>'form_vaccination', :locals =>{:bat => @bat, :show_vaccination_date_select=> show_vaccination_date_select, :reactivating=>@reactivating} %>

<% if @creating %>

Weight

		<%= render :partial => 'weigh_one_bat', :locals => {:bat => @bat, :initial_weight => true} %>

<% end %>

<% if (@reactivating == true) || (@creating == true) %>

Choose Cage

<% if @reactivating %>
(previous cage: <%=h @bat.cage_out_histories[0].cage.name %>)
<% end %>

Cage
Number of bats
Average current weight

<% for cage in Cage.active %>

<%=radio_button :bat, :cage_id, cage.id %>
<%= cage.name %>
<%= cage.bats.length %>
<%= cage.average_bat_weight %>

<% end %>

<% end %>

<%= @leave_date %>

Leave date

<%= date_select 'bat', 'leave_date',  :disabled => @disable_leave_date%>

Leave reason

<%= text_field 'move', 'note',  :disabled => @disable_leave_date%>

<%= error_messages_for 'bat' %>

<% if @deactivating == true %>
<%   @disable_leave_date = false %>
<%   @disable_cage = true %>
<%   @everything_else = '
' %>
<%   @leave_date = '
' %>
<% else %>
<% if @reactivating == true %>
<%   @disable_leave_date = true %>
<%   @disable_cage = false %>
<%   @everything_else = '
' %>
<%   @leave_date = '
' %>
<% else %>
<%   @disable_leave_date = true %>
<%   @disable_cage = false %>
<%   @everything_else = '
' %>
<%   @leave_date = '
' %>
<% end %>
<% end %>

<%= @everything_else %>

Band

<%= text_field 'bat', 'band', :disabled => @reactivating, :maxlength => 10, :focus => true %>

Species

<%= select_tag("bat[species_id]", options_from_collection_for_select(@species, "id", "name", (@bat.species ? @bat.species.id : '')), {:disabled => @reactivating}) %>

Gender

<%= select_tag("bat[gender]", options_for_select([["Male","M"],["Female","F"]],@bat.gender), :disabled => @reactivating) %>

Collection date

<%= date_select 'bat', 'collection_date', :disabled => @reactivating %>

Collection age

<%= select_tag("bat[collection_age]", options_for_select([["Juvenile","Juvenile"],["Adult", "Adult"]], @bat.collection_age), :disabled => @reactivating) %>

Collection place

<%= text_field 'bat', 'collection_place', :disabled => @reactivating %>

<% if @bat.vaccination_date %>
	<% show_vaccination_date_select = true %>
<% else %>
  <% show_vaccination_date_select = false %>
<% end %>

<%= render :partial=>'form_vaccination', :locals =>{:bat => @bat, :show_vaccination_date_select=> show_vaccination_date_select, :reactivating=>@reactivating} %>

<% if @creating %>

Initial Weight

		<%= render :partial => 'weigh_one_bat', :locals => {:bat => @bat, :initial_weight => true} %>

<% end %>

<% if (@reactivating == true) || (@creating == true) %>

Choose Cage

<% if @reactivating %>
(previous cage: <%=h @bat.cage_out_histories[0].cage.name %>)
<% end %>

Cage
Number of bats
Average current weight

<% for cage in Cage.active %>

<%=radio_button :bat, :cage_id, cage.id %>
<%= cage.name %>
<%= cage.bats.length %>
<%= cage.average_bat_weight %>

<% end %>

<% end %>

<%= @leave_date %>

Leave date

<%= date_select 'bat', 'leave_date',  :disabled => @disable_leave_date%>

Leave reason

<%= text_field 'move', 'note',  :disabled => @disable_leave_date%>


Now shows more information on tasks

Now shows more information on tasks

Showing Task

  Title:
    <% if @task.internal_description == nil %>
      <%=h @task.title%>
    <% else %>
    <%= @task.medical_problem_id ? (link_to @task.title, :controller => 'tasks', :action => 'show', :id => @task.medical_problem_id) : '' %>
    <%= @task.cage_id ? (link_to @task.title, :controller => 'cages', :action => 'show', :id => @task.cage) : '' %>
    <% end %>

  Who:
    <% for user in @task.users %>
      <%=h user.name %>,
    <% end %>

  When:
      <%= @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.notes != '' %>

  Notes: <%=h @task.notes %>

<% end %>

<% if @task.internal_description == 'feed' %>

    Food: <%=h @task.food %> g

    Dishes: <%=h @task.dish_num.to_s + ' ' + @task.dish_type %>

<% end %>

  Last Done: <%=h nice_date(@task.last_done_date) %>

  Date Started: <%=h nice_date(@task.date_started) %>

<% if @task.date_ended != nil %>

  Date Ended: <%=h nice_Date(@task.date_ended) %>

<% end %>

<% if @task.jitter == -1 %>

Leniency: This task can be done one day ahead of schedule

<% else %>

Leniency: This task must be done on time

<% end %>

<%= link_to 'Edit', :action => 'edit', :id => @task %> |
<%= link_to 'List Tasks', :action => 'list' %>

Showing Task

  Title:
    <% if @task.medical_problem_id == nil && @task.cage_id == nil %>
      <%=h @task.title%>
    <% else %>
    <%= @task.medical_problem_id ? (link_to @task.title, :controller => 'tasks', :action => 'show', :id => @task.medical_problem_id) : '' %>
    <%= @task.cage_id ? (link_to @task.title, :controller => 'cages', :action => 'show', :id => @task.cage_id) : '' %>
    <% end %>

  Who:
    <% for user in @task.users %>
      <%=h user.name %>,
    <% end %>

  When:
      <%= @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" : '' %>

  Notes: <%=h @task.notes %>

  Last Done: <%=h nice_date(@task.last_done_date) %>

<%= link_to 'Edit', :action => 'edit', :id => @task %> |
<%= link_to 'List Tasks', :action => 'list' %>


Bugfix: it was impossible to uncheck a checkbox by default

<%= start_question @question %>
<% if @editing -%>
	<%= check_box_tag "question[#{@question.id}][default_answer]", "checked",
                (@question.default_answer and @question.default_answer != ''),
		:onChange => "updateDefault(#{@question.id}, this.checked ? 'checked' : '');"%>
<% else -%>
	<%= check_box_tag "question[#{@question.id}]", 'checked', (value and value != '') %>
<% end -%>
<%= end_question @question %>

<%= start_question @question %>
<% if @editing -%>
	<%= check_box "question[]", "default_answer",
		:onChange => "updateDefault(#{@question.id}, this.checked);"%>
<% else -%>
	<%= check_box_tag "question[#{@question.id}]", 'checked', (value and value != '') %>
<% end -%>
<%= end_question @question %>


Label the select box in a standard way

Label the select box in a standard way

<% if @parent %>
  <%= hidden_field_tag('parent_id', @parent.id) %>
<% else %>
  <%= labelled_form_field(_('Choose folder to upload files:'), select_tag('parent_id', options_for_select([[profile.identifier, '']] + @folders.collect {|f| [ profile.identifier + '/' +  f.full_name, f.id ] }))) %>
<% end %>

<div id='uploaded_files'>
  <% 3.times do %>
    <%= render :partial => 'upload_file', :locals => {:size => size} %>
  <% end %>
</div>

<%= hidden_field_tag('back_to', @back_to) %>

<% button_bar do %>
  <%= add_upload_file_field(_('More files'), {:size => size}) %>
  <% if @media_listing %>
    <%= submit_button :save, _('Upload') %>
  <% elsif @back_to %>
    <%= submit_button :save, _('Upload'), :cancel => @back_to %>
  <% else %>
    <%= submit_button :save, _('Upload'), :cancel => {:action => (@parent ? 'view' : 'index'), :id => @parent } %>
  <% end %>
<% end %>

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

<%= _('Choose folder to upload files:') %>

  <%= select_tag('parent_id', options_for_select([[profile.identifier, '']] + @folders.collect {|f| [ profile.identifier + '/' +  f.full_name, f.id ] })) %>
<% end %>

  <% 3.times do %>
    <%= render :partial => 'upload_file', :locals => {:size => size} %>
  <% end %>

<%= hidden_field_tag('back_to', @back_to) %>

<% button_bar do %>
  <%= add_upload_file_field(_('More files'), {:size => size}) %>
  <% if @media_listing %>
    <%= submit_button :save, _('Upload') %>
  <% elsif @back_to %>
    <%= submit_button :save, _('Upload'), :cancel => @back_to %>
  <% else %>
    <%= submit_button :save, _('Upload'), :cancel => {:action => (@parent ? 'view' : 'index'), :id => @parent } %>
  <% end %>
<% end %>


Fixed the select tag again.

Fixed the select tag again.

<%= error_messages_for 'bat' %>

<% if @deactivating == true %>
<%   @disable_leave_date = false %>
<%   @disable_cage = true %>
<%   @everything_else = '
' %>
<%   @leave_date = '
' %>
<% else %>
<% if @reactivating == true %>
<%   @disable_leave_date = true %>
<%   @disable_cage = false %>
<%   @everything_else = '
' %>
<%   @leave_date = '
' %>
<% else %>
<%   @disable_leave_date = true %>
<%   @disable_cage = false %>
<%   @everything_else = '
' %>
<%   @leave_date = '
' %>
<% end %>
<% end %>

<%= @everything_else %>

Band

<%= text_field 'bat', 'band', :disabled => @reactivating, :maxlength => 10 %>

Species

<%= select_tag("bat[species_id]", options_from_collection_for_select(@species, "id", "name", (@bat.species ? @bat.species.id : '')), {:disabled => @reactivating}) %>

Gender

<%= select_tag("bat[gender]", options_for_select([["Male","M"],["Female","F"]],@bat.gender), :disabled => @reactivating) %>

Collection date

<%= date_select 'bat', 'collection_date', :disabled => @reactivating %>

Collection age

<%= select_tag("bat[collection_age]", options_for_select([["Juvenile","Juvenile"],["Adult", "Adult"]], @bat.collection_age), :disabled => @reactivating) %>

Collection place

<%= text_field 'bat', 'collection_place', :disabled => @reactivating %>

<% if @bat.vaccination_date %>
	<% show_vaccination_date_select = true %>
<% else %>
  <% show_vaccination_date_select = false %>
<% end %>

<%= render :partial=>'form_vaccination', :locals =>{:bat => @bat, :show_vaccination_date_select=> show_vaccination_date_select, :reactivating=>@reactivating} %>

<% if (@reactivating == true) || (@creating == true) %>

Choose cage

<% if @reactivating %>
(previous cage: <%=h @bat.cage_out_histories[0].cage.name %>)
<% end %>

Cage
Number of bats
Average current weight

<% for cage in Cage.active %>

<%=radio_button :bat, :cage_id, cage.id %>
<%= cage.name %>
<%= cage.bats.length %>
<%= cage.average_bat_weight %>

<% end %>

<% end %>

<%= @leave_date %>

Leave date

<%= date_select 'bat', 'leave_date',  :disabled => @disable_leave_date%>

Leave reason

<%= text_field 'move', 'note',  :disabled => @disable_leave_date%>

<%= error_messages_for 'bat' %>

<% if @deactivating == true %>
<%   @disable_leave_date = false %>
<%   @disable_cage = true %>
<%   @everything_else = '
' %>
<%   @leave_date = '
' %>
<% else %>
<% if @reactivating == true %>
<%   @disable_leave_date = true %>
<%   @disable_cage = false %>
<%   @everything_else = '
' %>
<%   @leave_date = '
' %>
<% else %>
<%   @disable_leave_date = true %>
<%   @disable_cage = false %>
<%   @everything_else = '
' %>
<%   @leave_date = '
' %>
<% end %>
<% end %>

<%= @everything_else %>

Band

<%= text_field 'bat', 'band', :disabled => @reactivating, :maxlength => 10 %>

Species

<%= select_tag("bat[species_id]", options_from_collection_for_select(@species, "id", "name", @bat.species.id), {:disabled => @reactivating}) %>

Gender

<%= select_tag("bat[gender]", options_for_select([["Male","M"],["Female","F"]],@bat.gender), :disabled => @reactivating) %>

Collection date

<%= date_select 'bat', 'collection_date', :disabled => @reactivating %>

Collection age

<%= select_tag("bat[collection_age]", options_for_select([["Juvenile","Juvenile"],["Adult", "Adult"]], @bat.collection_age), :disabled => @reactivating) %>

Collection place

<%= text_field 'bat', 'collection_place', :disabled => @reactivating %>

<% if @bat.vaccination_date %>
	<% show_vaccination_date_select = true %>
<% else %>
  <% show_vaccination_date_select = false %>
<% end %>

<%= render :partial=>'form_vaccination', :locals =>{:bat => @bat, :show_vaccination_date_select=> show_vaccination_date_select, :reactivating=>@reactivating} %>

<% if (@reactivating == true) || (@creating == true) %>

Choose cage

<% if @reactivating %>
(previous cage: <%=h @bat.cage_out_histories[0].cage.name %>)
<% end %>

Cage
Number of bats
Average current weight

<% for cage in Cage.active %>

<%=radio_button :bat, :cage_id, cage.id %>
<%= cage.name %>
<%= cage.bats.length %>
<%= cage.average_bat_weight %>

<% end %>

<% end %>

<%= @leave_date %>

Leave date

<%= date_select 'bat', 'leave_date',  :disabled => @disable_leave_date%>

Leave reason

<%= text_field 'move', 'note',  :disabled => @disable_leave_date%>


Does what it says on the tin.

Does what it says on the tin.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

        <%= javascript_include_tag :defaults %>

        <title>
        <% if @title %>
            <%=@title%> - WhatDoTheyKnow
        <% else %>
            WhatDoTheyKnow - file and explore Freedom of Information (FOI) requests
        <% end %>
        </title>
        <%
            # Angie, just change this to true / false :)
            yucky = true
        %>
        <%= stylesheet_link_tag 'yucky-green', :title => "Yucky Green", :rel => yucky ? "stylesheet" : "alternate stylesheet" %>
        <%= stylesheet_link_tag 'main', :title => "Main", :rel => yucky ? "alternate stylesheet" : "stylesheet"  %>

            WhatDoTheyKnow?
            (<%= link_to "in development", about_url %>)

            Make and explore Freedom of Information requests

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

               <%= text_field_tag 'query', params[:query], { :size => 25, :id => "navigation_search_query" } %>
               <%= submit_tag "Search" %>

        <% end %>

Make request

<%= link_to "View requests", request_list_url(:view => nil) %>

<%= link_to "View authorities", list_public_bodies_url(:tag => 'department') %>

			<% if @user %>

<%=link_to "My requests", user_url(@user) %>

			<% end %>

<%= link_to "About", about_url %>

		<% if not (controller.action_name == 'signin' or controller.action_name == 'signup') %>

			<% if @user %>
				Hello, <%=h(@user.name)%>!
				(<%= link_to "Sign out", signout_url(:r => request.request_uri) %>)
			<% else %>
				Hello! (<%= link_to "Sign in or sign up", signin_url(:r => request.request_uri) %>)
			<% end %>

		<% end %>

            <% if flash[:notice] %>

<%= flash[:notice] %>

            <% end %>
            <% if flash[:error] %>

<%= flash[:error] %>

            <% end %>

            <div id="<%= controller.controller_name + "_" + controller.action_name %>">
            <%= yield :layout %>

        Built by mySociety ... and you.
        Get the source code (is on Rails).
        Dedicated to Chris Lightfoot.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

        <%= javascript_include_tag :defaults %>

        <title>
        <% if @title %>
            <%=@title%> - WhatDoTheyKnow
        <% else %>
            WhatDoTheyKnow - file and explore Freedom of Information (FOI) requests
        <% end %>
        </title>
        <%
            # Angie, just change this to true / false :)
            yucky = true
        %>
        <%= stylesheet_link_tag 'yucky-green', :title => "Yucky Green", :rel => yucky ? "stylesheet" : "alternate stylesheet" %>
        <%= stylesheet_link_tag 'main', :title => "Main", :rel => yucky ? "alternate stylesheet" : "stylesheet"  %>

            WhatDoTheyKnow?
            (<%= link_to "in development", about_url %>)

            Lift the lid on the UK public sector!

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

               <%= text_field_tag 'query', params[:query], { :size => 25, :id => "navigation_search_query" } %>
               <%= submit_tag "Search" %>

        <% end %>

Make request

<%= link_to "View requests", request_list_url(:view => nil) %>

<%= link_to "View authorities", list_public_bodies_url(:tag => 'department') %>

			<% if @user %>

<%=link_to "My requests", user_url(@user) %>

			<% end %>

<%= link_to "About", about_url %>

		<% if not (controller.action_name == 'signin' or controller.action_name == 'signup') %>

			<% if @user %>
				Hello, <%=h(@user.name)%>!
				(<%= link_to "Sign out", signout_url(:r => request.request_uri) %>)
			<% else %>
				Hello! (<%= link_to "Sign in or sign up", signin_url(:r => request.request_uri) %>)
			<% end %>

		<% end %>

            <% if flash[:notice] %>

<%= flash[:notice] %>

            <% end %>
            <% if flash[:error] %>

<%= flash[:error] %>

            <% end %>

            <div id="<%= controller.controller_name + "_" + controller.action_name %>">
            <%= yield :layout %>

        Built by mySociety ... and you.
        Get the source code (is on Rails).
        Dedicated to Chris Lightfoot.


minor ui fix:  in the administrator sidebar of a page, if a user was an administrator for that page, the user icon was overlapping the login name

<% @page.groups.each do |g| -%>
  <%= link_to_group g, :avatar => 'tiny', :style => 'width:10em' %>
<% end -%>
<% @page.users_with_access.each do |u| -%>
  <%= link_to_user u, :avatar => 'tiny' %>
<% end -%>

<% @page.groups.each do |g| -%>
  <%= link_to_group g, :avatar => 'tiny', :style => 'width:10em' %>
<% end -%>
<% @page.users_with_access.each do |u| -%>
  <%= link_to_user u, :avatar => 'tiny', :style => '' %>
<% end -%>


Don't bail out for unscheduled events

Don't bail out for unscheduled events

<% current = []
upcoming = []
past = []

now = Time.now
context_events(logged_in_person).each do |a|
  e = a.event
  if e.end and e.end < now
    past.push a
  elsif e.start and e.start < now
    current.push a
  else
    upcoming.push a
  end
end -%>

My events
    <% if @context -%>
      at <%= @context.fullname %>
    <% end -%>

  <% if current.length > 0 -%>
    <% reset_cycle("agenda_rows") -%>

Events In Progress

      <%= render :partial => 'event', :collection => current.sort { |a,b| a.event.length <=> b.event.length } %>

  <% end -%>

  <% if upcoming.length > 0 -%>
    <% reset_cycle("agenda_rows") -%>

Upcoming events

      <%= render :partial => 'event', :collection => upcoming.sort { |a,b| a.event.start <=> b.event.start } %>

  <% end -%>

  <% if past.length > 0 -%>
    <% reset_cycle("agenda_rows") -%>

Past events

      <%= render :partial => 'event', :collection => past.sort { |a,b| b.event.end <=> a.event.end } %>

  <% end -%>

<% current = []
upcoming = []
past = []

now = Time.now
context_events(logged_in_person).each do |a|
  e = a.event
  if e.end < now
    past.push a
  elsif e.start < now
    current.push a
  else
    upcoming.push a
  end
end -%>

My events
    <% if @context -%>
      at <%= @context.fullname %>
    <% end -%>

  <% if current.length > 0 -%>
    <% reset_cycle("agenda_rows") -%>

Events In Progress

      <%= render :partial => 'event', :collection => current.sort { |a,b| a.event.length <=> b.event.length } %>

  <% end -%>

  <% if upcoming.length > 0 -%>
    <% reset_cycle("agenda_rows") -%>

Upcoming events

      <%= render :partial => 'event', :collection => upcoming.sort { |a,b| a.event.start <=> b.event.start } %>

  <% end -%>

  <% if past.length > 0 -%>
    <% reset_cycle("agenda_rows") -%>

Past events

      <%= render :partial => 'event', :collection => past.sort { |a,b| b.event.end <=> a.event.end } %>

  <% end -%>


Added partialized "add feeding task remote"

Dossier on <%= @cage.name%>

Owner: <%= @cage.user ? @cage.user.name : 'NP' %>

Room: <%= @cage.room.name %>

Bats: <%= @cage.bats.count %>

<% average_bat_weight = @cage.average_bat_weight %>

Average Weight: <%= average_bat_weight %> g

Date Created: <%= nice_date @cage.date_created %>

<% if @cage.date_destroyed != nil %>

Date Destroyed: <%= nice_date @cage.date_destroyed %>

<% end %>

Current Feeding Tasks:

<%= render :partial => 'tasks/tasks_list', :locals =>{:tasks_list => nil, :tasks => @cage.tasks.feeding_tasks, :div_id => 'feeding_tasks', :single_cage_task_list => true, :manage => true} %>

[<%= link_to_remote "Add Feeding Tasks", :url => {:controller => 'tasks', :action => 'remote_new_feed_cage_task', :id => @cage, :div_id => "feeding_tasks"},
                                                          :update => 'add_feeding_task' %>]

[<%= link_to 'Edit multiple feeding tasks', :controller => 'tasks', :action => 'edit_multiple_feeding_tasks', :id => @cage %>]

<% @tasks = @cage.tasks.weighing_tasks %>
Current Weighing Tasks:

<%= render :partial => 'tasks/tasks_list', :locals =>{:tasks_list => nil, :tasks => @cage.tasks.weighing_tasks, :div_id => 'weighing_tasks', :single_cage_task_list => true, :manage => false} %>

[<%= link_to 'Add weighing task', :controller => 'tasks', :action => 'new_weigh_cage_task', :id => @cage %>]

<% if @cage.bats.active.length == 0 %>
No bats are in this cage.
<% else %>
  Current Bats:

  Band
  Last Weight
  Weigh Date
  Date in
  Who
  Why
  <% for bat in @cage.bats %>
    <% cih = bat.cage_in_histories %>
    <% if cih %>
    <%      @date_in = cih[0].date %>
    <%      @sig = cih[0].user.initials %>
    <%      @why = cih[0].note %>
    <% else %>
    <%      @date_in ="" %>
    <%      @sig = "" %>
    <%      @why = "" %>
    <% end %>

    <%= link_to bat.band, :controller => 'bats', :action => 'show', :id => bat %>
    <% if bat.weights.length > 0 %>
          <%=h bat.weights.recent.weight %>
          <%=h nice_date(bat.weights.recent.date) %>
    <% else %>
          N/A
          N/A
    <% end %>
    <%=h nice_date(@date_in) %>
    <%=h @sig %>
    <%=h @why %>

  <% end %>

<% end %>

<% if @cohs.length == 0 %>
No bats were in this cage.
<% else %>
  Past Bats:

  Band
  Date in
  Who
  Date out
  Who
  <% for coh in @cohs %>

    <%=link_to coh.bat.band, :controller => 'bats', :action => 'show', :id => coh.bat %>
    <%=h nice_date(coh.cage_in_history.date) %>
    <%=h coh.cage_in_history.user.initials %>
    <%=h nice_date(coh.date) %>
    <%=h coh.user.initials %>

  <% end %>

<% end %>

<%= link_to 'Edit', :action => 'edit', :id => @cage %> |
<%= link_to 'List Current Cages', :action => 'list' %>

Dossier on <%= @cage.name%>

Owner: <%= @cage.user ? @cage.user.name : 'NP' %>

Room: <%= @cage.room.name %>

Bats: <%= @cage.bats.count %>

<% average_bat_weight = @cage.average_bat_weight %>

Average Weight: <%= average_bat_weight %> g

Date Created: <%= nice_date @cage.date_created %>

<% if @cage.date_destroyed != nil %>

Date Destroyed: <%= nice_date @cage.date_destroyed %>

<% end %>

Current Feeding Tasks:

<%= render :partial => 'tasks/tasks_list', :locals =>{:tasks_list => nil, :tasks => @cage.tasks.feeding_tasks, :div_id => 'feeding_tasks', :single_cage_task_list => true, :manage => true} %>

[<%= link_to 'Add feeding task', :controller => 'tasks', :action => 'new_feed_cage_task', :id => @cage %>]
[<%= link_to 'Edit multiple feeding tasks', :controller => 'tasks', :action => 'edit_multiple_feeding_tasks', :id => @cage %>]

<% @tasks = @cage.tasks.weighing_tasks %>
Current Weighing Tasks:

<%= render :partial => 'tasks/tasks_list', :locals =>{:tasks_list => nil, :tasks => @cage.tasks.weighing_tasks, :div_id => 'weighing_tasks', :single_cage_task_list => true, :manage => false} %>

[<%= link_to 'Add weighing task', :controller => 'tasks', :action => 'new_weigh_cage_task', :id => @cage %>]

<% if @cage.bats.active.length == 0 %>
No bats are in this cage.
<% else %>
  Current Bats:

  Band
  Last Weight
  Weigh Date
  Date in
  Who
  Why
  <% for bat in @cage.bats %>
    <% cih = bat.cage_in_histories %>
    <% if cih %>
    <%      @date_in = cih[0].date %>
    <%      @sig = cih[0].user.initials %>
    <%      @why = cih[0].note %>
    <% else %>
    <%      @date_in ="" %>
    <%      @sig = "" %>
    <%      @why = "" %>
    <% end %>

    <%= link_to bat.band, :controller => 'bats', :action => 'show', :id => bat %>
    <% if bat.weights.length > 0 %>
          <%=h bat.weights.recent.weight %>
          <%=h nice_date(bat.weights.recent.date) %>
    <% else %>
          N/A
          N/A
    <% end %>
    <%=h nice_date(@date_in) %>
    <%=h @sig %>
    <%=h @why %>

  <% end %>

<% end %>

<% if @cohs.length == 0 %>
No bats were in this cage.
<% else %>
  Past Bats:

  Band
  Date in
  Who
  Date out
  Who
  <% for coh in @cohs %>

    <%=link_to coh.bat.band, :controller => 'bats', :action => 'show', :id => coh.bat %>
    <%=h nice_date(coh.cage_in_history.date) %>
    <%=h coh.cage_in_history.user.initials %>
    <%=h nice_date(coh.date) %>
    <%=h coh.user.initials %>

  <% end %>

<% end %>

<%= link_to 'Edit', :action => 'edit', :id => @cage %> |
<%= link_to 'List Current Cages', :action => 'list' %>


Updated cases

Updated cases

<%= link_to "home", :controller => "articles", :action => "home"-%>
<%for page in @pages -%>
   | <%= (not page.target_url or page.target_url == "") ? link_to( page.title.downcase, :controller => "pages", :action => "show", :id => page.id) : link_to(page.title.downcase, page.target_url)-%>
<%end-%> | <%if @current_user-%><%=link_to("logout "+@current_user[:username], {:controller => 'people', :action => 'logout'})-%><%else-%><%=link_to("login", {:controller => 'people', :action => 'login'})-%><%end-%>

<%= link_to "home", :controller => "articles", :action => "home"-%>
<%for page in @pages -%>
   | <%= (not page.target_url or page.target_url == "") ? link_to( page.title.downcase, :controller => "pages", :action => "show", :id => page.id) : link_to(page.title.downcase, page.target_url)-%>
<%end-%> | <%if @current_user-%><%=link_to("Logout "+@current_user[:username], {:controller => 'people', :action => 'logout'})-%><%else-%><%=link_to("Login", {:controller => 'people', :action => 'login'})-%><%end-%>


ActionItem110: removing javascript search

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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <%= design_all_header_tags %>
    <%= stylesheet_link_tag 'common' %>
    <%= stylesheet_link_tag 'help' %>
    <%= stylesheet_link_tag 'menu' %>
    <%= javascript_include_tag 'menu' %>

    <% unless flash[:notice].nil? %>

        <%= flash[:notice] %>
        <%= javascript_tag(visual_effect(:fade, "notice", :duration => 2.0)) %>

    <% end %>

    <%= image_tag 'loading.gif', :id => 'spinner', :style => "display:none; float:right;", :alt => _('Image for Loading...') %>

    <div id="wrap" class='category<%= category_color %>'>
      <div id='noosfero_bar' class='category<%= category_color %>'>
       <div id='top_bar' class='category<%= category_color %>'>

	  Ir para conteúdo
	  <%= accessibility_link  %>

        <% if @category %>
            <%= @category.full_name %>
	<% else @category %>

	  <%= user_options.join(' ') %>

        <% end %>

	  <%= search_box %>

        <div id='navigation_bar' class='category<%= category_color %>'>
          <%= render :file => 'shared/categories_menu' %>

        <% if params[:controller] == 'cms' %>

            <%= yield %>

        <% else %>
          <%= design_display(yield) %>
        <% end %>

        <%= footer %>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <%= design_all_header_tags %>
    <%= stylesheet_link_tag 'common' %>
    <%= stylesheet_link_tag 'help' %>
    <%= stylesheet_link_tag 'menu' %>
    <%= javascript_include_tag 'menu' %>
    <%= javascript_include_tag 'search_box' %>

    <% unless flash[:notice].nil? %>

        <%= flash[:notice] %>
        <%= javascript_tag(visual_effect(:fade, "notice", :duration => 2.0)) %>

    <% end %>

    <%= image_tag 'loading.gif', :id => 'spinner', :style => "display:none; float:right;", :alt => _('Image for Loading...') %>

    <div id="wrap" class='category<%= category_color %>'>
      <div id='noosfero_bar' class='category<%= category_color %>'>
       <div id='top_bar' class='category<%= category_color %>'>

	  Ir para conteúdo
	  <%= accessibility_link  %>

        <% if @category %>
            <%= @category.full_name %>
	<% else @category %>

	  <%= user_options.join(' ') %>

        <% end %>

	  <%= search_box %>

        <div id='navigation_bar' class='category<%= category_color %>'>
          <%= render :file => 'shared/categories_menu' %>

        <% if params[:controller] == 'cms' %>

            <%= yield %>

        <% else %>
          <%= design_display(yield) %>
        <% end %>

        <%= footer %>


Replaced "Other Options" by "Translations"

(ActionItem2121)

<%= _('Profile settings for %s') % profile.name %>

<%= error_messages_for :profile %>

<% labelled_form_for :profile_data, @profile, :html => { :id => 'profile-data', :multipart => true } do |f| %>

  <%= render :partial => partial_for_class(@profile.class), :locals => { :f => f } %>

<%= _('Change picture') %>

    <% f.fields_for :image_builder, @profile.image do |i| %>
      <%= file_field_or_thumbnail(_('Image:'), @profile.image, i) %><%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %>
    <% end %>

<%= _('Privacy options') %>

  <% if profile.person? %>

        <%= _('This profile is:') %>

        <%= radio_button 'profile_data', 'public_profile', 'true' %>
        <%= _('Public') %>

        <%= radio_button 'profile_data', 'public_profile', 'false' %>
        <%= _('Private') %>

       <%= _('Activate Intranet access (restricted area only for me)') %> 	<%= _('Yes') %>	<%= _('Yes') %>

       <%= _('Include my contact in directory of people') %> 	<%= _('Yes') %>	<%= _('Yes') %>

       <%= _('Show my contents to all internet users') %> 	<%= _('Yes') %>	<%= _('No') %>

       <%= _('Show my contents to my friends (person)') %> 	<%= _('Yes') %>	<%= _('Yes') %>

  <% else %>

        <%= _('This profile is:') %>

        <%= radio_button 'profile_data', 'public_profile', 'true' %>
        <%= _('Public') %>

        <%= radio_button 'profile_data', 'public_profile', 'false' %>
        <%= _('Private') %>

       <%= _('Activate Intranet access (restricted area only for members)') %> 	<%= _('Yes') %>	<%= _('Yes') %>

       <%= _('Include this group directory of groups') %> 	<%= _('Yes') %>	<%= _('Yes') %>

       <%= _('Show content of this group to all internet users') %> 	<%= _('Yes') %>	<%= _('No') %>

       <%= _('Show content of this group to members') %> 	<%= _('Yes') %>	<%= _('Yes') %>

  <% end %>

  <%= select_categories(:profile_data, _('Select the categories of your interest'), 2) %>

<%= _('Translations') %>

  <%= labelled_check_box(
    _('Automatic redirect the visitor to the translated article of him language'),
    'profile_data[redirect_l10n]', true, @profile.redirect_l10n
  )%>

  <%=
    @plugins.map(:profile_editor_extras).each do |content|
      content.respond_to?(:call) ? content.call : content
    end.join("\n")
  %>

  <% button_bar do %>
    <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %>
    <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %>
  <% end %>

  <% if user && user.has_permission?('destroy_profile', profile) %>
    <% button_bar(:id => 'delete-profile') do %>
      <%= button(:remove, _('Delete profile'), {:action => :destroy_profile}) %>
    <% end %>
  <% end %>

<% end %>

<%# = generate_form :info, @info, {...} %>

<%= _('Profile settings for %s') % profile.name %>

<%= error_messages_for :profile %>

<% labelled_form_for :profile_data, @profile, :html => { :id => 'profile-data', :multipart => true } do |f| %>

  <%= render :partial => partial_for_class(@profile.class), :locals => { :f => f } %>

<%= _('Change picture') %>

    <% f.fields_for :image_builder, @profile.image do |i| %>
      <%= file_field_or_thumbnail(_('Image:'), @profile.image, i) %><%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %>
    <% end %>

<%= _('Privacy options') %>

  <% if profile.person? %>

        <%= _('This profile is:') %>

        <%= radio_button 'profile_data', 'public_profile', 'true' %>
        <%= _('Public') %>

        <%= radio_button 'profile_data', 'public_profile', 'false' %>
        <%= _('Private') %>

       <%= _('Activate Intranet access (restricted area only for me)') %> 	<%= _('Yes') %>	<%= _('Yes') %>

       <%= _('Include my contact in directory of people') %> 	<%= _('Yes') %>	<%= _('Yes') %>

       <%= _('Show my contents to all internet users') %> 	<%= _('Yes') %>	<%= _('No') %>

       <%= _('Show my contents to my friends (person)') %> 	<%= _('Yes') %>	<%= _('Yes') %>

  <% else %>

        <%= _('This profile is:') %>

        <%= radio_button 'profile_data', 'public_profile', 'true' %>
        <%= _('Public') %>

        <%= radio_button 'profile_data', 'public_profile', 'false' %>
        <%= _('Private') %>

       <%= _('Activate Intranet access (restricted area only for members)') %> 	<%= _('Yes') %>	<%= _('Yes') %>

       <%= _('Include this group directory of groups') %> 	<%= _('Yes') %>	<%= _('Yes') %>

       <%= _('Show content of this group to all internet users') %> 	<%= _('Yes') %>	<%= _('No') %>

       <%= _('Show content of this group to members') %> 	<%= _('Yes') %>	<%= _('Yes') %>

  <% end %>

<%= _('Other options') %>

  <%= labelled_check_box(
    _('Automatic redirect the visitor to the translated article of him language'),
    'profile_data[redirect_l10n]', true, @profile.redirect_l10n
  )%>

  <%= select_categories(:profile_data, _('Select the categories of your interest'), 2) %>

  <% button_bar do %>
    <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %>
    <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %>
  <% end %>

  <% if user && user.has_permission?('destroy_profile', profile) %>
    <% button_bar(:id => 'delete-profile') do %>
      <%= button(:remove, _('Delete profile'), {:action => :destroy_profile}) %>
    <% end %>
  <% end %>

<% end %>

<%# = generate_form :info, @info, {...} %>


Remove old comment.

Remove old comment.

        <%  if not attachments.nil? and attachments.size > 0 %>

                <% attachments.each do |a| %>

                        <%
                            attachment_url = get_attachment_url(:id => incoming_message.info_request_id,
                                    :incoming_message_id => incoming_message.id, :part => a.url_part_number,
                                    :file_name => a.display_filename)
                            attachment_as_html_url = get_attachment_as_html_url(:id => incoming_message.info_request_id,
                                    :incoming_message_id => incoming_message.id, :part => a.url_part_number,
                                    :file_name => a.display_filename)
                        %>
                        <% img_filename = "icon_" + a.content_type.sub('/', '_') + "_large.png"
                        full_filename = File.join(File.dirname(__FILE__), "../../../public/images", img_filename)
                        if File.exist?(full_filename) %>
                            <a href="<%=attachment_url%>"><img class="attachment_image" alt="Attachment" src="/images/<%=img_filename%>">
                        <% else %>
                            <a href="<%=attachment_url%>">
                        <% end %>
                        <%= h a.display_filename %>

                        <%= a.display_size %>
                        <%= link_to "Download", attachment_url %>
                        <% if a.has_body_as_html? %>
                            <%= link_to "View as HTML", attachment_as_html_url %>
                        <% end %>

                <% end %>

        <% end %>

<%= body %>


Move the "back button" to the outside of the article body.

(ActionItem2838)

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

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

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

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

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

<% end %>

<% if @page.display_hits? || @page.license.present? %>

    <% if @page.display_hits? %>

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

    <% end %>

    <% if @page.license.present? %>

        <%= _('Licensed under %s') % (@page.license.url.present? ? link_to(@page.license.name, @page.license.url, :target => '_blank') : @page.license.name) %>

    <% end %>

<% end %>

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

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

<% end %>

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

<% if NOOSFERO_CONF['addthis_enabled'] %>

<%= addthis_image_tag %>

<% end %>

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

<% end %>

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

<%= _('Categories') %>

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

<% end %>

<%= display_source_info(@page) %>

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

  <% end %>

  <% if @page.accept_comments? && @comments.count > 1 %>
    <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "jQuery('#page-comment-form .display-comment-form').first().click();") %>
  <% end %>

    <%= render :partial => 'comment/comment', :collection => @comments %>
    <%= pagination_links @comments, :param_name => 'comment_page' %>

  <% if @page.accept_comments? %>

<%= render :partial => 'comment/comment_form', :locals =>{:comment => Comment.new, :url => {:controller => :comment, :action => :create}, :display_link => true, :cancel_triggers_hide => true}%>

  <% end %>

<%= add_zoom_to_article_images %>

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

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

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

<% if @page.display_hits? || @page.license.present? %>

    <% if @page.display_hits? %>

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

    <% end %>

    <% if @page.license.present? %>

        <%= _('Licensed under %s') % (@page.license.url.present? ? link_to(@page.license.name, @page.license.url, :target => '_blank') : @page.license.name) %>

    <% end %>

<% end %>

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

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

<% end %>

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

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

<% end %>

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

<% if NOOSFERO_CONF['addthis_enabled'] %>

<%= addthis_image_tag %>

<% end %>

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

<% end %>

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

<%= _('Categories') %>

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

<% end %>

<%= display_source_info(@page) %>

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

  <% end %>

  <% if @page.accept_comments? && @comments.count > 1 %>
    <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "jQuery('#page-comment-form .display-comment-form').first().click();") %>
  <% end %>

    <%= render :partial => 'comment/comment', :collection => @comments %>
    <%= pagination_links @comments, :param_name => 'comment_page' %>

  <% if @page.accept_comments? %>

<%= render :partial => 'comment/comment_form', :locals =>{:comment => Comment.new, :url => {:controller => :comment, :action => :create}, :display_link => true, :cancel_triggers_hide => true}%>

  <% end %>

<%= add_zoom_to_article_images %>


Added a link to list all the medical problems from the main medical problem page

<% if @medical_problems[0] != nil  %>

Pick a current medical problem:

<% for medical_problem in @medical_problems %>
      <p<%= link_to medical_problem.description, :action => 'show', :id => medical_problem %>
      Bat: <%= medical_problem.bat.band%>

<% end %>
<% else %>
There are no current medical problems!
<% end %>

<%= link_to 'New Medical Problem', :action => 'new'%> |
<%= link_to 'List All Medical Problems', :action => 'list_all'%>


had dev. hard-coded in the bulk create url, changed to use a relative path to hit the correct site

<%
begin
  remote_controller = active_scaffold_controller_for(column.association.klass)
rescue ActiveScaffold::ControllerNotFound
  remote_controller = nil
end

show_add_existing = !(respond_to?('no_show_existing') && no_show_existing) &&
    (!column.through_association? and options_for_association_count(column.association) > 0)

show_add_new = !column.through_association? and (column.plural_association? or (column.singular_association? and not associated.empty?))
show_add_new = false unless @record.class.authorized_for?(:action => :create)

edit_associated_url = url_for(:action => 'edit_associated', :id => parent_record.id, :association => column.name, :associated_id => '--ID--', :_method => :get, :escape => false)
add_new_url = url_for(:action => 'edit_associated', :id => parent_record.id, :association => column.name, :_method => :get, :escape => false);

return unless show_add_new or show_add_existing

-%>

    <% if show_add_new -%>
    <% add_label = column.plural_association? ? as_('Create Another') : as_('Replace With New') -%>
    <%= button_to_function add_label, "new Ajax.Request(#{add_new_url.to_json}, {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id.to_json})}})" %>
    <% if params[:controller] == 'custom_reports' %>

<%= button_to_function "Bulk Create", "window.open('/report_element_questions/get_element?report_id=#{parent_record.id}&bulk=true','new_window','height=600,width=600,resizable=1,scrollbars=1');return false;" %>

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

    <%= '|' if show_add_new and show_add_existing %>

    <% if show_add_existing -%>
      <% if remote_controller and remote_controller.respond_to? :uses_record_select? and remote_controller.uses_record_select? -%>
        <%= link_to_record_select as_('Add Existing'), remote_controller.controller_path, :onselect => "new Ajax.Request(#{edit_associated_url.to_json}.sub('--ID--', id), {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id})}});" -%>
      <% else -%>
        <% select_options = options_for_select(options_for_association(column.association)) unless column.through_association? -%>
        <%= select_tag 'associated_id', '<option value="">' + as_('- select -') + '</option>' + select_options %>
        <%= button_to_function as_('Add Existing'), "new Ajax.Request(#{edit_associated_url.to_json}.sub('--ID--', Element.previous(this).value), {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id})}})" %>
      <% end -%>
    <% end -%>

Important: Changes in order are now not saved until 'Update' is pressed.

<%
begin
  remote_controller = active_scaffold_controller_for(column.association.klass)
rescue ActiveScaffold::ControllerNotFound
  remote_controller = nil
end

show_add_existing = !(respond_to?('no_show_existing') && no_show_existing) &&
    (!column.through_association? and options_for_association_count(column.association) > 0)

show_add_new = !column.through_association? and (column.plural_association? or (column.singular_association? and not associated.empty?))
show_add_new = false unless @record.class.authorized_for?(:action => :create)

edit_associated_url = url_for(:action => 'edit_associated', :id => parent_record.id, :association => column.name, :associated_id => '--ID--', :_method => :get, :escape => false)
add_new_url = url_for(:action => 'edit_associated', :id => parent_record.id, :association => column.name, :_method => :get, :escape => false);

return unless show_add_new or show_add_existing

-%>

    <% if show_add_new -%>
    <% add_label = column.plural_association? ? as_('Create Another') : as_('Replace With New') -%>
    <%= button_to_function add_label, "new Ajax.Request(#{add_new_url.to_json}, {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id.to_json})}})" %>
    <% if params[:controller] == 'custom_reports' %>

<%= button_to_function "Bulk Create", "window.open('http://dev.spt.campusforchrist.org/report_element_questions/get_element?report_id=#{parent_record.id}&bulk=true','new_window','height=600,width=600,resizable=1,scrollbars=1');return false;" %>

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

    <%= '|' if show_add_new and show_add_existing %>

    <% if show_add_existing -%>
      <% if remote_controller and remote_controller.respond_to? :uses_record_select? and remote_controller.uses_record_select? -%>
        <%= link_to_record_select as_('Add Existing'), remote_controller.controller_path, :onselect => "new Ajax.Request(#{edit_associated_url.to_json}.sub('--ID--', id), {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id})}});" -%>
      <% else -%>
        <% select_options = options_for_select(options_for_association(column.association)) unless column.through_association? -%>
        <%= select_tag 'associated_id', '<option value="">' + as_('- select -') + '</option>' + select_options %>
        <%= button_to_function as_('Add Existing'), "new Ajax.Request(#{edit_associated_url.to_json}.sub('--ID--', Element.previous(this).value), {asynchronous: true, evalScripts: true, onFailure: function(){ActiveScaffold.report_500_response(#{active_scaffold_id})}})" %>
      <% end -%>
    <% end -%>

Important: Changes in order are now not saved until 'Update' is pressed.


Fixed controller name for 'destroy this page' (closes #218) [kevin@sb.org]

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

<% @page_heading = 'Pages' %>

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

Are you sure you want to delete this page?

  <%= start_form_tag :controller => 'pages', :action => 'destroy' %>
  <%= hidden_field "page", "id" %>
  <%= confirm_delete("Delete this page") %>
  <%= end_form_tag %>

<% @page_heading = 'Pages' %>

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

Are you sure you want to delete this page?

  <%= start_form_tag :controller => 'page', :action => 'destroy' %>
  <%= hidden_field "page", "id" %>
  <%= confirm_delete("Delete this page") %>
  <%= end_form_tag %>


unhide plugins tab

unhide plugins tab

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

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title><%= site.title %>: Admin <%= controller.controller_name %></title>
    <%= stylesheet_link_tag 'mephisto/mephisto' %>
    <%= javascript_include_tag 'mephisto/prototype', 'mephisto/effects', 'mephisto/dragdrop', 'mephisto/lowpro', 'mephisto/application' %>

    <%= yield :head %>

<%= link_to 'Website', dispatch_path([]) %>

      <% if admin? -%>

<%= link_to 'Settings', :controller => 'settings' %>

      <% end -%>
			<% if Site.multi_sites_enabled && global_admin? %>

<%= link_to 'Sites', :controller => '/admin/sites' %>

			<% end %>

<%= link_to 'Account', :controller => 'users', :action => 'show', :id => current_user %>

<%= link_to 'Logout', :controller => '/account', :action => 'logout' %>

<%= link_to "#{site.title} — Admin", { :controller => '/admin/overview' }, :title => "#{site.title} admin" %>

        <% if logged_in? -%>

<%= link_to 'Overview',  :controller => '/admin/overview' %>

<%= link_to 'Articles',  :controller => '/admin/articles' %>

<%= link_to 'Assets',    :controller => '/admin/assets' %>

          <% Mephisto::Plugin.tabs.each do |tab| -%>

<%= link_to tab.first, tab.last %>

          <% end -%>

          <% if admin? -%>

<%= link_to 'Sections', :controller => '/admin/sections' %>

<%= link_to 'Design',   :controller => '/admin/design' %>

<%= link_to "Users",    :controller => "users" %>

<%= link_to 'Plugins',  :controller => '/admin/plugins' %>

          <% Mephisto::Plugin.admin_tabs.each do |tab| -%>

<%= link_to tab.first.to_s.tableize.humanize, tab.last %>

          <% end -%>

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

      <%= yield :form if @content_for_form %>

<%= flash[:error] %>

<%= flash[:notice] %>

          <%= yield :action_nav %>

<%= yield %>

          <%= yield :sidebar %>

      <%= '</form>' if @content_for_form %>

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

    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title><%= site.title %>: Admin <%= controller.controller_name %></title>
    <%= stylesheet_link_tag 'mephisto/mephisto' %>
    <%= javascript_include_tag 'mephisto/prototype', 'mephisto/effects', 'mephisto/dragdrop', 'mephisto/lowpro', 'mephisto/application' %>

    <%= yield :head %>

<%= link_to 'Website', dispatch_path([]) %>

      <% if admin? -%>

<%= link_to 'Settings', :controller => 'settings' %>

      <% end -%>
			<% if Site.multi_sites_enabled && global_admin? %>

<%= link_to 'Sites', :controller => '/admin/sites' %>

			<% end %>

<%= link_to 'Account', :controller => 'users', :action => 'show', :id => current_user %>

<%= link_to 'Logout', :controller => '/account', :action => 'logout' %>

<%= link_to "#{site.title} — Admin", { :controller => '/admin/overview' }, :title => "#{site.title} admin" %>

        <% if logged_in? -%>

<%= link_to 'Overview',  :controller => '/admin/overview' %>

<%= link_to 'Articles',  :controller => '/admin/articles' %>

<%= link_to 'Assets',    :controller => '/admin/assets' %>

          <% Mephisto::Plugin.tabs.each do |tab| -%>

<%= link_to tab.first, tab.last %>

          <% end -%>

          <% if admin? -%>

<%= link_to 'Sections', :controller => '/admin/sections' %>

<%= link_to 'Design',   :controller => '/admin/design' %>

<%= link_to "Users",    :controller => "users" %>

					<% if false -%>
						hidden because plugins are in for a change

<%= link_to 'Plugins',  :controller => '/admin/plugins' %>

					<% end -%>
          <% Mephisto::Plugin.admin_tabs.each do |tab| -%>

<%= link_to tab.first.to_s.tableize.humanize, tab.last %>

          <% end -%>

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

      <%= yield :form if @content_for_form %>

<%= flash[:error] %>

<%= flash[:notice] %>

          <%= yield :action_nav %>

<%= yield %>

          <%= yield :sidebar %>

      <%= '</form>' if @content_for_form %>


we shouldn't be caching projects page

we shouldn't be caching projects page

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>CruiseControl.rb<%= @title ? " - " + @title : '' %></title>
  <%= stylesheet_link_tag 'cruisecontrol', :media => 'all' %>
  <%= stylesheet_link_tag 'site', :media => 'all' if File.exists?(RAILS_ROOT + "/public/stylesheets/site.css") %>

  <% if @autorefresh %>
    <meta http-equiv="refresh" content="5">
    <meta http-equiv="cache-control" content="no-cache">
  <% end %>
  <% if @rss_feeds -%>
    <% @rss_feeds.sort.each do |title, url| -%>
      <%= auto_discovery_link_tag :rss, url_path(url), {:title => title} %>
    <% end -%>
  <% end -%>
  <%= javascript_include_tag :defaults %>
</head>

<body>

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

  <div id="content">
    <%= yield %>
  </div>

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

</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>CruiseControl.rb<%= @title ? " - " + @title : '' %></title>
  <%= stylesheet_link_tag 'cruisecontrol', :media => 'all' %>
  <%= stylesheet_link_tag 'site', :media => 'all' if File.exists?(RAILS_ROOT + "/public/stylesheets/site.css") %>

  <% if @autorefresh %>
    <meta http-equiv="refresh" content="5">
  <% end %>
  <% if @rss_feeds -%>
    <% @rss_feeds.sort.each do |title, url| -%>
      <%= auto_discovery_link_tag :rss, url_path(url), {:title => title} %>
    <% end -%>
  <% end -%>
  <%= javascript_include_tag :defaults %>
</head>

<body>

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

  <div id="content">
    <%= yield %>
  </div>

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

</body>
</html>


take out the $year variable

take out the $year variable

<%= @profile.viewer.name %> Cost Items

<%= @profile.project.year %> <%= @profile.project.title %>

  <%- if @eg.cost_item_instructions.present? -%>

<%= @eg.cost_item_instructions %>

  <%- else -%>

yearly cost items show up first in the list, then project cost items which are sorted by project title, then profile cost items which are sorted by description

locked cost items can not be opted in or out of after the application has been submitted.

cost items that apply to this year's projects are in this color.

cost items that apply to a specific project are in this color.

cost items that apply to a specific person are in this color.

  <%- end %>

	  <%= render :partial => 'optin_cost_items/list' %>

  <%- unless @eg.hide_profile_cost_item_link %>
    <%= link_to_remote 'New Cost Item',
      :url => { :controller => 'optin_cost_items', :action => 'create', :profile_id => @profile.id },
      :loading => "$('spt_loading').show();",
      :loaded => "$('spt_loading').hide();"
    %>
  <%- end -%>

		<%= render :partial => 'optin_cost_items/sums' %>

<%= @profile.viewer.name %> Cost Items

<%= @profile.project.year %> <%= @profile.project.title %>

  <%- if @eg.cost_item_instructions.present? -%>

<%= @eg.cost_item_instructions %>

  <%- else -%>

yearly cost items show up first in the list, then project cost items which are sorted by project title, then profile cost items which are sorted by description

locked cost items can not be opted in or out of after the application has been submitted.

cost items that apply to all <%= $year %> projects are in this color.

cost items that apply to a specific project are in this color.

cost items that apply to a specific person are in this color.

  <%- end %>

	  <%= render :partial => 'optin_cost_items/list' %>

  <%- unless @eg.hide_profile_cost_item_link %>
    <%= link_to_remote 'New Cost Item',
      :url => { :controller => 'optin_cost_items', :action => 'create', :profile_id => @profile.id },
      :loading => "$('spt_loading').show();",
      :loaded => "$('spt_loading').hide();"
    %>
  <%- end -%>

		<%= render :partial => 'optin_cost_items/sums' %>


Blockquoted the tables

Blockquoted the tables

Listing General Tasks

<% if @general_tasks.length == 0 %>
No general tasks.
<% else %>

<%= render_partial 'general_tasks_list' %>

<% end %>

<%= link_to 'New General Task', :controller => 'tasks', :action => 'new' %>

Listing Cage Weighing Tasks

<% if @cage_tasks.length == 0 %>
No cage weighing tasks.
<% else %>

    Title
    User(s)
    Frequency
    Last Done

<% for task in @cage_tasks %>
 <%= render_partial 'task_list', nil, 'task' => task, 'manage' => false %>
<% end %>

[Cage weighing tasks are managed from the <%= link_to 'cage pages', :controller => 'cages', :action => 'list' %>]

<% end %>

Listing Medical Tasks

<% if @medical_tasks.length == 0 %>
No medical tasks.
<% else %>

    Title
    User(s)
    Frequency
    Last Done

<% for task in @medical_tasks %>
 <%= render_partial 'task_list', nil, 'task' => task, 'manage' => false %>
<% end %>

[Medical tasks are managed from the <%= link_to 'medical page', :controller => 'medical_problems', :action => 'list_current' %>]

<% end %>

Listing General Tasks

<% if @general_tasks.length == 0 %>
No general tasks.
<% else %>

<%= render_partial 'general_tasks_list' %>

<% end %>

<%= link_to 'New General Task', :controller => 'tasks', :action => 'new' %>

Listing Cage Weighing Tasks

[Cage weighing tasks are managed from the <%= link_to 'cage pages', :controller => 'cages', :action => 'list' %>]

<% if @cage_tasks.length == 0 %>
No cage weighing tasks.
<% else %>

    Title
    User(s)
    Frequency
    Last Done

<% for task in @cage_tasks %>
 <%= render_partial 'task_list', nil, 'task' => task, 'manage' => false %>
<% end %>

<% end %>

Listing Medical Tasks

[Medical tasks are managed from the <%= link_to 'medical page', :controller => 'medical_problems', :action => 'list_current' %>]

<% if @medical_tasks.length == 0 %>
No medical tasks.
<% else %>

    Title
    User(s)
    Frequency
    Last Done

<% for task in @medical_tasks %>
 <%= render_partial 'task_list', nil, 'task' => task, 'manage' => false %>
<% end %>

<% end %>


Fanbox

Fanbox

<% view_cache :ttl => 5.minutes.to_i, :tag => I18n.locale do %>

<%= _("¿Querés información sobre un organismo público?") %>

1

2

3

          <%= link_to _("Hacé click acá para comenzar."), body_index_path %>

<%= _("Elegí el organizmo y formulá tu pregunta") %>

<%= _("El sistema le da formato y envia tu consulta") %>

<%= _("La respuesta llega a vos y queda registrada") %>

	 <%= link_to image_tag("/quesabes-theme/images/periodista.png"), help_requesting_path(:anchor => 'making_requests') %>

Twittear

<%= _("Novedades") %>

                <%
                  position = 0;
                  for item in @blog_items[0..3]:
                    position = position + 1; %>

                  <div class="frontpage-blog-post <%= position.even? ? 'right' : 'left' %>" <%= position == 3 ? '' 'style="clear:left"' : '' %> >
                    <img src="/quesabes-theme/images/posts/<%= item['title'].to_s.gsub(/[^A-Za-z]/,'').downcase %>.jpg" width="278" height="128"/>

                      <a href='<%= "#{blog_url}\##{Time.parse(item['pubDate'][0]).to_i}" %>'><%= h item['title'] %>

<a href="<%= "#{blog_url}\##{Time.parse(item['pubDate'][0]).to_i}" %>"><%= _("Leer más »") %>

                <% end %>

<%= _("Peticiones destacadas") %>

                <% @featured_requests.each do |featured_request| %>
                <%= render :partial => 'track/tracking_request_links',
                      :locals => {
                        :track_thing => TrackThing.create_track_for_request(featured_request),
                        :own_request => featured_request.user == @user,
                        :location => "frontpage"
                      } %>
                <% end %>

<%= _("Buscar un pedido:") %>

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

                 <%= text_field_tag 'query', params[:query], { :size => 60 } %>
                 <%= submit_tag _('Search') %>

              <% end %>

		<%= link_to image_tag("/quesabes-theme/images/rss_subscribe.png"), help_requesting_path(:anchor => 'making_requests') %>

<% end %>


Consistent linking

Consistent linking

Elsewhere the icon is the admin link and the text is the link
to the public page. Let’s be consistent about that.

<% include_destroy = include_destroy || false %>
<% if track_things.empty? %>

      <%=_("No tracked things found.")%>

<% else %>

    <% for track_thing in track_things %>

         <a href="#track_<%=track_thing.id%>" data-toggle="collapse" data-parent="requests">
             <%=track_thing.id%>: <%=track_thing.track_query%> <% if @admin_user.nil? %>tracked by <%=track_thing.tracking_user.email%> (<%=track_thing.tracking_user.name%>)<% end %>

        <div id="track_<%=track_thing.id%>" class="accordion-body collapse">

             <% if @admin_user.nil? %>

                  <%=link_to ''.html_safe, user_admin_url(track_thing.tracking_user) %> <%=link_to h(track_thing.tracking_user.name), main_url(user_url(track_thing.tracking_user)) %>

              <% end %>
              <% if include_destroy %>

                    <% form_tag '../../user/destroy_track', :class => "form form-inline admin-table-form" do %>

                        <%= hidden_field_tag 'track_id', track_thing.id %>
                        <%= submit_tag "Destroy track", :class => "btn btn-warning" %>

                    <% end %>

              <% end %>
              <% TrackThing.content_columns.each do |column| %>

                  <%=column.human_name%>

                  <% if column.type.to_s == 'datetime' %>
                    <%= I18n.l(track_thing.send(column.name), :format => "%e %B %Y %H:%M:%S") %>
                    (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(track_thing.send(column.name))) %>)
                  <% elsif column.name == 'track_medium' and track_thing.track_medium == 'feed' %>
                    <%= link_to track_thing.track_medium, atom_feed_url(:track_id => track_thing.id) %>
                  <% else %>
                    <%= h track_thing.send(column.name)%>
                  <% end %>

              <% end %>

                <%=_("Items sent in last month")%>
                <%= track_thing.track_things_sent_emails.size %>

    <% end %>

<% end %>

<% include_destroy = include_destroy || false %>
<% if track_things.empty? %>

      <%=_("No tracked things found.")%>

<% else %>

    <% for track_thing in track_things %>

         <a href="#track_<%=track_thing.id%>" data-toggle="collapse" data-parent="requests">
             <%=track_thing.id%>: <%=track_thing.track_query%> <% if @admin_user.nil? %>tracked by <%=track_thing.tracking_user.email%> (<%=track_thing.tracking_user.name%>)<% end %>

        <div id="track_<%=track_thing.id%>" class="accordion-body collapse">

             <% if @admin_user.nil? %>

                  <%=link_to ''.html_safe, main_url(user_url(track_thing.tracking_user)) %> <%=link_to h(track_thing.tracking_user.name), user_admin_url(track_thing.tracking_user) %>

              <% end %>
              <% if include_destroy %>

                    <% form_tag '../../user/destroy_track', :class => "form form-inline admin-table-form" do %>

                        <%= hidden_field_tag 'track_id', track_thing.id %>
                        <%= submit_tag "Destroy track", :class => "btn btn-warning" %>

                    <% end %>

              <% end %>
              <% TrackThing.content_columns.each do |column| %>

                  <%=column.human_name%>

                  <% if column.type.to_s == 'datetime' %>
                    <%= I18n.l(track_thing.send(column.name), :format => "%e %B %Y %H:%M:%S") %>
                    (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(track_thing.send(column.name))) %>)
                  <% elsif column.name == 'track_medium' and track_thing.track_medium == 'feed' %>
                    <%= link_to track_thing.track_medium, atom_feed_url(:track_id => track_thing.id) %>
                  <% else %>
                    <%= h track_thing.send(column.name)%>
                  <% end %>

              <% end %>

                <%=_("Items sent in last month")%>
                <%= track_thing.track_things_sent_emails.size %>

    <% end %>

<% end %>


plugins? wtF?

plugins? wtF?

<%= @user.login %>, your account has been activated.

  <%= @url %>

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

  <%= @url %>


Don't show "nothing to do" message when there is something to do.

<% @title = "Summary" %>

Things to do

  <% if @holding_pen_messages.size > 0 %>

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

            <% for message in @holding_pen_messages %>

                  <% if message.get_body_for_quoting.strip.size == 0 %>
                      <%= link_to "(no body)", "request/show_raw_email/" + message.raw_email_id.to_s %>
                  <% else %>
                      <%= link_to excerpt(message.get_body_for_quoting, "", 60), "request/show_raw_email/" + message.raw_email_id.to_s %>
                  <% end %>

                  <%=simple_date(message.sent_at)%>

            <% end %>

  <% end %>

  <% if @error_message_requests.size > 0 %>

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

            <% for @request in @error_message_requests %>

                  <%= link_to(''.html_safe, request_admin_url(@request))%>
                  <%= @request.title %>

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

            <% end %>

  <% end %>

  <% if @attention_requests.size > 0 %>

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

            <% for @request in @attention_requests %>

                  <%= link_to(''.html_safe, request_admin_url(@request))%>
                  <%= link_to(@request.title, request_url(@request)) %>

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

            <% end %>

  <% end %>

  <% if @requires_admin_requests.size > 0 %>

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

            <% for @request in @requires_admin_requests %>

                  <%= link_to(''.html_safe, request_admin_url(@request))%>
                  <%= @request.title %>

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

            <% end %>

  <% end %>

  <% if @blank_contacts.size > 0 %>

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

            <% for @blank_contact in @blank_contacts %>

                  <%= link_to(''.html_safe, public_body_admin_url(@blank_contact))%>
                  <%= public_body_link(@blank_contact)%>

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

            <% end %>

  <% end %>

  <% if @old_unclassified.size > 0 %>

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

            <% for @request in @old_unclassified %>

                    <%= link_to("".html_safe, request_admin_url(@request)) %>
                    <%= request_link(@request) %>

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

            <% end %>

  <% end %>

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

      No pending administration required.

<% end %>

<% @title = "Summary" %>

Things to do

  <% if @holding_pen_messages.size > 0 %>

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

            <% for message in @holding_pen_messages %>

                  <% if message.get_body_for_quoting.strip.size == 0 %>
                      <%= link_to "(no body)", "request/show_raw_email/" + message.raw_email_id.to_s %>
                  <% else %>
                      <%= link_to excerpt(message.get_body_for_quoting, "", 60), "request/show_raw_email/" + message.raw_email_id.to_s %>
                  <% end %>

                  <%=simple_date(message.sent_at)%>

            <% end %>

  <% end %>

  <% if @error_message_requests.size > 0 %>

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

            <% for @request in @error_message_requests %>

                  <%= link_to(''.html_safe, request_admin_url(@request))%>
                  <%= @request.title %>

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

            <% end %>

  <% end %>

  <% if @attention_requests.size > 0 %>

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

            <% for @request in @attention_requests %>

                  <%= link_to(''.html_safe, request_admin_url(@request))%>
                  <%= link_to(@request.title, request_url(@request)) %>

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

            <% end %>

  <% end %>

  <% if @requires_admin_requests.size > 0 %>

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

            <% for @request in @requires_admin_requests %>

                  <%= link_to(''.html_safe, request_admin_url(@request))%>
                  <%= @request.title %>

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

            <% end %>

  <% end %>

  <% if @blank_contacts.size > 0 %>

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

            <% for @blank_contact in @blank_contacts %>

                  <%= link_to(''.html_safe, public_body_admin_url(@blank_contact))%>
                  <%= public_body_link(@blank_contact)%>

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

            <% end %>

  <% end %>

  <% if @old_unclassified.size > 0 %>

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

            <% for @request in @old_unclassified %>

                    <%= link_to("".html_safe, request_admin_url(@request)) %>
                    <%= request_link(@request) %>

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

            <% end %>

  <% end %>

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

      No pending administration required.

<% end %>


Default export format based on selected base layer.

<% form_tag :action => "finish" do %>

Area to Export

    <%= text_field_tag('maxlat', nil, :size => 10, :class => "export_bound") %>

    <%= text_field_tag('minlon', nil, :size => 10, :class => "export_bound") %>
    <%= text_field_tag('maxlon', nil, :size => 10, :class => "export_bound") %>

    <%= text_field_tag('minlat', nil, :size => 10, :class => "export_bound") %>

      Drag a box with control held down to select an area to export

Format to Export

      <%= radio_button_tag("format", "osm") %>OpenStreetMap XML Data

      <%= radio_button_tag("format", "mapnik") %>Mapnik Image

      <%= radio_button_tag("format", "osmarender") %>Osmarender Image

Licence

OpenStreetMap data is licensed under the Creative Commons Attribution-ShareAlike 2.0 license.

    </div

Options

Format <%= select_tag("mapnik_format", options_for_select([["PNG", "png"], ["JPEG", "jpeg"], ["SVG", "svg"], ["PDF", "pdf"], ["Postscript", "ps"]], "png")) %>

Scale 1 : <%= text_field_tag("mapnik_scale", nil, :size => 8) %> (max 1 : )

Options

Format <%= select_tag("osmarender_format", options_for_select([["PNG", "png"], ["JPEG", "jpeg"]], "png")) %>

Zoom <%= select_tag("osmarender_zoom", options_for_select([4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17])) %>

<%= submit_tag "Export", :id => "export_commit" %>

<% end %>


* app/views/page/_form.rhtml: We need to pass the title with a hidden
  field.

git-svn-id: ce004a3be656e491f060c65e2aab8dd2a5477e8b@40 f7b17897-190c-4688-811d-8cf59fb8cab0

<%= error_messages_for 'page' %>

    <% unless logged_in? -%>

      You are not logged in.  That's ok - you can
      edit a page anonymously - but we'd like to encourage you to sign up or log in.

    <% end %>

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

     Title: <%= @page.title -%>
      <%= hidden_field('page', 'title') -%>

     Contents

      <%= text_area 'page', 'content', 'cols' => 80, 'rows' => 30 %>

    Describe your changes

      <%= text_field 'revision', 'comment', :size => 70 %>

<%= error_messages_for 'page' %>

    <% unless logged_in? -%>

      You are not logged in.  That's ok - you can
      edit a page anonymously - but we'd like to encourage you to sign up or log in.

    <% end %>

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

     Title: <%= @page.title -%>

     Contents

      <%= text_area 'page', 'content', 'cols' => 80, 'rows' => 30 %>

    Describe your changes

      <%= text_field 'revision', 'comment', :size => 70 %>


Removed system notices from project view.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

  	<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <% if not @active_project.nil? %>
    <title><%= h @active_project.name %> - <%= h @page_title %> @ <%= h Company.owner.name %></title>
    <% else %>
    <title><%= h @page_title %> @ <%= h Company.owner.name %></title>
    <% end %>

	<%= stylesheet_link_tag 'project_website' %>
	<% if not @additional_stylesheets.nil?
	  @additional_stylesheets.each do |ss| -%>
	  <%= stylesheet_link_tag ss %>
	  <% end %>
	<% end %>
	<%= javascript_include_tag 'prototype.js' %>
	<%= javascript_include_tag 'effects.js' %>
	<%= javascript_include_tag 'dragdrop.js' %>
	<%= javascript_include_tag 'controls.js' %>
	<%= javascript_include_tag 'lowpro.js' %>
	<%= javascript_include_tag 'application.js' %>

<%= link_to (h @active_project.name), :controller => 'project', :action => 'overview', :id => @active_project.id %>

<%= render :partial => 'layouts/user_box', :locals => {:user => @logged_user, :projects => @active_projects} %>

      <%= render :partial => 'layouts/tabs' if not @tabbed_navigation_items.nil? %>

          <%= render :partial => 'layouts/crumbs' if not @bread_crumbs.nil? %>

          <% if AppConfig.search_enabled %>

            <%= form_tag :controller => 'project', :action => 'search' %>

<%
  @search_field_default_value = :search_box_default.l
  #@last_search ||= @search_field_default_value
  @search_field_attrs = {
	 # :onfocus => "if (event.target.value == '#{@search_field_default_value}' event.target.value=''",
	#	:onblur => "if (event.target.value == '#{@search_field_default_value}' event.target.value=''"
  }
%>
                <%= text_field_tag 'search_id', (h @last_search), @search_field_attrs %><button type="submit"><%= "Go" %></button>

            </form>

         <% end %>

<% if flash[:message] %>
          <div id="status_bar" class="<%= flash[:error] ? 'flash_error' : 'flash_success' %>"><%= h flash[:message] %>

<% end %>

<%= h @page_title %>

              <%= render :partial => 'layouts/actions' if not @page_actions.nil? %>

              <%= yield %>

<% if not @content_for_sidebar.nil? %>

<%= render :partial => @content_for_sidebar %>

<% end %>

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

  	<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <% if not @active_project.nil? %>
    <title><%= h @active_project.name %> - <%= h @page_title %> @ <%= h Company.owner.name %></title>
    <% else %>
    <title><%= h @page_title %> @ <%= h Company.owner.name %></title>
    <% end %>

	<%= stylesheet_link_tag 'project_website' %>
	<% if not @additional_stylesheets.nil?
	  @additional_stylesheets.each do |ss| -%>
	  <%= stylesheet_link_tag ss %>
	  <% end %>
	<% end %>
	<%= javascript_include_tag 'prototype.js' %>
	<%= javascript_include_tag 'effects.js' %>
	<%= javascript_include_tag 'dragdrop.js' %>
	<%= javascript_include_tag 'controls.js' %>
	<%= javascript_include_tag 'lowpro.js' %>
	<%= javascript_include_tag 'application.js' %>

<%= render :partial => 'layouts/system_notices', :collection => system_notices %>

<%= link_to (h @active_project.name), :controller => 'project', :action => 'overview', :id => @active_project.id %>

<%= render :partial => 'layouts/user_box', :locals => {:user => @logged_user, :projects => @active_projects} %>

      <%= render :partial => 'layouts/tabs' if not @tabbed_navigation_items.nil? %>

          <%= render :partial => 'layouts/crumbs' if not @bread_crumbs.nil? %>

          <% if AppConfig.search_enabled %>

            <%= form_tag :controller => 'project', :action => 'search' %>

<%
  @search_field_default_value = :search_box_default.l
  #@last_search ||= @search_field_default_value
  @search_field_attrs = {
	 # :onfocus => "if (event.target.value == '#{@search_field_default_value}' event.target.value=''",
	#	:onblur => "if (event.target.value == '#{@search_field_default_value}' event.target.value=''"
  }
%>
                <%= text_field_tag 'search_id', (h @last_search), @search_field_attrs %><button type="submit"><%= "Go" %></button>

            </form>

         <% end %>

<% if flash[:message] %>
          <div id="status_bar" class="<%= flash[:error] ? 'flash_error' : 'flash_success' %>"><%= h flash[:message] %>

<% end %>

<%= h @page_title %>

              <%= render :partial => 'layouts/actions' if not @page_actions.nil? %>

              <%= yield %>

<% if not @content_for_sidebar.nil? %>

<%= render :partial => @content_for_sidebar %>

<% end %>

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


Remove obsolete show_description view

Remove obsolete show_description view

<%= @event.fullname %>

<% if logged_in? and logged_in_person.app_profile.events.include? @event -%>
View this event from the "My Events" page to drop out of the event.
<% end -%>

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

Length: <%= event_length @event %>
<% if @event.locations.size > 0 -%>

Location: <%= @event.locations.collect { |l| h(l.name) }.join(", ") %>
<% end -%>

<% if @event.staff.length > 0 -%>

Event Staff

    <% @event.staff.each do |staff| -%>

<%= staff.name %>

    <% end -%>

<% end -%>

<% if @event.blurb and @event.blurb.length > 0 -%>

Blurb

<%= @event.blurb %>

<% end -%>

<% if @event.description and @event.description.length > 0 -%>

Description

<%= @event.description %>

<% end -%>

Attendees

  <%= pluralize(@event.attendee_count, "attendee") %> total:
  <%= @event.attendee_count "male" %> male,
  <%= @event.attendee_count "female" %> female
  <% if @event.kind_of? LimitedCapacityEvent -%>

<%= pluralize(@event.open_slots, "open slot")%>:
    <%= @event.open_slots "male" %>/<%= @event.max_count "male" %> male,
    <%= @event.open_slots "female" %>/<%= @event.max_count "female" %> female,
    <%= @event.open_slots "neutral" %>/<%= @event.max_count "neutral" %> neutral
  <% end -%>
  <% if @event.has_edit_permissions? logged_in_person -%>

    View this event from the "My Events" page to view/edit the attendee list, or to edit the event.
  <% end -%>


Make it valid HTML.

Make it valid HTML.

<% if @is_owning_user %>
    <% form_for(:incoming_message, @info_request, :url => describe_state_url(:id => @info_request.id)) do |f| %>

What is the status of this request now?

            <%= radio_button "incoming_message", "described_state", "waiting_response", :id => 'waiting_response' + id_suffix %>
            <label for="waiting_response<%=id_suffix%>">I'm still waiting for my information / a rejection (e.g. if the new response was just an acknowledgement)

            <%= radio_button "incoming_message", "described_state", "waiting_clarification", :id => 'waiting_clarification' + id_suffix %>
            <label for="waiting_clarification<%=id_suffix%>">I'm about to clarify my request

            <%= radio_button "incoming_message", "described_state", "not_held", :id => 'not_held' + id_suffix %>
            <label for="not_held<%=id_suffix%>">The authority does not have the information (perhaps they suggest making the request elsewhere)

            <%= radio_button "incoming_message", "described_state", "partially_successful", :id => 'partially_successful' + id_suffix %>
            <label for="partially_successful<%=id_suffix%>">I've received some of the information that I asked for

            <%= radio_button "incoming_message", "described_state", "successful", :id => 'successful' + id_suffix %>
            <label for="successful<%=id_suffix%>">I've received all the information (or equivalents) that I asked for

            <%= radio_button "incoming_message", "described_state", "rejected", :id => 'rejected' + id_suffix %>
            <label for="rejected<%=id_suffix%>">My request has been rejected

           <%= radio_button "incoming_message", "described_state", "requires_admin", :id => 'requires_admin' + id_suffix %>
            <label for="requires_admin<%=id_suffix%>">None of the above - enter quick summary here:
            <%= text_field "incoming_message", 'requires_admin_details', :class => 'requires_admin_details', :id => 'requires_admin_details' + id_suffix, :size => 60 %>

Filling this in helps everyone track the progress of your request.

        <%= hidden_field_tag 'last_info_request_event_id', @last_info_request_event_id, :id => 'last_info_request_event_id' + id_suffix %>
        <%= hidden_field_tag 'submitted_describe_state', 1, :id => 'submitted_describe_state' + id_suffix %>
        <%= submit_tag "Submit status" %> (and we'll advise you on what to do next)

    <% end %>
<% else %>
        We don't know whether the most recent response to this request contains
        information or not
            –
        if you are
            <%= user_link(@info_request.user) %>,
        please
            <%= link_to "sign in as them", signin_url(:r => request.request_uri) %>
        and let everyone know.
<% end %>


Fixing search container class

Fixing search container class

<div id="search-results" class="<%= !multiple_search? ? 'only-one-result-box' : 'multiple-results-boxes' %>">
  <% @order.each do |name| %>
    <% search = @searches[name] %>

    <div class="search-results-<%= name %> search-results-box <%= "search-results-empty" if search[:results].blank? %>">
      <% if !search[:results].blank? %>

        <% if multiple_search? %>

<%= @names[name] %>

          <% if search[:results].total_entries > SearchController::MULTIPLE_SEARCH_LIMIT %>
            <%= link_to(_('see all (%d)') % search[:results].total_entries, params.merge(:action => name), :class => 'see-more' ) %>
          <% end %>
        <% end %>

        <div class="search-results-innerbox search-results-type-<%= name.to_s.singularize %> <%= 'common-profile-list-block' if [:enterprises, :people, :communities].include?(name) %>">

          <% search[:results].each do |hit| %>
            <% partial = partial_for_class(hit.class, params[:display]) %>
            <% variable_name = partial.gsub("#{params[:display]}_", '').to_sym %>
            <%= render :partial => partial, :locals => {variable_name => hit} %>
          <% end %>

      <% else %>
        <% if multiple_search? %>

<%= @names[name] %>

        <% end %>

 <%= _('None') %>

      <% end %>

  <% end %>

  <%= add_zoom_to_images %>

<div id="search-results" class="<%= !multiple_search? ? 'only-one-result-box' : 'multiple-results-boxes' %>">
  <% @order.each do |name| %>
    <% search = @searches[name] %>

    <div class="search-results-<%= name %> search-results-box <%= "search-results-empty" if search[:results].blank? %>">
      <% if !search[:results].blank? %>

        <% if multiple_search? %>

<%= @names[name] %>

          <% if search[:results].total_entries > SearchController::MULTIPLE_SEARCH_LIMIT %>
            <%= link_to(_('see all (%d)') % search[:results].total_entries, params.merge(:action => name), :class => 'see-more' ) %>
          <% end %>
        <% end %>

        <div class="search-results-innerbox search-results-type-<%= name.to_s %> <%= 'common-profile-list-block' if [:enterprises, :people, :communities].include?(name) %>">

          <% search[:results].each do |hit| %>
            <% partial = partial_for_class(hit.class, params[:display]) %>
            <% variable_name = partial.gsub("#{params[:display]}_", '').to_sym %>
            <%= render :partial => partial, :locals => {variable_name => hit} %>
          <% end %>

      <% else %>
        <% if multiple_search? %>

<%= @names[name] %>

        <% end %>

 <%= _('None') %>

      <% end %>

  <% end %>

  <%= add_zoom_to_images %>


Do not cache lang files of jquery-validation

<%= javascript_include_tag :defaults, 'jquery-latest.js', 'jquery.noconflict.js', 'jquery.cycle.all.min.js', 'thickbox.js', 'lightbox', 'jquery-ui-1.8.2.custom.min', 'jquery.scrollTo', 'jquery.form.js', 'jquery.cookie', 'reflection', 'add-and-join', 'jquery.tokeninput', 'report-abuse','colorbox', 'jquery-validation/jquery.validate', :cache => 'cache-general' %>
<% language = FastGettext.locale %>
<%= javascript_include_tag 'jquery-validation/localization/messages_'+language, 'jquery-validation/localization/methods_'+language %>

<% language = FastGettext.locale %>
<%= javascript_include_tag :defaults, 'jquery-latest.js', 'jquery.noconflict.js', 'jquery.cycle.all.min.js', 'thickbox.js', 'lightbox', 'jquery-ui-1.8.2.custom.min', 'jquery.scrollTo', 'jquery.form.js', 'jquery.cookie', 'reflection', 'add-and-join', 'jquery.tokeninput', 'report-abuse','colorbox', 'jquery-validation/jquery.validate', 'jquery-validation/localization/messages_'+language, 'jquery-validation/localization/methods_'+language, :cache => 'cache-general' %>


Moved 'search' menu item after home when user logged in

git-svn-id: fff0e24cb22af42ca7d192cf3063f87aa8e42ffe@1296 3db89d08-1e44-db11-a2a8-0014220fd31b

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

    <title>
      <% unless @page_title == 'index' %><%= h(@page_title) %> -<% end %>
      <%= @project ? h(@project.name) : h(Policy.lookup(:site_name)) %>
    </title>

    <%= stylesheet_link_tag('style') %>
    <%= stylesheet_link_tag('tagging') %>
    <%= stylesheet_link_tag('stickies') %>
    <%= javascript_include_tag(:defaults) %>
    <%= javascript_include_tag(@page_javascript) if @page_javascript %>

    <% if @project and !(pcss = @project.policies.lookup(:project_stylesheet).value).blank? %>
      <%= stylesheet_link_tag(pcss) %>
    <% end %>

    <% if @layout_feed %>
      <% @layout_feed.update(:controller => 'feed', :only_path => false) %>
      <%= auto_discovery_link_tag(:rss,  url_for(@layout_feed.merge(:format => 'rss'))) %>
      <%= auto_discovery_link_tag(:atom, url_for(@layout_feed.merge(:format => 'atom'))) %>
    <% end %>

  <body class="<%= @controller.controller_name %>">

          <% render_rounded_line do %>
            <% if logged_in? %>
              <%= link_to(_('Home'), home_url) %> |
              <%= link_to(_('Search'), search_url) %> |
              <%= link_to(_('%{user_name}\'s Dashboard') % { :user_name => h(current_user.first_name) }, :controller => '/dashboard') %> |

              <% if current_user.is_root? %>
                <%= link_to(_('Admin'), :controller => '/admin') %> |
              <% end %>

              <%= help_link %> |
              <%= link_to_function(_('Logout')) {|p| p << visual_effect(:toggle_slide, :confirm_logout)} %>
            <% else %>
              <%= link_to(_('Home'), home_url) %> |
              <%= link_to(_('Search'), search_url) %> |
              <%= help_link %> |
              <%= link_to(_('Login'), :controller => '/account', :action => 'login') %>
            <% end %>
          <% end %>

          <% if logged_in? %>
            <%= generate_fast_form(:id => 'confirm_logout',
                                   :label => _("Are you sure you want to logout?"),
                                   :button => _('OK'), :cancel => true, :field => :none,
                                   :xhr => false, :url => {:controller => '/account', :action => 'logout'}) %>
          <% end %>

        <% if @project %>

<%= link_to(h(@project.name), project_url(:project => @project)) %>

<%= h(@project.summary) %>

<%= render(:partial => 'layouts/project_menu') %>

        <% else %>

<%= link_to(h(Policy.lookup(:site_name)), home_url) %>

<%= h(Policy.lookup(:site_description)) %>

        <% end %>

          <%= render(:partial => 'layouts/stickies') %>
          <%= yield %>

Powered by <a href="<%= APP_HOME %>"><%= h(APP_NAME) %> from pmade inc.

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

    <title>
      <% unless @page_title == 'index' %><%= h(@page_title) %> -<% end %>
      <%= @project ? h(@project.name) : h(Policy.lookup(:site_name)) %>
    </title>

    <%= stylesheet_link_tag('style') %>
    <%= stylesheet_link_tag('tagging') %>
    <%= stylesheet_link_tag('stickies') %>
    <%= javascript_include_tag(:defaults) %>
    <%= javascript_include_tag(@page_javascript) if @page_javascript %>

    <% if @project and !(pcss = @project.policies.lookup(:project_stylesheet).value).blank? %>
      <%= stylesheet_link_tag(pcss) %>
    <% end %>

    <% if @layout_feed %>
      <% @layout_feed.update(:controller => 'feed', :only_path => false) %>
      <%= auto_discovery_link_tag(:rss,  url_for(@layout_feed.merge(:format => 'rss'))) %>
      <%= auto_discovery_link_tag(:atom, url_for(@layout_feed.merge(:format => 'atom'))) %>
    <% end %>

  <body class="<%= @controller.controller_name %>">

          <% render_rounded_line do %>
            <% if logged_in? %>
              <%= link_to(_('Home'), home_url) %> |
              <%= link_to(_('%{user_name}\'s Dashboard') % { :user_name => h(current_user.first_name) }, :controller => '/dashboard') %> |

              <% if current_user.is_root? %>
                <%= link_to(_('Admin'), :controller => '/admin') %> |
              <% end %>

              <%= link_to(_('Search'), search_url) %> |
              <%= help_link %> |
              <%= link_to_function(_('Logout')) {|p| p << visual_effect(:toggle_slide, :confirm_logout)} %>
            <% else %>
              <%= link_to(_('Home'), home_url) %> |
              <%= link_to(_('Search'), search_url) %> |
              <%= help_link %> |
              <%= link_to(_('Login'), :controller => '/account', :action => 'login') %>
            <% end %>
          <% end %>

          <% if logged_in? %>
            <%= generate_fast_form(:id => 'confirm_logout',
                                   :label => _("Are you sure you want to logout?"),
                                   :button => _('OK'), :cancel => true, :field => :none,
                                   :xhr => false, :url => {:controller => '/account', :action => 'logout'}) %>
          <% end %>

        <% if @project %>

<%= link_to(h(@project.name), project_url(:project => @project)) %>

<%= h(@project.summary) %>

<%= render(:partial => 'layouts/project_menu') %>

        <% else %>

<%= link_to(h(Policy.lookup(:site_name)), home_url) %>

<%= h(Policy.lookup(:site_description)) %>

        <% end %>

          <%= render(:partial => 'layouts/stickies') %>
          <%= yield %>

Powered by <a href="<%= APP_HOME %>"><%= h(APP_NAME) %> from pmade inc.