Try and make browsers display the search box sanely.

<% content_for "optionals" do %>

    Search
    Where am I?

    <% form_remote_tag(:loading => "startSearch()",
                       :complete => "endSearch()",
                       :url => { :controller => :geocoder, :action => :search }) do %>

          <%= text_field_tag :query, h(params[:query]) %>

          <%= submit_tag 'Go' %>

    <% end %>

Searching...

      examples: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ',
      or 'post offices near Lünen'
      more examples...

<% end %>


ActionItem2145: changing profile's page

ActionItem2145: changing profile's page

    <%= _('Basic information')%>

  <%= display_field(_('Sex:'), profile, :sex) { |gender| { 'male' => _('Male'), 'female' => _('Female') }[gender] } %>
  <%= display_field(_('Date of birth:'), profile, :birth_date) { |date| show_date(date)  }%>
  <%= display_field(_('Location:'), profile, :location, true) %>

  <%= display_field(_('Type:'), profile, :privacy_setting, true) %>

    <%= _('Profile created at:')  %>
    <%= show_date(profile.created_at) %>

  <% if profile == user || profile.friends.include?(user) %>

      <%= _('Contact')%>

    <%= display_field(_('Address:'), profile, :address) %>
    <%= display_field(_('ZIP code:'), profile, :zip_code) %>
    <%= display_field(_('Contact phone:'), profile, :contact_phone) %>
    <%= display_field(_('e-Mail:'), profile, :email, true) { |email| link_to_email(email) } %>
  <% end %>

  <% cache_timeout(profile.relationships_cache_key, 4.hours.from_now) do %>
    <% if !(profile.organization.blank? && profile.organization_website.blank?) && (profile.active_fields.include?('organization') || profile.active_fields.include?('organization_website')) %>

        <%= _('Work')%>

    <% end %>
    <%= display_field(_('Organization:'), profile, :organization) %>
    <%= display_field(_('Organization website:'), profile, :organization_website) { |url| link_to(url, url) }%>

    <% if !environment.enabled?('disable_asset_enterprises') && !profile.enterprises.empty? %>

        <%= __('Enterprises') %>

      <% profile.enterprises.each do |item| %>

          <%= button 'menu-enterprise', item.name, item.url %>

      <% end %>
    <% end %>

      <%= _('Network')%>

      <%= __('Friends') + ':' %>
      <%= link_to  profile.friends.count, { :controller => 'profile', :action => 'friends' } %>

      <%= __('Communities') + ':' %>
      <%= link_to profile.communities.count, :controller => "profile", :action => 'communities' %>

    <% if !environment.enabled?('disable_categories') && !profile.interests.empty? %>

        <%= _('Interests') %>

      <% profile.interests.each do |item| %>

          <%= link_to item.name, :controller => 'search', :action => 'category_index', :category_path => item.explode_path %>

      <% end %>
    <% end %>

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

<% end %>

    <%= _('Basic information')%>

  <%= display_field(_('Sex:'), profile, :sex) { |gender| { 'male' => _('Male'), 'female' => _('Female') }[gender] } %>
  <%= display_field(_('Date of birth:'), profile, :birth_date) { |date| show_date(date)  }%>
  <%= display_field(_('Location:'), profile, :location, true) %>

  <%= display_field(_('Type:'), profile, :privacy_setting, true) %>

    <%= _('Created at:')  %>
    <%= show_date(profile.created_at) %>

  <% if profile == user || profile.friends.include?(user) %>

      <%= _('Contact')%>

    <%= display_field(_('Address:'), profile, :address) %>
    <%= display_field(_('ZIP code:'), profile, :zip_code) %>
    <%= display_field(_('Contact phone:'), profile, :contact_phone) %>
    <%= display_field(_('e-Mail:'), profile, :email, true) { |email| link_to_email(email) } %>
  <% end %>

  <% cache_timeout(profile.relationships_cache_key, 4.hours.from_now) do %>
    <% if !(profile.organization.blank? && profile.organization_website.blank?) && (profile.active_fields.include?('organization') || profile.active_fields.include?('organization_website')) %>

        <%= _('Work')%>

    <% end %>
    <%= display_field(_('Organization:'), profile, :organization) %>
    <%= display_field(_('Organization website:'), profile, :organization_website) { |url| link_to(url, url) }%>

    <% if !environment.enabled?('disable_asset_enterprises') && !profile.enterprises.empty? %>

        <%= __('Enterprises') %>

      <% profile.enterprises.each do |item| %>

          <%= button 'menu-enterprise', item.name, item.url %>

      <% end %>
    <% end %>

      <%= _('Network')%>

      <%= __('Friends') + ':' %>
      <%= link_to  profile.friends.count, { :controller => 'profile', :action => 'friends' } %>

      <%= __('Communities') + ':' %>
      <%= link_to profile.communities.count, :controller => "profile", :action => 'communities' %>

    <% if !environment.enabled?('disable_categories') && !profile.interests.empty? %>

        <%= _('Interests') %>

      <% profile.interests.each do |item| %>

          <%= link_to item.name, :controller => 'search', :action => 'category_index', :category_path => item.explode_path %>

      <% end %>
    <% end %>

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

<% end %>


fixed broken path to sub-partial

fixed broken path to sub-partial

git-svn-id: 6606c8392feca0c51b447c8420e2bd4802c1db31@208 4f249914-c612-0410-8deb-f4485a9d85ab

Streamlined  Please use 'rake header' to create the tabbed menu, or edit the layout to point to your own header.
<%= render(:partial => 'shared/streamlined/menu') %>

Streamlined  Please use 'rake header' to create the tabbed menu, or edit the layout to point to your own header.
<%= render(:partial => '../../vendor/plugins/streamlined/templates/menu') %>


Added a coupon field

Added a coupon field

Signup for Acme Projects

<% if @call && !@call.errors.empty? %>

Could not complete signup. Please correct the following problems:

    <% @call.errors.each do |error| %>

<%= error.message %>

    <% end %>

<% end %>

<% if @flash %>

<%= @flash %>

<% end %>

<form method="post" action="<%= chargify.base_uri %>/signups">
  <%= chargify.direct.secure_parameters(
    :data => {
      :redirect_uri => "http://localhost:4567/verify"
    }
  ).to_form_inputs %>
  <fieldset>
    <legend>Select Plan</legend>

      <input type="radio" name="signup[product][handle]" id="signup_product_handle_basic" value="basic" <%= 'checked' if original_params.signup.product[:handle] == 'basic' %>/>Basic

      <input type="radio" name="signup[product][handle]" id="signup_product_handle_pro" value="pro" <%= 'checked' if original_params.signup.product[:handle] == 'pro' %>/>Pro

  </fieldset>

  <fieldset>
    <legend>Coupon</legend>

      Coupon Code

      <input type="text" name="signup[coupon_code]" id="signup_coupon_code" value="<%= h(original_params.signup[:coupon_code]) %>" />

  </fieldset>

  <fieldset>
    <legend>About You</legend>

      First Name

      <input type="text" name="signup[customer][first_name]" id="signup_customer_first_name" value="<%= h(original_params.signup.customer[:first_name]) %>" />

      Last Name

      <input type="text" name="signup[customer][last_name]" id="signup_customer_last_name" value="<%= h(original_params.signup.customer[:last_name]) %>"/>

      Email

      <input type="text" name="signup[customer][email]" id="signup_customer_email" value="<%= h(original_params.signup.customer[:email]) %>"/>

  </fieldset>

  <fieldset>
    <legend>Payment Profile</legend>

      First Name on Card

      <input type="text" name="signup[payment_profile][first_name]" id="signup_payment_profile_first_name" value="<%= h(original_params.signup.payment_profile[:first_name]) %>" />

      Last Name on Card

      <input type="text" name="signup[payment_profile][last_name]" id="signup_payment_profile_last_name" value="<%= h(original_params.signup.payment_profile[:last_name]) %>" />

      Card Number

      <input type="text" name="signup[payment_profile][card_number]" id="signup_payment_profile_card_number" value="<%= h(original_params.signup.payment_profile[:card_number]) %>" />

      Expiration Month / Year

      <select name="signup[payment_profile][expiration_month]" id="signup_payment_profile_expiration_month">
        <% for i in 1..12 do %>
        <option value="<%= i %>"<%= ' selected' if original_params.signup.payment_profile[:expiration_month] == i.to_s %>><%= "%02d" % i.to_s %></option>
        <% end %>
      </select>
      /
      <select name="signup[payment_profile][expiration_year]" id="signup_payment_profile_expiration_year">
        <% t = Time.now.year; for i in t..(t+10) %>
        <option value="<%= i %>"<%= ' selected' if original_params.signup.payment_profile[:expiration_year] == i.to_s %>><%= i %></option>
        <% end %>
      </select>

  </fieldset>

    <input type="submit" value="Sign Up" />
    or
    Go Back

