Use `project_me` to show your own name for all entries.

This should maybe be made configurable?

---
id: home
title: Overview
---
<%

    num_entries = PloggyHelper.log_items.length
    logged_time_s = PloggyHelper.log_time
    logged_time = PloggyHelper.time_to_s(logged_time_s)
    tot_day_count = PloggyHelper.work_time(project_start_date, project_end_date)
    cur_day_count = PloggyHelper.work_time(project_start_date, Date.today)
    cur_day_count_s = cur_day_count.to_s + '' + PloggyHelper.sup_fix(cur_day_count) + ''
    day_perc = sprintf '%.1f', (100.0 * cur_day_count / tot_day_count)
    logged_perc = sprintf '%.1f', (100.0 * logged_time_s / (tot_day_count / 5.0 * project_hours_per_week))

%>

        <%= render 'glyph-icon', :name => 'th-list' %>
        <%= num_entries %>
        log entries

        <%= render 'glyph-icon', :name => 'user' %>
        <%= project_persons.length %>
        persons involved

        <%= render 'glyph-icon', :name => 'hourglass' %>
        <%= cur_day_count %> / <%= tot_day_count %>
        days passed (<%= day_perc %>%)

        <%= render 'glyph-icon', :name => 'time' %>
        <%= logged_time %>
        spent (<%= logged_perc %>%)

    <div class="stats-day-progress-bar light" style="width: <%= day_perc %>%;">

    <div class="stats-day-progress-bar" style="width: <%= logged_perc %>%;">

<%
    PloggyHelper.sort_log_items
    -1.downto(-5) do |i|
        if PloggyHelper.log_items.length < -i
            break
        end
        item = PloggyHelper.log_items[i]
        start_time = DateTime.parse(item[:start_time])
        end_time = (item[:end_time] == nil) ? start_time : DateTime.parse(item[:end_time])
        date = start_time.strftime('%Y-%m-%d')
        start_time_s = start_time.strftime('%H:%M')
        end_time_s = (item[:end_time] == nil) ? '...?' : end_time.strftime('%H:%M')
%>

        <%= date %>, <%= start_time_s %> - <%= end_time_s %>
        <%= PloggyHelper.time_to_s((end_time - start_time) * 1.day) %>

            <%= (item[:category].is_a? Array) ? item[:category].join(', ') : item[:category] %>
            <%= render 'glyph-icon', :name => 'tag' %>

