Make worklog tooltip show on whole header, not just on the title

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

    <%= javascript_include_merged :base %>
    <%= javascript_include_merged :tt %>

    <%= javascript_include_tag "beast" if ['forums', 'posts', 'topics'].include? controller.controller_name %>

    <%= stylesheet_link_merged :tt %>
    <%= stylesheet_link_tag "beast" if ['forums', 'posts', 'topics'].include? controller.controller_name %>
    <%= javascript_include_tag "builder" if ['activities'].include? controller.controller_name %>
    <% if ['activities'].include? controller.controller_name %>
      <%= javascript_include_tag "portal" %>

      <%= javascript_include_tag "flotr" %>
    <% end %>

    <%= stylesheet_link_tag "print", { :media => "print" } %>
    <%= auto_discovery_link_tag(:rss, {:controller => 'feeds', :action => 'rss', :id => current_user.uuid }) %>

    <title><%= controller.controller_name + " / " + controller.action_name %></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<% @internal = Customer.find(:first, :conditions => ["(name = 'Internal' or name = ?) AND company_id = ?", current_user.company.name, current_user.company.id]) %>

<%= image_tag('spinner.gif', :border => 0) %>

              <%= render(:partial => "layouts/menu") %>

              <% form_tag( {:controller => 'search', :action => 'search'}, {:method => 'get'}) do %>

                <% if current_user.seen_welcome.to_i == 0 %>
                  <% if controller.controller_name == "activities" && controller.action_name == 'welcome' %>

<%= link_to "#{_('Tutorial')}", { :controller => 'activities', :action => 'welcome'}, :class => "active"%>

                  <% else %>

<%= link_to "#{_('Tutorial')}", { :controller => 'activities', :action => 'welcome'} %>

                  <% end %>
                <% end %>

                <% if controller.controller_name == "activities" && controller.action_name != 'welcome' %>

<%= link_to "#{_('Overview') }", { :controller => 'activities', :action => 'list'}, :class => "active"%>

<%= link_to_remote _('Add New Widget'), :url => { :controller => 'widgets', :action => 'add'} %>

                <% else %>

<%= link_to "#{_('Overview')}", { :controller => 'activities', :action => 'list'} %>
		<% end %>

                <% if controller.controller_name == "tasks" && !['timeline', 'new'].include?(controller.action_name) %>

<%= link_to "#{_('Browse')}", { :controller => 'views', :action => 'browse'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('Browse')}", :controller => 'views', :action => 'browse' %>
                <% end %>

<%= link_to "#{_('Open Tasks')}", :controller => 'views', :action => 'all_tasks'%>

<%= link_to _('My Open Tasks'), :controller => 'views', :action => 'my_tasks'%>

<%= link_to _('My In Progress Tasks'), :controller => 'views', :action => 'my_in_progress_tasks'%>

<%= link_to _('Unassigned Tasks'), :controller => 'views', :action => 'unassigned_tasks'%>

                    <% project_ids = current_project_ids %>
                    <% client_ids = current_projects.collect(&:customer_id).join(',')
                       client_ids = "0" if client_ids.nil? || client_ids.empty?

                       views = View.find(:all, :conditions => ["company_id = ? AND (user_id = ? or shared = 1) AND (filter_customer_id = 0 OR filter_customer_id IS NULL OR filter_customer_id IN (#{client_ids})) AND (filter_project_id = 0 OR filter_project_id IS NULL OR filter_project_id IN (#{project_ids}))", current_user.company_id, current_user.id], :order => "shared, name")
                    for view in views %>

<%= link_to(view.name, { :controller => 'views', :action => 'select', :id => view }) %><%= link_to("[#{_('Edit')}]", {:controller => 'views', :action => 'edit', :id => view}) if view.user_id == current_user.id %><%= "[#{_('Shared')}]" if view.user_id != current_user.id %>

		    <% end %>

<%= link_to "[#{_('New View')}]",  :controller => 'views', :action => 'new' %>

                <% if current_user.option_tracktime.to_i == 1%>
                  <% if controller.controller_name == "timeline" && controller.action_name == "list" %>