</form>

Signup for Acme Projects

<% if @call && !@call.errors.empty? %>

Could not complete signup. Please correct the following problems:

    <% @call.errors.each do |error| %>

<%= error.message %>

    <% end %>

<% end %>

<% if @flash %>

<%= @flash %>

<% end %>

<form method="post" action="<%= chargify.base_uri %>/signups">
  <%= chargify.direct.secure_parameters(
    :data => {
      :redirect_uri => "http://localhost:4567/verify"
    }
  ).to_form_inputs %>
  <fieldset>
    <legend>Select Plan</legend>

      <input type="radio" name="signup[product][handle]" id="signup_product_handle_basic" value="basic" <%= 'checked' if original_params.signup.product[:handle] == 'basic' %>/>Basic

      <input type="radio" name="signup[product][handle]" id="signup_product_handle_pro" value="pro" <%= 'checked' if original_params.signup.product[:handle] == 'pro' %>/>Pro

  </fieldset>

  <fieldset>
    <legend>About You</legend>

      First Name

      <input type="text" name="signup[customer][first_name]" id="signup_customer_first_name" value="<%= h(original_params.signup.customer[:first_name]) %>" />

      Last Name

      <input type="text" name="signup[customer][last_name]" id="signup_customer_last_name" value="<%= h(original_params.signup.customer[:last_name]) %>"/>

      Email

      <input type="text" name="signup[customer][email]" id="signup_customer_email" value="<%= h(original_params.signup.customer[:email]) %>"/>

  </fieldset>

  <fieldset>
    <legend>Payment Profile</legend>

      First Name on Card

      <input type="text" name="signup[payment_profile][first_name]" id="signup_payment_profile_first_name" value="<%= h(original_params.signup.payment_profile[:first_name]) %>" />

      Last Name on Card

      <input type="text" name="signup[payment_profile][last_name]" id="signup_payment_profile_last_name" value="<%= h(original_params.signup.payment_profile[:last_name]) %>" />

      Card Number

      <input type="text" name="signup[payment_profile][card_number]" id="signup_payment_profile_card_number" value="<%= h(original_params.signup.payment_profile[:card_number]) %>" />

      Expiration Month / Year

      <select name="signup[payment_profile][expiration_month]" id="signup_payment_profile_expiration_month">
        <% for i in 1..12 do %>
        <option value="<%= i %>"<%= ' selected' if original_params.signup.payment_profile[:expiration_month] == i.to_s %>><%= "%02d" % i.to_s %></option>
        <% end %>
      </select>
      /
      <select name="signup[payment_profile][expiration_year]" id="signup_payment_profile_expiration_year">
        <% t = Time.now.year; for i in t..(t+10) %>
        <option value="<%= i %>"<%= ' selected' if original_params.signup.payment_profile[:expiration_year] == i.to_s %>><%= i %></option>
        <% end %>
      </select>

  </fieldset>

    <input type="submit" value="Sign Up" />
    or
    Go Back

</form>


specific article fields from prior form may be present, if the user is now choosing from amongst serveral possible title matches. Preserve them on refinement of search terms.

<%
if (params["action"] == "journal_list")
  @page_title = "Browse by Journal Title: #{params['id']}"
else
  @page_title = 'Journal titles that '

  @page_title +=
  (params["umlaut.title_search_type"] == "begins") ?
  'begin with ' : 'contain '

  @page_title += "'" + params['rft.jtitle'] + "'"
end

%>

<%= @page_title %>

  <%= form_tag({:controller=>'search', :action=>'journal_search'}, {:method=>'get', :name=>'OpenURL', :id=>'OpenURL'})  %>
      <input type=hidden name="rfr_id" value="info:sid/sfxit.com:citation">

      <input type="hidden" class="rft_title" name="rft.title">
      <input type="hidden" class="rft_object_id" name="rft.object_id">

      <%-
      # specific article fields from prior form may be present, if the user is now choosing from
      # amongst serveral possible title matches. Preserve them on refinement of search terms.
      -%>
      <% params.slice("rft.date", "__year", "__month", "__day", "rft.volume", "rft.issue", "rft.spage").each_pair do |key, value| %>
        <%= hidden_field_tag key, value %>
      <% end %>

      Journal Title:
      <%= text_field :journal, :title, {:name=>'rft.jtitle', :autocomplete=>'off', :size=>'40', :value=>params['rft.jtitle'], :class=>"title_search"}
      %>

      <select name="umlaut.title_search_type" class="sfx_title_search">
          <option value="contains" <%= "SELECTED" if params["umlaut.title_search_type"] == "contains" %>>contains</option>
          <option value="begins" <%= "SELECTED" if params["umlaut.title_search_type"] == "begins" %> >begins
          with</option>
          <option value="exact">exact match</option>
      </select>

      <input type=hidden name="rft.issn">
      <input type="submit" name="Generate_OpenURL2" value="Search">
      <%= link_to('More search options', :controller=>'search') %>
  </form>

<% if params["action"] == "journal_list" %>
  <%= render :partial=>"a_to_z" %>

<% end %>

<% unless @hits == 0%>

Showing results <%= @start_result_num %> through <%= @end_result_num %> of <%= @hits %>

<% end %>
<% if params["rft.jtitle"] %>

Note: Alternate titles might have matched your search terms

<% end %>

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

<% @display_results.each do | co |
@current_context_object = co
%>
  <% partial_name = @citation_partial || 'citation' %>
  <%= render :partial=>partial_name %>

<% end %>

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

<% if params["action"] == "journal_list" %>

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

<%
if (params["action"] == "journal_list")
  @page_title = "Browse by Journal Title: #{params['id']}"
else
  @page_title = 'Journal titles that '

  @page_title +=
  (params["umlaut.title_search_type"] == "begins") ?
  'begin with ' : 'contain '

  @page_title += "'" + params['rft.jtitle'] + "'"
end

%>

<%= @page_title %>

  <%= form_tag({:controller=>'search', :action=>'journal_search'}, {:method=>'get', :name=>'OpenURL', :id=>'OpenURL'})  %>
      <input type=hidden name="rfr_id" value="info:sid/sfxit.com:citation">

      <input type="hidden" class="rft_title" name="rft.title">
      <input type="hidden" class="rft_object_id" name="rft.object_id">
      <input type="hidden" class="date" name="rft.date">

      Journal Title:
      <%= text_field :journal, :title, {:name=>'rft.jtitle', :autocomplete=>'off', :size=>'40', :value=>params['rft.jtitle'], :class=>"title_search"}
      %>

      <select name="umlaut.title_search_type" class="sfx_title_search">
          <option value="contains" <%= "SELECTED" if params["umlaut.title_search_type"] == "contains" %>>contains</option>
          <option value="begins" <%= "SELECTED" if params["umlaut.title_search_type"] == "begins" %> >begins
          with</option>
          <option value="exact">exact match</option>
      </select>

      <input type=hidden name="rft.issn">
      <input type="submit" name="Generate_OpenURL2" value="Search">
      <%= link_to('More search options', :controller=>'search') %>
  </form>

<% if params["action"] == "journal_list" %>
  <%= render :partial=>"a_to_z" %>

<% end %>

<% unless @hits == 0%>

Showing results <%= @start_result_num %> through <%= @end_result_num %> of <%= @hits %>

<% end %>
<% if params["rft.jtitle"] %>

Note: Alternate titles might have matched your search terms

<% end %>

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

<% @display_results.each do | co |
@current_context_object = co
%>
  <% partial_name = @citation_partial || 'citation' %>
  <%= render :partial=>partial_name %>

<% end %>

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

<% if params["action"] == "journal_list" %>

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


Don't find users from a deleted project

Don't find users from a deleted project

<%= error_messages_for 'task' %>
<%

  perms = {}

  ['comment', 'edit', 'reassign', 'prioritize', 'close', 'milestone'].each do |p|
    if @task.project_id.to_i == 0 || current_user.can?( @task.project, p )
      perms[p] = {}
    else
      perms[p] = { :disabled => 'disabled' }
    end
  end