<%= item.reps[0].compiled_content.gsub(/\n\n/, "
\n
") %>

        <%
            persons = item[:persons]
            if persons == nil
                persons = []
            elsif persons.is_a? String
                persons = [persons]
            end
            ([PloggyHelper.project_me] + persons).each{|nick|
        %>
        <span class="person" data-nick="<%= nick %>">
            <%= project_persons[nick] %>
            <%= render 'glyph-icon', :name => 'user' %>

        <%
            }
        %>

<%
    end
%>

---
id: home
title: Overview
---
<%

    num_entries = PloggyHelper.log_items.length
    logged_time_s = PloggyHelper.log_time
    logged_time = PloggyHelper.time_to_s(logged_time_s)
    tot_day_count = PloggyHelper.work_time(project_start_date, project_end_date)
    cur_day_count = PloggyHelper.work_time(project_start_date, Date.today)
    cur_day_count_s = cur_day_count.to_s + '' + PloggyHelper.sup_fix(cur_day_count) + ''
    day_perc = sprintf '%.1f', (100.0 * cur_day_count / tot_day_count)
    logged_perc = sprintf '%.1f', (100.0 * logged_time_s / (tot_day_count / 5.0 * project_hours_per_week))

%>

        <%= render 'glyph-icon', :name => 'th-list' %>
        <%= num_entries %>
        log entries

        <%= render 'glyph-icon', :name => 'user' %>
        <%= project_persons.length %>
        persons involved

        <%= render 'glyph-icon', :name => 'hourglass' %>
        <%= cur_day_count %> / <%= tot_day_count %>
        days passed (<%= day_perc %>%)

        <%= render 'glyph-icon', :name => 'time' %>
        <%= logged_time %>
        spent (<%= logged_perc %>%)

    <div class="stats-day-progress-bar light" style="width: <%= day_perc %>%;">

    <div class="stats-day-progress-bar" style="width: <%= logged_perc %>%;">

<%
    PloggyHelper.sort_log_items
    -1.downto(-5) do |i|
        if PloggyHelper.log_items.length < -i
            break
        end
        item = PloggyHelper.log_items[i]
        start_time = DateTime.parse(item[:start_time])
        end_time = (item[:end_time] == nil) ? start_time : DateTime.parse(item[:end_time])
        date = start_time.strftime('%Y-%m-%d')
        start_time_s = start_time.strftime('%H:%M')
        end_time_s = (item[:end_time] == nil) ? '...?' : end_time.strftime('%H:%M')
%>

        <%= date %>, <%= start_time_s %> - <%= end_time_s %>
        <%= PloggyHelper.time_to_s((end_time - start_time) * 1.day) %>

            <%= (item[:category].is_a? Array) ? item[:category].join(', ') : item[:category] %>
            <%= render 'glyph-icon', :name => 'tag' %>

<%= item.reps[0].compiled_content.gsub(/\n\n/, "
\n
") %>

        <%
            persons = item[:persons]
            if persons == nil
                persons = []
            elsif persons.is_a? String
                persons = [persons]
            end
            persons.each{|nick|
        %>
        <span class="person" data-nick="<%= nick %>">
            <%= project_persons[nick] %>
            <%= render 'glyph-icon', :name => 'user' %>

        <%
            }
        %>

<%
    end
%>


Remove reference to missing application.js in scribbish.  Closes #985

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

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

  <title><%=h page_title %></title>
  <%= page_header %>
  <%= stylesheet_link_tag '/stylesheets/theme/application.css', :media => 'all' %>

<%= link_to this_blog.blog_name, { :controller => '/' } %>

<%= this_blog.blog_subtitle %>

      <%= @content_for_layout %>
      <%= javascript_tag 'show_dates_as_local_time()' %>

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

      <%= render_sidebars %>

<%= link_to this_blog.blog_name, { :controller => '/' } %>

powered by <%= link_to 'typo', 'http://typosphere.org' %> /
          styled with <%= link_to 'scribbish', 'http://quotedprintable.com/pages/scribbish' %>

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

  <title><%=h page_title %></title>
  <%= page_header %>
  <%= stylesheet_link_tag '/stylesheets/theme/application.css', :media => 'all' %>
  <%= javascript_include_tag '/javascript/theme/application.js' %>

<%= link_to this_blog.blog_name, { :controller => '/' } %>

<%= this_blog.blog_subtitle %>

      <%= @content_for_layout %>
      <%= javascript_tag 'show_dates_as_local_time()' %>

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

      <%= render_sidebars %>

<%= link_to this_blog.blog_name, { :controller => '/' } %>

powered by <%= link_to 'typo', 'http://typosphere.org' %> /
          styled with <%= link_to 'scribbish', 'http://quotedprintable.com/pages/scribbish' %>


Revert "Let everyone know, not just us"

Revert "Let everyone know, not just us"

This reverts commit e3cfe550fe835c68b25d693abd40aedd954913b3.

It’s a bit late in the release cycle to be making a cosmetic change
to a string that has to be translated into lots of different languages.
We’ll pull this change into the develop branch, but not release/0.6.

<%=_('To let us know, follow this link and then select the appropriate box.')%>

<%=@url%>

<%= _('Your request was called {{info_request}}. Letting everyone know whether you got the information will help us keep tabs on',:info_request=>@info_request.title)%>
<%= @info_request.public_body.name %>.

-- <%= _('the {{site_name}} team', :site_name=>site_name) %>

<%=_('To let everyone know, follow this link and then select the appropriate box.')%>

<%=@url%>

<%= _('Your request was called {{info_request}}. Letting everyone know whether you got the information will help us keep tabs on',:info_request=>@info_request.title)%>
<%= @info_request.public_body.name %>.

-- <%= _('the {{site_name}} team', :site_name=>site_name) %>


small network create fix

small network create fix

<% submit = true if submit.nil? %>
<%= hidden_field_tag('parent_id', @parent.id) if @parent %>

  <%= '{group_type} Information'[:group_infomation, {:group_type => group_type.t}] %>

<%-
# only show the committee type form if:
#  * we are creatting a new committee,
#  * the parent group of said committe doesn't already have a council,
#  * and we have admin privileges on the group.
# Yes, this is confusing.
-%>
<% if @parent and may_admin_group? and @group and @group.new_record? and @parent.real_council.nil? %>

    <%= "Committee type"[:commitee_type]%>

    <%= "What type of committee will this be?"[:committee_type_description]%>

<%= radio_button(:group, 'is_council', "true") %> <%= "coordinating council".t %>: <%= :coordinating_council_description.t % {:group_type => @parent.display_type, :group_name => @parent.name} %>

<%= radio_button(:group, 'is_council', "false") %> <%= "working group".t %>: <%= :working_group_description.t % {:group_type => @parent.display_type, :group_name => @parent.name} %>

<%- elsif @group && @group.is_council? && !@parent.nil? -%>

  <%= "This committee is the coordinating council for {parent_group}."[:this_is_coordinating,
    {:parent_group => link_to_group(@parent)}] %>

<%- elsif !@parent.nil? -%>

  <%= "This committee is part of {parent_group}."[:this_is_committee,
    {:parent_group => link_to_group(@parent)}] %>

<% end -%>

    <%= "Full name"[:fullname]%>

    <%= "A descriptive name used for display."[:descriptive_name_for_display]%>

  <%= text_field 'group', 'full_name', :size => 30  %>

  <%= "Link Name"[:link_name] %>

    <%= "This name is how you will refer to this group in links and URLs. It must only contain alphanumeric characters, no spaces allowed."[:link_name_description] %>

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

    <%= "Language"[:language] %>

    <%= 'The main language of this %s.'[:group_language] % group_type.t %>

  <%= select 'group', 'language', Language.find(:all).to_select(:name, :code), { :include_blank => true }  %>

    <%= :summary.t %>

    <%= 'Brief information regarding this %s.'[:group_summary] % group_type %>

  <%= text_field 'group', 'summary', :size => 60, :maxlength => 256  %>

<% if !@parent and @group.new_record? and false%>
<%# this is a nice idea, but it doesn't appear to be working at all, so i have disabled it -elijah %>

    <input type="checkbox" name="add_council" value="true" /><%= 'Add Council'[:add_council] %>

    <%= 'If this group has a coordinating council, then only a member of that council may administer the group. Otherwise, any member of the group may do so.'[:edit_council_help_text] %>

<% end %>

<%-
# Show the coordinating council selection form iff we are editing a group with at least one committee
-%>
<%- if !@group.committees.empty? && may_admin_group? -%>

    <%= "Coordinating council".t.capitalize %>

    <%= 'If this group has a coordinating council, then only a member of that council may administer the group. Otherwise, any member of the group may do so.'[:edit_council_help_text] %>

  <%= select 'group', 'council_id', @group.committees.map{|c| [c.name, c.id]}.sort, { :include_blank => true } %>

<%- end -%>
  <%= submit_tag 'Save changes'[:save_changes] if submit %>

<%= '%s Privacy Settings'[:group_privacy_settings] % group_type.capitalize %>

<%= check_box :group, :publicly_visible_group, :onclick => "show_or_hide_vis_opts();" %>
<%= 'Make %s Publicly Visible'[:group_publicly_visible] % group_type.capitalize %>

<%= "Group appears in public directory and group profile is viewable by non-members at we.riseup.net/yourgroupname."[:group_publicly_visible_description] %>

<% if not committee? -%>

<%= check_box :group, :publicly_visible_committees %>
  <%= 'Make Committees Publicly Visible'[:committee_publicly_visible] %>

  <%= "Committees are viewable by non-members at we.riseup.net/yourgroupname"[:committee_publicly_visible_description] %>

<% end -%>

<%= check_box :group, :publicly_visible_members %>
  <%= "Make Members Publicly Visible"[:group_members_publicly_visible] %>

<%= "  Members are viewable by non-members at we.riseup.net/yourgroupname. Also, the name of the group will be listed on each members profile page (we.riseup.net/username)"[:group_members_publicly_visible_description] %>

<%= check_box :group, :accept_new_membership_requests %>
  <%= :allow_membership_requests.t %>

  A “join group” link will appear on your group page. This will send a request for membership to your group that can be accepted or rejected.

  <%= submit_tag 'Save changes'[:save_changes] if submit%>

<%# this is probably not the rails way to do javascript.  someone teach me.  --af
  # i put this at the end of the file, so that group_publicly_visible_group exists
  # in time for the function to show/hide it correctly -%>

<% submit = true if submit.nil? %>
<%= hidden_field_tag('parent_id', @parent.id) if @parent %>

  <%= '{group_type} Information'[:group_infomation, {:group_type => group_type.t}] %>

<%-
# only show the committee type form if:
#  * we are creatting a new committee,
#  * the parent group of said committe doesn't already have a council,
#  * and we have admin privileges on the group.
# Yes, this is confusing.
-%>
<% if @parent and may_admin_group? and @group.new_record? and @parent.real_council.nil? %>

    <%= "Committee type"[:commitee_type]%>

    <%= "What type of committee will this be?"[:committee_type_description]%>

<%= radio_button(:group, 'is_council', "true") %> <%= "coordinating council".t %>: <%= :coordinating_council_description.t % {:group_type => @parent.display_type, :group_name => @parent.name} %>

<%= radio_button(:group, 'is_council', "false") %> <%= "working group".t %>: <%= :working_group_description.t % {:group_type => @parent.display_type, :group_name => @parent.name} %>

<%- elsif @group.is_council? && !@parent.nil? -%>

  <%= "This committee is the coordinating council for {parent_group}."[:this_is_coordinating,
    {:parent_group => link_to_group(@parent)}] %>

<%- elsif !@parent.nil? -%>

  <%= "This committee is part of {parent_group}."[:this_is_committee,
    {:parent_group => link_to_group(@parent)}] %>

<% end -%>

    <%= "Full name"[:fullname]%>

    <%= "A descriptive name used for display."[:descriptive_name_for_display]%>

  <%= text_field 'group', 'full_name', :size => 30  %>

  <%= "Link Name"[:link_name] %>

    <%= "This name is how you will refer to this group in links and URLs. It must only contain alphanumeric characters, no spaces allowed."[:link_name_description] %>

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

    <%= "Language"[:language] %>

    <%= 'The main language of this %s.'[:group_language] % group_type.t %>

  <%= select 'group', 'language', Language.find(:all).to_select(:name, :code), { :include_blank => true }  %>

    <%= :summary.t %>

    <%= 'Brief information regarding this %s.'[:group_summary] % group_type %>

  <%= text_field 'group', 'summary', :size => 60, :maxlength => 256  %>

<% if !@parent and @group.new_record? and false%>
<%# this is a nice idea, but it doesn't appear to be working at all, so i have disabled it -elijah %>

    <input type="checkbox" name="add_council" value="true" /><%= 'Add Council'[:add_council] %>

    <%= 'If this group has a coordinating council, then only a member of that council may administer the group. Otherwise, any member of the group may do so.'[:edit_council_help_text] %>

<% end %>

<%-
# Show the coordinating council selection form iff we are editing a group with at least one committee
-%>
<%- if !@group.committees.empty? && may_admin_group? -%>

    <%= "Coordinating council".t.capitalize %>

    <%= 'If this group has a coordinating council, then only a member of that council may administer the group. Otherwise, any member of the group may do so.'[:edit_council_help_text] %>

  <%= select 'group', 'council_id', @group.committees.map{|c| [c.name, c.id]}.sort, { :include_blank => true } %>

<%- end -%>
  <%= submit_tag 'Save changes'[:save_changes] if submit %>

<%= '%s Privacy Settings'[:group_privacy_settings] % group_type.capitalize %>

<%= check_box :group, :publicly_visible_group, :onclick => "show_or_hide_vis_opts();" %>
<%= 'Make %s Publicly Visible'[:group_publicly_visible] % group_type.capitalize %>

<%= "Group appears in public directory and group profile is viewable by non-members at we.riseup.net/yourgroupname."[:group_publicly_visible_description] %>

<% if not committee? -%>

<%= check_box :group, :publicly_visible_committees %>
  <%= 'Make Committees Publicly Visible'[:committee_publicly_visible] %>

  <%= "Committees are viewable by non-members at we.riseup.net/yourgroupname"[:committee_publicly_visible_description] %>

<% end -%>

<%= check_box :group, :publicly_visible_members %>
  <%= "Make Members Publicly Visible"[:group_members_publicly_visible] %>

<%= "  Members are viewable by non-members at we.riseup.net/yourgroupname. Also, the name of the group will be listed on each members profile page (we.riseup.net/username)"[:group_members_publicly_visible_description] %>

<%= check_box :group, :accept_new_membership_requests %>
  <%= :allow_membership_requests.t %>

  A “join group” link will appear on your group page. This will send a request for membership to your group that can be accepted or rejected.

  <%= submit_tag 'Save changes'[:save_changes] if submit%>

<%# this is probably not the rails way to do javascript.  someone teach me.  --af
  # i put this at the end of the file, so that group_publicly_visible_group exists
  # in time for the function to show/hide it correctly -%>


fix pdc styles

fix pdc styles

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

  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="robots" content="all">
  <title>Workload - BAM</title>

  <%= javascript_include_tag :defaults %>
  <link href='http://fonts.googleapis.com/css?family=Kameron&v1' rel='stylesheet' type='text/css'>
  <link href='http://fonts.googleapis.com/css?family=Stardos+Stencil&v1' rel='stylesheet' type='text/css'>
  <link href='http://fonts.googleapis.com/css?family=Zeyada&v1' rel='stylesheet' type='text/css'>
  <link rel="Shortcut Icon" type="image/x-icon" href="/images/favicon.ico" />
  <link rel="stylesheet" type="text/css" href="/stylesheets/fixed_header_table.css" />
  <link rel="stylesheet" type="text/css" href="/stylesheets/jquery-ui.css">
  <link rel="stylesheet" type="text/css" href="/stylesheets/jquery.tagit.css" />
  <link rel="stylesheet" type="text/css" href="/stylesheets/styles.css" />
  <link rel="stylesheet" type="text/css" href="/stylesheets/pdc.css" />
  <link rel="stylesheet" type="text/css" href="/stylesheets/tabs.css" />
  <link rel="stylesheet" type="text/css" href="/stylesheets/tagit.ui-zendesk.css" />

<%
  cu = current_user
  cu.last_view = Time.now
  cu.save
%>

<%#= render :file => 'chat/main' %>

  <%= render :file => 'layouts/context_select' %>

Workloads

  <% b = get_bandeau; if b %>

<%= b.text %>

<%= b.person.name %>

  <% end %>

    <%= link_to('Add something', {:controller=>'bandeaus', :action=>'new'}) %> |
    <%= link_to('See all', {:controller=>'bandeaus', :action=>'index'}) %>

  <% if current_user.has_role?('Admin') %>
  <%= link_to('Workload', {:controller=>'workloads', :action=>'index'}, {:class=>menu_style('workloads','index')}) %>

  <% if APP_CONFIG['plannings_menu'] %>
    <%= link_to('Planning', {:controller=>'plannings', :action=>'index'}, {:class=>menu_style('planning','index')}) %>
  <% end %>
  <%= link_to('Consolidation', {:controller=>'workloads', :action=>'consolidation'}, {:class=>menu_style('workloads', 'consolidation')}) %>
  <%= link_to('Holidays', {:controller=>'holidays', :action=>'index'}, {:class=>menu_style('holidays','*')}) %>
  <% end %>
  <%= Date.today.strftime('%d-%b-%Y') %> - week <%= Date.today.cweek %>

<%= yield %>

<%= render :file => 'layouts/footer.erb' %>

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

  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="robots" content="all">
  <title>Workload - BAM</title>

  <%= javascript_include_tag :defaults %>
  <link href='http://fonts.googleapis.com/css?family=Kameron&v1' rel='stylesheet' type='text/css'>
  <link href='http://fonts.googleapis.com/css?family=Stardos+Stencil&v1' rel='stylesheet' type='text/css'>
  <link href='http://fonts.googleapis.com/css?family=Zeyada&v1' rel='stylesheet' type='text/css'>
  <link rel="Shortcut Icon" type="image/x-icon" href="/images/favicon.ico" />
  <link rel="stylesheet" type="text/css" href="/stylesheets/fixed_header_table.css" />
  <link rel="stylesheet" type="text/css" href="/stylesheets/jquery-ui.css">
  <link rel="stylesheet" type="text/css" href="/stylesheets/jquery.tagit.css" />
  <link rel="stylesheet" type="text/css" href="/stylesheets/pdc.css" />
  <link rel="stylesheet" type="text/css" href="/stylesheets/styles.css" />
  <link rel="stylesheet" type="text/css" href="/stylesheets/tabs.css" />
  <link rel="stylesheet" type="text/css" href="/stylesheets/tagit.ui-zendesk.css" />

<%
  cu = current_user
  cu.last_view = Time.now
  cu.save
%>

<%#= render :file => 'chat/main' %>

  <%= render :file => 'layouts/context_select' %>

Workloads

  <% b = get_bandeau; if b %>

<%= b.text %>

<%= b.person.name %>

  <% end %>

    <%= link_to('Add something', {:controller=>'bandeaus', :action=>'new'}) %> |
    <%= link_to('See all', {:controller=>'bandeaus', :action=>'index'}) %>

  <% if current_user.has_role?('Admin') %>
  <%= link_to('Workload', {:controller=>'workloads', :action=>'index'}, {:class=>menu_style('workloads','index')}) %>

  <% if APP_CONFIG['plannings_menu'] %>
    <%= link_to('Planning', {:controller=>'plannings', :action=>'index'}, {:class=>menu_style('planning','index')}) %>
  <% end %>
  <%= link_to('Consolidation', {:controller=>'workloads', :action=>'consolidation'}, {:class=>menu_style('workloads', 'consolidation')}) %>
  <%= link_to('Holidays', {:controller=>'holidays', :action=>'index'}, {:class=>menu_style('holidays','*')}) %>
  <% end %>
  <%= Date.today.strftime('%d-%b-%Y') %> - week <%= Date.today.cweek %>

<%= yield %>

<%= render :file => 'layouts/footer.erb' %>


Put missing required

Put missing required

<% if profile.person? %>

<%= _('Send an e-mail to %s') % profile.name %>

<% else %>

<%= _('Send an e-mail to administrators') %>

<%= _("The e-mail will be sent to the administrators of '%s'") % profile.name %>

<% end %>

<%= error_messages_for 'contact' %>

<% labelled_form_for :contact, @contact do |f| %>
  <%= hidden_field_tag(:confirm, 'false') %>

  <%= required_fields_message %>

  <% location_fields = select_city(true) %>

  <% unless environment.enabled?('disable_select_city_for_contact') || location_fields.blank? %>
    <%= labelled_form_field _('City and state'), location_fields %>
  <% end %>
  <%= required f.text_field(:subject) %>

  <%= render :file => 'shared/tiny_mce' %>
  <%= required f.text_area(:message, :class => 'mceEditor') %>

  <%= labelled_form_field check_box(:contact, :receive_a_copy) + _('I want to receive a copy of the message in my e-mail.'), '' %>

  <%= submit_button(:send, _('Send'), :onclick => "$('confirm').value = 'true'") %>
<% end %>

<% if profile.person? %>

<%= _('Send an e-mail to %s') % profile.name %>

<% else %>

<%= _('Send an e-mail to administrators') %>

<%= _("The e-mail will be sent to the administrators of '%s'") % profile.name %>

<% end %>

<%= error_messages_for 'contact' %>

<% labelled_form_for :contact, @contact do |f| %>
  <%= hidden_field_tag(:confirm, 'false') %>

  <%= required_fields_message %>

  <% location_fields = select_city(true) %>

  <% unless environment.enabled?('disable_select_city_for_contact') || location_fields.blank? %>
    <%= labelled_form_field _('City and state'), location_fields %>
  <% end %>
  <%= f.text_field :subject %>

  <%= render :file => 'shared/tiny_mce' %>
  <%= f.text_area :message, :class => 'mceEditor' %>

  <%= labelled_form_field check_box(:contact, :receive_a_copy) + _('I want to receive a copy of the message in my e-mail.'), '' %>

  <%= submit_button(:send, _('Send'), :onclick => "$('confirm').value = 'true'") %>
<% end %>


Link to publication scheme (if known) when making a new request.

<% @title = "Make an " + h(@info_request.law_used_short) + " request to '" + h(@info_request.public_body.name) + "'" %>

<% if @existing_request %>

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

<% end %>

<%= foi_error_messages_for :info_request, :outgoing_message %>

Read this before writing your <%=h(@info_request.law_used_full)%> request

        <% form_tag("http://www.google.co.uk/search", {:id => "search_body_website_form", :method => "get"} ) do %>

               First, search the authority's web site ...
               <% if !@info_request.public_body.calculated_home_page.nil? %>

                           <%= text_field_tag 'q', params[:q], { :size => 20 } %>
                   <%= hidden_field_tag 'as_sitesearch', @info_request.public_body.calculated_home_page %>
                   <%= submit_tag "Search" %>
               <% end %>

               ... to check that the info isn't already published.

        <% end %>

    <% if !@info_request.public_body.publication_scheme.empty? %>

Browse the authority's
        <%= link_to "publication scheme", @info_request.public_body.publication_scheme %>
        to see if the information is already readily accessible, or for clues as to what could be requested.

    <% end %>

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

Write your request in simple, precise language.

Ask for specific documents or information, this site is not suitable for general enquiries.

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

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

    <% if @info_request.public_body.notes != "" %>

Special note for this authority!

<%=MySociety::Format.make_clickable(@info_request.public_body.notes) %>

    <% 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 %>

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

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

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

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

		<% 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 (why?).
                If you are thinking of using a pseudonym,
                please read this first.

        <% else %>

                Everything that you enter on this page
                will be displayed publicly on
                this website (why?).

        <% end %>

			Can I request information about myself?
			No! (Click here for details)

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

<% end %>

<% @title = "Make an " + h(@info_request.law_used_short) + " request to '" + h(@info_request.public_body.name) + "'" %>

<% if @existing_request %>

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

<% end %>

<%= foi_error_messages_for :info_request, :outgoing_message %>

Read this before writing your <%=h(@info_request.law_used_full)%> request

        <% form_tag("http://www.google.co.uk/search", {:id => "search_body_website_form", :method => "get"} ) do %>

               First, search the authority's web site ...
               <% if !@info_request.public_body.calculated_home_page.nil? %>

                           <%= text_field_tag 'q', params[:q], { :size => 20 } %>
                   <%= hidden_field_tag 'as_sitesearch', @info_request.public_body.calculated_home_page %>
                   <%= submit_tag "Search" %>
               <% end %>

               ... to check that the info isn't already published.

        <% end %>

Write your request in simple, precise language.

Ask for specific documents or information, this site is not suitable
    for general enquiries.

    <% if @info_request.public_body.info_requests.size > 0 %>

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

    <% else %>

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

    <% end %>

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

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

    <% if @info_request.public_body.notes != "" %>

Special note for this authority!

<%=MySociety::Format.make_clickable(@info_request.public_body.notes) %>

    <% 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 %>

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

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

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

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

		<% 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 (why?).
                If you are thinking of using a pseudonym,
                please read this first.

        <% else %>

                Everything that you enter on this page
                will be displayed publicly on
                this website (why?).

        <% end %>

			Can I request information about myself?
			No! (Click here for details)

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

<% end %>


Removing an item should utilise a cross rather than a tick.

<%= 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 => 15, :style => "width:80%;" }.merge( perms['edit'] )  %>

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

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

	<% if @task.new_record? %>
        <%= submit_tag _("Create"), :class => "nolabel" %>
        <%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %>
<%=_ 'Send notification emails' %>

	<% else %>
        <%= submit_tag _("Save"), :class => "nolabel" %> <%=_ 'and' %>

        <%
 options = []
 options << [_("Leave Open"), 0] if @task.status == 0
 options << [_("Revert to Open"), 0] if @task.status != 0
 options << [_("Set in Progress"), 1] if @task.status == 0
 options << [_("Leave as in Progress"), 1] if @task.status == 1
 options << [_("Close"), 2] if @task.status == 0 || @task.status == 1
 options << [_("Leave Closed"), 2] if @task.status == 2
 options << [_("Set as Won't Fix"), 3] if @task.status == 0 || @task.status == 1
 options << [_("Leave as Won't Fix"), 3] if @task.status == 3
 options << [_("Set as Invalid"), 4] if @task.status == 0 || @task.status == 1
 options << [_("Leave as Invalid"), 4] if @task.status == 4
 options << [_("Set as Duplicate"), 5] if @task.status == 0 || @task.status == 1
 options << [_("Leave as Duplicate"), 5] if @task.status == 5
 options << [_("Wait"), 6] if @task.status < 2

 can_close = {:disabled => "disabled"} unless current_user.can?( @task.project, 'close' )
 can_close ||= {}

 defer_options = []
 defer_options << [_("Tomorrow"), tz.local_to_utc(tz.now.at_midnight + 1.days).to_s(:db)  ]
 defer_options << [_("End of week"), tz.local_to_utc(tz.now.beginning_of_week + 4.days).to_s(:db)  ]
 defer_options << [_("Next week"), tz.local_to_utc(tz.now.beginning_of_week + 7.days).to_s(:db) ]
 defer_options << [_("One week"), tz.local_to_utc(tz.now.at_midnight + 7.days).to_s(:db) ]
 defer_options << [_("Next month"), tz.local_to_utc(tz.now.next_month.beginning_of_month).to_s(:db)]
 defer_options << [_("One month"), tz.local_to_utc(tz.now.next_month.at_midnight).to_s(:db)]

%>

<%= select 'task', 'status', options, {:selected => @task.status}, can_close %>

<%= _("until") %>
<%= select 'task', 'hide_until', defer_options %>

<%= check_box_tag 'notify', '1', (current_user.send_notifications > 0) %>
<%=_ 'Send notification emails' %>

        <% end %>

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

<% end %>

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

             selected_project = current_user.projects.find(selected_project).id rescue current_user.projects.find(:first, :order => 'name').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 %>
          <% if current_user.can?( Project.find(selected_project), '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' %>

        <% disabled = (perms['prioritize'].empty? || @task.new_record?) ? "" : "disabled=\"disabled\"" %>
        <input type="radio" name="task[type_id]" id="task_type_id_0" value="0" style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 0 %> <%= disabled %>/>
          <%=_'Task'%>

        <input type="radio" name="task[type_id]" id="task_type_id_1" value="1" style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 1 %> <%= disabled %>/>
          <%=_'New Feature'%>

        <input type="radio" name="task[type_id]" id="task_type_id_2" value="2"  style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 2 %> <%= disabled %>/>
          <%=_'Defect'%>

        <input type="radio" name="task[type_id]" id="task_type_id_3" value="3"  style="float:none;vertical-align:middle;" <%= "checked=\"checked\"" if @task.type_id.to_i == 3 %> <%= disabled %>/>
          <%=_'Improvement'%>

        <%#= 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]", "#{(@task.duration.to_i > 0 ? worked_nice(@task.duration) : "")}" %>
<% 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 %>


Remove update info from bottom of printable page.

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

<% @page_title = @page.title %>

<% unless @page.title == 'index' %>
  <h1>
    <%= h(@page.title) %>
  </h1>
<% end %>

<%= render_page(@page) %>

<% @page_title = @page.title %>

<% unless @page.title == 'index' %>

    <%= h(@page.title) %>

<% end %>

<%= render_page(@page) %>

  Updated <%= h(format_time_from(@page.filtered_text.updated_on, current_user)) %>
  by <%= @page.filtered_text.updated_by.name %>


Now printing the labels only when field has value

<%content_for("left") do-%>
<%= render :partial => "layouts/nav_bar", :locals => {:category => @venue.class.to_s.pluralize, :property => @venue.name} -%>

<%= link_to @venue.name-%>

Short name: <%=h @venue.short_name-%>

Organization: <%=h @venue.organization-%>

Locality: <%=h @venue.locality-%>

<%if @venue.address != ""-%>
Address:
<%end-%>
<%=h @venue.address-%>
<%if @venue.reaching != ""-%>
Reaching directions:
<%end-%>
<%= @venue.reaching-%>

<%if @current_user-%><%= link_to 'Edit', :action => 'edit', :id => @venue %> | <%end-%>
<%= link_to 'Venues list', :action => 'list' %>
<%end-%>
<%content_for("right") do-%>

<%if @recent_venues-%>

Recent venues

    <%for venue in @recent_venues -%>

<%= link_to truncate(venue.name,30), :id => venue-%>

    <%end-%>

<%= link_to "Show all", :action => 'list'-%>
<%end-%>

Properties

Venue: <%= @venue.short_name-%>

  <%if @venue.venue_url and @venue.venue_url != ""%>
Venue URL: <%= link_to truncate(@venue.venue_url,25), @venue.venue_url-%>
<%end-%>
  <%if @venue.contact_person and @venue.contact_person != ""%>
Contact person: <%=h @venue.contact_person-%>
<%end-%>
  <%if @venue.contact_phone and @venue.contact_phone != ""%>
Phone: <%=h @venue.contact_phone-%>
<%end-%>

Published: <%= @venue.published ? "Yes" : "No"-%>

Created on: <%= @venue.created_at.strftime("%d %b, %Y")-%>

<%end-%>

<%content_for("left") do-%>
<%= render :partial => "layouts/nav_bar", :locals => {:category => @venue.class.to_s.pluralize, :property => @venue.name} -%>

<%= link_to @venue.name-%>

Short name: <%=h @venue.short_name-%>

Organization: <%=h @venue.organization-%>

Locality: <%=h @venue.locality-%>

Address:

<%=h @venue.address-%>

Reaching directions:

<%= @venue.reaching-%>

<%if @current_user-%><%= link_to 'Edit', :action => 'edit', :id => @venue %> | <%end-%>
<%= link_to 'Venues list', :action => 'list' %>
<%end-%>
<%content_for("right") do-%>

<%if @recent_venues-%>

Recent venues

    <%for venue in @recent_venues -%>

<%= link_to truncate(venue.name,30), :id => venue-%>

    <%end-%>

<%= link_to "Show all", :action => 'list'-%>
<%end-%>

Properties

Venue: <%= @venue.short_name-%>

  <%if @venue.venue_url and @venue.venue_url != ""%>
Venue URL: <%= link_to truncate(@venue.venue_url,25), @venue.venue_url-%>
<%end-%>
  <%if @venue.contact_person and @venue.contact_person != ""%>
Contact person: <%=h @venue.contact_person-%>
<%end-%>
  <%if @venue.contact_phone and @venue.contact_phone != ""%>
Phone: <%=h @venue.contact_phone-%>
<%end-%>

Published: <%= @venue.published ? "Yes" : "No"-%>

Created on: <%= @venue.created_at.strftime("%d %b, %Y")-%>

<%end-%>


Remove user signup lock

Remove user signup lock

<% if !@post_redirect.nil? && @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') %>

          <% if params[:letmein] == '1' %>
            <%= render :partial => 'signup' %>
          <% else %>
            Estamos dando los últimos retoques a la página. Abrimos a lo largo de hoy jueves por la mañana. Mientras tanto
            puedes leer sobre la situación actual de la ley de transparencia.
          <% end %>

<% end %>


Add CSS-friendly IDs to event editing form

Basic Information

Event name: <%= text_field "event", "fullname" %>

    Short name: <%= text_field "event", "shortname" %>

    Starts at: <%= datetime_select "event", "start" %>

    Ends at: <%= datetime_select "event", "end" %>

Locations

Current locations:
  <% if @event.locations.size > 0 -%>
    <%= @event.locations.collect { |l| h(l.name) }.join(", ") %>
  <% else -%>
    none
  <% end -%>

  (<%= link_to_function "Edit" do |page|
      page.hide "location_summary"
      page.show "event_locations"
    end %>)

  <select id="event_locations" style="display: none;" multiple="multiple" name="event[locations][]">
  	<%= location_options @event.locations %>
  </select>

Description/Blurb

Blurb:

          <%= text_area "event", "blurb" %>

Description:

          <%= text_area "event", "description" %>

Registration Options

      <%= check_box_tag "registration_open", "open", @registration_open %>
      Event registration is open

    	<%= check_box "event", "attendees_visible" %>
  	People attending this event can see the attendee list

      <%= check_box_tag "non_exclusive", "nonexclusive", @non_exclusive %>
      People can attend this event at the same time as other events

      <%= check_box_tag "age_restricted", "agerestricted", @age_restricted %>
      This event has a minimum age of <%= text_field_tag "min_age", @min_age %>

      <%= check_box_tag "limited_capacity", "limited", @limited_capacity,
              :onChange => "updateCapacityLimitsVisibility();"%>
      Limited capacity

          <% %w( male female neutral ).each do |gender| -%>

              <%= gender %>
              <% %w( min preferred max ).each do |threshold| -%>
                <%= threshold.humanize %>: <%= text_field_tag "limits[#{gender}][#{threshold}]", @limits[gender][threshold] %>
              <% end -%>

          <% end %>

Virtual Sites

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

Event Staff

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

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

<%= staff.name %> (Remove: <%= check_box_tag "remove_staff[#{staff.id}]" %>)

      <% end -%>

  <% else -%>

There are currently no staff listed for this event.

  <% end -%>

Add staff by name: <%= text_field_tag "add_staff[firstname]" %> <%= text_field_tag "add_staff[lastname]" %>

<%= submit_tag %>


for user directory, replaced <th> with <td>

<% if user %>
  <% profile = user.profiles.visible_by(current_user) %>

        <div <% if user.online? %>class="online"<% end %> style='text-align: center;'>
        <%=
          link_to "#{avatar_for user, 'small'}",
          url_for_user(user),:class=>'imglink'
        %>

      <%=  link_to "#{user.login}", url_for_user(user) %>
      <%= profile.full_name %>
      <%= profile.organization %>

        <% if profile.locations.any? %>
          <%= profile.locations.first.city %> <%= profile.locations.first.state %> <%= profile.locations.first.country_name %>
        <% end %>

      <%= user.last_seen_at ? user.last_seen_at.strftime("%Y-%m-%d") : "" %>

<% end %>

<% if user %>
  <% profile = user.profiles.visible_by(current_user) %>

        <div <% if user.online? %>class="online"<% end %> style='float: left; text-align: center; margin: 1em;'>
        <%=
          link_to "#{avatar_for user, 'small'}",
          url_for_user(user),:class=>'imglink'
        %>

      <%=  link_to "#{user.login}", url_for_user(user) %>
      <%= profile.full_name %>
      <%= profile.organization %>

        <% if profile.locations.any? %>
          <%= profile.locations.first.city %> <%= profile.locations.first.state %> <%= profile.locations.first.country_name %>
        <% end %>

      <%= user.last_seen_at ? user.last_seen_at.strftime("%Y-%m-%d") : "" %>

<% end %>


Put (admin) in right place

Put (admin) in right place

<% @title = h(@info_request.title) %>

<% if @info_request.prominence == 'hidden' %>

    This request has prominence 'hidden'. You can only see it because you are logged
    in as a super user.

<% end %>
<% if @info_request.prominence == 'requester_only' %>

    This request is hidden, so that only you the requester can see it. Please
    contact us if you are not sure why.

<% end %>

<% if @update_status || @info_request.awaiting_description %>

    <%= render :partial => 'describe_state', :locals => { :id_suffix => "1" } %>

<% end %>

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

<%=@title%>

    <% if @info_request.user.profile_photo %>

            <img src="<%= get_profile_photo_url(:url_name => @info_request.user.url_name) %>" alt="">

    <% end %>

    <%= user_link(@info_request.user) %> made this
    <%=h @info_request.law_used_full%>
    request
    <% if !@user.nil? && @user.admin_page_links? %>
        (<%= link_to "admin", request_admin_url(@info_request) %>)
    <% end %>
    to <%= public_body_link(@info_request.public_body) %>

    <p id="request_status" class="request_icon_line icon_<%= @info_request.calculate_status %>">
    <% if @info_request.awaiting_description %>
        <% if @is_owning_user %>
            Please answer the question above so we know whether the
            <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'recent response contains', 'recent responses contain') %> useful information.
        <% else %>
            This request has an unknown status.
            <% if @old_unclassified %>
              We're waiting for someone to read
              <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %>
              and update the status accordingly. Perhaps you might like to help out by doing that?
            <% else %>
              We're waiting for
              <%= user_link(@info_request.user) %> to read
              <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %>
              and update the status.
            <% end %>
        <% end %>
    <% elsif @status == 'waiting_response' %>
        Currently waiting for a response from <%= public_body_link(@info_request.public_body) %>,
        they must respond promptly and
        <% if @info_request.public_body.is_school? %>
            in term time
        <% else %>
            normally
        <% end %>
        no later than <%= simple_date(@info_request.date_response_required_by) %>
        (<%= link_to "details", about_url + "#quickly_response" %>).
    <% elsif @status == 'waiting_response_overdue' %>
        Response to this request is delayed.
        By law, <%= public_body_link(@info_request.public_body) %> should
        normally have responded promptly and
            <% if @info_request.public_body.is_school? %>
                in term time
            <% end %>
            by <%= simple_date(@info_request.date_response_required_by) %>
        (<%= link_to "details", about_url + "#quickly_response" %>).
    <% elsif @status == 'waiting_response_very_overdue' %>
        Response to this request is long overdue.
        By law, under all circumstances, <%= public_body_link(@info_request.public_body) %>
        should have responded by now
        (<%= link_to "details", about_url + "#quickly_response" %>).
        You can complain by
        <%= link_to "requesting an internal review", show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>.
    <% elsif @status == 'not_held' %>
        <%= public_body_link(@info_request.public_body) %> did not have the information requested.
    <% elsif @status == 'rejected' %>
        The request was refused by <%= public_body_link(@info_request.public_body) %>.
    <% elsif @status == 'successful' %>
        The request was successful.
    <% elsif @status == 'partially_successful' %>
        The request was partially successful.
    <% elsif @status == 'waiting_clarification' %>
        <% if @is_owning_user %>
            <%=h @info_request.public_body.name %> is waiting for your clarification.
            Please
              <%= link_to "send a follow up message", respond_to_last_url(@info_request) + '#followup' %>.
        <% else %>
            The request is waiting for clarification.
            If you are
            <%= user_link(@info_request.user) %>, please
            <%= link_to "sign in", signin_url(:r => request.request_uri) %> to send a follow up message.
        <% end %>
    <% elsif @status == 'gone_postal' %>
        The authority would like to / has responded by post to this request.
    <% elsif @status == 'internal_review' %>
        Waiting for an internal review by <%= public_body_link(@info_request.public_body) %> of their handling of this request.
    <% elsif @status == 'error_message' %>
        There was a delivery error or similar, which needs fixing by the WhatDoTheyKnow team.
    <% elsif @status == 'requires_admin' %>
        This request has had an unusual response, and requires attention from the WhatDoTheyKnow team.
    <% elsif @status == 'user_withdrawn' %>
        This request has been withdrawn by the person who made it.
        There may be an explanation in the correspondence below.
    <% else %>
        <% raise "unknown status " + @status %>
    <% end %>

    <% for info_request_event in @info_request_events %>
        <% if info_request_event.visible %>
            <%= render :partial => 'correspondence', :locals => { :info_request_event => info_request_event } %>
        <% end %>
    <% end %>

    <% if @info_request.awaiting_description %>

        <%= render :partial => 'describe_state', :locals => { :id_suffix => "2" } %>

    <% end %>

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

<% @title = h(@info_request.title) %>

<% if @info_request.prominence == 'hidden' %>

    This request has prominence 'hidden'. You can only see it because you are logged
    in as a super user.

<% end %>
<% if @info_request.prominence == 'requester_only' %>

    This request is hidden, so that only you the requester can see it. Please
    contact us if you are not sure why.

<% end %>

<% if @update_status || @info_request.awaiting_description %>

    <%= render :partial => 'describe_state', :locals => { :id_suffix => "1" } %>

<% end %>

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

<%=@title%>

    <% if @info_request.user.profile_photo %>

            <img src="<%= get_profile_photo_url(:url_name => @info_request.user.url_name) %>" alt="">

    <% end %>

    <%= user_link(@info_request.user) %> made this
    <% if !@user.nil? && @user.admin_page_links? %>
        (<%= link_to "admin", request_admin_url(@info_request) %>)
    <% end %>
    <%=h @info_request.law_used_full%>
    request to <%= public_body_link(@info_request.public_body) %>

    <p id="request_status" class="request_icon_line icon_<%= @info_request.calculate_status %>">
    <% if @info_request.awaiting_description %>
        <% if @is_owning_user %>
            Please answer the question above so we know whether the
            <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'recent response contains', 'recent responses contain') %> useful information.
        <% else %>
            This request has an unknown status.
            <% if @old_unclassified %>
              We're waiting for someone to read
              <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %>
              and update the status accordingly. Perhaps you might like to help out by doing that?
            <% else %>
              We're waiting for
              <%= user_link(@info_request.user) %> to read
              <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %>
              and update the status.
            <% end %>
        <% end %>
    <% elsif @status == 'waiting_response' %>
        Currently waiting for a response from <%= public_body_link(@info_request.public_body) %>,
        they must respond promptly and
        <% if @info_request.public_body.is_school? %>
            in term time
        <% else %>
            normally
        <% end %>
        no later than <%= simple_date(@info_request.date_response_required_by) %>
        (<%= link_to "details", about_url + "#quickly_response" %>).
    <% elsif @status == 'waiting_response_overdue' %>
        Response to this request is delayed.
        By law, <%= public_body_link(@info_request.public_body) %> should
        normally have responded promptly and
            <% if @info_request.public_body.is_school? %>
                in term time
            <% end %>
            by <%= simple_date(@info_request.date_response_required_by) %>
        (<%= link_to "details", about_url + "#quickly_response" %>).
    <% elsif @status == 'waiting_response_very_overdue' %>
        Response to this request is long overdue.
        By law, under all circumstances, <%= public_body_link(@info_request.public_body) %>
        should have responded by now
        (<%= link_to "details", about_url + "#quickly_response" %>).
        You can complain by
        <%= link_to "requesting an internal review", show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>.
    <% elsif @status == 'not_held' %>
        <%= public_body_link(@info_request.public_body) %> did not have the information requested.
    <% elsif @status == 'rejected' %>
        The request was refused by <%= public_body_link(@info_request.public_body) %>.
    <% elsif @status == 'successful' %>
        The request was successful.
    <% elsif @status == 'partially_successful' %>
        The request was partially successful.
    <% elsif @status == 'waiting_clarification' %>
        <% if @is_owning_user %>
            <%=h @info_request.public_body.name %> is waiting for your clarification.
            Please
              <%= link_to "send a follow up message", respond_to_last_url(@info_request) + '#followup' %>.
        <% else %>
            The request is waiting for clarification.
            If you are
            <%= user_link(@info_request.user) %>, please
            <%= link_to "sign in", signin_url(:r => request.request_uri) %> to send a follow up message.
        <% end %>
    <% elsif @status == 'gone_postal' %>
        The authority would like to / has responded by post to this request.
    <% elsif @status == 'internal_review' %>
        Waiting for an internal review by <%= public_body_link(@info_request.public_body) %> of their handling of this request.
    <% elsif @status == 'error_message' %>
        There was a delivery error or similar, which needs fixing by the WhatDoTheyKnow team.
    <% elsif @status == 'requires_admin' %>
        This request has had an unusual response, and requires attention from the WhatDoTheyKnow team.
    <% elsif @status == 'user_withdrawn' %>
        This request has been withdrawn by the person who made it.
        There may be an explanation in the correspondence below.
    <% else %>
        <% raise "unknown status " + @status %>
    <% end %>

    <% for info_request_event in @info_request_events %>
        <% if info_request_event.visible %>
            <%= render :partial => 'correspondence', :locals => { :info_request_event => info_request_event } %>
        <% end %>
    <% end %>

    <% if @info_request.awaiting_description %>

        <%= render :partial => 'describe_state', :locals => { :id_suffix => "2" } %>

    <% end %>

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


