Updated markup to reduce redundant display of dead steps in both the Dead Steps and Step Definitions sections

  Cuke Sniffer

      <%= summary[:total_score] %> Total Score

    - Summary

  <%
     feature_results = cuke_sniffer.summary[:features]
     scenario_results = cuke_sniffer.summary[:scenarios]
     step_definition_results = cuke_sniffer.summary[:step_definitions]
  %>

      Features
      Scenarios
      Step Definitions

      Total Score
      <%= feature_results[:total_score] %>
      <%= scenario_results[:total_score] %>
      <%= step_definition_results[:total_score] %>

      Count
      <%= cuke_sniffer.features.count %>
      <%= cuke_sniffer.scenarios.count %>
      <%= cuke_sniffer.step_definitions.count %>

      Lowest Score
      <%= feature_results[:min] %>
      <%= scenario_results[:min] %>
      <%= step_definition_results[:min] %>

      Highest Score
      <%= feature_results[:max] %>
      <%= scenario_results[:max] %>
      <%= step_definition_results[:max] %>

      Average Score
      <%= feature_results[:average] %>
      <%= scenario_results[:average] %>
      <%= step_definition_results[:average] %>

      Threshold
      <%= feature_results[:threshold] %>
      <%= scenario_results[:threshold] %>
      <%= step_definition_results[:threshold] %>

      Good
      <%= (feature_results[:good].to_f/feature_results[:total].to_f*100).round(2) %>%
      <%= (scenario_results[:good].to_f/scenario_results[:total].to_f*100).round(2) %>%
      <%= (step_definition_results[:good].to_f/step_definition_results[:total].to_f*100).round(2) %>
        %

      Bad
      <%= (feature_results[:bad].to_f/feature_results[:total].to_f*100).round(2) %>%
      <%= (scenario_results[:bad].to_f/scenario_results[:total].to_f*100).round(2) %>%
      <%= (step_definition_results[:bad].to_f/step_definition_results[:total].to_f*100).round(2) %>
        %

    + Improvement List

Types of
      improvements: <%= cuke_sniffer.summary[:improvement_list].keys.count %>

      <% cuke_sniffer.summary[:improvement_list].each do |improvement, count| %>

            <%= count %>
            <%= improvement %>

      <% end %>

    + Dead Steps

    <% dead_steps = cuke_sniffer.get_dead_steps %>

Total Dead
      Steps: <%= dead_steps[:total] %>

    <% dead_steps.delete :total%>
    <% dead_steps.each_key do |step_file| %>

          <%= step_file %>

            <%dead_steps[step_file].each  do |regex|%>
                <%= regex %>

            <% end %>

    <% end %>

    + Features

    <% i=0 %>
    <% cuke_sniffer.features.each do |feature| %>
        <% next if feature.score == 0 and feature.scenarios_score == 0 %>
        <div style="cursor: hand;" onclick="toggle(this,3)" class="feature <%= i%2==0 ? "even" : "odd" %>">

<%= feature.score + feature.scenarios_score %>

            <%= feature.name %>

            <%= feature.location.gsub(cuke_sniffer.features_location, "") %>

                  Scenarios: <%= feature.scenarios.size %>

                  Score: <%= feature.score %>

                  <% unless feature.rules_hash.empty? %>
                      Feature Improvements:

                        <% feature.rules_hash.each_key do |rule| %>
                            <%= rule %>

                        <% end %>

                  <% end %>

            <% feature.scenarios = [feature.background, feature.scenarios].flatten unless feature.background.nil? %>

              <% feature.scenarios.each do |scenario| %>
                  <% next if scenario.rules_hash.empty? %>

                      <%= scenario.type %>: <%= scenario.name %>

                      <% scenario.steps.each do |step| %>

                            <%= step %>

                      <% end %>

                      Score: <%= scenario.score %>

                      Line: <%= scenario.start_line %>

                      Scenario Improvements:

                      <% scenario.rules_hash.each_key do |rule| %>

                            <%= rule %>

                      <% end %>

              <% end %>

        <% i+=1 %>
    <% end %>

    + Step Definitions

    <% i=0 %>
    <% cuke_sniffer.step_definitions.each do |step_definition| %>
        <div style="cursor: hand;" onclick="toggle(this,4)" class="feature <%= i%2==0 ? "even" : "odd" %>">
          <% next if step_definition.score <= 0 or step_definition.calls.empty? %>

<%= step_definition.score %>

            <% parameters = "" %>
            <% step_definition.parameters.each do |param| %>
                <% if param == step_definition.parameters.first %>
                    <% parameters << "| " %>
                <% end %>
                <% parameters << param %>

                <% if param == step_definition.parameters.last %>
                    <% parameters << " |" %>
                <% else %>
                    <% parameters << ", " %>
                <% end %>
            <% end %>
            <%= "/" + step_definition.regex.to_s.match(/\(\?\-mix\:(?<regex>.*)\)/)[:regex] + "/ do " + parameters %>

          <% if step_definition.calls.empty? %>

Dead step!

          <% else %>

Calls: <%= step_definition.calls.size %>

          <% end %>

            <%= step_definition.location.gsub(cuke_sniffer.step_definitions_location, "") %>

                  <% unless step_definition.parameters.empty? %>
                      <% calls = step_definition.condensed_call_list %>
                      <% calls.each_key do |step_string| %>

<%= step_string %>

                          <% calls[step_string].each do |call| %>

<%= call %>

                          <% end %>

                      <% end %>
                  <% end %>

                  Step Definition improvements:

                  <% step_definition.rules_hash.each_key do |improvement| %>

                        (<%= step_definition.rules_hash[improvement] %>) <%= improvement %>

                  <% end %>

        <% i+=1 %>
    <% end %>

  Cuke Sniffer

      <%= summary[:total_score] %> Total Score

    - Summary

  <%
     feature_results = cuke_sniffer.summary[:features]
     scenario_results = cuke_sniffer.summary[:scenarios]
     step_definition_results = cuke_sniffer.summary[:step_definitions]
  %>

      Features
      Scenarios
      Step Definitions

      Total Score
      <%= feature_results[:total_score] %>
      <%= scenario_results[:total_score] %>
      <%= step_definition_results[:total_score] %>

      Count
      <%= cuke_sniffer.features.count %>
      <%= cuke_sniffer.scenarios.count %>
      <%= cuke_sniffer.step_definitions.count %>

      Lowest Score
      <%= feature_results[:min] %>
      <%= scenario_results[:min] %>
      <%= step_definition_results[:min] %>

      Highest Score
      <%= feature_results[:max] %>
      <%= scenario_results[:max] %>
      <%= step_definition_results[:max] %>

      Average Score
      <%= feature_results[:average] %>
      <%= scenario_results[:average] %>
      <%= step_definition_results[:average] %>

      Threshold
      <%= feature_results[:threshold] %>
      <%= scenario_results[:threshold] %>
      <%= step_definition_results[:threshold] %>

      Good
      <%= (feature_results[:good].to_f/feature_results[:total].to_f*100).round(2) %>%
      <%= (scenario_results[:good].to_f/scenario_results[:total].to_f*100).round(2) %>%
      <%= (step_definition_results[:good].to_f/step_definition_results[:total].to_f*100).round(2) %>
        %

      Bad
      <%= (feature_results[:bad].to_f/feature_results[:total].to_f*100).round(2) %>%
      <%= (scenario_results[:bad].to_f/scenario_results[:total].to_f*100).round(2) %>%
      <%= (step_definition_results[:bad].to_f/step_definition_results[:total].to_f*100).round(2) %>
        %

    + Improvement List

Types of
      improvements: <%= cuke_sniffer.summary[:improvement_list].keys.count %>

      <% cuke_sniffer.summary[:improvement_list].each do |improvement, count| %>

            <%= count %>
            <%= improvement %>

      <% end %>

    + Dead Steps

    <% dead_steps = cuke_sniffer.get_dead_steps %>

Total Dead
      Steps: <%= dead_steps[:total] %>

    <% dead_steps.delete :total%>
    <% dead_steps.each_key do |step_file| %>

          <%= step_file %>

            <%dead_steps[step_file].each  do |regex|%>
                <%= regex %>

            <% end %>

    <% end %>

    + Features

    <% i=0 %>
    <% cuke_sniffer.features.each do |feature| %>
        <% next if feature.score == 0 and feature.scenarios_score == 0 %>
        <div style="cursor: hand;" onclick="toggle(this,3)" class="feature <%= i%2==0 ? "even" : "odd" %>">

<%= feature.score + feature.scenarios_score %>

            <%= feature.name %>

            <%= feature.location.gsub(cuke_sniffer.features_location, "") %>

                  Scenarios: <%= feature.scenarios.size %>

                  Score: <%= feature.score %>

                  <% unless feature.rules_hash.empty? %>
                      Feature Improvements:

                        <% feature.rules_hash.each_key do |rule| %>
                            <%= rule %>

                        <% end %>

                  <% end %>

            <% feature.scenarios = [feature.background, feature.scenarios].flatten unless feature.background.nil? %>

              <% feature.scenarios.each do |scenario| %>
                  <% next if scenario.rules_hash.empty? %>

                      <%= scenario.type %>: <%= scenario.name %>

                      <% scenario.steps.each do |step| %>

                            <%= step %>

                      <% end %>

                      Score: <%= scenario.score %>

                      Line: <%= scenario.start_line %>

                      Scenario Improvements:

                      <% scenario.rules_hash.each_key do |rule| %>

                            <%= rule %>

                      <% end %>

              <% end %>

        <% i+=1 %>
    <% end %>

    + Step Definitions

    <% i=0 %>
    <% cuke_sniffer.step_definitions.each do |step_definition| %>
        <div style="cursor: hand;" onclick="toggle(this,4)" class="feature <%= i%2==0 ? "even" : "odd" %>">
          <% next if step_definition.score <= 0 and !step_definition.calls.empty? %>

<%= step_definition.score %>

            <% parameters = "" %>
            <% step_definition.parameters.each do |param| %>
                <% if param == step_definition.parameters.first %>
                    <% parameters << "| " %>
                <% end %>
                <% parameters << param %>

                <% if param == step_definition.parameters.last %>
                    <% parameters << " |" %>
                <% else %>
                    <% parameters << ", " %>
                <% end %>
            <% end %>
            <%= "/" + step_definition.regex.to_s.match(/\(\?\-mix\:(?<regex>.*)\)/)[:regex] + "/ do " + parameters %>

          <% if step_definition.calls.empty? %>

Dead step!

          <% else %>

Calls: <%= step_definition.calls.size %>

          <% end %>

            <%= step_definition.location.gsub(cuke_sniffer.step_definitions_location, "") %>

                  <% unless step_definition.parameters.empty? %>
                      <% calls = step_definition.condensed_call_list %>
                      <% calls.each_key do |step_string| %>