%>

      <fieldset id="task_information" style="padding-right:0.5em;"><legend><%=_ 'Information' %></legend>
        <%=_ 'Summary' %>
        <%= text_field 'task', 'name', { :size => 47, :maxlength => 200, :style => "width:80%;"}.merge( perms['edit'] )  %>

        <%=_ 'Tags' %>
        <%= text_field 'task', 'set_tags', { :size => 47, :value => @task.tags.collect{|t| t.name}.join(', '), :autocomplete => "off", :style => "width:80%;" }.merge( perms['edit'] ) %>

        <%=_ 'Description' %>
        <%= text_area 'task', 'description', { :rows => 20, :style => "width:80%;" }.merge( perms['edit'] )  %>

        <%=_ 'Comment' %>
        <%= text_area_tag 'comment', {}, { :rows => 10, :style => "width:80%;" }.merge( perms['comment'] )  %>

        <%=_ 'Attach file' %>
        <%= file_field_tag 'task_file', { :size => 35, :class => "file" }.merge( perms['comment'] ) %>

      </fieldset>
<% unless @tags.nil? %>

<% end %>

          <% if @task.project_id > 0
               selected_project = @task.project_id
             elsif session[:last_project_id].to_i > 0
               selected_project = session[:last_project_id].to_i
             elsif session[:filter_project].to_i > 0
               selected_project = session[:filter_project].to_i
             else
               selected_project = current_user.projects.find(:first, :order => 'name').id
             end

             @project = current_user.projects.find(selected_project) rescue begin
                                                                      @project = current_user.projects.find(:first, :order => 'name').id
                                                                     end

             selected_project = @project.id

            %>
      <fieldset id="task_project_selection" style="padding-right:0;">
        <legend><%=_ 'Target' %></legend>
          <%=_ 'Project' %>

          <select name="task[project_id]" id="task_project_id" <%= "disabled=\"disabled\"" unless perms['reassign'].empty? %>>
          <% @clients = Customer.find(:all, :conditions => ["company_id = ?", current_user.company_id], :order => "name") %>
          <% @clients.each do |c| %>
          <% @client_projects = current_user.projects.find(:all, :conditions => ["customer_id = #{c.id} AND completed_at IS NULL"], :order => "name" ) %>
            <% if @client_projects.size > 0 %>
            <optgroup class="select_heading" label="<%= h(c.name) %>">
              <% @client_projects.each do |p| %>
                 <option value="<%=p.id%>" class="select_item"<%= " selected" if p.id == selected_project%>><%= p.name %></option>
              <% end %>
            </optgroup>
           <% end %>

          <% end %>

           </select>

          <%=_ 'Milestone' %>
          <% unless @task.id.nil? %>
            <%= select 'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', current_user.company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {}, perms['milestone'] %>

          <% else %>
            <%= select'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', current_user.company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {:selected => session[:filter_milestone] ? session[:filter_milestone].to_i : 0}, perms['milestone'] %>

          <% end %>

<%

users = Project.find(selected_project).users.find(:all, :order => 'name' ) rescue []

resource_string = "<select id=\"task_users\" name=\"users[]\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('Unassigned')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\">#{us.name}</option>"}.join('') + "</select>"
resource_string = resource_string.split(/\n/).join('').gsub(/'/, "\\\\\'")

owner_string = ''
num = 0
unless @task.users.empty?
  @task.users.each do |u|
    owner_string << "
#{_('Assigned To')}" if num == 0
    owner_string << "
" if num != 0
    owner_string <<  "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{(u.id == us.id ? "selected=\"selected\"" : '')}>#{us.name}</option>"}.join('').gsub(/'/,"\\\\\'") + "</select>" #, perms['reassign'] )

    if( perms['reassign'].keys.size == 0 )
      owner_string << "" if num == 0
      owner_string << "" if num != 0
    end
    owner_string << "
"
    num = num + 1
  end
  owner_string = owner_string.split(/\n/).join('')
else
  owner_string = "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{"selected" if (us.id == current_user.id && @task.created_at.nil?) }>#{us.name}</option>"}.join('') + "</select>" #, perms['reassign']
  owner_string = owner_string.split(/\n/).join('').gsub(/'/, "\\\\\'")

  if perms['reassign'].keys.size == 0
    owner_string = "
#{_('Assigned To')}#{owner_string}"
    owner_string << "
"
  end
  num = num + 1
end

%>

       <%= owner_string %>

      <%=_ 'Requested By' %>
      <%= text_field 'task', 'requested_by', {:size => 12}.merge(perms['edit']) %>

      </fieldset>

      <fieldset id="task_attr" style="padding-right:0;">
        <legend><%=_ 'Attributes' %></legend>
      <%=_ 'Type' %>
        <%= select 'task', 'type_id', [[_('Task'),0],[_('New Feature'),1],[_('Defect'),2],[_('Improvement'),3]], {:selected => @task.type_id}, perms['prioritize']  %>

        <%=_ 'Priority' %>
        <%= select 'task', 'priority', [[_('Critical'),3],[_('Urgent'),2],[_('High'),1],[_('Normal'),0],[_('Low'),-1],[_('Lowest'),-2]], {:selected => @task.priority}, perms['prioritize']  %>

      <%=_ 'Severity' %>
        <%= select 'task', 'severity_id', [[_('Blocker'),3],[_('Critical'),2],[_('Major'),1],[_('Normal'),0],[_('Minor'),-1],[_('Trivial'),-2]], {:selected => @task.severity_id}, perms['prioritize']  %>

      <% if current_user.option_tracktime.to_i == 1%>
       <%=_ 'Time Estimate' %>
      <%= text_field 'task', 'duration', {:size => 12, :value => (@task.duration.to_i > 0 ? worked_nice(@task.duration) : ""), :class => 'tooltip', :title => '2w 3d 1h'}.merge(perms['prioritize']) %>

<% else %>
    <%= hidden_field_tag "task[duration]", "1h" %>
<% end %>
      <%=_ 'Due Date' %>
        <% if perms['prioritize'].empty? %>
          <% if( (current_user.locale || 'en_US') == 'en_US' )
               date_tooltip = _("Enter task due date, or click calendar button.
For recurring tasks, try:
every day
every thursday
every last friday
every 14 days
every 3rd monday (of a month)")
             else
               date_tooltip = _("Enter task due date, or click calendar button.")
             end %>
          <% if @task.repeat && @task.repeat.length > 0 %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar'), :value => @task.repeat_summary },
          { :ifFormat => current_user.date_format, :firstDay => 1, :range => [2006, 2010], :step => 1, :showOthers => true } %>
          <% else %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar') },
          { :ifFormat => current_user.date_format, :firstDay => 1, :range => [2006, 2010], :step => 1, :showOthers => true } %>
          <% end %>

        <% else %>
          <% if @task.repeat && @task.repeat.length > 0 %>
        <%= text_field 'task', 'due_at', {:size => 12, :value => @task.repeat_summary}.merge(perms['prioritize']) %>

          <% else %>
        <%= text_field 'task', 'due_at', {:size => 12}.merge(perms['prioritize']) %>

          <% end %>
        <% end %>

      </fieldset>

      <fieldset id="task_dependencies" style="padding-right:0;">
        <legend><%=_ "Dependencies"%></legend>

        <%=_ 'Depends on'%> #
        <% if perms['prioritize'].empty? %>
        <input name="dependencies[]" size="12" type="text" id="dependencies_input" title="<%=_("Enter task numbers, separated by commas. Type text to search.")%>" class="tooltip" >

        <%= auto_complete_field 'dependencies_input', { :url => { :action => 'dependency_targets' }, :min_chars => 1, :frequency => 0.5, :indicator => 'loading', :select => 'complete_value', :tokens => ',' } %>
        <% else %>
        <input name="dependencies[]" size="12" type="text" disabled="disabled">
        <% end %>

        <% @task.dependencies.each do |d| %>

        <div id="dep_<%=d.id%>" style="clear:both;">

<% if d.done? %><% else %><% end %><%= link_to_task(d) %>

        <% if perms['prioritize'].empty? %>

<a href="#" onclick="javascript:new Element.remove('dep_<%=d.id%>'); false;" ><img src="/images/delete.png" border="0" title="<%=_ 'Remove dependency'%>" class="tooltip">

        <% end %>
        <input name="dependencies[]" type="hidden" value="<%=d.task_num%>">

        <% end %>

      </fieldset>

<% unless @task.dependants.empty? %>

      <fieldset id="task_dependants" style="padding-right:0;">
        <legend><%=_ "Depended on by"%></legend>

        <% @task.dependants.each do |d| %>

        <div id="dep_<%=d.id%>" style="clear:both;">

<% if d.done? %><% else %><% end %><%= link_to_task(d) %>

        <% end %>

      </fieldset>

<% end %>

      <fieldset id="task_notify" style="padding-right:0;">
        <legend><%=_ 'Notification' %></legend>
        <%= _"Name / Email" %><input type="text" size="12" name="watchers[]" id="notification-input">

      </fieldset>

      <% if @task.attachments.size > 0 %>
      <fieldset id="task_attachments">
        <legend><%=_ "Attachments" %></legend>

        <% for file in @task.attachments %>
        <%= link_to h(file.name), {:controller => 'project_files', :action => 'download', :id => file.id} %> (<%=number_to_human_size(file.file_size)%>)
        <%= link_to _('[Delete]'), {:controller => 'project_files', :action => 'destroy', :id => file.id}, :confirm => _("Really delete %s?", file.name) %>

        <% end %>
      </fieldset>
      <% end %>

<%= error_messages_for 'task' %>
<%

  perms = {}

  ['comment', 'edit', 'reassign', 'prioritize', 'close', 'milestone'].each do |p|
    if @task.project_id.to_i == 0 || current_user.can?( @task.project, p )
      perms[p] = {}
    else
      perms[p] = { :disabled => 'disabled' }
    end
  end

%>

      <fieldset id="task_information" style="padding-right:0.5em;"><legend><%=_ 'Information' %></legend>
        <%=_ 'Summary' %>
        <%= text_field 'task', 'name', { :size => 47, :maxlength => 200, :style => "width:80%;"}.merge( perms['edit'] )  %>

        <%=_ 'Tags' %>
        <%= text_field 'task', 'set_tags', { :size => 47, :value => @task.tags.collect{|t| t.name}.join(', '), :autocomplete => "off", :style => "width:80%;" }.merge( perms['edit'] ) %>

        <%=_ 'Description' %>
        <%= text_area 'task', 'description', { :rows => 20, :style => "width:80%;" }.merge( perms['edit'] )  %>

        <%=_ 'Comment' %>
        <%= text_area_tag 'comment', {}, { :rows => 10, :style => "width:80%;" }.merge( perms['comment'] )  %>

        <%=_ 'Attach file' %>
        <%= file_field_tag 'task_file', { :size => 35, :class => "file" }.merge( perms['comment'] ) %>

      </fieldset>
<% unless @tags.nil? %>

<% end %>

          <% if @task.project_id > 0
               selected_project = @task.project_id
             elsif session[:last_project_id].to_i > 0
               selected_project = session[:last_project_id].to_i
             elsif session[:filter_project].to_i > 0
               selected_project = session[:filter_project].to_i
             else
               selected_project = current_user.projects.find(:first, :order => 'name').id
             end

             @project = current_user.projects.find(selected_project) rescue begin
                                                                      @project = current_user.projects.find(:first, :order => 'name').id
                                                                     end

             selected_project = @project.id

            %>
      <fieldset id="task_project_selection" style="padding-right:0;">
        <legend><%=_ 'Target' %></legend>
          <%=_ 'Project' %>

          <select name="task[project_id]" id="task_project_id" <%= "disabled=\"disabled\"" unless perms['reassign'].empty? %>>
          <% @clients = Customer.find(:all, :conditions => ["company_id = ?", current_user.company_id], :order => "name") %>
          <% @clients.each do |c| %>
          <% @client_projects = current_user.projects.find(:all, :conditions => ["customer_id = #{c.id} AND completed_at IS NULL"], :order => "name" ) %>
            <% if @client_projects.size > 0 %>
            <optgroup class="select_heading" label="<%= h(c.name) %>">
              <% @client_projects.each do |p| %>
                 <option value="<%=p.id%>" class="select_item"<%= " selected" if p.id == selected_project%>><%= p.name %></option>
              <% end %>
            </optgroup>
           <% end %>

          <% end %>

           </select>

          <%=_ 'Milestone' %>
          <% unless @task.id.nil? %>
            <%= select 'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', current_user.company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {}, perms['milestone'] %>

          <% else %>
            <%= select'task', 'milestone_id', [[_("[None]"), "0"]] + Milestone.find(:all, :order => 'name', :conditions => ['company_id = ? AND project_id = ? AND completed_at IS NULL', current_user.company.id, selected_project] ).collect {|c| [ c.name, c.id ] }, {:selected => session[:filter_milestone] ? session[:filter_milestone].to_i : 0}, perms['milestone'] %>

          <% end %>

<%

users = Project.find(selected_project).users.find(:all, :order => 'name' )

resource_string = "<select id=\"task_users\" name=\"users[]\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('Unassigned')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\">#{us.name}</option>"}.join('') + "</select>"
resource_string = resource_string.split(/\n/).join('').gsub(/'/, "\\\\\'")

owner_string = ''
num = 0
unless @task.users.empty?
  @task.users.each do |u|
    owner_string << "
#{_('Assigned To')}" if num == 0
    owner_string << "
" if num != 0
    owner_string <<  "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{(u.id == us.id ? "selected=\"selected\"" : '')}>#{us.name}</option>"}.join('').gsub(/'/,"\\\\\'") + "</select>" #, perms['reassign'] )

    if( perms['reassign'].keys.size == 0 )
      owner_string << "" if num == 0
      owner_string << "" if num != 0
    end
    owner_string << "