ActionItem9: minor style change

ActionItem9: minor style change

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

<%= _('Identify yourself') %>

<%= link_to _('Login.'), :action => 'login' %>
<%= _('You need to login to be able to use all the features in this virtual community.') %>

<%= link_to _('Sign up.'), :action => 'signup' %>
<%= _('If you are not an user already, you can register now to become a member of this virtual community.') %>


More notes.

More notes.

<%= error_messages_for 'censor_rule' %>

Text (that you want to remove, case sensitive)

<%= text_field 'censor_rule', 'text', :size => 60  %>

Replacement (put it in [square brackets], e.g. [personal information removed]. applies only to text in emails; binaries must stay the same length and the replacement is just a bunch of 'x's)

<%= text_field 'censor_rule', 'replacement', :size => 60  %>

Comment for this edit (put purpose of the rule, and why the change)

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

Rule is for request '<%=request_link(info_request)%>'
    <%= hidden_field 'censor_rule', 'info_request_id', { :value => info_request.id } %>

Warning and notes: This does replace text in binary files, but only
in a naive way.  It doesn't even do UCS-2 (unicode sometimes used in Word). It
should work for cases that aren't links and are in Word documents, but probably
won't work for much else.  Please carefully check all
attachments have changed in the way you expect.

You may need to manually rebuild the search index afterwards. If you need to
redact things across a large number of requests, ask for code changes, should
be easy enough to add this per user or per authority.