<%= step_string %>

                          <% calls[step_string].each do |call| %>

<%= call %>

                          <% end %>

                      <% end %>
                  <% end %>

                  Step Definition improvements:

                  <% step_definition.rules_hash.each_key do |improvement| %>

                        (<%= step_definition.rules_hash[improvement] %>) <%= improvement %>

                  <% end %>

        <% i+=1 %>
    <% end %>


Fix links in unclassified list.

Fix links in unclassified list.

<% @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)) %>
                    <%= link_to(@request.title, 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 && @attention_requests.size == 0 %>

      No pending administration required.

<% end %>

<% @title = "Summary" %>

Things to do

  <% if @holding_pen_messages.size > 0 %>

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

            <% for message in @holding_pen_messages %>

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

                  <%=simple_date(message.sent_at)%>

            <% end %>

  <% end %>

  <% if @error_message_requests.size > 0 %>

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

            <% for @request in @error_message_requests %>

                  <%= link_to(''.html_safe, request_admin_url(@request))%>
                  <%= 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 && @attention_requests.size == 0 %>

      No pending administration required.

<% end %>


Display a link to the channel archive on a channel. closes: #1136

<%
remote_url = {:controller => 'chat', :action => 'say', :id => @channel}

loading_command = %(
  msg = '
' + time_and_name + '' + $('entryfield').value + '
';
  $('entryfield').value = '';
  $('entryfield').focus;
  new Insertion.Bottom('stage', msg);
  $('conversation').scrollTop = $('conversation').scrollHeight + $('conversation').clientHeight; )

complete = "eval(request.responseText)"
%>

<% content_for :style do %>
  @import url(/stylesheets/chat.css);
<% end %>

  <%= render :partial => 'chat/userlist' %>

    <% for message in @messages -%>
    <%= message_content(message) %>
    <% end -%>

<%= javascript_tag scroll_conversation_script %>
<%= javascript_tag set_time_and_name_script %>

<% form_remote_tag(:url => remote_url, :loading => loading_command, :complete => complete) do %>

  <%= current_user.login %>

    <% default_text = "Type your messages here and press enter..."[:type_your_messages_here] -%>
    <textarea id="entryfield" name="message" rows="2"
      onkeypress="if (enterPressed(event)) {document.forms[0].onsubmit();}"
      onclick="if (this.value == '<%=default_text%>') {this.clear();}"><%= default_text %></textarea>
    <input type="submit" value="Say" style="display: none;" />

<% end -%>

<% form_tag(:action => :leave_channel, :id => @channel) do %>
  <input type='submit' value='<%= "Leave channel"[:leave_channel] %>' />
<% end %>

<%= link_to "This channel archive"[:chat_archive], {:action => :archive, :id => @channel.name} %>

<%= # update the user list
wait_time = 4
periodically_call_remote(:url => { :controller => 'chat',
			      	   :action => 'user_list',
				   :id => @channel},
			 :frequency => wait_time,
			 :update => 'userlist')

%>

<%= # poll server every wait_time seconds for new messages
wait_time = 3
periodically_call_remote :url => { :controller => 'chat',
                                   :action => 'poll_channel_for_updates',
                                   :id => @channel},
                         :frequency => wait_time,
                         :complete => "eval(request.responseText)"
#                         :update => 'userlist'
%>

<%= # update server if user has been typing
wait_time = 6
observe_field(:entryfield,
              :frequency => wait_time,
              :url => { :controller => 'chat',
                        :action => 'user_is_typing',
                        :id => @channel })
%>

<%
remote_url = {:controller => 'chat', :action => 'say', :id => @channel}

loading_command = %(
  msg = '
' + time_and_name + '' + $('entryfield').value + '
';
  $('entryfield').value = '';
  $('entryfield').focus;
  new Insertion.Bottom('stage', msg);
  $('conversation').scrollTop = $('conversation').scrollHeight + $('conversation').clientHeight; )

complete = "eval(request.responseText)"
%>

<% content_for :style do %>
  @import url(/stylesheets/chat.css);
<% end %>

  <%= render :partial => 'chat/userlist' %>

    <% for message in @messages -%>
    <%= message_content(message) %>
    <% end -%>

<%= javascript_tag scroll_conversation_script %>
<%= javascript_tag set_time_and_name_script %>

<% form_remote_tag(:url => remote_url, :loading => loading_command, :complete => complete) do %>

  <%= current_user.login %>

    <% default_text = "Type your messages here and press enter..."[:type_your_messages_here] -%>
    <textarea id="entryfield" name="message" rows="2"
      onkeypress="if (enterPressed(event)) {document.forms[0].onsubmit();}"
      onclick="if (this.value == '<%=default_text%>') {this.clear();}"><%= default_text %></textarea>
    <input type="submit" value="Say" style="display: none;" />

<% end -%>

<% form_tag(:action => :leave_channel, :id => @channel) do %>
  <input type='submit' value='<%= "Leave channel"[:leave_channel] %>' />
<% end %>

<%= # update the user list
wait_time = 4
periodically_call_remote(:url => { :controller => 'chat',
			      	   :action => 'user_list',
				   :id => @channel},
			 :frequency => wait_time,
			 :update => 'userlist')

%>

<%= # poll server every wait_time seconds for new messages
wait_time = 3
periodically_call_remote :url => { :controller => 'chat',
                                   :action => 'poll_channel_for_updates',
                                   :id => @channel},
                         :frequency => wait_time,
                         :complete => "eval(request.responseText)"
#                         :update => 'userlist'
%>

<%= # update server if user has been typing
wait_time = 6
observe_field(:entryfield,
              :frequency => wait_time,
              :url => { :controller => 'chat',
                        :action => 'user_is_typing',
                        :id => @channel })
%>


Fix up some escaping

Fix up some escaping

  We aim to cover all Australian Federal public authorities with State and local authorities coming soon.

  <%= raw(_('Are we missing a public authority?') % [help_requesting_path + '#missing_body']) %>

  <%= link_to _('List of all authorities (CSV)'), all_public_bodies_csv_url() %>

  We aim to cover all Australian Federal public authorities with State and local authorities coming soon.

  <%= _('Are we missing a public authority?') % [help_requesting_path + '#missing_body'] %>

  <%= link_to _('List of all authorities (CSV)'), all_public_bodies_csv_url() %>


Updated form display

Updated form display

<%= feature_output %>

Please login or register to continue the checkout

<% cms_unstyled_form_for :login,login, :url => '' do |f| %>

    Existing users login here:

<% if invalid_login %>

    Invalid email or password - Please verify your login credentials

<% end -%>

    Email <%= f.text_field :email, :vertical => true, :size => 20, :class => 'textfield' %>
    Password   <%= f.password_field :password, :vertical => true, :size => 20, :class => 'textfield' %>

      <%= f.submit_tag 'Login', :class => 'submittag' %>

<% end -%>

<% cms_form_for :register,user, :url => '' do |f| %>
  <% if user.errors.length > 0 %>

      We encountered the following problems with your registration:

      <% user.errors.each do |err| -%>
        <% err[1].each do |desc| -%>
          <% unless desc.blank? -%>
            <%= err[0].humanize %> <%= desc %>

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

  <% end -%>

      New users please register below:

  <%= f.text_field :first_name, :vertical => true, :required => true, :size => 30, :class => 'textfield' %>
  <%= f.text_field :last_name, :vertical => true, :required => true, :size => 30, :class => 'textfield' %>
  <%= f.text_field :email, :vertical => true, :required => true, :size => 50, :class => 'textfield' %>
  <%= f.password_field :password, :vertical => true, :required => true, :size => 30, :class => 'textfield' %>
  <%= f.password_field :password_confirmation, :vertical => true, :label => 'Confirm', :required => true, :size => 30, :class => 'textfield'%>

      <%= f.submit_tag 'Register', :class => 'submittag' %>

<% end -%>

<%= feature_output %>

Please login or register to continue the checkout

<% cms_unstyled_form_for :login,login, :url => '' do |f| %>

    Existing users login here:

<% if invalid_login %>

    Invalid email or password - Please verify your login credentials

<% end -%>

    Email <%= f.text_field :email, :vertical => true, :size => 20, :class => 'textfield' %>
    Password   <%= f.password_field :password, :vertical => true, :size => 20, :class => 'textfield' %>

      <%= f.submit_tag 'Login', :class => 'submittag' %>

<% end -%>

<% cms_unstyled_form_for :register,user, :url => '' do |f| %>
  <% if user.errors.length > 0 %>

      We encountered the following problems with your registration:

      <% user.errors.each do |err| -%>
        <% err[1].each do |desc| -%>
          <% unless desc.blank? -%>
            <%= err[0].humanize %> <%= desc %>

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

  <% end -%>

      New users please register below:

      First name* <%= f.text_field :first_name, :vertical => true, :required => true, :size => 15, :class => 'textfield' %>

      Last name* <%= f.text_field :last_name, :vertical => true, :required => true, :size => 15, :class => 'textfield' %>

    Email* <%= f.text_field :email, :vertical => true, :required => true, :size => 50, :class => 'textfield' %>

      Password* <%= f.password_field :password, :vertical => true, :required => true, :size => 15, :class => 'textfield' %>

      Re-enter*<%= f.password_field :password_confirmation, :vertical => true, :label => 'Confirm', :required => true, :size => 15, :class => 'textfield'%>

      <%= f.submit_tag 'Register', :class => 'submittag' %>

<% end -%>


Applied patch in #805

Applied patch in #805

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

<div id="active_<%= active.html_id %>" class="dragitem">

<%= active.sidebar_controller.display_name %>

<%= active.sidebar_controller.description %>

<%= render_component :layout=>false,
             :controller=>active.sidebar_controller,
             :action=>'configure_wrapper', :params => {:sidebar => active } %>

  <%= link_to_remote('remove',
        :url => {:action => 'remove', :id => active.id,
                 :element => "active_#{active.html_id}"},
        :before => "new Effect.Fade('active_#{active.html_id}')",
        :loading => "new Element.show('update_spinner')") %>

<div id="active_<%= active.html_id %>" class="dragitem">

<%= active.sidebar_controller.display_name %>

<%= active.sidebar_controller.description %>

<%= render_component :layout=>false,
             :controller=>active.sidebar_controller,
             :action=>'configure_wrapper', :params => {:sidebar => active } %>

  <%= link_to_remote('remove',
        :url => {:action => 'remove', :id => 'active',
                 :element => "active_#{active.html_id}"},
        :before => "new Effect.Fade('active_#{active.html_id}')",
        :loading => "new Element.show('update_spinner')") %>


fixed #1: moving between selects in the IE

git-svn-id: 47f3e90b35476776f3491e9667105825572c66a1@53 a23ba2f0-501e-4c28-b130-3ad736a215ff

<%= params[:action] == 'new' ? 'New' : 'Editing' %> <%= entity_human_name.downcase %>

<% form_tag :action => params[:action], :id => @object do %>
<%= render :partial => 'form' %>

<% get_single_associations(entity_class_name).each do |association| %>

<label for="<%= association.name %>"><%= association.name.to_s.humanize %>

    <%= select('object',
            "#{association.name.to_s}_id",
            association.class_name.constantize.find(:all).collect{|o| [o.display_name, o.id]},
            { :include_blank => true } ) %>

<% end %>

<% get_multiple_associations(entity_class_name).each do |association| %>

    <% associated = association.name.to_s %>

Manage <%= association.name.to_s.humanize %>

    <%
        assigned = @object.send(association.name)
        other = association.class_name.constantize.find(:all)-@object.send(association.name)
        if !referer.nil? && association.class_name == referer.class.to_s
          assigned += [referer]
          other -= [referer]
        end
    %>

<%= "Assigned #{association.name.to_s.humanize}" %>

        <%= select('object', "#{association.name.to_s.singularize}_ids",
            assigned.collect {|c| [c.display_name, c.id]}, {},
            { :multiple => true, :size => 10, :id => "select_object_#{association.name}" })
        %>

        <%= button_to_function "< Add selected", "addSelected('#{associated}')" %>

        <%= button_to_function "<< Add all", "addAll('#{associated}')" %>

        <%= button_to_function "Remove selected >", "removeSelected('#{associated}')" %>

        <%= button_to_function "Remove all >>", "removeAll('#{associated}')" %>

Other <%= association.name.to_s.humanize %>

        <%= select_tag("other_#{association.name}",
            other.collect {|c|
                "<option value='#{c.id}'>#{c.display_name}</option>"}.join,
            { :multiple => true, :size => 10, :id => "select_other_#{association.name}" })
        %>

<% end %>

<%= submit_tag (params[:action] == 'new' ? 'Create' : 'Update'), :onclick => "selectAllOptions()" %>
<% end %>

<%= link_to 'Show', :action => 'show', :id => @object %> |
<%= link_to 'Back', :action => 'list' %>


remove permalink_style hint from archive_path

git-svn-id: 4158f9403e16ea83fe8a6e07a45f1f3b56a747ab@2161 567b1171-46fb-0310-a4c9-b4bef9110e78

<% form_remote_for :section,
     :url => { :action => (@section.new_record? ? 'create' : 'update'), :id => @section }, :html => { :id => 'section-form' } do |f| %>

Section name (<%= link_to_function 'Customize path', %(Element.toggle('sec-lbl', 'sec-input')) %>)

<%= f.text_field :name, :class => 'big' %>

      Section path

        Example: If you have a section called Tips & Tricks and you'd like the URL for this section to be domain.com/tips,
        you can add 'tips' in this field.

<%= f.text_field :path, :class => 'big' %>

Type of section

      <select id="section_show_paged_articles" name="section[show_paged_articles]" onchange="SectionForm.toggleSettings();">
        <%= options_for_select [
              ['Section with multiple articles (blog)', '0'],
              ['Section with multiple pages (one article per page)', '1']],
              (@section.show_paged_articles? ? '1' : '0') %>
      </select>

      Url that the archive area is available at.

<%= f.text_field :archive_path %>

    <% if @templates.any? -%>

<%= 'Paged ' if @section.show_paged_articles? %>Section Template

      <select name="section[template]">
        <%= options_from_templates_for_select(@templates, @section.template) %>
      </select>

Section Archive Template

      <select name="section[archive_template]">
        <%= options_from_templates_for_select(@templates, @section.archive_template) %>
      </select>

    <% end -%>
    <% if @layouts.any? -%>

Section layout

      <select name="section[layout]">
        <%= options_from_templates_for_select(@layouts, @section.layout) %>
      </select>

    <% end -%>

    <div id="blog-options"<%= %( style="display:none;") if @section.show_paged_articles? %>>

Articles per page

<%= f.text_field :articles_per_page, :class => 'tiny' %>

<%= submit_tag 'Save Section' %>

<% end -%>

<% form_remote_for :section,
     :url => { :action => (@section.new_record? ? 'create' : 'update'), :id => @section }, :html => { :id => 'section-form' } do |f| %>

Section name (<%= link_to_function 'Customize path', %(Element.toggle('sec-lbl', 'sec-input')) %>)

<%= f.text_field :name, :class => 'big' %>

      Section path

        Example: If you have a section called Tips & Tricks and you'd like the URL for this section to be domain.com/tips,
        you can add 'tips' in this field.

<%= f.text_field :path, :class => 'big' %>

Type of section

      <select id="section_show_paged_articles" name="section[show_paged_articles]" onchange="SectionForm.toggleSettings();">
        <%= options_for_select [
              ['Section with multiple articles (blog)', '0'],
              ['Section with multiple pages (one article per page)', '1']],
              (@section.show_paged_articles? ? '1' : '0') %>
      </select>

      Url that the search area is available at.
      Defaults to #{section_path}/archives/#{year}/#{month}

<%= f.text_field :archive_path %>

    <% if @templates.any? -%>

<%= 'Paged ' if @section.show_paged_articles? %>Section Template

      <select name="section[template]">
        <%= options_from_templates_for_select(@templates, @section.template) %>
      </select>

Section Archive Template

      <select name="section[archive_template]">
        <%= options_from_templates_for_select(@templates, @section.archive_template) %>
      </select>

    <% end -%>
    <% if @layouts.any? -%>

Section layout

      <select name="section[layout]">
        <%= options_from_templates_for_select(@layouts, @section.layout) %>
      </select>

    <% end -%>

    <div id="blog-options"<%= %( style="display:none;") if @section.show_paged_articles? %>>

Articles per page

<%= f.text_field :articles_per_page, :class => 'tiny' %>

<%= submit_tag 'Save Section' %>

<% end -%>


Remove annoying javascript tags in layout

git-svn-id: 268669d3058f191005ae665964cd19b71efa10c4@15514 3f47a204-8049-4147-aab0-d444c64e7564

<!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=iso-8859-1">
  <meta http-equiv="Pragma" content="no-cache">
  <meta http-equiv="Expires" content="-1">

  <%=yield(:head)%>

  <%= javascript_include_tag("prototype", "effects") %>
  <%= javascript_include_tag("sir") %>
  <%= javascript_include_tag 'fckeditor/fckeditor' %>
  <%= javascript_include_tag 'shadedborder' %>
  <title><%= 'Isabel Server'.t %></title>
  <%= stylesheet_link_tag 'sir_global2' %>
  <%= stylesheet_link_tag 'estilosir3' %>
  <%= stylesheet_link_tag 'grids' %>
  <%= stylesheet_link_tag 'reset-fonts-grids' %>
  <%= stylesheet_link_tag 'calendar-blue' %>

				<%if @space.id == 1 || !@space_thumbnail%>
				<%=image_tag("gp-logo.jpg")%>
				<%else%>
				<%=image_tag(space_logotype_path(@space, :thumbnail => @space_thumbnail)) if @space_thumbnail%>
				<%end%>

			 	<%= render :partial => 'home/login', :layout => false%>

GLOBAL - Virtual Conference Centre

				<%= render :partial => 'home/space', :layout => false %>

				<%if @space!=nil %>

					<%= render :partial => 'home/buttons', :layout => false%>
					<%= render :partial => 'home/secondary_buttons', :layout => false%>

				<%else%>
					<%session[:current_tab]=""%>
					<%= render :partial => 'home/buttons', :layout => false%>
				<%end%>

	         <% if flash[:notice] -%>

<%= flash[:notice] %>

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

<%= flash[:error] %>

	        	<% end -%>
				<% if flash[:warning] -%>

<%= flash[:warning] %>

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

			Home |Site map | Faq | About | <%= link_to 'Report Feedback', "/spaces/2/articles/new"  , :method=> 'get'%>

<!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=iso-8859-1">
  <meta http-equiv="Pragma" content="no-cache">
  <meta http-equiv="Expires" content="-1">

  <%=yield(:head)%>

  <%= javascript_include_tag("prototype", "effects") %>
  <%= javascript_include_tag("sir") %>
  <%= javascript_include_tag 'fckeditor/fckeditor' %>
  <%= javascript_include_tag 'shadedborder' %>
  <%= javascript_include_tag '' %>
  <%= javascript_include_tag '' %>
  <%= javascript_include_tag '' %>
  <title><%= 'Isabel Server'.t %></title>
  <%= stylesheet_link_tag 'sir_global2' %>
  <%= stylesheet_link_tag 'estilosir3' %>
  <%= stylesheet_link_tag 'grids' %>
  <%= stylesheet_link_tag 'reset-fonts-grids' %>
  <%= stylesheet_link_tag 'calendar-blue' %>

				<%if @space.id == 1 || !@space_thumbnail%>
				<%=image_tag("gp-logo.jpg")%>
				<%else%>
				<%=image_tag(space_logotype_path(@space, :thumbnail => @space_thumbnail)) if @space_thumbnail%>
				<%end%>

			 	<%= render :partial => 'home/login', :layout => false%>

GLOBAL - Virtual Conference Centre

				<%= render :partial => 'home/space', :layout => false %>

				<%if @space!=nil %>

					<%= render :partial => 'home/buttons', :layout => false%>
					<%= render :partial => 'home/secondary_buttons', :layout => false%>

				<%else%>
					<%session[:current_tab]=""%>
					<%= render :partial => 'home/buttons', :layout => false%>
				<%end%>

	         <% if flash[:notice] -%>

<%= flash[:notice] %>

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

<%= flash[:error] %>

	        	<% end -%>
				<% if flash[:warning] -%>

<%= flash[:warning] %>

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

			Home |Site map | Faq | About | <%= link_to 'Report Feedback', "/spaces/2/articles/new"  , :method=> 'get'%>


ActionItem1054: identifying logged in

ActionItem1054: identifying logged in

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= html_language %>" lang="<%= html_language %>">

    <title><%=
       (@page ? @page.name + ' - ' : '') +
       (@profile ? @profile.name + ' - ' : '') +
       @environment.name +
       (@category ? "→ #{@category.full_name}" : '')
    %></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="FIXME: Descriptions of Noosfero" />
    <meta name="keywords" content="Noosfero, Community, Open Source" />
    <link rel="shortcut icon" href="<%= '/designs/themes/' + current_theme + '/images/favicon.ico' %>" type="image/x-icon" />
    <%= meta_tags_for_article(@page) if @controller.controller_name == 'content_viewer' %>
    <%= javascript_include_tag 'default-config' %>
    <%= javascript_include_tag :defaults %>
    <%# javascript_include_tag 'animator' %>

    <%= javascript_include_tag 'jquery-latest.js' %>

    <%= javascript_include_tag 'thickbox.js' %>

    <%= javascript_include_tag 'menu' %>
    <%= javascript_include_tag 'auto-open-menu' %>
    <%= include_lightbox_header %>
    <%= javascript_include_tag 'cms' if @controller.controller_name == 'cms' %>
    <%= theme_javascript %>

    <%#
     stylesheet_import is better then stylesheet_link_tag because the stylesheet
     must be loaded before the page show.
    %>
    <%=
      # Load the principal css files:
      stylesheet_import( %w( common help menu article button search blocks forms login-box thickbox profiles )
                         ) + "\n" +
      stylesheet_import( %w( common help menu article button search blocks forms login-box ),
                         :themed_source => true ) + "\n" +
      # Load the boxes's css file if each exists:
      import_blocks_stylesheets +
      # Load the controller's css file if it exists:
      stylesheet_import( "controller_"+ @controller.controller_name() ) + "\n" +
      stylesheet_import( "controller_"+ @controller.controller_name(), :themed_source => true )
    %>

    <%= template_stylesheet_tag %>
    <%= icon_theme_stylesheet_tag %>

    <%= stylesheet_link_tag 'iepngfix/iepngfix.css' %>

  <body class='noosfero category<%= category_color %><%=
    # Identify the current controller and action for the CSS:
    " controller_"+ @controller.controller_name() +
    " action_"+ @controller.controller_name() +"_"+ @controller.action_name() +
    (logged_in? ? ' logged-in' : '')
    %>' onload='noosfero_init();'
    help=<%= _('Pass the mouse over page elements to get help on them. Click the question mark icon on the top-right corner to deactivate this help window.').inspect %> onresize="registerDocumentSize()">

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

        <%= flash[:notice] %>
        <%= javascript_tag(
          visual_effect( :appear,    'notice', :duration => 2, :queue => :end ) +
          visual_effect( :highlight, 'notice', :duration => 3, :queue => :end ) +
          visual_effect( :fade,      'notice', :duration => 2, :queue => :end )
        ) %>

    <% end %>

      <%= _('Go to content') %>

BETA

        <%= _("This is %s's shortcuts bar. Using it you have access to the main features of the environment and you find the information of your interest more quickly.") % @environment.name %>

        <%= _("This bar helps you find information following two paths or dimensions. First dimension is composed of categories, which you'll find in the colored tabs in the top. Second dimension has content types, and you'll find them in the animated bar on your right.") % @environment.name %>

          <%= link_to ""+ @environment.name() +"",
                      @environment.top_url,
                        :id=>"menu_link_to_envhome",
                        :title=>@environment.name  %>
          <% unless environment.enabled?(:disable_categories) %>
            <% cache(:controller => 'public', :action => 'categories_menu') do %>
              <%= render :file => 'shared/categories_menu' %>
            <% end %>
          <% end %>
          <%= render :file => 'shared/assets_menu' %>

           <%= language_chooser(:element => 'dropdown') %>

          <%= render :file => 'shared/user_menu' %>

        <a href="#" id="btShowHelp" class="icon-help32on help-on icon-help-on"
           title="<%= _('Turn help on/off') %>"
           onclick="mouseHelpOnOff(); return false"><%= _('Help') %>

          <% if @controller.send(:boxes_editor?) %>
            <%= yield %>
            <%= display_boxes_editor(@controller.boxes_holder) %>
          <% else %>
            <% if uses_design_blocks?  %>
              <%= display_boxes(@controller.boxes_holder, yield) %>
            <% else %>

                <%= yield %>

            <% end %>
          <% end %>

      <%= theme_footer %>

    <%= javascript_include_tag 'show-mouse-help' %>
    <%= javascript_include_tag 'noosfero-show-help' %>

    <% if environment.enabled?('warn_obsolete_browser') %>

<%=
        _('Your web browser is obsolete!') +'

'+
        _('This website will not look as good as it could. Don\'t you want to use Firefox? That is a great web browser, free, and made by people from all over the world.')
        %>

        <%= _('Get Firefox Now!') %>

    <% end %>
    <%= javascript_include_tag 'better-browser-promotion' %>

    <% if is_testing_theme %>
      <%= render :file => 'shared/theme_test_panel' %>
    <% end %>

    <% if ask_to_join? %>
      <%= render :file => 'shared/join_community_popup' %>
    <% end %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%= html_language %>" lang="<%= html_language %>">

    <title><%=
       (@page ? @page.name + ' - ' : '') +
       (@profile ? @profile.name + ' - ' : '') +
       @environment.name +
       (@category ? "→ #{@category.full_name}" : '')
    %></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="FIXME: Descriptions of Noosfero" />
    <meta name="keywords" content="Noosfero, Community, Open Source" />
    <link rel="shortcut icon" href="<%= '/designs/themes/' + current_theme + '/images/favicon.ico' %>" type="image/x-icon" />
    <%= meta_tags_for_article(@page) if @controller.controller_name == 'content_viewer' %>
    <%= javascript_include_tag 'default-config' %>
    <%= javascript_include_tag :defaults %>
    <%# javascript_include_tag 'animator' %>

    <%= javascript_include_tag 'jquery-latest.js' %>

    <%= javascript_include_tag 'thickbox.js' %>

    <%= javascript_include_tag 'menu' %>
    <%= javascript_include_tag 'auto-open-menu' %>
    <%= include_lightbox_header %>
    <%= javascript_include_tag 'cms' if @controller.controller_name == 'cms' %>
    <%= theme_javascript %>

    <%#
     stylesheet_import is better then stylesheet_link_tag because the stylesheet
     must be loaded before the page show.
    %>
    <%=
      # Load the principal css files:
      stylesheet_import( %w( common help menu article button search blocks forms login-box thickbox profiles )
                         ) + "\n" +
      stylesheet_import( %w( common help menu article button search blocks forms login-box ),
                         :themed_source => true ) + "\n" +
      # Load the boxes's css file if each exists:
      import_blocks_stylesheets +
      # Load the controller's css file if it exists:
      stylesheet_import( "controller_"+ @controller.controller_name() ) + "\n" +
      stylesheet_import( "controller_"+ @controller.controller_name(), :themed_source => true )
    %>

    <%= template_stylesheet_tag %>
    <%= icon_theme_stylesheet_tag %>

    <%= stylesheet_link_tag 'iepngfix/iepngfix.css' %>

  <body class='noosfero category<%= category_color %><%=
    # Identify the current controller and action for the CSS:
    " controller_"+ @controller.controller_name() +
    " action_"+ @controller.controller_name() +"_"+ @controller.action_name()
    %>' onload='noosfero_init();'
    help=<%= _('Pass the mouse over page elements to get help on them. Click the question mark icon on the top-right corner to deactivate this help window.').inspect %> onresize="registerDocumentSize()">

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

        <%= flash[:notice] %>
        <%= javascript_tag(
          visual_effect( :appear,    'notice', :duration => 2, :queue => :end ) +
          visual_effect( :highlight, 'notice', :duration => 3, :queue => :end ) +
          visual_effect( :fade,      'notice', :duration => 2, :queue => :end )
        ) %>

    <% end %>

      <%= _('Go to content') %>

BETA

        <%= _("This is %s's shortcuts bar. Using it you have access to the main features of the environment and you find the information of your interest more quickly.") % @environment.name %>

        <%= _("This bar helps you find information following two paths or dimensions. First dimension is composed of categories, which you'll find in the colored tabs in the top. Second dimension has content types, and you'll find them in the animated bar on your right.") % @environment.name %>

          <%= link_to ""+ @environment.name() +"",
                      @environment.top_url,
                        :id=>"menu_link_to_envhome",
                        :title=>@environment.name  %>
          <% unless environment.enabled?(:disable_categories) %>
            <% cache(:controller => 'public', :action => 'categories_menu') do %>
              <%= render :file => 'shared/categories_menu' %>
            <% end %>
          <% end %>
          <%= render :file => 'shared/assets_menu' %>

           <%= language_chooser(:element => 'dropdown') %>

          <%= render :file => 'shared/user_menu' %>

        <a href="#" id="btShowHelp" class="icon-help32on help-on icon-help-on"
           title="<%= _('Turn help on/off') %>"
           onclick="mouseHelpOnOff(); return false"><%= _('Help') %>

          <% if @controller.send(:boxes_editor?) %>
            <%= yield %>
            <%= display_boxes_editor(@controller.boxes_holder) %>
          <% else %>
            <% if uses_design_blocks?  %>
              <%= display_boxes(@controller.boxes_holder, yield) %>
            <% else %>

                <%= yield %>

            <% end %>
          <% end %>

      <%= theme_footer %>

    <%= javascript_include_tag 'show-mouse-help' %>
    <%= javascript_include_tag 'noosfero-show-help' %>

    <% if environment.enabled?('warn_obsolete_browser') %>

<%=
        _('Your web browser is obsolete!') +'

'+
        _('This website will not look as good as it could. Don\'t you want to use Firefox? That is a great web browser, free, and made by people from all over the world.')
        %>

        <%= _('Get Firefox Now!') %>

    <% end %>
    <%= javascript_include_tag 'better-browser-promotion' %>

    <% if is_testing_theme %>
      <%= render :file => 'shared/theme_test_panel' %>
    <% end %>

    <% if ask_to_join? %>
      <%= render :file => 'shared/join_community_popup' %>
    <% end %>


fix unclickable link bug

fix unclickable link bug

<% content_for :page_scripts do -%>
  document.observe('dom:loaded', function(){
    Event.addBehavior({
      'tr.comment td.content': function(event){
        $(this).observe('click', function(event){
          if($(this).down('blockquote.expanded')){
            $(this).down('blockquote.expanded').toggle();
            $(this).down('blockquote.short').toggle();
          }
          event.stop();
        });
      }
    });
  });
<% end %>
<%- include_stylesheet 'admin/comments' %>

  <% if @page -%>
    <%= @page.comments.count %> <%= "#{params[:status].titleize} " if params[:status] %><%= pluralize(@page.comments.count, 'Comment') %> on <%= link_to @page.title, edit_admin_page_path(@page) %>
  <% else -%>
    <%= params[:status].titleize if params[:status] %> Comments
  <% end -%>

<%= link_or_span_unless_current("All", :status => 'all', :page_id => params[:page_id]) %>

<%= link_or_span_unless_current("Approved", :status => "approved", :page_id => params[:page_id]) %>

<%= link_or_span_unless_current("Unapproved", :status => "unapproved", :page_id => params[:page_id]) %>

<%= link_to "Download CSV", :format => :csv %>

<%= will_paginate @comments %>

      Content
      Date
      Author
      <% unless @page %>Page	<% end %>
      Actions

    <%= render(:partial => "comment", :collection => @comments) || %Q[
No comments
] %>

<%= will_paginate @comments %>

<% form_tag destroy_unapproved_admin_comments_url, :method => :delete do %>

<button type="submit" class="delete-unapproved"><%= image_tag("admin/comments_delete.png") %> Delete All Unapproved</button>

<% end %>

<%= Comment.spam_filter.message %>

<% content_for :page_scripts do -%>
  document.observe('dom:loaded', function(){
    Event.addBehavior({
      'tr.comment td': function(event){
        $(this).observe('click', function(event){
          if($(this).down('blockquote.expanded')){
            $(this).down('blockquote.expanded').toggle();
            $(this).down('blockquote.short').toggle();
          }
          event.stop();
        });
      }
    });
  });
<% end %>
<%- include_stylesheet 'admin/comments' %>

  <% if @page -%>
    <%= @page.comments.count %> <%= "#{params[:status].titleize} " if params[:status] %><%= pluralize(@page.comments.count, 'Comment') %> on <%= link_to @page.title, edit_admin_page_path(@page) %>
  <% else -%>
    <%= params[:status].titleize if params[:status] %> Comments
  <% end -%>

<%= link_or_span_unless_current("All", :status => 'all', :page_id => params[:page_id]) %>

<%= link_or_span_unless_current("Approved", :status => "approved", :page_id => params[:page_id]) %>

<%= link_or_span_unless_current("Unapproved", :status => "unapproved", :page_id => params[:page_id]) %>

<%= link_to "Download CSV", :format => :csv %>

<%= will_paginate @comments %>

      Content
      Date
      Author
      <% unless @page %>Page	<% end %>
      Actions

    <%= render(:partial => "comment", :collection => @comments) || %Q[
No comments
] %>

<%= will_paginate @comments %>

<% form_tag destroy_unapproved_admin_comments_url, :method => :delete do %>

<button type="submit" class="delete-unapproved"><%= image_tag("admin/comments_delete.png") %> Delete All Unapproved</button>

<% end %>

<%= Comment.spam_filter.message %>


renamed local variable

renamed local variable

<%
   set_parameters_for_sharing_form
   show_advanced_permissions = !@resource.respond_to?(:has_advanced_permissions?) || @resource.has_advanced_permissions?
%>
<%# initialization: required to keep javascript independent of the access type codes, to allow the use the constants instead -%>
<%= render :partial=>"assets/sharing_constants" %>

<%# this hidden input will submit all permission data with the form -%>
<%= hidden_field_tag "sharing[permissions][contributor_types]", "" -%>
<%= hidden_field_tag "sharing[permissions][values]", "" -%>

    <%= help_icon("Here you can specify who can see#{', download' if @resource.is_downloadable?} and edit this #{@resource_type}.") -%>
    Sharing

        Here you can specify who can view the summary of<% if @resource.is_downloadable? %>, get access to the content of,<% end %> and edit the <%= @resource_type -%>.
        <%= link_to_function "More info " + expand_image, visual_effect(:toggle_blind, "more_sharing_info", :duration => 0.3) -%>

          You may:

Keep the <%= @resource_type -%> private, and only visible to yourself.

Share within the selected projects and with all other users that are a member of a <%= Seek::Config.project_name %> project.

          <% if try_block{@resource.can_publish?} %>

Share with the all visitors (including anonymous visitors with no login)

          <% end %>

Define more fine-grained sharing in the Advanced sharing: you can share within your Project/Institution only,
 with specific individuals, or set up custom favourite groups for people you regularly need to share with.

<label for="sharing_scope_<%= Policy::PRIVATE -%>">
            <input type="hidden" id='access_type_select_<%= Policy::PRIVATE -%>' name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>">
            <input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
                                                                                value="<%= Policy::PRIVATE -%>" type="radio" />
            - Keep this <%= @resource_type -%> private (only visible to you)

          <%= additional_advanced_permissions_included @resource, Policy::PRIVATE -%>

Or share it with..

            <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_SYSMO_USERS -%> id="sharing_scope_<%= Policy::ALL_SYSMO_USERS -%>" name="sharing[sharing_scope]" value="<%= Policy::ALL_SYSMO_USERS -%>" />
            - Members of projects associated with this <%= @resource_type -%>:

             <select name="sharing[your_proj_access_type]" id="sharing_your_proj_access_type">
                 <%= policy_selection_options([Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING,Policy::MANAGING], @resource, your_project_access_type(@policy, @resource)) -%>
             </select>

            ... and all other project members:
             <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::ALL_SYSMO_USERS,
               :sharing_scope => Policy::ALL_SYSMO_USERS, :access_type => @access_mode, :access_type_options=>[Policy::NO_ACCESS,Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING] } -%>
             <%= additional_advanced_permissions_included @resource, Policy::ALL_SYSMO_USERS -%>

          <label for="sharing_scope_<%= Policy::EVERYONE -%>">
            <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::EVERYONE -%> id="sharing_scope_<%= Policy::EVERYONE -%>" name="sharing[sharing_scope]"
                   value="<%= Policy::EVERYONE -%>" <%= 'disabled="true"' if @resource.respond_to?(:can_publish?) && !@resource.can_publish? -%>/>
            - All visitors (including anonymous visitors with no login):

              <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::EVERYONE,
            :sharing_scope => @sharing_mode, :access_type => @access_mode } -%>
           <%= additional_advanced_permissions_included @resource, Policy::EVERYONE -%>

    <% if @resource.new_record? && @resource.errors.empty? -%>

    <% end -%>

    <%= link_to_function "Advanced permissions " + expand_image, :class => 'advanced_sharing_link', :style => "display:" + (show_advanced_permissions ? 'none;' : 'block;'), :id =>'advanced_sharing_expand_image' do |page|
        page.visual_effect :toggle_blind, "advanced sharing", :duration => 0.5
        page["advanced_sharing_expand_image"].toggle
        page["advanced_sharing_collapse_image"].toggle
        end
    -%>
    <%= link_to_function "Advanced permissions " + collapse_image, :class => 'advanced_sharing_link', :style => "display:" + (show_advanced_permissions ? 'block;' : 'none;'), :id =>'advanced_sharing_collapse_image'do |page|
        page.visual_effect :toggle_blind, "advanced sharing", :duration => 0.5
        page["advanced_sharing_expand_image"].toggle
        page["advanced_sharing_collapse_image"].toggle
        end
    -%>

    <div id="advanced sharing" class='sharing_box_form' style="display:<%= show_advanced_permissions ? 'block;' : 'none;'-%>">