"
    num = num + 1
  end
  owner_string = owner_string.split(/\n/).join('')
else
  owner_string = "<select name=\"users[]\" id=\"task_users\" #{"disabled=\"disabled\"" if @task.project && !current_user.can?( @task.project, 'reassign' )}><option value=\"\">[#{_('No one')}]</option>" + users.collect{|us| "<option value=\"#{us.id}\" #{"selected" if (us.id == current_user.id && @task.created_at.nil?) }>#{us.name}</option>"}.join('') + "</select>" #, perms['reassign']
  owner_string = owner_string.split(/\n/).join('').gsub(/'/, "\\\\\'")

  if perms['reassign'].keys.size == 0
    owner_string = "
#{_('Assigned To')}#{owner_string}"
    owner_string << "
"
  end
  num = num + 1
end

%>

       <%= owner_string %>

      <%=_ 'Requested By' %>
      <%= text_field 'task', 'requested_by', {:size => 12}.merge(perms['edit']) %>

      </fieldset>

      <fieldset id="task_attr" style="padding-right:0;">
        <legend><%=_ 'Attributes' %></legend>
      <%=_ 'Type' %>
        <%= select 'task', 'type_id', [[_('Task'),0],[_('New Feature'),1],[_('Defect'),2],[_('Improvement'),3]], {:selected => @task.type_id}, perms['prioritize']  %>

        <%=_ 'Priority' %>
        <%= select 'task', 'priority', [[_('Critical'),3],[_('Urgent'),2],[_('High'),1],[_('Normal'),0],[_('Low'),-1],[_('Lowest'),-2]], {:selected => @task.priority}, perms['prioritize']  %>

      <%=_ 'Severity' %>
        <%= select 'task', 'severity_id', [[_('Blocker'),3],[_('Critical'),2],[_('Major'),1],[_('Normal'),0],[_('Minor'),-1],[_('Trivial'),-2]], {:selected => @task.severity_id}, perms['prioritize']  %>

      <% if current_user.option_tracktime.to_i == 1%>
       <%=_ 'Time Estimate' %>
      <%= text_field 'task', 'duration', {:size => 12, :value => (@task.duration.to_i > 0 ? worked_nice(@task.duration) : ""), :class => 'tooltip', :title => '2w 3d 1h'}.merge(perms['prioritize']) %>

<% else %>
    <%= hidden_field_tag "task[duration]", "1h" %>
<% end %>
      <%=_ 'Due Date' %>
        <% if perms['prioritize'].empty? %>
          <% if( (current_user.locale || 'en_US') == 'en_US' )
               date_tooltip = _("Enter task due date, or click calendar button.
For recurring tasks, try:
every day
every thursday
every last friday
every 14 days
every 3rd monday (of a month)")
             else
               date_tooltip = _("Enter task due date, or click calendar button.")
             end %>
          <% if @task.repeat && @task.repeat.length > 0 %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar'), :value => @task.repeat_summary },
          { :ifFormat => current_user.date_format, :firstDay => 1, :range => [2006, 2010], :step => 1, :showOthers => true } %>
          <% else %>
          <%= calendar_field 'task', 'due_at', { :class => 'date tooltip', :field_title => date_tooltip, :button_title => _('Show Calendar') },
          { :ifFormat => current_user.date_format, :firstDay => 1, :range => [2006, 2010], :step => 1, :showOthers => true } %>
          <% end %>

        <% else %>
          <% if @task.repeat && @task.repeat.length > 0 %>
        <%= text_field 'task', 'due_at', {:size => 12, :value => @task.repeat_summary}.merge(perms['prioritize']) %>

          <% else %>
        <%= text_field 'task', 'due_at', {:size => 12}.merge(perms['prioritize']) %>

          <% end %>
        <% end %>

      </fieldset>

      <fieldset id="task_dependencies" style="padding-right:0;">
        <legend><%=_ "Dependencies"%></legend>

        <%=_ 'Depends on'%> #
        <% if perms['prioritize'].empty? %>
        <input name="dependencies[]" size="12" type="text" id="dependencies_input" title="<%=_("Enter task numbers, separated by commas. Type text to search.")%>" class="tooltip" >

        <%= auto_complete_field 'dependencies_input', { :url => { :action => 'dependency_targets' }, :min_chars => 1, :frequency => 0.5, :indicator => 'loading', :select => 'complete_value', :tokens => ',' } %>
        <% else %>
        <input name="dependencies[]" size="12" type="text" disabled="disabled">
        <% end %>

        <% @task.dependencies.each do |d| %>

        <div id="dep_<%=d.id%>" style="clear:both;">

<% if d.done? %><% else %><% end %><%= link_to_task(d) %>

        <% if perms['prioritize'].empty? %>

<a href="#" onclick="javascript:new Element.remove('dep_<%=d.id%>'); false;" ><img src="/images/delete.png" border="0" title="<%=_ 'Remove dependency'%>" class="tooltip">

        <% end %>
        <input name="dependencies[]" type="hidden" value="<%=d.task_num%>">

        <% end %>

      </fieldset>

<% unless @task.dependants.empty? %>

      <fieldset id="task_dependants" style="padding-right:0;">
        <legend><%=_ "Depended on by"%></legend>

        <% @task.dependants.each do |d| %>

        <div id="dep_<%=d.id%>" style="clear:both;">

<% if d.done? %><% else %><% end %><%= link_to_task(d) %>

        <% end %>

      </fieldset>

<% end %>

      <fieldset id="task_notify" style="padding-right:0;">
        <legend><%=_ 'Notification' %></legend>
        <%= _"Name / Email" %><input type="text" size="12" name="watchers[]" id="notification-input">

      </fieldset>

      <% if @task.attachments.size > 0 %>
      <fieldset id="task_attachments">
        <legend><%=_ "Attachments" %></legend>

        <% for file in @task.attachments %>
        <%= link_to h(file.name), {:controller => 'project_files', :action => 'download', :id => file.id} %> (<%=number_to_human_size(file.file_size)%>)
        <%= link_to _('[Delete]'), {:controller => 'project_files', :action => 'destroy', :id => file.id}, :confirm => _("Really delete %s?", file.name) %>

        <% end %>
      </fieldset>
      <% end %>


Now with a sticky footer.

Now with a sticky footer.

<%
#
# Nathan Reed, 29/04/2010

$LOAD_PATH << './lib' << '../shared'

require 'rubygems'
require 'json'

load '../shared/so-db.rb'

db = SoSql.real_connect();

q_count = db.get_rate('so-question-count', 4);
a_count = db.get_rate('so-answer-count', 4);
c_count = db.get_rate('so-comment-count', 4);

# the answer count is really the combined question and answer count
# so we need to subtract the question count to get the *actual* answer count
a_count['count'] -= q_count['count'];
a_count['rate'] -= q_count['rate'];

count_data = [q_count, a_count, c_count];

db.close;

def to_hourly(rate)
	return (rate*3600).round().to_s + ' / hr';
end

%>

<!doctype html public "-//w3c//dtd html 4.0 strict//en">

<title>Stackoverflow Counter</title>

<link rel="stylesheet" href="css/default.css" type="text/css" media="screen, projection">

 stackoverflow/counter

 ...

 comments <%= to_hourly(c_count['rate']) %>

 ...

 answers <%= to_hourly(a_count['rate']) %>

 ...

 questions <%= to_hourly(q_count['rate']) %>

data updated from stackoverflow.com every 15 minutes

Nathan Reed (c) 2010 | popacular.com

view the source code on github


Adding mention of JSON support to API page

API Documentation

Creating a new RubyURL

If you'd like to generate a RubyURL through the REST API, you'll just need to POST an XML or JSON request to http://rubyurl.com/api/link.

To view the example XML and JSON requests and responses, view these examples.

API Documentation

Creating a new RubyURL

If you'd like to generate a RubyURL through the REST API, you'll just need to POST an XML request to http://rubyurl.com/api/link.

To view the example XML requests and responses, view these examples.


fixed bug that resulted in multiple hide messages, as << was modifying the strings themselves

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

<% if RAILS_ENV == "development" %>
  <% flash[:error] ||= "You are on our development site -- you should NOT be filling in your app or reference here.  Remove the 'dev.' from your url, and email spt@campusforchrist.org with how you got here" %>
<% end %>

    <title>Project Application Tool</title>
    <%= stylesheet_link_tag 'main2' %>
    <%= render :partial => "externs/sortable_tables" %>
    <%= javascript_include_tag "prototype", "effects" %>
    <%= render :partial => "externs/load_extern" %>

    <% if RAILS_ENV == 'development' && @debug -%>

debug: <%= @debug -%>

    <% end -%>

      Loading <%=image_tag('spinner.gif')%>

        <% if @user %>

user:
            <%= @user.viewer.name %> -
            <%= link_to 'logout', :action => :logout, :controller => :security %>

        <% end %>

        <% if @eg %>

group:
            <%= @eg.to_s_with_eg_path %>
            <%= link_to 'change', scope_event_groups_url %>

        <% end %>

Project Application Tool

    <% if @user %>

          <%= new_item "Your Apps", "your_apps", :list %>
          <% if @show_your_project %>
            <%= new_item "Your Projects", "main", :your_projects %>
          <% end %>
          <% unless @user.is_student? %>
            <%= new_item "App Processing", "main", :your_applications %>
	    <% if @eg && @eg.has_your_campuses %>
              <%= new_item "Your Campuses", "main", :your_campuses %>
	    <% end %>
            <% if @user.is_projects_coordinator? %>
              <%= new_item "Tools", "tools", :index %>
              <%= new_item "Manage Forms", "forms" %>
              <%= new_item "Manage Groups", "event_groups" %>
            <% end %>
            <%= new_item "Manage Projects", "manage_projects", :list %>
            <%= new_item "Reports", "reports", :index %>
          <% end %>
          <%= new_item "Profiles", "profiles", :index%>

    <% end %>

    <% flash.each do |key, msg| %>
      <% full_msg = msg + "
" + link_to_function('Hide') do |page|
      	page["flash_#{key}"].visual_effect :fade
    	end + "
"%>
      <%= content_tag :div, full_msg, :id => "flash_#{key}", :class => 'error flash' %>
    <% end %>

    <% if @user && !@user.is_student? && !@eg.nil? %>

        <%= form_remote_tag :url => { :controller => 'main', :action => :find_people },	:before => "Element.show('loading');", :complete  => "Element.hide('loading');" %>
          Search People:
          <%= text_field 'viewer', 'name', :size => 20%>
          <%= submit_tag "Search" %>
        </form>

    <% end %>

    <% if @title %>

<%=@title%>

    <% end %>

    <% if file_exists? controller.controller_name + "/_menu" %>
      <%= render :partial => controller.controller_name + "/menu" %>
    <% elsif @submenu && file_exists?(@submenu + "/_menu") %>
      <%= render :partial => @submenu + "/menu" %>
    <% end %>

    <% submenu_items_html = yield :submenu %>
    <% if submenu_items_html && !@eg.nil? %>

          <%= submenu_items_html %>

    <% end %>

        <% if @form && params[:controller] != 'forms' %>
          <%= render "layouts/form_#{@form}.rhtml" %>
        <% else %>
          <%= yield %>
        <% end %>

    <% if @eg || @show_contact_emails_override %>

        Non-Technical Inquiries:

				Campus for Christ - projects@campusforchrist.org

				LeaderImpact Group - danielled@leaderimpactgroup.com

				Athletes in Action - morgank@athletesinaction.com

			Technial Inquiries: spt@campusforchrist.org

			Online help can be found here.

    <% end %>

    <%= initialize_sortable_tables %>

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

<% if RAILS_ENV == "development" %>
  <% flash[:error] ||= "You are on our development site -- you should NOT be filling in your app or reference here.  Remove the 'dev.' from your url, and email spt@campusforchrist.org with how you got here" %>
<% end %>

    <title>Project Application Tool</title>
    <%= stylesheet_link_tag 'main2' %>
    <%= render :partial => "externs/sortable_tables" %>
    <%= javascript_include_tag "prototype", "effects" %>
    <%= render :partial => "externs/load_extern" %>

    <% if RAILS_ENV == 'development' && @debug -%>

debug: <%= @debug -%>

    <% end -%>

      Loading <%=image_tag('spinner.gif')%>

        <% if @user %>

user:
            <%= @user.viewer.name %> -
            <%= link_to 'logout', :action => :logout, :controller => :security %>

        <% end %>

        <% if @eg %>

group:
            <%= @eg.to_s_with_eg_path %>
            <%= link_to 'change', scope_event_groups_url %>

        <% end %>

Project Application Tool

    <% if @user %>

          <%= new_item "Your Apps", "your_apps", :list %>
          <% if @show_your_project %>
            <%= new_item "Your Projects", "main", :your_projects %>
          <% end %>
          <% unless @user.is_student? %>
            <%= new_item "App Processing", "main", :your_applications %>
	    <% if @eg && @eg.has_your_campuses %>
              <%= new_item "Your Campuses", "main", :your_campuses %>
	    <% end %>
            <% if @user.is_projects_coordinator? %>
              <%= new_item "Tools", "tools", :index %>
              <%= new_item "Manage Forms", "forms" %>
              <%= new_item "Manage Groups", "event_groups" %>
            <% end %>
            <%= new_item "Manage Projects", "manage_projects", :list %>
            <%= new_item "Reports", "reports", :index %>
          <% end %>
          <%= new_item "Profiles", "profiles", :index%>

    <% end %>

    <% flash.each do |key, msg| %>
      <% full_msg = msg << "
" << link_to_function('Hide') do |page|
      	page["flash_#{key}"].visual_effect :fade
    	end << "
"%>
      <%= content_tag :div, full_msg, :id => "flash_#{key}", :class => 'error flash' %>
    <% end %>

    <% if @user && !@user.is_student? && !@eg.nil? %>

        <%= form_remote_tag :url => { :controller => 'main', :action => :find_people },	:before => "Element.show('loading');", :complete  => "Element.hide('loading');" %>
          Search People:
          <%= text_field 'viewer', 'name', :size => 20%>
          <%= submit_tag "Search" %>
        </form>

    <% end %>

    <% if @title %>

<%=@title%>

    <% end %>

    <% if file_exists? controller.controller_name + "/_menu" %>
      <%= render :partial => controller.controller_name + "/menu" %>
    <% elsif @submenu && file_exists?(@submenu + "/_menu") %>
      <%= render :partial => @submenu + "/menu" %>
    <% end %>

    <% submenu_items_html = yield :submenu %>
    <% if submenu_items_html && !@eg.nil? %>

          <%= submenu_items_html %>

    <% end %>

        <% if @form && params[:controller] != 'forms' %>
          <%= render "layouts/form_#{@form}.rhtml" %>
        <% else %>
          <%= yield %>
        <% end %>

    <% if @eg || @show_contact_emails_override %>

        Non-Technical Inquiries:

				Campus for Christ - projects@campusforchrist.org

				LeaderImpact Group - danielled@leaderimpactgroup.com

				Athletes in Action - morgank@athletesinaction.com

			Technial Inquiries: spt@campusforchrist.org

			Online help can be found here.

    <% end %>

    <%= initialize_sortable_tables %>


hタグを使うよう修正。

hタグを使うよう修正。

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

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

<%= h @flash[:notice]%>

<% end %>
<% if @flash[:errors] && !@flash[:errors].empty? %>

  <% if @flash[:errors].size > 1%>

エラーがありました。ご確認ください。

    <% for error_message in @flash[:errors] %>

<%= h error_message%>

    <% end %>

  <% else %>

<%= h @flash[:errors][0] %>

  <% end %>

<% end %>

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

<%=@flash[:notice]%>

<% end %>
<% if @flash[:errors] && !@flash[:errors].empty? %>

  <% if @flash[:errors].size > 1%>

エラーがありました。ご確認ください。

    <% for error_message in @flash[:errors] %>

<%=error_message%>

    <% end %>

  <% else %>

<%= @flash[:errors][0] %>

  <% end %>

<% end %>


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

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

<%= error_messages_for :header %>

<div class="box" id="action"<% if current_action == 'index' %> style="display:none;"<% end %>>
	<% form_for(:header, :url => headers_path, :html => { :multipart => true }) do |f| -%>

New Header

<%= f.file_field :uploaded_data %>

Headers should be sized 760x200px.

		<%= submit_tag "Upload", :disable_with => "Upload" %> or
		<% if current_action == 'index' %>
			<%= link_to_function 'Cancel', "$('action').toggle()" %>
		<% else %>
			<%= link_to 'Cancel', headers_path %>
		<% end %>

	<% end %>

<div class="info-left"<% if current_action == 'index' %> style="display:none;"<% end %>>
	<%= link_to 'Home', home_path %> » <%= link_to 'Headers', headers_path %> » New Header

<%= error_messages_for :header %>

<div class="box" id="action"<% if current_action == 'index' %> style="display:none;"<% end %>>
	<% form_for(:header, :url => headers_path) do |f| -%>

New Header

<%= f.file_field :uploaded_data %>

Headers should be sized 760x200px.

		<%= submit_tag "Upload", :disable_with => "Upload" %> or
		<% if current_action == 'index' %>
			<%= link_to_function 'Cancel', "$('action').toggle()" %>
		<% else %>
			<%= link_to 'Cancel', headers_path %>
		<% end %>

	<% end %>

<div class="info-left"<% if current_action == 'index' %> style="display:none;"<% end %>>
	<%= link_to 'Home', home_path %> » <%= link_to 'Headers', headers_path %> » New Header


Remove donate box from front page.

Remove donate box from front page.


I18nize a few extra strings in sign-in page

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

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

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

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

<%= _('Sign in') %>

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

        <%= _('- or -') %>

<%= _('Sign up') %>

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

<% end %>

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

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

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

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

Sign in

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

          - or -

Sign up

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

<% end %>


Fix new user for people with projects without any users

<%
  @user_ids = []
  @current_user.company.projects.each do |p|
    @user_ids <
 ["id IN (#{@user_ids.flatten.compact.uniq.join(',')})"], :order => "name").collect{|u| [u.name, u.id.to_s]}
%>

<fieldset>
<legend>New User</legend>

<% form_tag :action => 'create' do %>
  <%= render :partial => "form" %>

  <%=_('Signup Message')%><%= text_area_tag 'welcome_message', {}, { :rows => 10, :style => "width:80%;"} %>

  <%=_('The message will be included in the signup email.')%>

  <%= submit_tag _("Create"), :class => 'nolabel' %> <%= _'and copy permissions from'%>

  <select name="copy_user" id="copy_user">
     <option value="0" class="select_default"><%= _("[No one]") %></option>
     <%= options_for_select @users, params[:copy_user].to_i %>
  </select>

<% end %>

</fieldset>

<%
  @user_ids = []
  @current_user.company.projects.each do |p|
    @user_ids <
 ["id IN (#{@user_ids.uniq.join(',')})"], :order => "name").collect{|u| [u.name, u.id.to_s]}