Fix search and add biopama link to sidebar

API Calls

      Authentication

        Countries

          GET /v3/countries
          GET /v3/countries/:iso_3

        Protected Areas

          GET /v3/protected_areas
          GET /v3/protected_areas/:wdpa_id
          GET /v3/protected_areas/search
          GET /v3/protected_areas/biopama


acronym on gradebook

acronym on gradebook

<%= link_to 'Back', :controller => '/instructor/index', :course => @course %> |
<%= link_to 'Grade Book Settings', :action => 'settings', :course => @course %> |
<% if @course.gradebook && @course.gradebook.weight_grades %>
  <%= link_to 'Set Weighting', :action => 'set_weights', :course => @course %> |
<% end %>
<%= link_to 'Export', :action => 'export', :course => @course %> |
<%= link_to 'Add New Item', :action => 'item', :course => @course %>

Grade Book for <%= @course.title %>

   ID
   Students
   <% for gi in @grade_items %>

	  <% if gi.assignment.nil? || gi.assignment.file_uploads %>
		<%= gi.name %>
	  <% else %>
	    <acronym title="<%=h gi.assignment.description %>"><%= gi.name %></acronym>
	  <% end %>

	  <%= gi.grade_category.category %>

	  Points: <%= gi.points %>

	   <acronym title="Delete Item"><%= link_to "#{image_tag 'cross'}", { :action => 'delete_item', :course => @course, :id => gi.id}, :confirm => "Are you sure you want to delete the item '#{gi.name}'?  All entered student grade will be deleted.  This action can not be undone." %></acronym>
	   <% if gi.visible %>
	     <acronym title="Visible to Students"><%= image_tag 'picture_add' %></acronym>
	   <% else %>
	     <acronym title="Hidden from Students"><%= image_tag 'picture_delete' %></acronym>
	   <% end %>
	   <acronym title="Edit Item Information">
	     <%= link_to "#{image_tag 'book_edit'}", :action => 'item', :course => @course, :id => gi.id %>

	   <acronym title="Enter Grades"><%= link_to "#{image_tag 'calculator'}", :action => 'enter', :course => @course, :id => gi.id %>
	    <% if @course.gradebook.weight_grades %>

	      Cat: <%= sprintf("%.2f", @weight_map[gi.grade_category.id] ) %>%
	    <% end %>

   <% end %>
   Total Points