Additional fine-grained sharing permissions

              So far you have selected to share this <%= @resource_type -%> with:

              Loading...

              Build up the list of people and groups to share with.
              Select from the options below and click "Add" to apply
              your choices and add collaborators to your current selection:

                <%= image_tag icon_filename_for_key("spinner"), :id => "f_group_deleting_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle; float: right;" -%>
                <%= help_icon("Here you can choose your favourite groups to share this #{@resource_type} with.") -%>
                Favourite Groups

                  <% favourite_groups = FavouriteGroup.get_all_without_blacklists_and_whitelists(current_user.id) -%>
                  <% f_group_select_options = (favourite_groups.blank? ? "<option value=\"\">You don't have any favourite groups</option>" : options_for_select(favourite_groups)) -%>

                  <%= select_tag "favourite_group_select", f_group_select_options, :style => "width: 82%; vertical-align: middle; margin-right: 0.4em;", :disabled => (favourite_groups.blank?) -%>

                  <%= link_to "Add", "", :id => "add_f_group_link", :style => "font-weight: bold; vertical-align: middle;", :disabled => (favourite_groups.blank?),
                    :onclick => "javascript: if($('favourite_group_select').disabled) return(false); addContributor('FavouriteGroup', $('favourite_group_select').options[$('favourite_group_select').selectedIndex].text, parseInt($('favourite_group_select').options[$('favourite_group_select').selectedIndex].value), #{Policy::DETERMINED_BY_GROUP}); return(false);" -%>

                  <li id="edit_f_group_li" style="display: <%= favourite_groups.blank? ? "none" : "block" -%>; list-style-type: disc; padding: 0;"><%= favourite_group_popup_link_action_edit(@resource.class.name) -%>

                  <li id="delete_f_group_li" style="display: <%= favourite_groups.blank? ? "none" : "block" -%>; list-style-type: disc; padding: 0;">
                    <%= link_to "Delete selected favourite group", delete_favourite_group_path(0), :onclick => "deleteSelectedFavouriteGroup(); return(false);" -%>