%>

<fieldset>
<legend>New User</legend>

<% form_tag :action => 'create' do %>
  <%= render :partial => "form" %>

  <%=_('Signup Message')%><%= text_area_tag 'welcome_message', {}, { :rows => 10, :style => "width:80%;"} %>

  <%=_('The message will be included in the signup email.')%>

  <%= submit_tag _("Create"), :class => 'nolabel' %> <%= _'and copy permissions from'%>

  <select name="copy_user" id="copy_user">
     <option value="0" class="select_default"><%= _("[No one]") %></option>
     <%= options_for_select @users, params[:copy_user].to_i %>
  </select>

<% end %>

</fieldset>


Fix display of no pending messages message.

<% @title = "Summary" %>

<%=@title%>

<%=@public_body_count%> public authorities

<%=@info_request_count%> requests

<%=@user_count%> users

<%=@track_thing_count%> tracked things

<%=@comment_count%> annotations

Things to do

<% if @holding_pen_messages.size > 0 %>

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

    <% for message in @holding_pen_messages %>

            <%= link_to excerpt(message.get_body_for_quoting, "", 60), "request/show_raw_email/" + message.raw_email_id.to_s %>
            (<%=simple_date(message.sent_at)%>)

    <% end %>

<% end %>

<% if @ten_days_old_unclassified.size > 0 %>