<%=@total_points%>

   <% if @course.gradebook.weight_grades %>Weighted Average
   <% else %>Average
   <% end %>

   Students

<% count = 0 %>
<% for student in @students %>
  <% count = count.next
	   odd = "odd"
	   odd = "even" if count.even?
	  %>
  <tr class="<%=odd%> hover" id="student_<%=student.id%>">
	<%= student.uniqueid %>
	<%= student.display_name %>

	<% for gi in @grade_items %>

	    <% if @grade_matrix[student.id][gi.id].nil? %>
	      <acronym title="no grade entered"><%= link_to "#{image_tag 'bullet_error'}", :action => 'enter', :course => @course, :id => gi.id %></acronym>
	    <% else %>
	      <%= sprintf( "%.1f", @grade_matrix[student.id][gi.id] ) %>
	    <% end %>

	<% end %>

	<%= @student_totals[student.id] %>

	  <% if @course.gradebook.weight_grades %>
	    <%= sprintf( "%.2f", @student_weighted[student.id] ) %>
      <% else %>
		<% if @total_points > 0 %>
		  <%= sprintf( "%.2f", @student_totals[student.id] / @total_points * 100 )%>%
		<% else %>
		  ?%
		<% end %>
      <% end %>

	<%= student.display_name %>

<% end %>