<%= favourite_group_popup_link_action_new(@resource.class.name) -%>

                <%= help_icon("Here you can choose projects, institutions and workgroups to share this #{@resource_type} with.") -%>
                Projects and Institutions

                  <% right_arrow_image = icon_filename_for_key("arrow_right") -%>

                  Step 1
                  <%= image_tag right_arrow_image, :style => "vertical-align: middle; padding: 0 0.8em;" -%>

                  Step 2
                  <%= image_tag right_arrow_image, :style => "vertical-align: middle; padding: 0 0.8em;" -%>

                  Step 3

                    <input type="hidden" id="proj_select_step_index" value="1">

                      <%= image_tag icon_filename_for_key("spinner"), :id => "institutions_loading_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle; float: right;" -%>
                      Step 1: Select a project
                      <%= select("proj_project", "select",
                        Project.find(:all).collect {|p| [ p.name, p.id ] },
                        {:include_blank => 'All Projects @ Institution (from Step 2)'}, {:style => "width: 100%; vertical-align: middle; margin: 0.3em 0;"}) -%>

                      Step 2: Select scope of the project
                      <%= select_tag("proj_institution_select", nil, {:style => "width: 100%; vertical-align: middle; margin: 0.3em 0;"}) -%>

                      Step 3: Choose access rights, review and submit

                      <select name="proj_access_type_select" id="proj_access_type_select" onchange="javascript: replaceReviewWorkGroupURL();" style="width: 100%; vertical-align: middle; margin: 0.3em 0;">
                        <%= policy_selection_options [Policy::NO_ACCESS,Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING,Policy::MANAGING], @resource -%>
                      </select>

                        <%= link_to "< Previous step", "", :onclick => "javascript: projectInstitutionStepAction(-1); return(false);", :style => "font-weight: bold;" -%>

                        <%= link_to "Next step >", "", :onclick => "javascript: projectInstitutionStepAction(1); return(false);", :style => "font-weight: bold;" -%>

                            <%= link_to "Add immediately", "", :onclick => "javascript: addProjectInstitution(); return(false);", :style => "font-weight: bold; padding: 0;" -%>