Classify responses that are still unclassified ten days after response (<%=@ten_days_old_unclassified.size%> total)

    <% for @request in @ten_days_old_unclassified %>

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

    <% end %>

<% end %>

<% if @requires_admin_requests.size > 0 %>

Work out what to do with these unusual responses (a new category?) (<%=@requires_admin_requests.size%> total)

    <% for @request in @requires_admin_requests %>

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

    <% end %>

<% end %>

<% if @blank_contacts.size > 0 %>

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

    <% for @blank_contact in @blank_contacts %>

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

    <% end %>

<% end %>

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

No pending administration required.

<% end %>

<% @title = "Summary" %>

<%=@title%>

<%=@public_body_count%> public authorities

<%=@info_request_count%> requests

<%=@user_count%> users

<%=@track_thing_count%> tracked things

<%=@comment_count%> annotations

Things to do

<% if @holding_pen_messages.size > 0 %>

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

    <% for message in @holding_pen_messages %>

            <%= link_to excerpt(message.get_body_for_quoting, "", 60), "request/show_raw_email/" + message.raw_email_id.to_s %>
            (<%=simple_date(message.sent_at)%>)

    <% end %>

<% end %>

<% if @ten_days_old_unclassified.size > 0 %>

Classify responses that are still unclassified ten days after response (<%=@ten_days_old_unclassified.size%> total)

    <% for @request in @ten_days_old_unclassified %>

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

    <% end %>