<% if @students.size > 0 %>

    Item Averages

	<% for gi in @grade_items %>

		  <%= sprintf( "%.2f", @averages[gi.id]/@students.size ) %>

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

    Item Averages w/o blanks and zeros

	<% for gi in @grade_items %>

		  <%= sprintf( "%.2f", @averages[gi.id]/(@students.size - @average_no_blank[gi.id]) ) rescue 'xx' %>

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

<% end %>

<%= link_to 'Back', :controller => '/instructor/index', :course => @course %> |
<%= link_to 'Grade Book Settings', :action => 'settings', :course => @course %> |
<% if @course.gradebook && @course.gradebook.weight_grades %>
  <%= link_to 'Set Weighting', :action => 'set_weights', :course => @course %> |
<% end %>
<%= link_to 'Export', :action => 'export', :course => @course %> |
<%= link_to 'Add New Item', :action => 'item', :course => @course %>

Grade Book for <%= @course.title %>

   ID
   Students
   <% for gi in @grade_items %>

	  <%= gi.name %>

	  <%= gi.grade_category.category %>

	  Points: <%= gi.points %>

	   <acronym title="Delete Item"><%= link_to "#{image_tag 'cross'}", { :action => 'delete_item', :course => @course, :id => gi.id}, :confirm => "Are you sure you want to delete the item '#{gi.name}'?  All entered student grade will be deleted.  This action can not be undone." %></acronym>
	   <% if gi.visible %>
	     <acronym title="Visible to Students"><%= image_tag 'picture_add' %></acronym>
	   <% else %>
	     <acronym title="Hidden from Students"><%= image_tag 'picture_delete' %></acronym>
	   <% end %>
	   <acronym title="Edit Item Information">
	     <%= link_to "#{image_tag 'book_edit'}", :action => 'item', :course => @course, :id => gi.id %>

	   <acronym title="Enter Grades"><%= link_to "#{image_tag 'calculator'}", :action => 'enter', :course => @course, :id => gi.id %>
	    <% if @course.gradebook.weight_grades %>

	      Cat: <%= sprintf("%.2f", @weight_map[gi.grade_category.id] ) %>%
	    <% end %>

   <% end %>
   Total Points