<%= workgroup_member_review_popup_link(@resource.class.name) -%>

                <%= help_icon("Here you can specify individual people to share this #{@resource_type} with.") -%>
                Individual People

                    Please type names of people to share this <%= @resource_type -%> with into the box below - suggestions will be displayed as you type.
                    Select access rights from drop-down menu; these will be applied to all chosen people.
                    Clicking "Add" will add selected people to the list.

                          ^_^<input type="text" id="ip_hidden_input" tabindex="-1" >

                            <input type="text" size="1" tabindex="" id="ip_autocomplete_input" />

Type the name of a friend, friend list, or email address

                        <select name="individual_people_access_type_select" id="individual_people_access_type_select" style="width: 344px; vertical-align: middle; margin-top: 0.3em;">
                          <%= policy_selection_options nil, @resource -%>
                        </select>

                        <%= link_to "Add", "", :onclick => "javascript: addIndividualPeople(); return(false);" -%>

<%
   set_parameters_for_sharing_form
   advanced_permissions = !@resource.respond_to?(:has_advanced_permissions?) || @resource.has_advanced_permissions?

%>
<%# initialization: required to keep javascript independent of the access type codes, to allow the use the constants instead -%>
<%= render :partial=>"assets/sharing_constants" %>

<%# this hidden input will submit all permission data with the form -%>
<%= hidden_field_tag "sharing[permissions][contributor_types]", "" -%>
<%= hidden_field_tag "sharing[permissions][values]", "" -%>

    <%= help_icon("Here you can specify who can see#{', download' if @resource.is_downloadable?} and edit this #{@resource_type}.") -%>
    Sharing

        Here you can specify who can view the summary of<% if @resource.is_downloadable? %>, get access to the content of,<% end %> and edit the <%= @resource_type -%>.
        <%= link_to_function "More info " + expand_image, visual_effect(:toggle_blind, "more_sharing_info", :duration => 0.3) -%>

          You may:

Keep the <%= @resource_type -%> private, and only visible to yourself.

Share within the selected projects and with all other users that are a member of a <%= Seek::Config.project_name %> project.

          <% if try_block{@resource.can_publish?} %>

Share with the all visitors (including anonymous visitors with no login)

          <% end %>

Define more fine-grained sharing in the Advanced sharing: you can share within your Project/Institution only,
 with specific individuals, or set up custom favourite groups for people you regularly need to share with.

<label for="sharing_scope_<%= Policy::PRIVATE -%>">
            <input type="hidden" id='access_type_select_<%= Policy::PRIVATE -%>' name="sharing[access_type_<%= Policy::PRIVATE -%>]" value="<%= Policy::NO_ACCESS -%>">
            <input <%= 'checked="checked"' if @sharing_mode == Policy::PRIVATE %> id="sharing_scope_<%= Policy::PRIVATE -%>" name="sharing[sharing_scope]"
                                                                                value="<%= Policy::PRIVATE -%>" type="radio" />
            - Keep this <%= @resource_type -%> private (only visible to you)

          <%= additional_advanced_permissions_included @resource, Policy::PRIVATE -%>

Or share it with..

            <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::ALL_SYSMO_USERS -%> id="sharing_scope_<%= Policy::ALL_SYSMO_USERS -%>" name="sharing[sharing_scope]" value="<%= Policy::ALL_SYSMO_USERS -%>" />
            - Members of projects associated with this <%= @resource_type -%>:

             <select name="sharing[your_proj_access_type]" id="sharing_your_proj_access_type">
                 <%= policy_selection_options([Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING,Policy::MANAGING], @resource, your_project_access_type(@policy, @resource)) -%>
             </select>

            ... and all other project members:
             <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::ALL_SYSMO_USERS,
               :sharing_scope => Policy::ALL_SYSMO_USERS, :access_type => @access_mode, :access_type_options=>[Policy::NO_ACCESS,Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING] } -%>
             <%= additional_advanced_permissions_included @resource, Policy::ALL_SYSMO_USERS -%>

          <label for="sharing_scope_<%= Policy::EVERYONE -%>">
            <input type="radio" <%= 'checked="checked"' if @sharing_mode == Policy::EVERYONE -%> id="sharing_scope_<%= Policy::EVERYONE -%>" name="sharing[sharing_scope]"
                   value="<%= Policy::EVERYONE -%>" <%= 'disabled="true"' if @resource.respond_to?(:can_publish?) && !@resource.can_publish? -%>/>
            - All visitors (including anonymous visitors with no login):

              <%= render :partial => "assets/sharing_form_access_type_dropdown", :locals => { :access_type_selector_for_scope => Policy::EVERYONE,
            :sharing_scope => @sharing_mode, :access_type => @access_mode } -%>
           <%= additional_advanced_permissions_included @resource, Policy::EVERYONE -%>

    <% if @resource.new_record? && @resource.errors.empty? -%>

    <% end -%>

    <%= link_to_function "Advanced permissions " + expand_image, :class => 'advanced_sharing_link', :style => "display:" + (advanced_permissions ? 'none;' : 'block;'), :id =>'advanced_sharing_expand_image' do |page|
        page.visual_effect :toggle_blind, "advanced sharing", :duration => 0.5
        page["advanced_sharing_expand_image"].toggle
        page["advanced_sharing_collapse_image"].toggle
        end
    -%>
    <%= link_to_function "Advanced permissions " + collapse_image, :class => 'advanced_sharing_link', :style => "display:" + (advanced_permissions ? 'block;' : 'none;'), :id =>'advanced_sharing_collapse_image'do |page|
        page.visual_effect :toggle_blind, "advanced sharing", :duration => 0.5
        page["advanced_sharing_expand_image"].toggle
        page["advanced_sharing_collapse_image"].toggle
        end
    -%>

    <div id="advanced sharing" class='sharing_box_form' style="display:<%= advanced_permissions ? 'block;' : 'none;'-%>">

Additional fine-grained sharing permissions

              So far you have selected to share this <%= @resource_type -%> with:

              Loading...

              Build up the list of people and groups to share with.
              Select from the options below and click "Add" to apply
              your choices and add collaborators to your current selection:

                <%= image_tag icon_filename_for_key("spinner"), :id => "f_group_deleting_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle; float: right;" -%>
                <%= help_icon("Here you can choose your favourite groups to share this #{@resource_type} with.") -%>
                Favourite Groups

                  <% favourite_groups = FavouriteGroup.get_all_without_blacklists_and_whitelists(current_user.id) -%>
                  <% f_group_select_options = (favourite_groups.blank? ? "<option value=\"\">You don't have any favourite groups</option>" : options_for_select(favourite_groups)) -%>

                  <%= select_tag "favourite_group_select", f_group_select_options, :style => "width: 82%; vertical-align: middle; margin-right: 0.4em;", :disabled => (favourite_groups.blank?) -%>

                  <%= link_to "Add", "", :id => "add_f_group_link", :style => "font-weight: bold; vertical-align: middle;", :disabled => (favourite_groups.blank?),
                    :onclick => "javascript: if($('favourite_group_select').disabled) return(false); addContributor('FavouriteGroup', $('favourite_group_select').options[$('favourite_group_select').selectedIndex].text, parseInt($('favourite_group_select').options[$('favourite_group_select').selectedIndex].value), #{Policy::DETERMINED_BY_GROUP}); return(false);" -%>

                  <li id="edit_f_group_li" style="display: <%= favourite_groups.blank? ? "none" : "block" -%>; list-style-type: disc; padding: 0;"><%= favourite_group_popup_link_action_edit(@resource.class.name) -%>

                  <li id="delete_f_group_li" style="display: <%= favourite_groups.blank? ? "none" : "block" -%>; list-style-type: disc; padding: 0;">
                    <%= link_to "Delete selected favourite group", delete_favourite_group_path(0), :onclick => "deleteSelectedFavouriteGroup(); return(false);" -%>

<%= favourite_group_popup_link_action_new(@resource.class.name) -%>

                <%= help_icon("Here you can choose projects, institutions and workgroups to share this #{@resource_type} with.") -%>
                Projects and Institutions

                  <% right_arrow_image = icon_filename_for_key("arrow_right") -%>

                  Step 1
                  <%= image_tag right_arrow_image, :style => "vertical-align: middle; padding: 0 0.8em;" -%>

                  Step 2
                  <%= image_tag right_arrow_image, :style => "vertical-align: middle; padding: 0 0.8em;" -%>

                  Step 3

                    <input type="hidden" id="proj_select_step_index" value="1">

                      <%= image_tag icon_filename_for_key("spinner"), :id => "institutions_loading_spinner", :alt=>"loading...", :title=>"loading...", :style => "display: none; vertical-align: middle; float: right;" -%>
                      Step 1: Select a project
                      <%= select("proj_project", "select",
                        Project.find(:all).collect {|p| [ p.name, p.id ] },
                        {:include_blank => 'All Projects @ Institution (from Step 2)'}, {:style => "width: 100%; vertical-align: middle; margin: 0.3em 0;"}) -%>

                      Step 2: Select scope of the project
                      <%= select_tag("proj_institution_select", nil, {:style => "width: 100%; vertical-align: middle; margin: 0.3em 0;"}) -%>

                      Step 3: Choose access rights, review and submit

                      <select name="proj_access_type_select" id="proj_access_type_select" onchange="javascript: replaceReviewWorkGroupURL();" style="width: 100%; vertical-align: middle; margin: 0.3em 0;">
                        <%= policy_selection_options [Policy::NO_ACCESS,Policy::VISIBLE,Policy::ACCESSIBLE,Policy::EDITING,Policy::MANAGING], @resource -%>
                      </select>

                        <%= link_to "< Previous step", "", :onclick => "javascript: projectInstitutionStepAction(-1); return(false);", :style => "font-weight: bold;" -%>

                        <%= link_to "Next step >", "", :onclick => "javascript: projectInstitutionStepAction(1); return(false);", :style => "font-weight: bold;" -%>

                            <%= link_to "Add immediately", "", :onclick => "javascript: addProjectInstitution(); return(false);", :style => "font-weight: bold; padding: 0;" -%>

<%= workgroup_member_review_popup_link(@resource.class.name) -%>

                <%= help_icon("Here you can specify individual people to share this #{@resource_type} with.") -%>
                Individual People

                    Please type names of people to share this <%= @resource_type -%> with into the box below - suggestions will be displayed as you type.
                    Select access rights from drop-down menu; these will be applied to all chosen people.
                    Clicking "Add" will add selected people to the list.

                          ^_^<input type="text" id="ip_hidden_input" tabindex="-1" >

                            <input type="text" size="1" tabindex="" id="ip_autocomplete_input" />