<% end %>

<% if @requires_admin_requests.size > 0 %>

Work out what to do with these unusual responses (a new category?) (<%=@requires_admin_requests.size%> total)

    <% for @request in @requires_admin_requests %>

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

    <% end %>

<% end %>

<% if @blank_contacts.size > 0 %>

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

    <% for @blank_contact in @blank_contacts %>

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

    <% end %>

<% end %>

<% if @requires_admin_requests.size == 0 and @ten_days_old_unclassified.size == 0 and @blank_contacts.size == 0 %>

No pending administration required.

<% end %>


Another link with missing main_url

Another link with missing main_url

<% @title = "Summary" %>

Things to do

  <% if @holding_pen_messages.size > 0 %>

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

            <% for message in @holding_pen_messages %>

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

                  <%=simple_date(message.sent_at)%>

            <% end %>

  <% end %>

  <% if @error_message_requests.size > 0 %>

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

            <% for @request in @error_message_requests %>

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

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

            <% end %>

  <% end %>

  <% if @attention_requests.size > 0 %>

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

            <% for @request in @attention_requests %>

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

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

            <% end %>

  <% end %>

  <% if @requires_admin_requests.size > 0 %>

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

            <% for @request in @requires_admin_requests %>

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

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

            <% end %>

  <% end %>

  <% if @blank_contacts.size > 0 %>

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

            <% for @blank_contact in @blank_contacts %>

                  <%= link_to(''.html_safe, public_body_admin_url(@blank_contact))%>
                  <%= link_to h(@blank_contact.name), main_url(public_body_url(@blank_contact)) %>

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

            <% end %>

  <% end %>

  <% if @old_unclassified.size > 0 %>

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

            <% for @request in @old_unclassified %>

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

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

            <% end %>

  <% end %>

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

      No pending administration required.

<% end %>

<% @title = "Summary" %>

Things to do

  <% if @holding_pen_messages.size > 0 %>

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

            <% for message in @holding_pen_messages %>

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

                  <%=simple_date(message.sent_at)%>

            <% end %>

  <% end %>

  <% if @error_message_requests.size > 0 %>

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

            <% for @request in @error_message_requests %>

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

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

            <% end %>

  <% end %>

  <% if @attention_requests.size > 0 %>

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

            <% for @request in @attention_requests %>

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

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

            <% end %>

  <% end %>

  <% if @requires_admin_requests.size > 0 %>

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

            <% for @request in @requires_admin_requests %>

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

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

            <% end %>

  <% end %>

  <% if @blank_contacts.size > 0 %>

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

            <% for @blank_contact in @blank_contacts %>

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

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

            <% end %>

  <% end %>

  <% if @old_unclassified.size > 0 %>

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

            <% for @request in @old_unclassified %>

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

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

            <% end %>

  <% end %>

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

      No pending administration required.

<% end %>


Fix a small typo.

Fix a small typo.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  <title>Digitaler Vertretungsplan</title>
  <%= stylesheet_link_tag "style" %>
  <%= javascript_include_tag :defaults %>
</head>
<body>
  <%= yield %>
</body>
</html>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  <title>Digitaler Vertretungsplan</title>
  <%= stylesheet_link_tag "style" %>
  <%= javascript_link_tag :defaults %>
</head>
<body>
  <%= yield %>
</body>
</html>


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

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

<%= error_messages_for :header %>

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

New Header

<%= f.file_field :uploaded_data %>

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

Description (optional)

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

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

<% end %>

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

<%= error_messages_for :header %>

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

New Header

<%= f.file_field :uploaded_data %>

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

Description (optional)

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

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

<% end %>

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


Remove modal sign-in from New Request page

<% @title = _("Make an {{law_used_short}} request to '{{public_body_name}}'",:law_used_short=>h(@info_request.law_used_short),:public_body_name=>h(@info_request.public_body.name))  %>

<% if @existing_request %>

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

<% end %>

    <%= foi_error_messages_for :info_request, :outgoing_message %>