<%= link_to "#{_('Timeline')}", { :controller => 'timeline', :action => 'list'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Timeline')}", :controller => 'timeline', :action => 'list' %>

                  <% end %>
                <% end %>

                <% if controller.controller_name == "schedule"  %>

<%= link_to "#{_('Schedule')}", {:controller => 'schedule', :action => 'list'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('Schedule')}", :controller => 'schedule', :action => 'list' %>
                <% end %>

<%= link_to "#{_('Plan / GANTT')}", :controller => 'schedule', :action => 'gantt'%>

                <% if current_user.option_tracktime.to_i == 1 && current_user.can_any?(current_user.projects, 'report') %>
                  <% if controller.controller_name == "reports"  %>

<%= link_to "#{_('Reports')}", {:controller => 'reports', :action => 'list'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Reports')}", :controller => 'reports', :action => 'list' %>

                  <% end %>
                <% end %>

	        <% if current_user.company.show_wiki? %>
		  <% if controller.controller_name == "wiki"  %>

<%= link_to "#{_('Wiki')}", {:controller => 'wiki', :action => 'show', :id => nil}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Wiki')}", :controller => 'wiki', :action => 'show' %>

                  <% end %>
	        <% end %>

	        <% if current_user.company.show_chat? %>
                  <% if controller.controller_name == "shout"  %>

<%= link_to "#{_('Chat')}", {:controller => 'shout', :action => 'list'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Chat')}", :controller => 'shout', :action => 'list' %>

                  <% end %>
		<% end %>

	        <% if current_user.company.show_forum? %>
                  <% if ['forums', 'posts', 'topics'].include? controller.controller_name  %>

<%= link_to "#{_('Forums')}", {:controller => 'forums', :action => 'index'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Forums')}", :controller => 'forums', :action => 'index' %>

                  <% end %>
                <% end %>

                <% if controller.controller_name == "project_files"  %>

<%= link_to "#{_('Files')}", {:controller => 'project_files', :action => 'list'}, :class => "active" %>

                <% else %>

<%= link_to "#{_('Files')}", :controller => 'project_files', :action => 'list' %>

                <% end %>

                <% if controller.controller_name == "projects" %>

<%= link_to "#{_('Projects')}", {:controller => 'projects', :action => 'list'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('Projects')}", {:controller => 'projects', :action => 'list'} %>
                <% end %>

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

                <% if controller.controller_name == "tasks" && controller.action_name == 'new'  %>

<%= link_to "#{_('New Task') + image_tag('tick.png',  :border => 0, :height => 16, :style => "margin-top:-2px;")}", {:controller => 'tasks', :action => 'new'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('New Task') + image_tag('tick.png',  :border => 0, :height => 16, :style => "margin-top:-2px;")}", {:controller => 'tasks', :action => 'new'} %>
                <% end %>

<%= link_to "#{_('Log Out')}", { :controller => 'login', :action => 'logout'}, :class => "right" %>

                <% if controller.controller_name == "users" && controller.action_name == "edit_preferences" %>

<%= link_to "#{_('Preferences')}", { :controller => 'users', :action => 'edit_preferences'}, :class => "right active"%>
                <% else %>

<%= link_to "#{_('Preferences')}", { :controller => 'users', :action => 'edit_preferences'}, :class => "right" %>
                <% end %>
                <% if current_user.admin > 0 %>

<%= link_to _('Company Settings'), :controller => 'companies', :action => 'edit', :id => current_user.company_id %>

                <% end %>

                <% if current_user.admin > 0 %>

                <% if current_user.option_externalclients.to_i == 1%>
                <% if controller.controller_name == "customers" %>

<%= link_to "#{_('Clients')}", { :controller => 'customers', :action => 'list'}, :class => "active"%>

                  <% else %>

<%= link_to "#{_('Clients')}", { :controller => 'customers', :action => 'list'}, :class => "right" %>

                <% end %>
                <% end %>

                <% if controller.controller_name == "users" && controller.action_name != "edit_preferences" %>

<%= link_to "#{_('Users')}", { :controller => 'users', :action => 'list'}, :class => "right active"%>

                <% else %>

<%= link_to "#{_('Users')}", { :controller => 'users', :action => 'list'}, :class => "right" %>

                <% end %>

                <% end %>

<%= text_field_tag 'query', _('Search'), {:size => 10, :style => "font-size:9px;", :class => 'optional', :onfocus => "if($('query').value == '#{_('Search')}') {$('query').value = ''; $('query').removeClassName('optional');};"  }%>

                <% end %>

        <% if current_user.respond_to?(:seen_news_id)%>
          <% news = NewsItem.find(:first, :order => "created_at desc", :conditions => ["id > ?", current_user.seen_news_id ]) %>
          <% unless news.nil? %>

[<%= tz.utc_to_local(news.created_at).strftime("#{current_user.time_format} #{current_user.date_format}") %>]	<%= news.body %>
                <%= link_to_remote "[#{_('Hide')}]", :url => { :controller => 'users', :action => 'update_seen_news', :id => news.id },
                :success => visual_effect(:fade, "news", :duration => 0.5) %>

          <% end %>
          <% end %>

          <div id="flash" <%="style=\"display:none\"" unless flash['notice']%>>

<%= flash['notice'] %>
	[<%=_ 'Hide'%>]

          <%= @content_for_layout %>

          <td align="right" valign="top" style="width:15%;<%= "display:none;" if session[:collapse_menu].to_i > 0 %>" id="left_menu">

                <td align="left" class="page_header tooltip" colspan="2" width="100%" title="<%= _'Custom saved filters showing a subset of your tasks'%>">
<%=_ 'Views' %>

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

<%= link_to "#{_('Open Tasks')}", :controller => 'views', :action => 'all_tasks'%>

<%= link_to _('My Open Tasks'), :controller => 'views', :action => 'my_tasks'%>

<%= link_to _('My In Progress Tasks'), :controller => 'views', :action => 'my_in_progress_tasks'%>

<%= link_to _('Unassigned Tasks'), :controller => 'views', :action => 'unassigned_tasks'%>

                <% project_ids = current_project_ids %>
                <% client_ids = current_projects.collect(&:customer_id).join(',')
                   client_ids = "0" if client_ids.nil? || client_ids.empty?

                   views = View.find(:all, :conditions => ["company_id = ? AND (user_id = ? or shared = 1) AND (filter_customer_id = 0 OR filter_customer_id IS NULL OR filter_customer_id IN (#{client_ids})) AND (filter_project_id = 0 OR filter_project_id IS NULL OR filter_project_id IN (#{project_ids}))", current_user.company_id, current_user.id], :order => "shared, name")
                   for view in views %>

<%= link_to view.name, :controller => 'views', :action => 'select', :id => view %>	<%= link_to _('Edit'), :controller => 'views', :action => 'edit', :id => view if view.user_id == current_user.id %><%= "[#{_('Shared')}]" if view.user_id != current_user.id %>

                   <% end %>

		   <div <%= "style=\"display:none;\"" if @current_sheet.nil? || controller.action_name == "stop_work" %> id="work-log">

		           <div class="tooltip" title="<%= _'Text entered will be saved automatically to your current work notes.'%>"><%= _'Work Log' %>

				  <form method="post" onsubmit="return false;" id="worklog_form">
		           <textarea name="worklog[body]" id="worklog_body" style="padding:0;margin-top:0.5em;margin-bottom:0.3em;width:100%;" rows="4"><%= @current_sheet.body if @current_sheet%></textarea>
				  </form>

                  <td align=left class="page_header tooltip" width="100%" colspan="2" title="<%= _'Easy access to commonly needed information.'%>">

<%=_ 'Notes'%>

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

          <% for page in current_pages %>

                  <%= link_to "#{page.name} / #{page.project.name}", { :controller => 'pages', :action => 'show', :id => page} %> (<%=_('%s ago', time_ago_in_words( page.updated_at, false ) )%>)

          <% end %>

  <% if current_user.company.show_messaging %>

	    <% current_user.chats.each do |@chat|
	      @user = @chat.target
            %>
	      <%= render :partial => 'shout/chat_user' if @chat.active >= 0%>
	      <% if @chat.active == 1 %>

	      <% end %>
	    <% end %>

<%= _'Loading'%>...

<%= _('Online')%> (<%= online_users %>)

Clocking IT v0.99.3<% if current_user.locale != 'en_US' %> - <%= _'Help Translate'%><% end %>
<%=_ 'Feedback? Suggestions? Ideas? Bugs?'%><%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

  <% else %>

Clocking IT v0.99.3<% if current_user.locale != 'en_US' %> - <%= _'Help Translate'%><% end %>
<%=_ 'Feedback? Suggestions? Ideas? Bugs?'%><%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

  <% end %>

<%= periodically_call_remote(:url => { :controller => 'tasks', :action => 'update_sheet_info' }, :frequency => 90 ) -%>

<%= flash_plugin(session[:channels]) %>

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

    <%= javascript_include_merged :base %>
    <%= javascript_include_merged :tt %>

    <%= javascript_include_tag "beast" if ['forums', 'posts', 'topics'].include? controller.controller_name %>

    <%= stylesheet_link_merged :tt %>
    <%= stylesheet_link_tag "beast" if ['forums', 'posts', 'topics'].include? controller.controller_name %>
    <%= javascript_include_tag "builder" if ['activities'].include? controller.controller_name %>
    <% if ['activities'].include? controller.controller_name %>
      <%= javascript_include_tag "portal" %>

      <%= javascript_include_tag "flotr" %>
    <% end %>

    <%= stylesheet_link_tag "print", { :media => "print" } %>
    <%= auto_discovery_link_tag(:rss, {:controller => 'feeds', :action => 'rss', :id => current_user.uuid }) %>

    <title><%= controller.controller_name + " / " + controller.action_name %></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<% @internal = Customer.find(:first, :conditions => ["(name = 'Internal' or name = ?) AND company_id = ?", current_user.company.name, current_user.company.id]) %>

<%= image_tag('spinner.gif', :border => 0) %>

              <%= render(:partial => "layouts/menu") %>

              <% form_tag( {:controller => 'search', :action => 'search'}, {:method => 'get'}) do %>

                <% if current_user.seen_welcome.to_i == 0 %>
                  <% if controller.controller_name == "activities" && controller.action_name == 'welcome' %>

<%= link_to "#{_('Tutorial')}", { :controller => 'activities', :action => 'welcome'}, :class => "active"%>

                  <% else %>

<%= link_to "#{_('Tutorial')}", { :controller => 'activities', :action => 'welcome'} %>

                  <% end %>
                <% end %>

                <% if controller.controller_name == "activities" && controller.action_name != 'welcome' %>

<%= link_to "#{_('Overview') }", { :controller => 'activities', :action => 'list'}, :class => "active"%>

<%= link_to_remote _('Add New Widget'), :url => { :controller => 'widgets', :action => 'add'} %>

                <% else %>

<%= link_to "#{_('Overview')}", { :controller => 'activities', :action => 'list'} %>
		<% end %>

                <% if controller.controller_name == "tasks" && !['timeline', 'new'].include?(controller.action_name) %>

<%= link_to "#{_('Browse')}", { :controller => 'views', :action => 'browse'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('Browse')}", :controller => 'views', :action => 'browse' %>
                <% end %>

<%= link_to "#{_('Open Tasks')}", :controller => 'views', :action => 'all_tasks'%>

<%= link_to _('My Open Tasks'), :controller => 'views', :action => 'my_tasks'%>

<%= link_to _('My In Progress Tasks'), :controller => 'views', :action => 'my_in_progress_tasks'%>

<%= link_to _('Unassigned Tasks'), :controller => 'views', :action => 'unassigned_tasks'%>

                    <% project_ids = current_project_ids %>
                    <% client_ids = current_projects.collect(&:customer_id).join(',')
                       client_ids = "0" if client_ids.nil? || client_ids.empty?

                       views = View.find(:all, :conditions => ["company_id = ? AND (user_id = ? or shared = 1) AND (filter_customer_id = 0 OR filter_customer_id IS NULL OR filter_customer_id IN (#{client_ids})) AND (filter_project_id = 0 OR filter_project_id IS NULL OR filter_project_id IN (#{project_ids}))", current_user.company_id, current_user.id], :order => "shared, name")
                    for view in views %>

<%= link_to(view.name, { :controller => 'views', :action => 'select', :id => view }) %><%= link_to("[#{_('Edit')}]", {:controller => 'views', :action => 'edit', :id => view}) if view.user_id == current_user.id %><%= "[#{_('Shared')}]" if view.user_id != current_user.id %>

		    <% end %>

<%= link_to "[#{_('New View')}]",  :controller => 'views', :action => 'new' %>

                <% if current_user.option_tracktime.to_i == 1%>
                  <% if controller.controller_name == "timeline" && controller.action_name == "list" %>

<%= link_to "#{_('Timeline')}", { :controller => 'timeline', :action => 'list'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Timeline')}", :controller => 'timeline', :action => 'list' %>

                  <% end %>
                <% end %>

                <% if controller.controller_name == "schedule"  %>

<%= link_to "#{_('Schedule')}", {:controller => 'schedule', :action => 'list'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('Schedule')}", :controller => 'schedule', :action => 'list' %>
                <% end %>

<%= link_to "#{_('Plan / GANTT')}", :controller => 'schedule', :action => 'gantt'%>

                <% if current_user.option_tracktime.to_i == 1 && current_user.can_any?(current_user.projects, 'report') %>
                  <% if controller.controller_name == "reports"  %>

<%= link_to "#{_('Reports')}", {:controller => 'reports', :action => 'list'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Reports')}", :controller => 'reports', :action => 'list' %>

                  <% end %>
                <% end %>

	        <% if current_user.company.show_wiki? %>
		  <% if controller.controller_name == "wiki"  %>

<%= link_to "#{_('Wiki')}", {:controller => 'wiki', :action => 'show', :id => nil}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Wiki')}", :controller => 'wiki', :action => 'show' %>

                  <% end %>
	        <% end %>

	        <% if current_user.company.show_chat? %>
                  <% if controller.controller_name == "shout"  %>

<%= link_to "#{_('Chat')}", {:controller => 'shout', :action => 'list'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Chat')}", :controller => 'shout', :action => 'list' %>

                  <% end %>
		<% end %>

	        <% if current_user.company.show_forum? %>
                  <% if ['forums', 'posts', 'topics'].include? controller.controller_name  %>

<%= link_to "#{_('Forums')}", {:controller => 'forums', :action => 'index'}, :class => "active" %>

                  <% else %>

<%= link_to "#{_('Forums')}", :controller => 'forums', :action => 'index' %>

                  <% end %>
                <% end %>

                <% if controller.controller_name == "project_files"  %>

<%= link_to "#{_('Files')}", {:controller => 'project_files', :action => 'list'}, :class => "active" %>

                <% else %>

<%= link_to "#{_('Files')}", :controller => 'project_files', :action => 'list' %>

                <% end %>

                <% if controller.controller_name == "projects" %>

<%= link_to "#{_('Projects')}", {:controller => 'projects', :action => 'list'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('Projects')}", {:controller => 'projects', :action => 'list'} %>
                <% end %>

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

                <% if controller.controller_name == "tasks" && controller.action_name == 'new'  %>

<%= link_to "#{_('New Task') + image_tag('tick.png',  :border => 0, :height => 16, :style => "margin-top:-2px;")}", {:controller => 'tasks', :action => 'new'}, :class => "active" %>
                <% else %>

<%= link_to "#{_('New Task') + image_tag('tick.png',  :border => 0, :height => 16, :style => "margin-top:-2px;")}", {:controller => 'tasks', :action => 'new'} %>
                <% end %>

<%= link_to "#{_('Log Out')}", { :controller => 'login', :action => 'logout'}, :class => "right" %>

                <% if controller.controller_name == "users" && controller.action_name == "edit_preferences" %>

<%= link_to "#{_('Preferences')}", { :controller => 'users', :action => 'edit_preferences'}, :class => "right active"%>
                <% else %>

<%= link_to "#{_('Preferences')}", { :controller => 'users', :action => 'edit_preferences'}, :class => "right" %>
                <% end %>
                <% if current_user.admin > 0 %>

<%= link_to _('Company Settings'), :controller => 'companies', :action => 'edit', :id => current_user.company_id %>

                <% end %>

                <% if current_user.admin > 0 %>

                <% if current_user.option_externalclients.to_i == 1%>
                <% if controller.controller_name == "customers" %>

<%= link_to "#{_('Clients')}", { :controller => 'customers', :action => 'list'}, :class => "active"%>

                  <% else %>

<%= link_to "#{_('Clients')}", { :controller => 'customers', :action => 'list'}, :class => "right" %>

                <% end %>
                <% end %>

                <% if controller.controller_name == "users" && controller.action_name != "edit_preferences" %>

<%= link_to "#{_('Users')}", { :controller => 'users', :action => 'list'}, :class => "right active"%>

                <% else %>

<%= link_to "#{_('Users')}", { :controller => 'users', :action => 'list'}, :class => "right" %>

                <% end %>

                <% end %>

<%= text_field_tag 'query', _('Search'), {:size => 10, :style => "font-size:9px;", :class => 'optional', :onfocus => "if($('query').value == '#{_('Search')}') {$('query').value = ''; $('query').removeClassName('optional');};"  }%>

                <% end %>

        <% if current_user.respond_to?(:seen_news_id)%>
          <% news = NewsItem.find(:first, :order => "created_at desc", :conditions => ["id > ?", current_user.seen_news_id ]) %>
          <% unless news.nil? %>

[<%= tz.utc_to_local(news.created_at).strftime("#{current_user.time_format} #{current_user.date_format}") %>]	<%= news.body %>
                <%= link_to_remote "[#{_('Hide')}]", :url => { :controller => 'users', :action => 'update_seen_news', :id => news.id },
                :success => visual_effect(:fade, "news", :duration => 0.5) %>

          <% end %>
          <% end %>

          <div id="flash" <%="style=\"display:none\"" unless flash['notice']%>>

<%= flash['notice'] %>
	[<%=_ 'Hide'%>]

          <%= @content_for_layout %>

          <td align="right" valign="top" style="width:15%;<%= "display:none;" if session[:collapse_menu].to_i > 0 %>" id="left_menu">

                <td align="left" class="page_header tooltip" colspan="2" width="100%" title="<%= _'Custom saved filters showing a subset of your tasks'%>">
<%=_ 'Views' %>

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

<%= link_to "#{_('Open Tasks')}", :controller => 'views', :action => 'all_tasks'%>

<%= link_to _('My Open Tasks'), :controller => 'views', :action => 'my_tasks'%>

<%= link_to _('My In Progress Tasks'), :controller => 'views', :action => 'my_in_progress_tasks'%>

<%= link_to _('Unassigned Tasks'), :controller => 'views', :action => 'unassigned_tasks'%>

                <% project_ids = current_project_ids %>
                <% client_ids = current_projects.collect(&:customer_id).join(',')
                   client_ids = "0" if client_ids.nil? || client_ids.empty?

                   views = View.find(:all, :conditions => ["company_id = ? AND (user_id = ? or shared = 1) AND (filter_customer_id = 0 OR filter_customer_id IS NULL OR filter_customer_id IN (#{client_ids})) AND (filter_project_id = 0 OR filter_project_id IS NULL OR filter_project_id IN (#{project_ids}))", current_user.company_id, current_user.id], :order => "shared, name")
                   for view in views %>

<%= link_to view.name, :controller => 'views', :action => 'select', :id => view %>	<%= link_to _('Edit'), :controller => 'views', :action => 'edit', :id => view if view.user_id == current_user.id %><%= "[#{_('Shared')}]" if view.user_id != current_user.id %>

                   <% end %>

		   <div <%= "style=\"display:none;\"" if @current_sheet.nil? || controller.action_name == "stop_work" %> id="work-log">

		           <div style="float: left;" class="tooltip" title="<%= _'Text entered will be saved automatically to your current work notes.'%>"><%= _'Work Log' %>

				  <form method="post" onsubmit="return false;" id="worklog_form">
		           <textarea name="worklog[body]" id="worklog_body" style="padding:0;margin-top:0.5em;margin-bottom:0.3em;width:100%;" rows="4"><%= @current_sheet.body if @current_sheet%></textarea>
				  </form>

                  <td align=left class="page_header tooltip" width="100%" colspan="2" title="<%= _'Easy access to commonly needed information.'%>">

<%=_ 'Notes'%>

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

          <% for page in current_pages %>

                  <%= link_to "#{page.name} / #{page.project.name}", { :controller => 'pages', :action => 'show', :id => page} %> (<%=_('%s ago', time_ago_in_words( page.updated_at, false ) )%>)

          <% end %>

  <% if current_user.company.show_messaging %>

	    <% current_user.chats.each do |@chat|
	      @user = @chat.target
            %>
	      <%= render :partial => 'shout/chat_user' if @chat.active >= 0%>
	      <% if @chat.active == 1 %>

	      <% end %>
	    <% end %>

<%= _'Loading'%>...

<%= _('Online')%> (<%= online_users %>)

Clocking IT v0.99.3<% if current_user.locale != 'en_US' %> - <%= _'Help Translate'%><% end %>
<%=_ 'Feedback? Suggestions? Ideas? Bugs?'%><%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

  <% else %>

Clocking IT v0.99.3<% if current_user.locale != 'en_US' %> - <%= _'Help Translate'%><% end %>
<%=_ 'Feedback? Suggestions? Ideas? Bugs?'%><%= link_to "[Admin]", :controller => "admin", :action => "index" if current_user.admin == 10 %>

  <% end %>

<%= periodically_call_remote(:url => { :controller => 'tasks', :action => 'update_sheet_info' }, :frequency => 90 ) -%>

<%= flash_plugin(session[:channels]) %>


Added Google Analytics

Added Google Analytics

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

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

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

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

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

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

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

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

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

								Observations:

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

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

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

								Species Lists:

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

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

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

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

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

                                <%= link_to('Contributors', :controller => 'observer',
                                            :action => 'users_by_contribution') %>

                                <%= link_to('Site Stats', :controller => 'observer',
                                            :action => 'show_site_stats') %>

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

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

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

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

								  <%= link_to('Comments for You',
								                        :controller => 'observer',
								                        :action => 'show_comments_for_user',
								                        :id => session['user']) %>

								  <%= link_to('Your Observations',
								                        :controller => 'observer',
								                        :action => 'show_user_observations',
								                        :id => session['user']) %>

                                  <%= link_to('Your Summary',
                                                        :controller => 'observer',
                                                        :action => 'show_user',
                                                        :id => session['user']) %>

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

								  Join Mailing List

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

										Admin:

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

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

									<% end %>
								<% end %>

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

									Powered by:

									Ruby on Rails

									Preferred browser:

									FireFox

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

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


Don't barf if events have disappeared

Don't barf if events have disappeared

<%= error_messages_for :questionnaire %>
<%= javascript_include_tag "layout.js" %>

<%= render :partial => "toolbar" %>

    Pages

      <%= render :partial => "pagelist", :locals => {:questionnaire => @questionnaire} %>
      <button onClick="createPage();">Create New Page</button>


working hours edit: clear ending time if running checkbox is activated and vice versa

<%= error_messages_for 'working_hours' %>

<%= f.hidden_field 'user_id' %>

<%= f.text_field :workday, :size => 10 %><%= calendar_for('working_hours_workday') %>

<%= l(:field_project) %>
<%= f.collection_select :project_id, User.current.projects, :id, :name, {:include_blank => false} %>

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

<%= observe_field 'working_hours_project_id', :update => 'issues_list', :url => {:action => 'update_edit_issues'}, :with => "'change_project_id=' + encodeURIComponent(value)" %>

<%= radio_button_tag("subform", "Timestamps", true, "onclick"=>"Element.hide('duration');Element.show('timestamps')") %> <%= l(:label_timestamps) %>
<%= radio_button_tag("subform", "Duration", false, "onclick"=>"Element.hide('timestamps');Element.show('duration')") %> <%= l(:label_duration) %>

<%= f.text_field :starting, :size => 25 %>

<%= f.text_field 'break', "size" => 5  %>

  <%= f.text_field :ending, :size => 25, :onkeyup => "updateRunning(this.form)", :onchange => "updateRunning(this.form)" %>
  <%= l(:label_running) %><%= check_box_tag 'running', "1", @working_hours.ending.nil?, :onclick => "updateEnding(this.form)" %>

<%= javascript_tag "function updateRunning(form)
{
  form.running.checked = (form.working_hours_ending.value == '');
}

function updateEnding(form){
  if (form.running.checked)
  {
    form.working_hours_ending.value = '';
  }
  else {
    form.working_hours_ending.value = '#{@working_hours.ending.nil? ? '' : @working_hours.ending.to_formatted_s(:db)}';
  }
}" %>

Hours
  <%= text_field_tag 'duration', @duration, "size" => 5  %>

<%= f.text_area 'comments', "cols" => 40, "rows" => 3  %>

<%= error_messages_for 'working_hours' %>

<%= f.hidden_field 'user_id' %>

<%= f.text_field :workday, :size => 10 %><%= calendar_for('working_hours_workday') %>

<%= l(:field_project) %>
<%= f.collection_select :project_id, User.current.projects, :id, :name, {:include_blank => false} %>

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

<%= observe_field 'working_hours_project_id', :update => 'issues_list', :url => {:action => 'update_edit_issues'}, :with => "'change_project_id=' + encodeURIComponent(value)" %>

<%= radio_button_tag("subform", "Timestamps", true, "onclick"=>"Element.hide('duration');Element.show('timestamps')") %> <%= l(:label_timestamps) %>
<%= radio_button_tag("subform", "Duration", false, "onclick"=>"Element.hide('timestamps');Element.show('duration')") %> <%= l(:label_duration) %>

<%= f.text_field :starting, :size => 25 %>

<%= f.text_field 'break', "size" => 5  %>

  <%= f.text_field :ending, :size => 25 %>
  <%= l(:label_running) %><%= check_box_tag 'running', "1", @working_hours.ending.nil?  %>

Hours
  <%= text_field_tag 'duration', @duration, "size" => 5  %>

<%= f.text_area 'comments', "cols" => 40, "rows" => 3  %>


Hiding environment name from addthis box

(ActionItem1965)

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

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

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

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

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

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

  <% end %>

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

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

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

<% end %>

<% if @page.display_hits? %>

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

<% end %>

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

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

<% end %>

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

<% if NOOSFERO_CONF['addthis_enabled'] %>

<% end %>

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

<% end %>

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

<%= _('Categories') %>

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

<% end %>

<%= display_source_info(@page) %>

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

  <% if @comments_count > 1 %>

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

  <% end %>

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

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

  <% end %>

<%= add_zoom_to_images %>


Inserting missing </h3>

Inserting missing </h3>

<%= stylesheet_link_tag "code" %>

API Instructions

Parse a citation

(POST) <%= URL_ROOT %>citations/create

Required argument: citation or citation[] - The string(s) to parse.

Header: Accept: text/xml

Returns a list of parsed citations in xml format. Each parsed citation includes a ContextObject with the citation as the referent.

Status code: 201

Examples

 Using Ruby:

require 'net/http'

Net::HTTP.start('localhost', 3000) do |http|
  response = http.post('/citations/create',
    'citation=A. Bookstein and S. T. Klein,  \
    Detecting content-bearing words by serial clustering,  \
    Proceedings of the Nineteenth Annual International ACM SIGIR Conference \
    on Research and Development in Information Retrieval,   \
    pp. 319327,   1995.',
    'Accept' => 'text/xml')

  puts "Code: #{response.code}"
  puts "Message: #{response.message}"
  puts "Body:\n #{response.body}"
end

 Using curl:

Parsing a single citation:

curl -H 'Accept: text/xml' -d "citation=Udvarhelyi, I.S., Gatsonis,
C.A., Epstein, A.M., Pashos, C.L., Newhouse, J.P. and McNeil, B.J.
Acute Myocardial Infarction in the Medicare population: process of
care and clinical outcomes. Journal of the American Medical
Association, 1992; 18:2530-2536.  "
http://0.0.0.0:3000/citations/create

Parsing multiple citations:

curl -H 'Accept: text/xml' -d "citation[]=Fielderman, A., Silvester,
G., Gatsonis, C.A., Hoenig, J., Flynn, S. Prognostic significance of
flow cytometric DNA analysis and proliferative index in stage I
non-small cell lung cancer. American Review of Respiratory Disease,
1992; 146:707-710.&citation[]=Udvarhelyi, I.S., Gatsonis, C.A.,
Epstein, A.M., Pashos, C.L., Newhouse, J.P. and McNeil, B.J. Acute
Myocardial Infarction in the Medicare population: process of care and
clinical outcomes. Journal of the American Medical Association, 1992;
18:2530-2536.  " http://0.0.0.0:3000/citations/create

Example Return:

<citations>
  <citation valid=true>
  <authors>
    <author>I S Udvarhelyi</author>
    <author>C A Gatsonis</author>
    <author>A M Epstein</author>
    <author>C L Pashos</author>
    <author>J P Newhouse</author>
    <author>B J McNeil</author>
  </authors>
  <title>Acute Myocardial Infarction in the Medicare population: process of care and clinical outcomes</title>
  <journal>Journal of the American Medical Association</ journal>
  <pages>18--2530</pages>
  <year>1992</year>
  <raw_string>Udvarhelyi, I.S., Gatsonis, C.A., Epstein, A.M., Pashos, C.L., Newhouse, J.P. and McNeil, B.J. Acute Myocardial Infarction in the Medicare population: process of care and clinical outcomes. Journal of the American Medical Association, 1992; 18:2530-2536.</raw_string>
  <ctx:context-objects xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='info:ofi/fmt:xml:xsd:ctx http://www.openurl.info/registry/docs/info:ofi/fmt:xml:xsd:ctx' xmlns:ctx='info:ofi/fmt:xml:xsd:ctx'>
    <ctx:context-object timestamp='2008-07-11T00:57:33-04:00'
    encoding='info:ofi/enc:UTF-8' version='Z39.88-2004' identifier=''>
      <ctx:referent>
        <ctx:metadata-by-val>
          <ctx:format>info:ofi/fmt:xml:xsd:journal</ctx:format>
          <ctx:metadata>
            <journal xmlns:rft='info:ofi/fmt:xml:xsd:journal' xsi:schemaLocation='info:ofi/fmt:xml:xsd:journal http://www.openurl.info/registry/docs/info:ofi/fmt:xml:xsd:journal'>
              <rft:atitle>Acute Myocardial Infarction in the Medicare population: process of care and clinical outcomes</rft:atitle>
              <rft:spage>18</rft:spage>
              <rft:date>1992</rft:date>
              <rft:stitle>Journal of the American Medical Association</rft:stitle>
              <rft:genre>article</rft:genre>
              <rft:epage>2530</rft:epage>
              <rft:au>I S Udvarhelyi</rft:au>
              <rft:au>C A Gatsonis</rft:au>
              <rft:au>A M Epstein</rft:au>
              <rft:au>C L Pashos</rft:au>
              <rft:au>J P Newhouse</rft:au>
              <rft:au>B J McNeil</rft:au>
            </journal>
          </ctx:metadata>
        </ctx:metadata-by-val>
      </ctx:referent>
    </ctx:context-object>
  </ctx:context-objects>
  </citation>
</citations>


Organise a bit.

Organise a bit.

<%= error_messages_for 'public_body' %>

List of tags

    <% first_row = true %>
    <% for row in PublicBody.categories_with_headings %>
        <% if row.instance_of?(Array) %>
            <% if row[0] != 'other' %>
                <%= row[0] %>=<%= row[1] %>

            <% end %>
        <% elsif row != 'Miscellaneous' %>
            <% if not first_row %>
            <% else %>
                <% first_row = false %>
            <% end %>

<%=h row%>

        <% end %>
    <% end %>

Name

<%= text_field 'public_body', 'name', :size => 60  %>

Short name (only put in abbreviations which are really used, otherwise leave blank. Short or long name is used in the URL - don't worry about breaking URLs through renaming, as the history is used to redirect)

<%= text_field 'public_body', 'short_name', :size => 60  %>

Request email (set to blank (empty string) if can't find an address; to not_apply if FOI no longer / never did apply to authority; these emails are public as anyone can view with a CAPTCHA)

<%= text_field 'public_body', 'request_email', :size => 40  %>

Home page (of whole authority, not just their FOI page; set to blank (empty string) to guess it from the email)

<%= text_field 'public_body', 'home_page', :size => 60  %>

Public notes (for users to consider when making FOI requests to the authority)

<%= text_area 'public_body', 'notes', :rows => 3, :cols => 60  %>

Tags (space separated; see list of tags on the right)

<%= text_field 'public_body', 'tag_string', :size => 60  %>

Comment for this edit (put URL or other source of new info)

<%= text_area 'public_body', 'last_edit_comment', :rows => 3, :cols => 60  %>

<%= error_messages_for 'public_body' %>

List of tags

    <% first_row = true %>
    <% for row in PublicBody.categories_with_headings %>
        <% if row.instance_of?(Array) %>
            <% if row[0] != 'other' %>
                <%= row[0] %>=<%= row[1] %>

            <% end %>
        <% elsif row != 'Miscellaneous' %>
            <% if not first_row %>
            <% else %>
                <% first_row = false %>
            <% end %>

<%=h row%>

        <% end %>
    <% end %>

Name

<%= text_field 'public_body', 'name', :size => 60  %>

Short name (only put in abbreviations which are really used, otherwise leave blank. Short or long name is used in the URL - don't worry about breaking URLs through renaming, as the history is used to redirect)

<%= text_field 'public_body', 'short_name', :size => 60  %>

Request email (set to blank (empty string) if can't find an address; to not_apply if FOI no longer / never did apply to authority)

<%= text_field 'public_body', 'request_email', :size => 40  %>

Home page (of whole authority, not just their FOI page; set to blank (empty string) to guess it from the email)

<%= text_field 'public_body', 'home_page', :size => 60  %>

Notes (for users to consider when making FOI requests to the authority)

<%= text_area 'public_body', 'notes', :rows => 3, :cols => 60  %>

Tags (space separated; see list of tags on the right)

<%= text_field 'public_body', 'tag_string', :size => 60  %>

Comment for this edit (put URL or other source of new info)

<%= text_area 'public_body', 'last_edit_comment', :rows => 2, :cols => 60  %>

Privacy note: The email addresses are assumed public data,
so we can share the love around later. If somebody wants to give us a
super-secret address (say to bypass spam traps) then we'll have to rethink
this.


Show the standard search with filters when searching from home page box.  Fixes #170.

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

        <%= _("Make a new

        Freedom of

        Information

        request") %>

      <%= _("Start now »") %>

	  <%= _("Search over

          {{number_of_requests}} requests and

          {{number_of_authorities}} authorities",
	  :number_of_requests => InfoRequest.count, :number_of_authorities => PublicBody.count) %>

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

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

        <% end %>

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

    <% if @popular_bodies.size > 0 %>

<%= _("Who can I request information from?") %>

	<%= _("{{site_name}} covers requests to {{number_of_authorities}} authorities, including:",
	    :site_name => site_name, :number_of_authorities => PublicBody.count) %>

            <% for popular_body in @popular_bodies %>

<%=public_body_link(popular_body)%>
                 <%= n_('%d request', '%d requests', popular_body.info_requests.count) % popular_body.info_requests.count %>

            <% end%>

                <%= link_to _('Browse all authorities...'), list_public_bodies_default %>

    <% end %>

<%= _("What information has been released?") %>

           <%= _("{{site_name}} users have made {{number_of_requests}} requests, including:",
	    :site_name => site_name, :number_of_requests => InfoRequest.count) %>

              <% for event in @request_events %>

 	       <%= public_body_link(event.info_request.public_body) %> <%= _('answered a request about') %>
	       <%=link_to h(event.info_request.title), request_url(event.info_request)%>
               <%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %>
	       <p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.info_request.title, "", 200) %>

            <% end %>

<%=link_to _('More successful requests...'), request_list_successful_url %>

<% end %>

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

        <%= _("Make a new

        Freedom of

        Information

        request") %>

      <%= _("Start now »") %>

	  <%= _("Search over

          {{number_of_requests}} requests and

          {{number_of_authorities}} authorities",
	  :number_of_requests => InfoRequest.count, :number_of_authorities => PublicBody.count) %>

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

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

        <% end %>

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

    <% if @popular_bodies.size > 0 %>

<%= _("Who can I request information from?") %>

	<%= _("{{site_name}} covers requests to {{number_of_authorities}} authorities, including:",
	    :site_name => site_name, :number_of_authorities => PublicBody.count) %>

            <% for popular_body in @popular_bodies %>

<%=public_body_link(popular_body)%>
                 <%= n_('%d request', '%d requests', popular_body.info_requests.count) % popular_body.info_requests.count %>

            <% end%>

                <%= link_to _('Browse all authorities...'), list_public_bodies_default %>

    <% end %>

<%= _("What information has been released?") %>

           <%= _("{{site_name}} users have made {{number_of_requests}} requests, including:",
	    :site_name => site_name, :number_of_requests => InfoRequest.count) %>

              <% for event in @request_events %>

 	       <%= public_body_link(event.info_request.public_body) %> <%= _('answered a request about') %>
	       <%=link_to h(event.info_request.title), request_url(event.info_request)%>
               <%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %>
	       <p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.info_request.title, "", 200) %>

            <% end %>

<%=link_to _('More successful requests...'), request_list_successful_url %>

<% end %>


fixed typo that hid author

fixed typo that hid author

<%
unless get_service_type('cover_image').empty? %>

<% end
cite = @user_request.referent.to_citation
%>

<%= cite[:title_label] %>:

<%= cite[:title] %>

<%
@page_title = cite[:title]
if cite[:author]
%>

Author:

<%= cite[:author] %>

<%
end
if cite[:subtitle] %>

<%= cite[:subtitle_label] %>:
<%= cite[:subtitle] %>

<%
end

if (cite[:issn] && ! cite[:issn].empty?) %>

ISSN:

<%=cite[:issn] %>

<%
end

if (cite[:isbn] && ! cite[:isbn].empty?) %>

ISBN:

<%= cite[:isbn] %>

<%
end
pub = []
pub << cite[:date] if cite[:date]
pub << 'Volume:  '+cite[:volume] if cite[:volume]
pub << 'Issue:  '+cite[:issue] if cite[:issue]
pub << 'Page:  '+cite[:page] if cite[:page]
if pub.length > 0
%>

Published:

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

<% end %>

<%
unless get_service_type('cover_image').empty?%>
	<%= tag('img', {'src'=>@dispatch_response.cover_art[:medium]})%>

<% end

%>

<%
unless get_service_type('cover_image').empty? %>

<% end
cite = @user_request.referent.to_citation
%>

<%= cite[:title_label] %>:

<%= cite[:title] %>

<%
@page_title = cite[:title]
if cite[:subtitle]
%>

Author:

<%= cite[:author] %>

<%
end
if cite[:subtitle] %>

<%= cite[:subtitle_label] %>:
<%= cite[:subtitle] %>

<%
end

if (cite[:issn] && ! cite[:issn].empty?) %>

ISSN:

<%=cite[:issn] %>

<%
end

if (cite[:isbn] && ! cite[:isbn].empty?) %>

ISBN:

<%= cite[:isbn] %>

<%
end
pub = []
pub << cite[:date] if cite[:date]
pub << 'Volume:  '+cite[:volume] if cite[:volume]
pub << 'Issue:  '+cite[:issue] if cite[:issue]
pub << 'Page:  '+cite[:page] if cite[:page]
if pub.length > 0
%>

Published:

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

<% end %>

<%
unless get_service_type('cover_image').empty?%>
	<%= tag('img', {'src'=>@dispatch_response.cover_art[:medium]})%>

<% end

%>


reorganize the layout of the page

reorganize the layout of the page

<%
extend WEBrick::HTMLUtils

def self.get_query(value)
   if value
       value = value.strip
       if value.empty?
           value = nil
       end
   end

   value
end

schema_dir = File.join(File.dirname(__FILE__), "schema")

request = get_query(query["request"])
request_schema = nil
request_template = nil
response = nil
response_schema = nil

errors = []

schema = get_query(query["schema"]) || "freeform"
schemas = Dir.glob(File.join(schema_dir, "*"))
schemas = schemas.map {|d| File.basename(d)}

template = get_query(query["template"]) || "default"
if template == "default"
  template_file = File.join(schema_dir, schema, "template.json")
else
  template_file = File.join(schema_dir, schema, "template.#{template}.json")
end

if query["save-template"]
  begin
    File.open(template_file, "w") do |f|
      f.write(request)
    end
  rescue => e
    errors << "Failed to save request as template #{template}"
  end
end

templates = ["default"]
templates += Dir.glob(File.join(schema_dir, schema, "template.*.json")).map {|f|
   File.basename(f).sub(/^template\.(.*)\.json$/, '\1')
}
unless templates.include? template
   template = "default"
end
if template == "default"
  template_file = File.join(schema_dir, schema, "template.json")
else
  template_file = File.join(schema_dir, schema, "template.#{template}.json")
end

# load schemas
selected_schema_dir = File.join(schema_dir, schema)
if File.directory? selected_schema_dir
  request_schema = File.read(File.join(selected_schema_dir, "request.json")) rescue nil
  response_schema = File.read(File.join(selected_schema_dir, "response.json")) rescue nil
  request_template = File.read(template_file) rescue nil
else
  errors << "Schema not found: #{schema}"
end

request = request_template

%>

  <title>SF1 Driver WEB Sender</title>

  <link rel="stylesheet" type="text/css" href="css/reset-min.css" />
  <link rel="stylesheet" type="text/css" href="css/main.css" />
  <link rel="stylesheet" type="text/css" href="css/ui-lightness/jquery-ui-1.8.2.custom.css" />

      Online Driver Specification

SF1 Driver WEB Sender

		  Hey! Changing schema and template will erase the
		  request.

    <form method="GET" id="schema-form">
      <fieldset><legend>Schema</legend>

          <select name="schema" type="text">
            <% schemas.each do |s| %>
            <option value="<%= escape s %>"
                    <%= s == schema ? 'selected="select"' : '' %>>
              <%= escape s %>
            </option>
            <% end %>
          </select>

          <input type="submit" value="Change Schema" />

      </fieldset>
    </form>

    <form method="GET" id="template-form">
      <fieldset><legend>Template</legend>

          <input type="hidden" name="schema" value="<%= escape schema %>" />
          <select name="template" type="text">
            <% templates.each do |s| %>
            <option value="<%= escape s %>"
                    <%= s == template ? 'selected="select"' : '' %>>
              <%= escape s %>
            </option>
            <% end %>
          </select>

          <input type="submit" value="Change Template" />

      </fieldset>
    </form>

  <div class="ui-widget error" id="error-container" <% if errors.empty? %>style="display:none"<% end %>>

Error:

        <% errors.each do |e| %>

          <%= escape e %>

        <% end %>

    [Request Form]
    [Request Source]
    [Response Form]
    [Response Source]

Request Form

Request Source

        Response Form

        Response Source

      <textarea id="request_schematextarea" class="schematextarea" rows="10" cols="80">
<%= escape (request_schema || '{"title":"Freeform JSON","type":"any"}') %>
      </textarea>

      <form id="request_sourcetextform" class="sourcetextform">
        <textarea id="request_sourcetextarea" rows="30" cols="80"
                  name="request" class="sourcetextarea">
<%= escape (request || "{}") %>
        </textarea>
      </form>

      <textarea id="response_schematextarea" class="schematextarea" rows="10" cols="80">
<%= escape (response_schema || "{}") %>
      </textarea>

      <form id="response_sourcetextform" class="sourcetextform">
        <textarea id="response_sourcetextarea" rows="30" cols="80"
                  name="response" class="sourcetextarea">
<%= escape (response || "{}") %>
        </textarea>
      </form>

    <button id="request-send-button">Send Request</button>

      Save as Template...

      <form id="save-template-form" method="POST">
        <input type="hidden" name="request" />
        <input type="hidden" name="save-template" value="true" />

          Name
          <input type="text" name="template" value="<%= escape template %>" />

      </form>

    iZENEsoft 2010

<%
extend WEBrick::HTMLUtils

def self.get_query(value)
   if value
       value = value.strip
       if value.empty?
           value = nil
       end
   end

   value
end

schema_dir = File.join(File.dirname(__FILE__), "schema")

request = get_query(query["request"])
request_schema = nil
request_template = nil
response = nil
response_schema = nil

errors = []

schema = get_query(query["schema"]) || "freeform"
schemas = Dir.glob(File.join(schema_dir, "*"))
schemas = schemas.map {|d| File.basename(d)}

template = get_query(query["template"]) || "default"
if template == "default"
  template_file = File.join(schema_dir, schema, "template.json")
else
  template_file = File.join(schema_dir, schema, "template.#{template}.json")
end

if query["save-template"]
  begin
    File.open(template_file, "w") do |f|
      f.write(request)
    end
  rescue => e
    errors << "Failed to save request as template #{template}"
  end
end

templates = ["default"]
templates += Dir.glob(File.join(schema_dir, schema, "template.*.json")).map {|f|
   File.basename(f).sub(/^template\.(.*)\.json$/, '\1')
}
unless templates.include? template
   template = "default"
end
if template == "default"
  template_file = File.join(schema_dir, schema, "template.json")
else
  template_file = File.join(schema_dir, schema, "template.#{template}.json")
end

# load schemas
selected_schema_dir = File.join(schema_dir, schema)
if File.directory? selected_schema_dir
  request_schema = File.read(File.join(selected_schema_dir, "request.json")) rescue nil
  response_schema = File.read(File.join(selected_schema_dir, "response.json")) rescue nil
  request_template = File.read(template_file) rescue nil
else
  errors << "Schema not found: #{schema}"
end

request = request_template

%>

  <title>SF1 Driver WEB Sender</title>

  <link rel="stylesheet" type="text/css" href="css/reset-min.css" />
  <link rel="stylesheet" type="text/css" href="css/main.css" />
  <link rel="stylesheet" type="text/css" href="css/ui-lightness/jquery-ui-1.8.2.custom.css" />

SF1 Driver WEB Sender

      Online Driver Specification

  <div class="ui-widget error" id="error-container" <% if errors.empty? %>style="display:none"<% end %>>

Error:

        <% errors.each do |e| %>

          <%= escape e %>

        <% end %>

    [Request Form]
    [Request Source]
    [Response Form]
    [Response Source]

Request Form

Request Source

        Response Form

        Response Source

      <textarea id="request_schematextarea" class="schematextarea" rows="10" cols="80">
<%= escape (request_schema || '{"title":"Freeform JSON","type":"any"}') %>
      </textarea>

      <form id="request_sourcetextform" class="sourcetextform">
        <textarea id="request_sourcetextarea" rows="30" cols="80"
                  name="request" class="sourcetextarea">
<%= escape (request || "{}") %>
        </textarea>
      </form>

      <textarea id="response_schematextarea" class="schematextarea" rows="10" cols="80">
<%= escape (response_schema || "{}") %>
      </textarea>

      <form id="response_sourcetextform" class="sourcetextform">
        <textarea id="response_sourcetextarea" rows="30" cols="80"
                  name="response" class="sourcetextarea">
<%= escape (response || "{}") %>
        </textarea>
      </form>

    <button id="request-send-button">Send Request</button>

      Save as Template...

      <form id="save-template-form" method="POST">
        <input type="hidden" name="request" />
        <input type="hidden" name="save-template" value="true" />

          Name
          <input type="text" name="template" value="<%= escape template %>" />

      </form>

		  Hey! Changing schema and template will erase the
		  request.

    <form method="GET" id="schema-form">
      <fieldset><legend>Schema</legend>

          <select name="schema" type="text">
            <% schemas.each do |s| %>
            <option value="<%= escape s %>"
                    <%= s == schema ? 'selected="select"' : '' %>>
              <%= escape s %>
            </option>
            <% end %>
          </select>

          <input type="submit" value="Change Schema" />

      </fieldset>
    </form>

    <form method="GET" id="template-form">
      <fieldset><legend>Template</legend>

          <input type="hidden" name="schema" value="<%= escape schema %>" />
          <select name="template" type="text">
            <% templates.each do |s| %>
            <option value="<%= escape s %>"
                    <%= s == template ? 'selected="select"' : '' %>>
              <%= escape s %>
            </option>
            <% end %>
          </select>

          <input type="submit" value="Change Template" />

      </fieldset>
    </form>

    iZENEsoft 2010


Make contact link relative

Make contact link relative

    <%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_path %>
|  <a href="https://twitter.com/<%= Configuration::twitter_username %>"><%= _("Follow us on twitter") %>
<%= render :partial => 'general/credits' %>

    <%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_url %>
|  <a href="https://twitter.com/<%= Configuration::twitter_username %>"><%= _("Follow us on twitter") %>
<%= render :partial => 'general/credits' %>


Move before_body_end to before the </body>

There was a load of other stuff between before_body_end and the
body end, which a) doesn’t seem right, morally speaking, and b)
makes it impossible to put any code in the before_body_end template
in your theme that interacts with Google Analytics, which is a thing
we want to do in whatdotheyknow-theme.

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

        <title>
        <% if @title %>
            <%=@title%> - <%= site_name %>
        <% else %>
            <%= site_name %> - <%= _('Make and browse Freedom of Information (FOI) requests') %>
        <% end %>
        </title>

        <link rel="shortcut icon" href="/favicon.ico">
        <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet", :media => "all" %>
        <%= stylesheet_link_tag 'fonts', :rel => "stylesheet", :media => "all"  %>
        <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "print"  %>
        <% if !params[:print_stylesheet].nil? %>
         <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "all"  %>
        <% end %>
        <%= javascript_include_tag 'jquery.js', 'jquery-ui.min','jquery.cookie.js', 'general.js' %>

        <% if @profile_photo_javascript %>

            <link rel="stylesheet" href="/stylesheets/jquery.Jcrop.css" type="text/css" >
        <% end %>

        <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%>

        <%= stylesheet_link_tag 'custom', :title => "Main", :rel => "stylesheet"  %>
        <% if force_registration_on_new_request %>
        <%= stylesheet_link_tag 'jquery.fancybox-1.3.4', :rel => "stylesheet"  %>
        <% end %>

        <% if @feed_autodetect %>
            <% for feed in @feed_autodetect %>
                <link rel="alternate" type="application/atom+xml" title="<%=h feed[:title] %>" href="<%=h feed[:url]%>">
                <% if feed[:has_json] %>
                    <link rel="alternate" type="application/json" title="JSON version of <%=h feed[:title] %>" href="<%=h feed[:url]%>.json">
                <% end %>
            <% end %>
        <% end %>
        <% if @has_json %>
            <link rel="alternate" type="application/json" title="JSON version of this page" href="<%=h main_url(request.request_uri, '.json') %>">
        <% end %>

        <% if @no_crawl %>
            <meta name="robots" content="noindex, nofollow">
        <% end %>

        <%= render :partial => 'general/before_head_end' %>

    <body class="<%= 'admin' if !session[:using_admin].nil?%> <%= 'front' if params[:action] == 'frontpage' %>">

    <% if force_registration_on_new_request && !@user %>
    <%= javascript_include_tag 'jquery.fancybox-1.3.4.pack' %>

    <% end %>

<% # code for popup advert for a campaign etc.
=begin

Close

    [ message goes here ]

Close

=end
%>

<%= render :partial => 'general/locale_switcher' %>

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

          <% if @user %>
              <%= _('Hello, {{username}}!', :username => h(@user.name))%>

                <% if @user %>
                    <%=link_to _("My requests"), show_user_requests_path(:url_name => @user.url_name) %>
                    <%=link_to _("My profile"), show_user_profile_path(:url_name => @user.url_name) %>
                    <%=link_to _("My wall"), show_user_wall_path(:url_name => @user.url_name) %>
                <% end %>

              <%= link_to _("Sign out"), signout_url(:r => request.request_uri) %>
          <% else %>
              <%= link_to _("Sign in or sign up"), signin_url(:r => request.request_uri) %>
          <% end %>

        <% end %>

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

                   <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query" } %>
                   <%= image_submit_tag('search-button.png') %>

            <% end %>

        <%= render :partial => 'general/orglink' %>

        <%= render :partial => 'general/topnav' %>

            <% if flash[:notice] %>

<%= flash[:notice] %>

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

<%= flash[:error] %>

            <% end %>

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

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

X
<%= _("Paste this link into emails, tweets, and anywhere else:") %>

<input type="text">

    <%
      ga_code = MySociety::Config.get('GA_CODE', '')
      unless ga_code.empty?
    %>

    <% end %>

      <%= render :partial => 'general/before_body_end' %>

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

        <title>
        <% if @title %>
            <%=@title%> - <%= site_name %>
        <% else %>
            <%= site_name %> - <%= _('Make and browse Freedom of Information (FOI) requests') %>
        <% end %>
        </title>

        <link rel="shortcut icon" href="/favicon.ico">
        <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet", :media => "all" %>
        <%= stylesheet_link_tag 'fonts', :rel => "stylesheet", :media => "all"  %>
        <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "print"  %>
        <% if !params[:print_stylesheet].nil? %>
         <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "all"  %>
        <% end %>
        <%= javascript_include_tag 'jquery.js', 'jquery-ui.min','jquery.cookie.js', 'general.js' %>

        <% if @profile_photo_javascript %>

            <link rel="stylesheet" href="/stylesheets/jquery.Jcrop.css" type="text/css" >
        <% end %>

        <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%>

        <%= stylesheet_link_tag 'custom', :title => "Main", :rel => "stylesheet"  %>
        <% if force_registration_on_new_request %>
        <%= stylesheet_link_tag 'jquery.fancybox-1.3.4', :rel => "stylesheet"  %>
        <% end %>

        <% if @feed_autodetect %>
            <% for feed in @feed_autodetect %>
                <link rel="alternate" type="application/atom+xml" title="<%=h feed[:title] %>" href="<%=h feed[:url]%>">
                <% if feed[:has_json] %>
                    <link rel="alternate" type="application/json" title="JSON version of <%=h feed[:title] %>" href="<%=h feed[:url]%>.json">
                <% end %>
            <% end %>
        <% end %>
        <% if @has_json %>
            <link rel="alternate" type="application/json" title="JSON version of this page" href="<%=h main_url(request.request_uri, '.json') %>">
        <% end %>

        <% if @no_crawl %>
            <meta name="robots" content="noindex, nofollow">
        <% end %>

        <%= render :partial => 'general/before_head_end' %>

    <body class="<%= 'admin' if !session[:using_admin].nil?%> <%= 'front' if params[:action] == 'frontpage' %>">

    <% if force_registration_on_new_request && !@user %>
    <%= javascript_include_tag 'jquery.fancybox-1.3.4.pack' %>

    <% end %>

<% # code for popup advert for a campaign etc.
=begin

Close

    [ message goes here ]

Close

=end
%>

<%= render :partial => 'general/locale_switcher' %>

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

          <% if @user %>
              <%= _('Hello, {{username}}!', :username => h(@user.name))%>

                <% if @user %>
                    <%=link_to _("My requests"), show_user_requests_path(:url_name => @user.url_name) %>
                    <%=link_to _("My profile"), show_user_profile_path(:url_name => @user.url_name) %>
                    <%=link_to _("My wall"), show_user_wall_path(:url_name => @user.url_name) %>
                <% end %>

              <%= link_to _("Sign out"), signout_url(:r => request.request_uri) %>
          <% else %>
              <%= link_to _("Sign in or sign up"), signin_url(:r => request.request_uri) %>
          <% end %>

        <% end %>

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

                   <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query" } %>
                   <%= image_submit_tag('search-button.png') %>

            <% end %>

        <%= render :partial => 'general/orglink' %>

        <%= render :partial => 'general/topnav' %>

            <% if flash[:notice] %>

<%= flash[:notice] %>

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

<%= flash[:error] %>

            <% end %>

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

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

    <%= render :partial => 'general/before_body_end' %>

X
<%= _("Paste this link into emails, tweets, and anywhere else:") %>

<input type="text">

    <%
      ga_code = MySociety::Config.get('GA_CODE', '')
      unless ga_code.empty?
    %>

    <% end %>


Fix bug #589 http://code.google.com/p/activescaffold/issues/detail?id=589 Use column.css_class in forms, not only in listings. Put in dl tag so you can modify CSS for labels and form fields

<% scope ||= nil %>
<dl class="<%= column.css_class unless column.css_class.nil? %>">

    <label for="<%= active_scaffold_input_options(column, scope)[:id] %>"><%= column.label %>

    <%= active_scaffold_input_for column, scope %>
    <% if column.description -%>
      <%= column.description %>
    <% end -%>

<% scope ||= nil %>

    <label for="<%= active_scaffold_input_options(column, scope)[:id] %>"><%= column.label %>

    <%= active_scaffold_input_for column, scope %>
    <% if column.description -%>
      <%= column.description %>
    <% end -%>


Removed unused file.

Removed unused file.

<%= render :partial => 'add_property_value_view_prototype', :locals => { :product => Product.find('1475079073') }, :layout => false %>


ActionItem874: apply terminology when generating search form.

<% simple_search = false unless defined? simple_search %>

<% form_tag( { :action => 'index', :asset => nil, :category_path => ( @category ? @category.explode_path : [] ) },
               :method => 'get', :class => 'search_form' ) do %>
  <%= '
%s
' % form_title if defined? form_title %>

  <%= hidden_field_tag :display, params[:display] %>

      <%= text_field_tag 'query', @query, :id => ( lightbox? ? 'popup-search-input' : '' ), :size => 50 %>
      <%= javascript_tag 'setTimeout("$(\"popup-search-input\").focus()", 10 )' if lightbox? %>

    <%= submit_button(:search, _('Search'), :name => :search_whole_site_no) %>
    <% if @category %>
      <%= submit_button(:search, _('Search in whole site'), :name => :search_whole_site_yes) %>
    <% end %>

  <div id='advanced-search-options' style="display: <%= simple_search ? 'none' : 'block' %>">

<%= _('Search within:') %>

          <%= select_city %>

          <%= labelled_select(_('Distance:'), 'radius', :first, :last, nil, [15, 30, 50, 100, 150, 200, 300, 400, 500, 1000].map{|n|[n, n.to_s + 'km']}) %>

<%= _('Search for:') %>

        <% @search_in.map { |t,n| [t,getterm(n)] } .
          sort_by(&:last).each do |thing, name| %>

            <%= labelled_check_box name, 'find_in[]', thing.to_s, @searching[thing.to_sym] %>

          <% end %>

  <% if simple_search %>
    <%= link_to_function(_('More options'), nil, :id => 'advanced_search_link') do |page|
      page['advanced_search_link'].hide
      page['advanced-search-options'].toggle
    end %>
  <% end %>

  <% if lightbox?; button_bar do %>
  <%= lightbox_close_button _('Close') %>
  <% end; end %>

<% end %>

<% simple_search = false unless defined? simple_search %>

<% form_tag( { :action => 'index', :asset => nil, :category_path => ( @category ? @category.explode_path : [] ) },
               :method => 'get', :class => 'search_form' ) do %>
  <%= '
%s
' % form_title if defined? form_title %>

  <%= hidden_field_tag :display, params[:display] %>

      <%= text_field_tag 'query', @query, :id => ( lightbox? ? 'popup-search-input' : '' ), :size => 50 %>
      <%= javascript_tag 'setTimeout("$(\"popup-search-input\").focus()", 10 )' if lightbox? %>

    <%= submit_button(:search, _('Search'), :name => :search_whole_site_no) %>
    <% if @category %>
      <%= submit_button(:search, _('Search in whole site'), :name => :search_whole_site_yes) %>
    <% end %>

  <div id='advanced-search-options' style="display: <%= simple_search ? 'none' : 'block' %>">

<%= _('Search within:') %>

          <%= select_city %>

          <%= labelled_select(_('Distance:'), 'radius', :first, :last, nil, [15, 30, 50, 100, 150, 200, 300, 400, 500, 1000].map{|n|[n, n.to_s + 'km']}) %>

<%= _('Search for:') %>

        <% @search_in.map { |t,n| [t,gettext(n)] } .
          sort_by(&:last).each do |thing, name| %>

            <%= labelled_check_box name, 'find_in[]', thing.to_s, @searching[thing.to_sym] %>

          <% end %>

  <% if simple_search %>
    <%= link_to_function(_('More options'), nil, :id => 'advanced_search_link') do |page|
      page['advanced_search_link'].hide
      page['advanced-search-options'].toggle
    end %>
  <% end %>

  <% if lightbox?; button_bar do %>
  <%= lightbox_close_button _('Close') %>
  <% end; end %>

<% end %>


Added links to footer images

Added links to footer images

Hopefully I understood it correctly.

Partneři projektu informaceprovsechny.cz

      <%= image_tag('/ipvtheme/images/OSF.jpg') %>
      <%= image_tag('/ipvtheme/images/otevrete.jpg') %>
      <%= image_tag('/ipvtheme/images/FOM.jpg') %>

    <%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_url %>
|  <a href="https://twitter.com/<%= Configuration::twitter_username %>"><%= _("Follow us on twitter") %>
<%= render :partial => 'general/credits' %>


WDTK-77 We can't say this until we've seen some of the boilerplate messages

<% @title = "Making requests" %>

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

<%= @title %> #

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

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

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

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

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

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

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

Who can make a request? #

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

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

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

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

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

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

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

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

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

 Those formally subject to the FOI Act

 Those which choose to voluntarily comply with the FOI Act

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

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

Why must I keep my request focused?#

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

arguments about your cause

statements that could defame or insult others

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

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

Does it cost me anything to make a request?#

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

The latest version of the FOI Act (s 3(4)) makes it clear that

… functions and powers given by this Act are to be performed and exercised, as far as possible, to facilitate and promote public access to information, promptly and at the lowest reasonable cost.

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

How quickly will I get a response? #

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

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

  For various reasons,
  this timeframe can be extended.

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

What if I never get a response?#

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

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

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

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

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

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

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

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

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

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

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

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

Can I request information about myself? #

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

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

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

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

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

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

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

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

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

How do you moderate request annotations? #

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

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

Next, read about your privacy -->

<% @title = "Making requests" %>

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

<%= @title %> #

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

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

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

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

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

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

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

Who can make a request? #

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

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

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

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

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

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

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

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

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

 Those formally subject to the FOI Act

 Those which choose to voluntarily comply with the FOI Act

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

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

Why must I keep my request focused?#

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

arguments about your cause

statements that could defame or insult others

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

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

Does it cost me anything to make a request?#

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

Authorities often include unnecessary, scary, boilerplate in
acknowledgement messages saying they "may" charge a fee. Ignore such notices.
They hardly ever will actually charge a fee.  If they do, they can only charge you if
you have specifically agreed in advance to pay.  More
    details from the Information Commissioner.

The latest version of the FOI Act (s 3(4)) makes it clear that

… functions and powers given by this Act are to be performed and exercised, as far as possible, to facilitate and promote public access to information, promptly and at the lowest reasonable cost.

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

How quickly will I get a response? #

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

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

  For various reasons,
  this timeframe can be extended.

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

What if I never get a response?#

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

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

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

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

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

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

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

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

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

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

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

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

Can I request information about myself? #

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

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

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

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

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

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

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

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

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

How do you moderate request annotations? #

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

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

Next, read about your privacy -->


ActionItem0: adding div options to template

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

    <%= javascript_include_tag :defaults %>
    <%= design_all_header_tags %>
    <%= javascript_include_tag 'comatose_admin' %>
    <% if params[:controller] == 'comatose_admin' %>
      <%= stylesheet_link_tag 'comatose_admin' %>
    <% end %>

    <%= image_tag 'loading.gif', :id => 'spinner', :style => "display:none; float:right;" %>

          <%= _('Skip to:') %>
          <%= _('Content') %> |
          <%= _('Navigation') %> |
          <%= _('Footer') %>

          <%= header %>

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

            <%= flash[:notice] %>

        <% end %>

          <%= design_display(yield) %>

          <%= footer %>
          <%= design_display_icon('back', _('Back') , :action => 'list')%>