Type the name of a friend, friend list, or email address

                        <select name="individual_people_access_type_select" id="individual_people_access_type_select" style="width: 344px; vertical-align: middle; margin-top: 0.3em;">
                          <%= policy_selection_options nil, @resource -%>
                        </select>

                        <%= link_to "Add", "", :onclick => "javascript: addIndividualPeople(); return(false);" -%>


ActionItem85: displaying error message

ActionItem85: displaying error message

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

<h2> <%= _('Access denied') %> </h2>

<% unless @message.nil? %>
  <p>
  <%= @message %>
  </p>
<% end %>


Tweaked burnup chart

Tweaked burnup chart

<div id="graph-<%=@widget.dom_id%>" style="width:500px;height:305px;margin-top:0.5em;margin-bottom:1em;">

<% if @end_date %>
ETA: <%= tz.utc_to_local(@end_date).strftime(current_user.date_format) %>
<% end %>

<div id="graph-<%=@widget.dom_id%>" style="width:475px;height:285px;margin-top:0.5em;margin-bottom:1em;">

<% if @end_date %>
ETA: <%= tz.utc_to_local(@end_date).strftime(current_user.date_format) %>
<% end %>


add present?, empty? is broken

add present?, empty? is broken

<% if !@viewers.nil? %>

Click on a person's name to see more information about what projects this person is associated with.

Inactive accounts will be gray.

  <% if @viewers.length > 0 %>

<%= sortable_table %>

          <%= th 'person record' %>
          <%= th 'name' %>
          <%= th 'viewer id', :type => 'int' %>
          <%= th 'person id', :type => 'int' %>
          <%= th 'email' %>
          <%= th 'campus' %>
          <%= th 'gcx' %>
          <%= th '# profiles' %>
          <%= th 'last login' %>
          <%= th '' %>

        <% for viewer in @viewers %>
          <tr id="row_<%=viewer.id%>" class="search_result <%= 'inactive' if viewer.viewer_isActive == 0 %>" >
            <% if viewer.person %>
              yes
            <% else %>
              no
            <% end %>

                <% view_result_params = { :url => {:action => 'get_viewer_specifics', :id => viewer.id},
                                  :update => 'viewer_specifics',
                                  :before => "Element.show('finding_viewer_specifics_#{viewer.id}');",
                                  :complete => "Element.hide('finding_viewer_specifics_#{viewer.id}');" } %>
                <% link_text = viewer.name =~ /^\s+$/ ? '(no name set)' : viewer.name %>
                <%= link_to_remote link_text, view_result_params %>
                <% @init_js = view_result_params if @viewers.length == 1 %>

            <%=h viewer.id %>
            <%=h viewer.person.try(:id) %>
            <%=h viewer.person.try(:person_email) %>
            <%=h viewer.person.try(:campus_or_team) %>
            <%=h 'gcx' if viewer.guid.present? %>
            <%=h viewer.profiles.length %>
            <%=h viewer.last_login %>

            <% if @viewer.is_projects_coordinator? %>
              <%= link_to 'merge..', merge_viewer_url(viewer) %>
              <%= link_to 'deactivate..', deactivate_viewer_url(viewer) %>
            <% end %>
            <% if @viewer.is_eventgroup_coordinator?(@eg) && (@viewer.is_projects_coordinator? || !viewer.eventgroups_coordinating.present?) %>
              <%= link_to 'impersonate', impersonate_viewer_url(viewer) %>
            <% end %>

              <span id="finding_viewer_specifics_<%= viewer.id %>" style="clear:both; display:none;">
                <%=image_tag('spinner.gif')%>

        <% end %>

  <% else %>

No results found.

  <% end %>
<% end %>

<% if !@viewers.nil? %>

Click on a person's name to see more information about what projects this person is associated with.

Inactive accounts will be gray.

  <% if @viewers.length > 0 %>

<%= sortable_table %>

          <%= th 'person record' %>
          <%= th 'name' %>
          <%= th 'viewer id', :type => 'int' %>
          <%= th 'person id', :type => 'int' %>
          <%= th 'email' %>
          <%= th 'campus' %>
          <%= th 'gcx' %>
          <%= th '# profiles' %>
          <%= th 'last login' %>
          <%= th '' %>

        <% for viewer in @viewers %>
          <tr id="row_<%=viewer.id%>" class="search_result <%= 'inactive' if viewer.viewer_isActive == 0 %>" >
            <% if viewer.person %>
              yes
            <% else %>
              no
            <% end %>

                <% view_result_params = { :url => {:action => 'get_viewer_specifics', :id => viewer.id},
                                  :update => 'viewer_specifics',
                                  :before => "Element.show('finding_viewer_specifics_#{viewer.id}');",
                                  :complete => "Element.hide('finding_viewer_specifics_#{viewer.id}');" } %>
                <% link_text = viewer.name =~ /^\s+$/ ? '(no name set)' : viewer.name %>
                <%= link_to_remote link_text, view_result_params %>
                <% @init_js = view_result_params if @viewers.length == 1 %>

            <%=h viewer.id %>
            <%=h viewer.person.try(:id) %>
            <%=h viewer.person.try(:person_email) %>
            <%=h viewer.person.try(:campus_or_team) %>
            <%=h 'gcx' unless viewer.guid.empty? %>
            <%=h viewer.profiles.length %>
            <%=h viewer.last_login %>

            <% if @viewer.is_projects_coordinator? %>
              <%= link_to 'merge..', merge_viewer_url(viewer) %>
              <%= link_to 'deactivate..', deactivate_viewer_url(viewer) %>
            <% end %>
            <% if @viewer.is_eventgroup_coordinator?(@eg) && (@viewer.is_projects_coordinator? || !viewer.eventgroups_coordinating.present?) %>
              <%= link_to 'impersonate', impersonate_viewer_url(viewer) %>
            <% end %>

              <span id="finding_viewer_specifics_<%= viewer.id %>" style="clear:both; display:none;">
                <%=image_tag('spinner.gif')%>

        <% end %>

  <% else %>

No results found.

  <% end %>
<% end %>


Show number of things tracked in search results for users.

<% if @highlight_words.nil?
      @highlight_words = []
   end %>

    <%= link_to highlight_words(display_user.name, @highlight_words), user_url(display_user) %>

        <%= pluralize(display_user.info_requests.size, "request") %> made.
        <%= pluralize(display_user.track_things.size, "thing") %> tracked.
        Joined on <%= simple_date(display_user.created_at) %>.

<% if @highlight_words.nil?
      @highlight_words = []
   end %>

    <%= link_to highlight_words(display_user.name, @highlight_words), user_url(display_user) %>

        <%= pluralize(display_user.info_requests.size, "request") %> made.
        Joined on <%= simple_date(display_user.created_at) %>.


Temporary for this year: Omit sponsor names from projects_sponsors.

        Project
	Sponsor/Notes

    <% for p in @projects %>

        <%= p.name %>

    <% end %>

        Project
	Sponsor/Notes

    <% for p in @projects %>

        <%= p.name %>
	<%= p.owner_requests.map { |r| r.person.name }.join(' ') %>

    <% end %>


Check if page is nil

Check if page is nil

<% edition_mode = (defined? edition_mode) ? edition_mode : false %>
<div class="<%= edition_mode ? '' : 'page-comment-form' %>">

<% focus_on = logged_in? ? 'title' : 'name' %>

<% if !edition_mode && !pass_without_comment_captcha? %>

<%= _('Please type the two words below') %>

    <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) %>
    <% button_bar do %>
      <%= button_to_function :add, _('Confirm'), "return false", :id => "confirm-captcha" %>
      <%= button_to_function :cancel, _('Cancel'), "jQuery.colorbox.close()" %>
    <% end %>

<% end %>

<% if @comment && @comment.errors.any? %>
  <%= error_messages_for :comment %>
<% end %>

<div class="post_comment_box <%= ((defined? show_form) && show_form) ? 'opened' : 'closed' %>">

  <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form') if display_link && @comment.reply_of_id.blank? %>
<% remote_form_for(:comment, comment, :url => {:profile => profile.identifier, :controller => 'comment', :action => (edition_mode ? 'update' : 'create'), :id => (edition_mode ?  comment.id : @page.id)}, :html => { :class => 'comment_form' } ) do |f| %>

  <%= required_fields_message %>

  <% unless logged_in? %>

    <%= required labelled_form_field(_('Name'), f.text_field(:name)) %>
    <%= required labelled_form_field(_('e-mail'), f.text_field(:email)) %>

    <%= _('If you are a registered user, you can login and be automatically recognized.') %>

  <% end %>

  <% if !edition_mode && !pass_without_comment_captcha? %>
    <%= hidden_field_tag(:recaptcha_response_field, nil, :id => nil) %>
    <%= hidden_field_tag(:recaptcha_challenge_field, nil, :id => nil) %>
  <% end %>

  <%= labelled_form_field(_('Title'), f.text_field(:title)) %>
  <% text = if @page and @page.parent and @page.parent.is_a?(Forum) then _('Enter your answer') else _('Enter your comment') end %>
  <%= required labelled_form_field(text, f.text_area(:body, :rows => 5)) %>

  <%= hidden_field_tag(:confirm, 'false') %>
  <%= hidden_field_tag(:view, params[:view])%>
  <%= f.hidden_field(:reply_of_id) %>

  <%= @plugins.dispatch(:comment_form_extra_contents, local_assigns).collect { |content| instance_eval(&content) }.join("") %>

  <% button_bar do %>
    <% text = if @page and @page.parent and @page.parent.is_a?(Forum) then _('Post answer') else _('Post comment') end %>
    <%= submit_button('add', text, :onclick => "if(check_captcha(this)) { save_comment(this) } else { check_captcha(this, save_comment)};return false;") %>
    <% if !edition_mode %>
      <%= button :cancel, _('Cancel'), '', :id => 'cancel-comment' %>
    <% else %>
      <%= button :cancel, _('Cancel'), '#', :onclick => "jQuery.colorbox.close();" %>
    <% end %>
  <% end %>
<% end %>

<%= javascript_include_tag 'comment_form'%>

<% edition_mode = (defined? edition_mode) ? edition_mode : false %>
<div class="<%= edition_mode ? '' : 'page-comment-form' %>">

<% focus_on = logged_in? ? 'title' : 'name' %>

<% if !edition_mode && !pass_without_comment_captcha? %>

<%= _('Please type the two words below') %>

    <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true) %>
    <% button_bar do %>
      <%= button_to_function :add, _('Confirm'), "return false", :id => "confirm-captcha" %>
      <%= button_to_function :cancel, _('Cancel'), "jQuery.colorbox.close()" %>
    <% end %>