<%= _('2. Ask for Information') %>

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

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

                <% if @info_request.public_body.info_requests.size > 0 %>
                    <%= _("Browse other requests to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_url(@info_request.public_body)) %>
                <% else %>
                    <%= _("Browse other requests for examples of how to word your request.", :url=>request_list_url) %>
                <% end %>

        <% if @info_request.public_body.has_notes? %>

<%= _('Special note for this authority!') %>

<%= @info_request.public_body.notes_as_html %>

        <% end %>

        <% if @info_request.public_body.eir_only? %>

<%= _('Please ask for environmental information only') %>

<%= _('The Freedom of Information Act does not apply to') %> <%=h(@info_request.public_body.name)%>.
            <%= _('However, you have the right to request environmental
            information under a different law') %> (explanation).
            <%= _('This covers a very wide spectrum of information about the state of
            the natural and built environment, such as:') %>

<%= _('Air, water, soil, land, flora and fauna (including how these effect
            human beings)') %>

<%= _('Information on emissions and discharges (e.g. noise, energy,
            radiation, waste materials)') %>

<%= _('Human health and safety') %>

<%= _('Cultural sites and built structures (as they may be affected by the
            environmental factors listed above)') %>

<%= _('Plans and administrative measures that affect these matters') %>

<%= _('Please only request information that comes under those categories, do not waste your
            time or the time of the public authority by requesting unrelated information.') %>

        <% end %>

            <%= _('Summary:') %>
            <%= f.text_field :title, :size => 50, :id =>"typeahead_search" %>

            (<%= _("a one line summary of the information you are requesting, \n\t\t\te.g.") %>
              <% if @info_request.law_used == 'eir' %>
                  <%= _("'Pollution levels over time for the River Tyne'") %>
              <% else %>
                  <%= _("'Crime statistics by ward level for Wales'") %>
              <% end %>
              )

<%= _('Write your request in simple, precise language.') %>

<%= _('Ask for specific documents or information, this site is not suitable for general enquiries.') %>

<%= _('Keep it focused, you\'ll be more likely to get what you want (why?).') % [help_requesting_path + '#focused'] %>

        <% fields_for :outgoing_message do |o| %>

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

        <% end %>

        <% if !@user %>

                <%= _('Everything that you enter on this page, including your name,
                will be displayed publicly on
                this website forever (why?).') % [help_privacy_path+"#public_request"] %>
                <%= _('If you are thinking of using a pseudonym,
                please read this first.') % [help_privacy_path+"#public_request"] %>

        <% else %>

                <%= _('Everything that you enter on this page
                will be displayed publicly on
                this website forever (why?).') % [help_privacy_path+"#public_request"] %>

        <% end %>

            <%= _(" Can I request information about myself?\n" +
            "\t\t\tNo! (Click here for details)") % [help_requesting_path+"#data_protection"] %>

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

        <% if !@info_request.tag_string.empty? %>

                <%= f.hidden_field(:tag_string) %>
                Tags: <%=h @info_request.tag_string %>

        <% end %>

<% end %>

<%
    enable_modal_signin = false;
%>

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

<% end %>

<% @title = _("Make an {{law_used_short}} request to '{{public_body_name}}'",:law_used_short=>h(@info_request.law_used_short),:public_body_name=>h(@info_request.public_body.name))  %>

<% if @existing_request %>

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

<% end %>

    <%= foi_error_messages_for :info_request, :outgoing_message %>

<%= _('2. Ask for Information') %>

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

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

                <% if @info_request.public_body.info_requests.size > 0 %>
                    <%= _("Browse other requests to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_url(@info_request.public_body)) %>
                <% else %>
                    <%= _("Browse other requests for examples of how to word your request.", :url=>request_list_url) %>
                <% end %>

        <% if @info_request.public_body.has_notes? %>

<%= _('Special note for this authority!') %>

<%= @info_request.public_body.notes_as_html %>

        <% end %>

        <% if @info_request.public_body.eir_only? %>

<%= _('Please ask for environmental information only') %>

<%= _('The Freedom of Information Act does not apply to') %> <%=h(@info_request.public_body.name)%>.
            <%= _('However, you have the right to request environmental
            information under a different law') %> (explanation).
            <%= _('This covers a very wide spectrum of information about the state of
            the natural and built environment, such as:') %>

<%= _('Air, water, soil, land, flora and fauna (including how these effect
            human beings)') %>

<%= _('Information on emissions and discharges (e.g. noise, energy,
            radiation, waste materials)') %>

<%= _('Human health and safety') %>

<%= _('Cultural sites and built structures (as they may be affected by the
            environmental factors listed above)') %>

<%= _('Plans and administrative measures that affect these matters') %>

<%= _('Please only request information that comes under those categories, do not waste your
            time or the time of the public authority by requesting unrelated information.') %>

        <% end %>

            <%= _('Summary:') %>
            <%= f.text_field :title, :size => 50, :id =>"typeahead_search" %>

            (<%= _("a one line summary of the information you are requesting, \n\t\t\te.g.") %>
              <% if @info_request.law_used == 'eir' %>
                  <%= _("'Pollution levels over time for the River Tyne'") %>
              <% else %>
                  <%= _("'Crime statistics by ward level for Wales'") %>
              <% end %>
              )

<%= _('Write your request in simple, precise language.') %>

<%= _('Ask for specific documents or information, this site is not suitable for general enquiries.') %>

<%= _('Keep it focused, you\'ll be more likely to get what you want (why?).') % [help_requesting_path + '#focused'] %>

        <% fields_for :outgoing_message do |o| %>

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

        <% end %>

        <% if !@user %>

                <%= _('Everything that you enter on this page, including your name,
                will be displayed publicly on
                this website forever (why?).') % [help_privacy_path+"#public_request"] %>
                <%= _('If you are thinking of using a pseudonym,
                please read this first.') % [help_privacy_path+"#public_request"] %>

        <% else %>

                <%= _('Everything that you enter on this page
                will be displayed publicly on
                this website forever (why?).') % [help_privacy_path+"#public_request"] %>

        <% end %>

            <%= _(" Can I request information about myself?\n" +
            "\t\t\tNo! (Click here for details)") % [help_requesting_path+"#data_protection"] %>

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

        <% if !@info_request.tag_string.empty? %>

                <%= f.hidden_field(:tag_string) %>
                Tags: <%=h @info_request.tag_string %>

        <% end %>

<% end %>


Bug fix: empty-string page titles don't get the in_place_edit work-around automatically.

<%= render({ :partial => '/shared/page_tabs',
             :locals => { :selected =>4,
                          :page_id => @page.id }}) %>

<%= render({ :partial => '/shared/page_navigation' }) %>

Title: <span id="title_<%= @page.id %>"><%= @page.title.blank? ? "none" : @page.title %>
<%= in_place_editor("title_#{@page.id}",
                    { :url => url_for({ :action => "set_page_title",
                                        :id => @page.id }) }) %>

Position: <%= @page.position %>

<%= button_to("Delete",
            { :action => 'delete',
              :page_id => @page.id },
            { :confirm => 'Are you sure?' }) %>

      <%= html_block('right') %>

<%= render({ :partial => '/shared/page_tabs',
             :locals => { :selected =>4,
                          :page_id => @page.id }}) %>

<%= render({ :partial => '/shared/page_navigation' }) %>

Title: <span id="title_<%= @page.id %>"><%= @page.title || "none" %>
<%= in_place_editor("title_#{@page.id}",
                    { :url => url_for({ :action => "set_page_title",
                                        :id => @page.id }) }) %>

Position: <%= @page.position %>

<%= button_to("Delete",
            { :action => 'delete',
              :page_id => @page.id },
            { :confirm => 'Are you sure?' }) %>

      <%= html_block('right') %>


Moved generate graph button

Moved generate graph button

<%= render({ :partial => '/shared/article_tabs',
             :locals => { :selected =>3,
                          :article_id => @article.id }}) %>

			        <%= link_to("articles",
			                    {:controller => 'article',
			                     :action => 'list',
			                     :collection_id => @collection.id,
      		                 :ol => 'a_graph_articles'}) %>

        Related Subjects Graph for <%= @article.title %>

			<%= image_tag(file_to_url(@article.graph_image), :usemap => '#G') %>
			<%= @map %>

        The graph displays the other subjects mentioned on the same pages as the
        subject <%= @article.title %>.  If the same subject occurs a page
        with <%= @article.title %> more than once, it appears closer to
        <%= @article.title %> on the graph, and is colored in a darker shade.
        The closer a subject is to the center, the more "related" the subjects
        are.

      <% form_for(:article, @article, :url => { :action => 'graph' }) do |f| %>
				Limit the graph to subjects in these categories:

				<%= display_categories(@collection.categories, nil) do |category|
			    check_box_tag("category_ids[]",
			                  category.id,
			                  @categories.include?(category)) +
			    category.title
		  	end %>
		  	Show subjects that appear on at least
		  	<%= text_field_tag('min_rank', @min_rank, :size => 3) %>
		  	pages in common with <%= @article.title %>.

		  	<%= hidden_field_tag(:article_id, @article.id) %>
		  	<%= hidden_field_tag(:force, true) %>
        <%= submit_tag "Generate New Graph", :name => 'graph' %>
  	  <% end %>


Add some explanatory copy about the app

Add some explanatory copy about the app

 About CiteParse

CiteParse classifies document citations into fielded data. You can use
it as a web <%= link_to "application", :controller => "citations", :action => "parse_string" %>
or a <%= link_to "service", :action => "api_instructions" %>. You can also
download the source and run CiteParse on your
own server.

CiteParse is based on  the work of Min-Yen Kan, Isaac G. Councill, C. Lee Giles,
and Yong Kiat Ng, and their application
ParsCit.

CiteParse was developed through a partnership between the
Brown
University Library and Providence-based start-up
Public Display,
with funding from the Mellon Foundation.

CiteParse is implemented in Ruby on Rails and
uses the CRF++ library implementation of
conditional random fields. Our model is trained on the
CORA dataset.

If you're interested in a tool like CiteParse, you should check out these other
citation tools:

ParaCite

ParsCit

<%= link_to "Let us know", :action => "feedback" %> of any other tools you'd like to see listed here.

<%= link_to "Please get in touch with us", :action => "feedback" %> if you have any feedback to share.

<h1> About ParsCit </h1>

ParsCit is a web application and web service to help you parse document
citations into fielded data. It's implemented in Ruby on Rails, and is
based on the work of


Fix non-Ajax habtm updates

Fix non-Ajax habtm updates

Edit <%=h @singular_object.scaffold_name %>'s <%= @many_name %>

<%= form_tag(:action=>@scaffold_update_page, :id=>params[:id]) %>

<% if @many_class.scaffold_use_auto_complete %>

Add This <%= @many_name.singularize.humanize %>

  <%= scaffold_text_field_tag_with_auto_complete('add', @many_class) %>
<% elsif @items_to_add.length > 0 %>

Add These <%= @many_name.humanize %>

  <%= select_tag('add[]', options_for_select(@items_to_add), :id=>'add', :multiple=>'multiple') %>
<% end %>

<% if @items_to_remove.length > 0 %>

Remove These <%= @many_name.humanize %>

  <%= select_tag('remove[]', options_for_select(@items_to_remove), :id=>'remove', :multiple=>'multiple') %>
<% end %>

<%= submit_tag("Update") %>
</form>

Edit <%=h @singular_object.scaffold_name %>'s <%= @many_name %>

<%= form_tag(:action=>@scaffold_update_page, :id=>params[:id]) %>

<% if @many_class.scaffold_use_auto_complete %>

Add This <%= @many_name.singularize.humanize %>

  <%= scaffold_text_field_tag_with_auto_complete('add', @many_class) %>
<% elsif @items_to_add.length > 0 %>

Add These <%= @many_name.humanize %>

  <%= select('add', '', @items_to_add, {}, :multiple=>true) %>
<% end %>

<% if @items_to_remove.length > 0 %>

Remove These <%= @many_name.humanize %>

  <%= select('remove', '', @items_to_remove, {}, :multiple=>true) %>
<% end %>

<%= submit_tag("Update") %>
</form>