<%=@total_points%>

   <% if @course.gradebook.weight_grades %>Weighted Average
   <% else %>Average
   <% end %>

   Students

<% count = 0 %>
<% for student in @students %>
  <% count = count.next
	   odd = "odd"
	   odd = "even" if count.even?
	  %>
  <tr class="<%=odd%> hover" id="student_<%=student.id%>">
	<%= student.uniqueid %>
	<%= student.display_name %>

	<% for gi in @grade_items %>

	    <% if @grade_matrix[student.id][gi.id].nil? %>
	      <acronym title="no grade entered"><%= link_to "#{image_tag 'bullet_error'}", :action => 'enter', :course => @course, :id => gi.id %></acronym>
	    <% else %>
	      <%= sprintf( "%.1f", @grade_matrix[student.id][gi.id] ) %>
	    <% end %>

	<% end %>

	<%= @student_totals[student.id] %>

	  <% if @course.gradebook.weight_grades %>
	    <%= sprintf( "%.2f", @student_weighted[student.id] ) %>
      <% else %>
		<% if @total_points > 0 %>
		  <%= sprintf( "%.2f", @student_totals[student.id] / @total_points * 100 )%>%
		<% else %>
		  ?%
		<% end %>
      <% end %>

	<%= student.display_name %>

<% end %>

<% if @students.size > 0 %>

    Item Averages

	<% for gi in @grade_items %>

		  <%= sprintf( "%.2f", @averages[gi.id]/@students.size ) %>

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

    Item Averages w/o blanks and zeros

	<% for gi in @grade_items %>

		  <%= sprintf( "%.2f", @averages[gi.id]/(@students.size - @average_no_blank[gi.id]) ) rescue 'xx' %>

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

<% end %>


minor cosmetic improvement when you have no groups or no contacts

<%
#
#
# also supports drop down menus, like this:
#
#
menu title
#

#
menu item 1

#
menu item 2

#

#

#

active = first_context()
selected = 'class="selected"'
-%>

  <% if logged_in? -%>
  <li <%= selected if active == 'me' %> >
    <%= link_to "Me", me_url %>

<%= link_to 'inbox', me_url(:action => 'inbox'), :style => page_icon_style('inbox') %>

<%= link_to 'tasks', me_url(:action => 'tasks'), :style => page_icon_style('task-list') %>

<%= link_to 'search', me_url(:action => 'search'), :style => page_icon_style('search') %>

<%= link_to 'create page', {:controller => 'pages', :action => 'create'}, :style => page_icon_style('new') %>

  <% else -%>
    <li <%= selected if params[:controller]=='account' %> >
      <%= link_to "Home", '/' %>

  <% end -%>

  <li <%= selected if active == 'people' %> >
    <%= link_to "People", people_url %>
    <% if logged_in? and current_user.contacts.any? -%>

      <% current_user.contacts.each do |person| -%>

<%= link_to_user person, :avatar => 'xsmall', :one_link => true %>

      <% end -%>

    <% end -%>

  <li <%= selected if active == 'groups' %> >
    <%= link_to "Groups", groups_url %>
   <% if logged_in? and current_user.groups.any? -%>

      <% current_user.groups.each do |group| -%>

<%= link_to_group group, :avatar => 'xsmall', :one_link => true %>

      <% end -%>

    <% end -%>

  <% if logged_in? -%>
  <li <%= selected if active == 'chat' %> >
    <%= link_to "Chat", '/chat' %>

  <% end -%>

  <% if logged_in? -%>

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

  <% end -%>

<%
#
#
# also supports drop down menus, like this:
#
#
menu title
#

#
menu item 1

#
menu item 2

#

#

#

active = first_context()
selected = 'class="selected"'
-%>

  <% if logged_in? -%>
  <li <%= selected if active == 'me' %> >
    <%= link_to "Me", me_url %>

<%= link_to 'inbox', me_url(:action => 'inbox'), :style => page_icon_style('inbox') %>

<%= link_to 'tasks', me_url(:action => 'tasks'), :style => page_icon_style('task-list') %>

<%= link_to 'search', me_url(:action => 'search'), :style => page_icon_style('search') %>

<%= link_to 'create page', {:controller => 'pages', :action => 'create'}, :style => page_icon_style('new') %>

  <% else -%>
    <li <%= selected if params[:controller]=='account' %> >
      <%= link_to "Home", '/' %>

  <% end -%>

  <li <%= selected if active == 'people' %> >
    <%= link_to "People", people_url %>
    <% if logged_in? -%>

      <% current_user.contacts.each do |person| -%>

<%= link_to_user person, :avatar => 'xsmall', :one_link => true %>

      <% end -%>

    <% end -%>

  <li <%= selected if active == 'groups' %> >
    <%= link_to "Groups", groups_url %>
   <% if logged_in? -%>

      <% current_user.groups.each do |group| -%>