<% end %>

<% if @comment && @comment.errors.any? %>
  <%= error_messages_for :comment %>
<% end %>

<div class="post_comment_box <%= ((defined? show_form) && show_form) ? 'opened' : 'closed' %>">

  <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form') if display_link && @comment.reply_of_id.blank? %>
<% remote_form_for(:comment, comment, :url => {:profile => profile.identifier, :controller => 'comment', :action => (edition_mode ? 'update' : 'create'), :id => (edition_mode ?  comment.id : @page.id)}, :html => { :class => 'comment_form' } ) do |f| %>

  <%= required_fields_message %>

  <% unless logged_in? %>

    <%= required labelled_form_field(_('Name'), f.text_field(:name)) %>
    <%= required labelled_form_field(_('e-mail'), f.text_field(:email)) %>

    <%= _('If you are a registered user, you can login and be automatically recognized.') %>

  <% end %>

  <% if !edition_mode && !pass_without_comment_captcha? %>
    <%= hidden_field_tag(:recaptcha_response_field, nil, :id => nil) %>
    <%= hidden_field_tag(:recaptcha_challenge_field, nil, :id => nil) %>
  <% end %>

  <%= labelled_form_field(_('Title'), f.text_field(:title)) %>
  <% text = if @page.parent and @page.parent.is_a?(Forum) then _('Enter your answer') else _('Enter your comment') end %>
  <%= required labelled_form_field(text, f.text_area(:body, :rows => 5)) %>

  <%= hidden_field_tag(:confirm, 'false') %>
  <%= hidden_field_tag(:view, params[:view])%>
  <%= f.hidden_field(:reply_of_id) %>

  <%= @plugins.dispatch(:comment_form_extra_contents, local_assigns).collect { |content| instance_eval(&content) }.join("") %>

  <% button_bar do %>
    <% text = if @page.parent and @page.parent.is_a?(Forum) then _('Post answer') else _('Post comment') end %>
    <%= submit_button('add', text, :onclick => "if(check_captcha(this)) { save_comment(this) } else { check_captcha(this, save_comment)};return false;") %>
    <% if !edition_mode %>
      <%= button :cancel, _('Cancel'), '', :id => 'cancel-comment' %>
    <% else %>
      <%= button :cancel, _('Cancel'), '#', :onclick => "jQuery.colorbox.close();" %>
    <% end %>
  <% end %>
<% end %>

<%= javascript_include_tag 'comment_form'%>


add tries around person so viewers with no person show up

<% if !@viewers.nil? %>

Click on a person's name to see more information about what projects this person is associated with.

Inactive accounts will be gray.

  <% if @viewers.length > 0 %>

<%= sortable_table %>

          <%= th 'person record' %>
          <%= th 'name' %>
          <%= th 'viewer id', :type => 'int' %>
          <%= th 'person id', :type => 'int' %>
          <%= th 'email' %>
          <%= th 'campus' %>
          <%= th 'gcx' %>
          <%= th '# profiles' %>
          <%= th 'last login' %>
          <%= th '' %>

        <% for viewer in @viewers %>
          <tr id="row_<%=viewer.id%>" class="search_result <%= 'inactive' if viewer.viewer_isActive == 0 %>" >
            <% if viewer.person %>
              yes
            <% else %>
              no
            <% end %>

                <% view_result_params = { :url => {:action => 'get_viewer_specifics', :id => viewer.id},
                                  :update => 'viewer_specifics',
                                  :before => "Element.show('finding_viewer_specifics_#{viewer.id}');",
                                  :complete => "Element.hide('finding_viewer_specifics_#{viewer.id}');" } %>
                <% link_text = viewer.name =~ /^\s+$/ ? '(no name set)' : viewer.name %>
                <%= link_to_remote link_text, view_result_params %>
                <% @init_js = view_result_params if @viewers.length == 1 %>

            <%=h viewer.id %>
            <%=h viewer.person.try(:id) %>
            <%=h viewer.person.try(:person_email) %>
            <%=h viewer.person.try(:campus_or_team) %>
            <%=h 'gcx' unless viewer.guid.empty? %>
            <%=h viewer.profiles.length %>
            <%=h viewer.last_login %>

            <% if @viewer.is_projects_coordinator? %>
              <%= link_to 'merge..', merge_viewer_url(viewer) %>
              <%= link_to 'deactivate..', deactivate_viewer_url(viewer) %>
            <% end %>
            <% if @viewer.is_eventgroup_coordinator?(@eg) && (@viewer.is_projects_coordinator? || !viewer.eventgroups_coordinating.present?) %>
              <%= link_to 'impersonate', impersonate_viewer_url(viewer) %>
            <% end %>

              <span id="finding_viewer_specifics_<%= viewer.id %>" style="clear:both; display:none;">
                <%=image_tag('spinner.gif')%>

        <% end %>

  <% else %>

No results found.

  <% end %>
<% end %>

<% if !@viewers.nil? %>

Click on a person's name to see more information about what projects this person is associated with.

Inactive accounts will be gray.

  <% if @viewers.length > 0 %>

<%= sortable_table %>

          <%= th 'person record' %>
          <%= th 'name' %>
          <%= th 'viewer id', :type => 'int' %>
          <%= th 'person id', :type => 'int' %>
          <%= th 'email' %>
          <%= th 'campus' %>
          <%= th 'gcx' %>
          <%= th '# profiles' %>
          <%= th 'last login' %>
          <%= th '' %>

        <% for viewer in @viewers %>
          <tr id="row_<%=viewer.id%>" class="search_result <%= 'inactive' if viewer.viewer_isActive == 0 %>" >
            <% if viewer.person %>
              yes
            <% else %>
              no
            <% end %>

                <% view_result_params = { :url => {:action => 'get_viewer_specifics', :id => viewer.id},
                                  :update => 'viewer_specifics',
                                  :before => "Element.show('finding_viewer_specifics_#{viewer.id}');",
                                  :complete => "Element.hide('finding_viewer_specifics_#{viewer.id}');" } %>
                <% link_text = viewer.name =~ /^\s+$/ ? '(no name set)' : viewer.name %>
                <%= link_to_remote link_text, view_result_params %>
                <% @init_js = view_result_params if @viewers.length == 1 %>

            <%=h viewer.id %>
            <%=h viewer.person.id %>
            <%=h viewer.person.person_email if viewer.person %>
            <%=h viewer.person.campus_or_team %>
            <%=h 'gcx' unless viewer.guid.empty? %>
            <%=h viewer.profiles.length %>
            <%=h viewer.last_login %>

            <% if @viewer.is_projects_coordinator? %>
              <%= link_to 'merge..', merge_viewer_url(viewer) %>
              <%= link_to 'deactivate..', deactivate_viewer_url(viewer) %>
            <% end %>
            <% if @viewer.is_eventgroup_coordinator?(@eg) && (@viewer.is_projects_coordinator? || !viewer.eventgroups_coordinating.present?) %>
              <%= link_to 'impersonate', impersonate_viewer_url(viewer) %>
            <% end %>

              <span id="finding_viewer_specifics_<%= viewer.id %>" style="clear:both; display:none;">
                <%=image_tag('spinner.gif')%>

        <% end %>

  <% else %>

No results found.

  <% end %>
<% end %>


retabbed account/index.rhtml

retabbed account/index.rhtml

Your settings

<% form_for :user, :url => { :action => 'update' } do |f| -%>

			Email:
			<%= f.text_field :email %>

			Address:
			<%= f.text_field :address %>

			City:
			<%= f.text_field :city %>

			Postal Code:
			<%= f.text_field :postalcode %>

			Longitude:
			<%= f.text_field :longitude %>

			Latitude:
			<%= f.text_field :latitude %>

			Cellphone:
			<%= f.text_field :cellphone %>

			Cellphone Provider:
			<% options = options_for_select({
				"Aliant" => "aliant",
				"Bell Mobility" => "bellmobility",
				"Fido Canada" => "fido-canada",
				"Manitoba Telecom" => "manitobatelecom",
				"NorthernTel" => "northerntel",
				"Rogers" => "rogers",
				"SaskTel" => "sasktel",
				"Telebec" => "telebec",
				"Telus Mobility" => "telus" }, @user.cellphone_provider)  %>
			<%= select_tag "user_cellphone_provider", options, :name => "user[cellphone_provider]" %>

			Write a little about yourself

			<%= f.text_area :about %>

<%= submit_tag 'Update' %>

<% end -%>

Change password

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

			New Password:
			<input type="password" name="user[password]" id="password">

			Again:
			<input type="password" name="user[password_confirmation]" id="password_confirmation">

<%= submit_tag 'Update' %>

<% end -%>

Your settings

<% form_for :user, :url => { :action => 'update' } do |f| -%>

      Email:
      <%= f.text_field :email %>

      Address:
      <%= f.text_field :address %>

      City:
      <%= f.text_field :city %>

      Postal Code:
      <%= f.text_field :postalcode %>

      Longitude:
      <%= f.text_field :longitude %>

      Latitude:
      <%= f.text_field :latitude %>

      Cellphone:
      <%= f.text_field :cellphone %>

      Cellphone Provider:
      <%= select_tag "user_cellphone_provider", options_for_select({ "Aliant" => "aliant", "Bell Mobility" => "bellmobility", "Fido Canada" => "fido-canada", "Manitoba Telecom" => "manitobatelecom", "NorthernTel" => "northerntel", "Rogers" => "rogers", "SaskTel" => "sasktel", "Telebec" => "telebec", "Telus Mobility" => "telus" }, @user.cellphone_provider), :name => "user[cellphone_provider]" %>

	  Write a little about yourself

	  <%= f.text_area :about %>

<%= submit_tag 'Update' %>

<% end -%>

Change password

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

			New Password:
			<input type="password" name="user[password]" id="password">

			Again:
			<input type="password" name="user[password_confirmation]" id="password_confirmation">

<%= submit_tag 'Update' %>

<% end -%>


ActionItem18: hiding uninplemented action

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

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

<%= link_to _('Change password.'), :action => 'change_password' %>
<%= _('It is a good idea to change your password from times to times.') %>

<%# FIXME: to be implemented %>

<%= link_to _('Logout.'), :action => 'logout' %>
<%= _('It is always a good idea to make a logout when you finish using the virtual community.')%>

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

<%= link_to _('Change password.'), :action => 'change_password' %>
<%= _('It is a good idea to change your password from times to times.') %>

<%= link_to _('Edit Personal details.'), :action => 'edit_details' %>
<%= _('You can change your personal details.') %>

<%= link_to _('Logout.'), :action => 'logout' %>
<%= _('It is always a good idea to make a logout when you finish using the virtual community.')%>