<%= link_to_group group, :avatar => 'xsmall', :one_link => true %>

      <% end -%>

    <% end -%>

  <% if logged_in? -%>
  <li <%= selected if active == 'chat' %> >
    <%= link_to "Chat", '/chat' %>

  <% end -%>

  <% if logged_in? -%>

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

  <% end -%>


fix "Post Comment" url

fix "Post Comment" url

git-svn-id: 6ed4032d55824b87387cea7ca50eb066630d6e73@95 c93d8143-eb44-0410-8798-7b17b0fd9f9b

<div id="post-<%= @post.id %>" class="post">

      <a href="<%= @post.url %>" rel="bookmark"
          title="Permalink for this article">
        <%= h(@post.title) %>

      <%= @post.created_at(Riposte::Config::TIMESTAMP_LONG) %>

    <%= @post.body_rendered %>

    <% unless @post.tags.empty? %>

          <% @post.tags.each do |tag| %>

              <a href="<%= tag.url %>" rel="tag"><%= h(tag.name) %>

          <% end %>

    <% end %>

      <a href="<%= @post.url %>#post-comment">Post a comment

Comments

  <% @post.comments.all.each do |comment| %>
    <%= render_template('../comment/comment.rhtml', :comment => comment) %>
  <% end %>

<form id="post-comment" class="robots-nocontent" method="post"
    action="<%= R(CommentController, :new, @post.id) %>#post-comment">

  <% if @preview && @preview.valid? %>
    <fieldset>
      <%= render_template('../comment/comment.rhtml', :comment => @preview) %>
    </fieldset>
  <% end %>

  <fieldset>
    <legend>Post a comment</legend>

      Name
      <input type="text" name="author" id="author" maxlength="32"
          title="Enter your name"
          value="<%= h(@author) %>" />

    <% if @preview; @preview.errors.on(:author).each do |error| %>

        <%= h(error) %>

    <% end; end %>

      URL
      <input type="text" name="author_url" id="author_url" maxlength="255"
          title="Enter the URL of your website (optional)"
          value="<%= h(@author_url) %>" />

    <% if @preview; @preview.errors.on(:author_url).each do |error| %>

        <%= h(error) %>

    <% end; end %>

      Title
      <input type="text" class="long" name="title" id="title" maxlength="255"
          title="Enter a title for this comment"
          value="<%= @preview && @preview.title ? h(@preview.title) : '' %>" />

    <% if @preview; @preview.errors.on(:title).each do |error| %>

        <%= h(error) %>

    <% end; end %>

      <textarea name="body" rows="6" cols="60"><%= @preview && @preview.body ? h(@preview.body) : '' %></textarea>

    <% if @preview; @preview.errors.on(:body).each do |error| %>

        <%= h(error) %>

    <% end; end %>

      Basic XHTML (including links) is allowed, just don't try anything fishy.
      Your comment will be auto-formatted unless you use your own
      <p> tags for formatting.

      Don't type anything here unless you're an evil robot:

      <input type="text" id="captcha" name="captcha" maxlength="50" />

      And especially don't type anything here:

      <textarea name="comment" rows="6" cols="60"></textarea>

    <% if @comment_error %>

<%= h(@comment_error) %>

    <% end %>

      <input type="submit" name="action" value="Preview Comment" />
      <input type="submit" name="action" value="Post Comment" />

  </fieldset>
</form>

<div id="post-<%= @post.id %>" class="post">

      <a href="<%= @post.url %>" rel="bookmark"
          title="Permalink for this article">
        <%= h(@post.title) %>

      <%= @post.created_at(Riposte::Config::TIMESTAMP_LONG) %>

    <%= @post.body_rendered %>

    <% unless @post.tags.empty? %>

          <% @post.tags.each do |tag| %>

              <a href="<%= tag.url %>" rel="tag"><%= h(tag.name) %>

          <% end %>

    <% end %>

      Post a comment

Comments

  <% @post.comments.all.each do |comment| %>
    <%= render_template('../comment/comment.rhtml', :comment => comment) %>
  <% end %>

<form id="post-comment" class="robots-nocontent" method="post"
    action="<%= R(CommentController, :new, @post.id) %>#post-comment">

  <% if @preview && @preview.valid? %>
    <fieldset>
      <%= render_template('../comment/comment.rhtml', :comment => @preview) %>
    </fieldset>
  <% end %>

  <fieldset>
    <legend>Post a comment</legend>

      Name
      <input type="text" name="author" id="author" maxlength="32"
          title="Enter your name"
          value="<%= h(@author) %>" />

    <% if @preview; @preview.errors.on(:author).each do |error| %>

        <%= h(error) %>

    <% end; end %>

      URL
      <input type="text" name="author_url" id="author_url" maxlength="255"
          title="Enter the URL of your website (optional)"
          value="<%= h(@author_url) %>" />

    <% if @preview; @preview.errors.on(:author_url).each do |error| %>

        <%= h(error) %>

    <% end; end %>

      Title
      <input type="text" class="long" name="title" id="title" maxlength="255"
          title="Enter a title for this comment"
          value="<%= @preview && @preview.title ? h(@preview.title) : '' %>" />

    <% if @preview; @preview.errors.on(:title).each do |error| %>

        <%= h(error) %>

    <% end; end %>

      <textarea name="body" rows="6" cols="60"><%= @preview && @preview.body ? h(@preview.body) : '' %></textarea>

    <% if @preview; @preview.errors.on(:body).each do |error| %>

        <%= h(error) %>

    <% end; end %>

      Basic XHTML (including links) is allowed, just don't try anything fishy.
      Your comment will be auto-formatted unless you use your own
      <p> tags for formatting.

      Don't type anything here unless you're an evil robot:

      <input type="text" id="captcha" name="captcha" maxlength="50" />

      And especially don't type anything here:

      <textarea name="comment" rows="6" cols="60"></textarea>

    <% if @comment_error %>

<%= h(@comment_error) %>

    <% end %>

      <input type="submit" name="action" value="Preview Comment" />
      <input type="submit" name="action" value="Post Comment" />

  </fieldset>
</form>


fix for converting nil column values to   (IE fix)
closes issue #296

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

<% record = list_record if list_record # compat with render :partial :collection -%>
<% classAttr = cycle("", "even-record") -%>
<% url_options = params_for(:action => :list, :id => record.id) -%>

<tr class="record <%= classAttr %>" id="<%= element_row_id(:action => :list, :id => record.id) %>" class="record">
  <% active_scaffold_config.list.columns.each do |column| %>
    <% column_value = render_column(record, column) -%>
    <% column_value << " " if column_value.nil? or column_value.empty? # For IE6 -%>

    <td class="<%= column_class(column, column_value) %>" >
      <% if column.link -%>
        <% column.link.label = column_value %>
        <%= record.authorized_for?(:action => column.link.crud_type) ? render_action_link(column.link, url_options) : "#{column.link.label}" -%>
      <% else -%>
        <%= column_value %>
      <% end -%>

  <% end -%>
  <% if active_scaffold_config.action_links.any? {|link| link.type == :record } -%>

    <%= render :partial => 'list_actions', :locals => {:record => record, :url_options => url_options} %>

  <% end -%>

<% target_id = element_row_id(:action => :list, :id => record.id) -%>

<% record = list_record if list_record # compat with render :partial :collection -%>
<% classAttr = cycle("", "even-record") -%>
<% url_options = params_for(:action => :list, :id => record.id) -%>

<tr class="record <%= classAttr %>" id="<%= element_row_id(:action => :list, :id => record.id) %>" class="record">
  <% active_scaffold_config.list.columns.each do |column| %>
    <% column_value = render_column(record, column) -%>
    <% column_value << " " if column_value.empty? # For IE6 -%>

    <td class="<%= column_class(column, column_value) %>" >
      <% if column.link -%>
        <% column.link.label = column_value %>
        <%= record.authorized_for?(:action => column.link.crud_type) ? render_action_link(column.link, url_options) : "#{column.link.label}" -%>
      <% else -%>
        <%= column_value %>
      <% end -%>

  <% end -%>
  <% if active_scaffold_config.action_links.any? {|link| link.type == :record } -%>

    <%= render :partial => 'list_actions', :locals => {:record => record, :url_options => url_options} %>

  <% end -%>

<% target_id = element_row_id(:action => :list, :id => record.id) -%>


Reload the page every 5 mins to take advantage of new data.

<%
#
# 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>

<meta http-equiv="REFRESH" content="300">

<link rel="stylesheet" href="css/default.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="css/so-count.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

<%
#
# 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">
<link rel="stylesheet" href="css/so-count.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