[ClockingIT @ Reset @task on rendering _task_row.rhtml]

<% cache( :controller => "tasks", :action => "task_row", :action_suffix => "#{task.id}_#{session[:user].id}_#{session[:filter_user].to_i}_#{session[:filter_milestone]}_#{tz.now.strftime('%d%m%y')}") do %>

<li id="task_<%=task.id%>"

<%
 priority = ""
 priority = " task_raised_pri" if (task.priority + task.severity_id)/2.0 >= 0.1 && !task.done?
 priority = " task_high_pri" if (task.priority + task.severity_id)/2.0 >= 0.51 && !task.done?
 priority = " task_crit_pri" if (task.priority + task.severity_id)/2.0 >= 1.5 && !task.done?
 priority = " task_low_pri" if (task.priority + task.severity_id)/2 < -0.51 && !task.done?
 priority = " task_lowest_pri" if (task.priority + task.severity_id)/2 < -1.5 && !task.done?

 can_complete = { :disabled => "disabled" } unless session[:user].can?(task.project, 'close')
 can_complete ||= {}

 can_work = { :disabled => "disabled" } unless session[:user].can?(task.project, 'work')
 can_work ||= {}
%>

<% if @session[:sheet] && @session[:sheet].task.id == task.id %>
class="task_active<%=priority%>"
<% elsif task.done? %>
class="task_done<%=priority%>"
<% else %>
class="task<%=priority%>"
<% end %>
  onMouseOver="javascript:Hover('task', '<%=task.id%>')" onMouseOut="javascript:ClearHover()">

<% @task = task %>

  <% unless task.done?
    %>
    <%= check_box("task", "done", { "title" => _("Close %s", task.name), "onclick" => remote_function(:url => { :controller => 'tasks', :action => 'ajax_check', :id => task },
                                                                :loading => "Element.show('loading');",
                                                                :complete => "Element.hide('loading');" ), :class => "button tooltip", :id => "button_#{task.id}" }.merge(can_complete) ) -%>
    <% if @session[:user].option_tracktime == 1 && can_work.size == 0 -%>
      <% if @session[:sheet] && @session[:sheet].task.id == task.id -%>
        <%= link_to(image_tag("time_add.png", :border => 0, :class => "tooltip work_icon", :title => _("Stop working on %s.", task.name)), {:controller => 'tasks', :action => 'stop_work'})  -%>
      <% else -%>
        <%= link_to_remote( image_tag("time.png", :border => 0, :class => "tooltip work_icon", :title => _("Start working on %s. Click again when done.", task.name)),
                        :url => {:controller => 'tasks', :action => 'start_work_ajax', :id => task },
                        :loading => "Element.show('loading');",
                        :complete => "Element.hide('loading');") -%>
      <% end -%>
   <% else -%>

   <% end -%>
   <%= task.issue_num %>
   <%= link_to in_progress(task, h(task.name)), {:controller => 'tasks', :action => 'edit', :id => task.id}, {:class => "tooltip", :title => task.description.gsub(/\n/, '
')} if (task.description && task.description.length > 0) -%>
   <%= link_to in_progress(task, h(task.name)), {:controller => 'tasks', :action => 'edit', :id => task.id} if (task.description.nil? || task.description.length == 0) -%>

     <%= "(#{worked_nice(task.worked_minutes)} / #{worked_nice( task.duration )})" if @session[:user].option_tracktime == 1 %>
     <%= "[#{task.milestone.name}]" unless task.milestone.nil? -%>

   <% name = _("No one")
      name = task.users.collect{|u| u.name}.join(', ') unless task.users.empty?
   %>

   <% if session[:user].option_tracktime == 1 %>

   <% else %>

   <% end %>
   <%= h(task.full_name) %>
   <%= "[#{name}]" %>
   <%= due_in_words(task) if (task.due_at != nil || task.milestone_id.to_i > 0)%>

  <% else %>
  <%#
    # Task is complete
    #%>
    <%= check_box("task", "done", {"title" => _("Revert %s to not completed status.", task.name), "onclick" => remote_function(:url => { :controller => 'tasks', :action => 'ajax_uncheck', :id => task },
                                                                :loading => "Element.show('loading');",
                                                                :complete => "Element.hide('loading');" ), :class => "button tooltip", :checked => "checked", :id => "button_#{task.id}" }.merge(can_complete) ) -%>
    <% if @session[:user].option_tracktime == 1 && can_work.size == 0 -%>
      <% if @session[:sheet] && @session[:sheet].task.id == task.id -%>
        <%= link_to(image_tag("time_add.png", :border => 0, :class => "tooltip work_icon", :title => _("Stop working on %s.", task.name)), {:controller => 'tasks', :action => 'stop_work'})  -%>
      <% else -%>
        <%= link_to_remote( image_tag("time.png", :border => 0, :class => "tooltip work_icon", :title => _("Start working on %s. Click again when done.", task.name)),
                        :url => {:controller => 'tasks', :action => 'start_work_ajax', :id => task },
                        :loading => "Element.show('loading');",
                        :complete => "Element.hide('loading');") -%>
     <% end -%>
   <% else -%>
     <% end -%>
     <%= task.issue_num %>
     <% task_name = task.name %>
     <%= link_to task_name, {:controller => 'tasks', :action => 'edit', :id => task.id}, {:class => "tooltip", :title => task.description.gsub(/\n/, '
')} if (task.description && task.description.length > 0) -%>
     <%= link_to task_name, {:controller => 'tasks', :action => 'edit', :id => task.id} if (task.description.nil? || task.description.length == 0) -%>
     <% if @session[:user].option_tracktime == 1%>(<%= worked_nice(task.worked_minutes) %> / <%= worked_nice( task.duration ) %>)<% end %> [<%=tz.utc_to_local(task.completed_at).strftime(session[:user].date_format) %>]
     <% if session[:user].option_tracktime == 1 %>

<%= h(task.full_name) %>

     <% else %>

<%= h(task.full_name) %>

     <% end %>

  <% end %>

  <%#
    # Always printed
    #%>

    <span id="edit_task_<%=task.id%>" style="display: none;">
      <% if @session[:sheet] && @session[:sheet].task.id == task.id -%>
        <%= link_to_remote image_tag("time_delete.png", :border => 0, :title => _("Cancel working on %s.", task.name), :class => "tooltip"),
          :url => { :controller => 'tasks', :action => 'cancel_work_ajax', :id => task },
          :loading => "Element.show('loading');",
          :complete => "Element.hide('loading');" -%>
      <% else -%>
        <% if task.done? -%>
          <% if task.hidden == 0 -%>
            <%= link_to_remote image_tag("folder_add.png", :border => 0, :title => _("Move %s to the Archive.", task.name), :class => "tooltip"),
                  :url => { :controller => 'tasks', :action => 'ajax_hide', :id => task },
                  :loading => "Element.show('loading');",
                  :complete => "Element.hide('loading');",
                  :success => visual_effect(:fade, "task_#{task.id}", :duration => 0.5) -%>
          <% else -%>
            <%= link_to_remote image_tag("folder_go.png", :border => 0, :title => _("Restore %s from the Archive.", task.name), :class => "tooltip"),
                  :url => { :controller => 'tasks', :action => 'ajax_restore', :id => task },
                  :loading => "Element.show('loading');",
                  :complete => "Element.hide('loading');",
                  :success => visual_effect(:fade, "task_#{task.id}", :duration => 0.5) -%>
          <% end -%>
        <% end -%>
      <% end -%>

<% end %>

<% cache( :controller => "tasks", :action => "task_row", :action_suffix => "#{task.id}_#{session[:user].id}_#{session[:filter_user].to_i}_#{session[:filter_milestone]}_#{tz.now.strftime('%d%m%y')}") do %>

<li id="task_<%=task.id%>"

<%
 priority = ""
 priority = " task_raised_pri" if (task.priority + task.severity_id)/2.0 >= 0.1 && !task.done?
 priority = " task_high_pri" if (task.priority + task.severity_id)/2.0 >= 0.51 && !task.done?
 priority = " task_crit_pri" if (task.priority + task.severity_id)/2.0 >= 1.5 && !task.done?
 priority = " task_low_pri" if (task.priority + task.severity_id)/2 < -0.51 && !task.done?
 priority = " task_lowest_pri" if (task.priority + task.severity_id)/2 < -1.5 && !task.done?

 can_complete = { :disabled => "disabled" } unless session[:user].can?(task.project, 'close')
 can_complete ||= {}

 can_work = { :disabled => "disabled" } unless session[:user].can?(task.project, 'work')
 can_work ||= {}
%>

<% if @session[:sheet] && @session[:sheet].task.id == task.id %>
class="task_active<%=priority%>"
<% elsif task.done? %>
class="task_done<%=priority%>"
<% else %>
class="task<%=priority%>"
<% end %>
  onMouseOver="javascript:Hover('task', '<%=task.id%>')" onMouseOut="javascript:ClearHover()">

  <% unless task.done?
    %>
    <%= check_box("task", "done", { "title" => _("Close %s", task.name), "onclick" => remote_function(:url => { :controller => 'tasks', :action => 'ajax_check', :id => task },
                                                                :loading => "Element.show('loading');",
                                                                :complete => "Element.hide('loading');" ), :class => "button tooltip", :id => "button_#{task.id}" }.merge(can_complete) ) -%>
    <% if @session[:user].option_tracktime == 1 && can_work.size == 0 -%>
      <% if @session[:sheet] && @session[:sheet].task.id == task.id -%>
        <%= link_to(image_tag("time_add.png", :border => 0, :class => "tooltip work_icon", :title => _("Stop working on %s.", task.name)), {:controller => 'tasks', :action => 'stop_work'})  -%>
      <% else -%>
        <%= link_to_remote( image_tag("time.png", :border => 0, :class => "tooltip work_icon", :title => _("Start working on %s. Click again when done.", task.name)),
                        :url => {:controller => 'tasks', :action => 'start_work_ajax', :id => task },
                        :loading => "Element.show('loading');",
                        :complete => "Element.hide('loading');") -%>
      <% end -%>
   <% else -%>

   <% end -%>
   <%= task.issue_num %>
   <%= link_to in_progress(task, h(task.name)), {:controller => 'tasks', :action => 'edit', :id => task.id}, {:class => "tooltip", :title => task.description.gsub(/\n/, '
')} if (task.description && task.description.length > 0) -%>
   <%= link_to in_progress(task, h(task.name)), {:controller => 'tasks', :action => 'edit', :id => task.id} if (task.description.nil? || task.description.length == 0) -%>

     <%= "(#{worked_nice(task.worked_minutes)} / #{worked_nice( task.duration )})" if @session[:user].option_tracktime == 1 %>
     <%= "[#{task.milestone.name}]" unless task.milestone.nil? -%>

   <% name = _("No one")
      name = task.users.collect{|u| u.name}.join(', ') unless task.users.empty?
   %>

   <% if session[:user].option_tracktime == 1 %>

   <% else %>

   <% end %>
   <%= h(task.full_name) %>
   <%= "[#{name}]" %>
   <%= due_in_words(task) if (task.due_at != nil || task.milestone_id.to_i > 0)%>

  <% else %>
  <%#
    # Task is complete
    #%>
    <%= check_box("task", "done", {"title" => _("Revert %s to not completed status.", task.name), "onclick" => remote_function(:url => { :controller => 'tasks', :action => 'ajax_uncheck', :id => task },
                                                                :loading => "Element.show('loading');",
                                                                :complete => "Element.hide('loading');" ), :class => "button tooltip", :checked => "checked", :id => "button_#{task.id}" }.merge(can_complete) ) -%>
    <% if @session[:user].option_tracktime == 1 && can_work.size == 0 -%>
      <% if @session[:sheet] && @session[:sheet].task.id == task.id -%>
        <%= link_to(image_tag("time_add.png", :border => 0, :class => "tooltip work_icon", :title => _("Stop working on %s.", task.name)), {:controller => 'tasks', :action => 'stop_work'})  -%>
      <% else -%>
        <%= link_to_remote( image_tag("time.png", :border => 0, :class => "tooltip work_icon", :title => _("Start working on %s. Click again when done.", task.name)),
                        :url => {:controller => 'tasks', :action => 'start_work_ajax', :id => task },
                        :loading => "Element.show('loading');",
                        :complete => "Element.hide('loading');") -%>
     <% end -%>
   <% else -%>
     <% end -%>
     <%= task.issue_num %>
     <% task_name = task.name %>
     <%= link_to task_name, {:controller => 'tasks', :action => 'edit', :id => task.id}, {:class => "tooltip", :title => task.description.gsub(/\n/, '
')} if (task.description && task.description.length > 0) -%>
     <%= link_to task_name, {:controller => 'tasks', :action => 'edit', :id => task.id} if (task.description.nil? || task.description.length == 0) -%>
     <% if @session[:user].option_tracktime == 1%>(<%= worked_nice(task.worked_minutes) %> / <%= worked_nice( task.duration ) %>)<% end %> [<%=tz.utc_to_local(task.completed_at).strftime(session[:user].date_format) %>]
     <% if session[:user].option_tracktime == 1 %>

<%= h(task.full_name) %>

     <% else %>

<%= h(task.full_name) %>

     <% end %>

  <% end %>

  <%#
    # Always printed
    #%>

    <span id="edit_task_<%=task.id%>" style="display: none;">
      <% if @session[:sheet] && @session[:sheet].task.id == task.id -%>
        <%= link_to_remote image_tag("time_delete.png", :border => 0, :title => _("Cancel working on %s.", task.name), :class => "tooltip"),
          :url => { :controller => 'tasks', :action => 'cancel_work_ajax', :id => task },
          :loading => "Element.show('loading');",
          :complete => "Element.hide('loading');" -%>
      <% else -%>
        <% if task.done? -%>
          <% if task.hidden == 0 -%>
            <%= link_to_remote image_tag("folder_add.png", :border => 0, :title => _("Move %s to the Archive.", task.name), :class => "tooltip"),
                  :url => { :controller => 'tasks', :action => 'ajax_hide', :id => task },
                  :loading => "Element.show('loading');",
                  :complete => "Element.hide('loading');",
                  :success => visual_effect(:fade, "task_#{task.id}", :duration => 0.5) -%>
          <% else -%>
            <%= link_to_remote image_tag("folder_go.png", :border => 0, :title => _("Restore %s from the Archive.", task.name), :class => "tooltip"),
                  :url => { :controller => 'tasks', :action => 'ajax_restore', :id => task },
                  :loading => "Element.show('loading');",
                  :complete => "Element.hide('loading');",
                  :success => visual_effect(:fade, "task_#{task.id}", :duration => 0.5) -%>
          <% end -%>
        <% end -%>
      <% end -%>

<% end %>


changed wording of "incomplete classes" to "unimplemented classes" thanks rue!

<%
# Wooter an html report :) --matt
require File.expand_path(File.dirname(__FILE__) + '/compare_tools')
include CompareTools

title = 'Rubinius Completeness Report'
generated = Time.now

def percent_bar(pct)
  width = (pct * 200).round
  rest = 200 - width
  percent = ((pct * 10000.0).round / 100.0).to_s + '%'
<<HTML

      #{pct >= 0.5 ? percent + '  ' : ''}

      #{pct < 0.5 ? '  ' + percent : ''}

HTML
end
%>

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

    <title><%= title %></title>

Generated on <%= generated %>.

<%= title %>

    <%
    total_classes = mri_classes.length
    classes_left = incomplete_classes.length
    classes_done = total_classes - classes_left
    classes_pct = 1.0 - classes_left.to_f / total_classes

    total_class_methods = mri_class_methods_total
    class_methods_left = class_methods_left()
    class_methods_done = total_class_methods - class_methods_left
    class_methods_pct = 1.0 - class_methods_left.to_f / total_class_methods

    total_instance_methods = mri_instance_methods_total
    instance_methods_left = instance_methods_left()
    instance_methods_done = total_instance_methods - instance_methods_left
    instance_methods_pct = 1.0 - instance_methods_left.to_f / total_instance_methods
    %>

Overview

    Classes(<%= "#{classes_done} out of #{total_classes}" %>)
    <%= percent_bar(classes_pct) %>

    Class Methods(<%= "#{class_methods_done} out of #{total_class_methods}" %>)
    <%= percent_bar(class_methods_pct) %>

    Instance Methods(<%= "#{instance_methods_done} out of #{total_instance_methods}" %>)
    <%= percent_bar(instance_methods_pct) %>

Partially Complete Classes

      Class
      class methods needed
      instance methods needed
      <% partially_complete_classes.each do |klass, info| %>

        <%= klass %>
        <%= info[:class_methods].join(', ') %>
        <%= info[:instance_methods].join(', ') %>

      <% end %>

Complete Classes

      <% for klass in complete_classes %>

<%= klass %>

      <% end %>

Un-Implemented Classes

      <% for klass in incomplete_classes %>

<%= klass %>

      <% end %>

      envisioned by Matthew Elder <sseses@gmail.com> MuHaHaHaHa

<%
# Wooter an html report :) --matt
require File.expand_path(File.dirname(__FILE__) + '/compare_tools')
include CompareTools

title = 'Rubinius Completeness Report'
generated = Time.now

def percent_bar(pct)
  width = (pct * 200).round
  rest = 200 - width
  percent = ((pct * 10000.0).round / 100.0).to_s + '%'
<<HTML

      #{pct >= 0.5 ? percent + '  ' : ''}

      #{pct < 0.5 ? '  ' + percent : ''}

HTML
end
%>

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

    <title><%= title %></title>

Generated on <%= generated %>.

<%= title %>

    <%
    total_classes = mri_classes.length
    classes_left = incomplete_classes.length
    classes_done = total_classes - classes_left
    classes_pct = 1.0 - classes_left.to_f / total_classes

    total_class_methods = mri_class_methods_total
    class_methods_left = class_methods_left()
    class_methods_done = total_class_methods - class_methods_left
    class_methods_pct = 1.0 - class_methods_left.to_f / total_class_methods

    total_instance_methods = mri_instance_methods_total
    instance_methods_left = instance_methods_left()
    instance_methods_done = total_instance_methods - instance_methods_left
    instance_methods_pct = 1.0 - instance_methods_left.to_f / total_instance_methods
    %>

Overview

    Classes(<%= "#{classes_done} out of #{total_classes}" %>)
    <%= percent_bar(classes_pct) %>

    Class Methods(<%= "#{class_methods_done} out of #{total_class_methods}" %>)
    <%= percent_bar(class_methods_pct) %>

    Instance Methods(<%= "#{instance_methods_done} out of #{total_instance_methods}" %>)
    <%= percent_bar(instance_methods_pct) %>

Partially Complete Classes

      Class
      class methods needed
      instance methods needed
      <% partially_complete_classes.each do |klass, info| %>

        <%= klass %>
        <%= info[:class_methods].join(', ') %>
        <%= info[:instance_methods].join(', ') %>

      <% end %>

Complete Classes

      <% for klass in complete_classes %>

<%= klass %>

      <% end %>

Incomplete Classes

      <% for klass in incomplete_classes %>

<%= klass %>

      <% end %>

      envisioned by Matthew Elder <sseses@gmail.com> MuHaHaHaHa


Organise a bit.

Organise a bit.

<%= error_messages_for 'public_body' %>

List of tags

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

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

<%=h row%>

        <% end %>
    <% end %>

Name

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

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

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

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

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

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

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

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

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

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

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

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

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

<%= error_messages_for 'public_body' %>

List of tags

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

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

<%=h row%>

        <% end %>
    <% end %>

Name

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

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

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

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

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

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

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

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

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

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

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

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

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

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


Link tracks to the relevant public page

Link tracks to the relevant public page

Where a track is for a user, request or public body, link to the
relevant public page.

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

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

<% else %>

    <% for track_thing in track_things %>

          <a href="#track_<%=track_thing.id%>" data-toggle="collapse" data-parent="requests">
          <%=track_thing.id%>:
          <% if track_thing.public_body_id %>
            <%= link_to "#{h track_thing.track_query}", main_url(public_body_url(track_thing.public_body)) %>
          <% elsif track_thing.info_request_id %>
            <%= link_to "#{h track_thing.track_query}", main_url(request_url(track_thing.info_request)) %>
          <% elsif track_thing.tracked_user_id %>
            <%= link_to "#{h track_thing.track_query}", main_url(user_url(track_thing.tracked_user)) %>
          <% else %>
            <%=h track_thing.track_query%>
          <% end %>
          <% if @admin_user.nil? %>
            <%# Do not show this on the list of tracks on the user page, because it’s rather repetitive there %>
            tracked by <%=link_to ''.html_safe, user_admin_url(track_thing.tracking_user) %> <%=link_to h(track_thing.tracking_user.name), main_url(user_url(track_thing.tracking_user)) %>
          <% end %>

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

              <% if include_destroy %>

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

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

                    <% end %>

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

                  <%=column.human_name%>

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

              <% end %>

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

    <% end %>

<% end %>

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

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

<% else %>

    <% for track_thing in track_things %>

         <a href="#track_<%=track_thing.id%>" data-toggle="collapse" data-parent="requests">
             <%=track_thing.id%>: <%=track_thing.track_query%> tracked by <%=link_to ''.html_safe, user_admin_url(track_thing.tracking_user) %> <%=link_to h(track_thing.tracking_user.name), main_url(user_url(track_thing.tracking_user)) %>

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

              <% if include_destroy %>

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

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

                    <% end %>

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

                  <%=column.human_name%>

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

              <% end %>

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

    <% end %>

<% end %>


Use a positive icon for notifications, to indicate that they will get notified

<%= error_messages_for 'task' %>
<%

  perms = {}

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

%>

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

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

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

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

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

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

<% end %>

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

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

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

          <% end %>

           </select>

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

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

          <% end %>

<%

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

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

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

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

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

%>

       <%= owner_string %>

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

      </fieldset>

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

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

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

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

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

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

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

          <% end %>
        <% end %>

      </fieldset>

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

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

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

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

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

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

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

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

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

        <% end %>

      </fieldset>

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

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

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

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

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

        <% end %>

      </fieldset>

<% end %>

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

      </fieldset>

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

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

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

<%= error_messages_for 'task' %>
<%

  perms = {}

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

%>

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

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

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

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

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

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

<% end %>

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

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

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

          <% end %>

           </select>

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

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

          <% end %>

<%

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

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

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

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

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

%>

       <%= owner_string %>

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

      </fieldset>

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

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

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

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

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

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

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

          <% end %>
        <% end %>

      </fieldset>

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

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

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

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

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

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

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

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

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

        <% end %>

      </fieldset>

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

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

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

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

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

        <% end %>

      </fieldset>

<% end %>

      <fieldset id="task_notify" style="padding-right:0;">
        <legend><%=_ 'Notification' %></legend>
        <%# users = Project.find(selected_project).users.find(:all, :order => 'name' ) %>

        <%# watchers = @task.watchers.collect {|t| t.id } %>

        Name / Email<input type="text" size="12" name="watchers[]" id="notification-input">

      </fieldset>

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

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

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


Remove old tinymce call

Remove old tinymce call

<%= render :file => 'shared/tiny_mce', :locals => {:mode => 'simple'} %>
<% remote_form_for(@product,
                   :loading => "small_loading('product-description-form')",
                   :update => 'product-description',
                   :url => {:controller => 'manage_products', :action => 'edit', :id => @product, :field => 'description'},
                   :html => {:id => 'product-description-form', :method => 'post'}) do |f| %>

  <%= labelled_form_field(_('Description:'), f.text_area(:description, :rows => 15, :style => 'width: 90%;', :class => 'mceEditor')) %>
  <% button_bar do %>
    <%= submit_button :save, _('Save') %>
    <%= cancel_edit_product_link(@product, 'description') %>
  <% end %>

<% end %>

<%= render :file => 'shared/tiny_mce', :locals => {:mode => 'simple'} %>
<% remote_form_for(@product,
                   :loading => "small_loading('product-description-form')",
                   :before => ("tinyMCE.triggerSave()" unless Rails.env == 'test'),
                   :update => 'product-description',
                   :url => {:controller => 'manage_products', :action => 'edit', :id => @product, :field => 'description'},
                   :html => {:id => 'product-description-form', :method => 'post'}) do |f| %>

  <%= labelled_form_field(_('Description:'), f.text_area(:description, :rows => 15, :style => 'width: 90%;', :class => 'mceEditor')) %>
  <% button_bar do %>
    <%= submit_button :save, _('Save') %>
    <%= cancel_edit_product_link(@product, 'description') %>
  <% end %>

<% end %>


ActionItem898: Reviewing text in "Not Found" page

<%= _('There is no such page: %s') % (content_tag('tt', @path)) %>

  <%= _('You may have clicked an expired link or mistyped the address.') %>
  <%= _('If you clicked a link that was in another site, or was given to you by someone else, it would be nice if you tell them that their link is not valid anymore.') %>

<%= link_to _('Go to the site home page'), :controller => 'home' %>

<%= link_to _('Go back'), :back %>

<%= _('There is no such page: %s') % (content_tag('tt', @path)) %>

<%= _('You may have clicked an expired link or mistyped the address.') %>

<%= link_to _(' Return home page'), :controller => 'home' %>

<%= link_to _('Go back'), :back %>


update contact info for c4c to be p2c students

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

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

<% end %>

  <%
=begin
  flash[:error] = %|
  There will be a short, approximately 10-20 minutes, scheduled outage between 12pm-2pm PST

  -CIM team, Wed May 7
  |
=end
  %>

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

    <%= connexion_bar if @viewer && session[:login_source] == 'gcx' %>

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

debug: <%= @debug -%>

    <% end -%>

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

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

        <% if @viewer %>

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

        <% end %>

        <% if @eg %>

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

        <% end %>

      <% if session[:logo_url] -%>
          <%= image_tag session[:logo_url], :class => 'branding_logo' %>
          <%= application_title %>
      <% else %>

<%= application_title %>

      <% end -%>

    <% if @viewer %>

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

    <% end %>

    <% flash.each do |key, msg| -%>
      <% full_msg = msg %>
      <%= content_tag :div, full_msg, :id => "flash_#{key}", :class => 'error flash' %>
    <% end -%>

    <% @notifications.each do |n| -%>
      <% full_msg = n.message
         full_msg = h(full_msg) unless n.allow_html
         full_msg += "
"

         unless n.no_hide_button || @viewer.nil?
           full_msg += link_to_remote('Hide',
            :url => { :controller => 'notification_acknowledgments',
                      :action => 'create', :notification_id => n.id },
            :success => "$(\"notification_#{n.id}\").fade()"
           )
         end
        %>
      <%= content_tag :div, full_msg, :id => "notification_#{n.id}", :class => 'error flash' %>
    <% end -%>

     <% if @viewer && !@eg.nil? && !@viewer.is_student?(@eg) %>

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

    <% end %>

    <% if @title %>

<%=@title%>

    <% end %>

    <%= render_if_possible(controller.controller_name + "/menu") ||
           (@submenu && render_if_possible(@submenu + "/menu"))
    %>

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

          <%= submenu_items_html %>

    <% end %>

        <% if @form && params[:controller] != 'forms' %>
          <%= render_if_possible("qe_forms/form_#{@form}") || render_if_possible(:file => "layouts/form_#{@form}")%>
        <% else %>
          <%= yield %>
        <% end %>

    <% if @eg || @show_contact_emails_override %>

        Questions?

        Power to Change - Students - susan.dossantos@powertochange.org

        LeaderImpact Group - judyh@leaderimpactgroup.com

        Athletes in Action - morgank@athletesinaction.com

        Drime - info@drime.com

        MinistryNet - ministrynet@ccci.org

        GAiN - lifeteams@globalaid.net

			General Inquiries:pat.help@powertochange.org

			Online help can be found here.

    <% end %>

    <%= initialize_sortable_tables %>

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

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

<% end %>

  <%
=begin
  flash[:error] = %|
  There will be a short, approximately 10-20 minutes, scheduled outage between 12pm-2pm PST

  -CIM team, Wed May 7
  |
=end
  %>

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

    <%= connexion_bar if @viewer && session[:login_source] == 'gcx' %>

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

debug: <%= @debug -%>

    <% end -%>

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

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

        <% if @viewer %>

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

        <% end %>

        <% if @eg %>

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

        <% end %>

      <% if session[:logo_url] -%>
          <%= image_tag session[:logo_url], :class => 'branding_logo' %>
          <%= application_title %>
      <% else %>

<%= application_title %>

      <% end -%>

    <% if @viewer %>

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

    <% end %>

    <% flash.each do |key, msg| -%>
      <% full_msg = msg %>
      <%= content_tag :div, full_msg, :id => "flash_#{key}", :class => 'error flash' %>
    <% end -%>

    <% @notifications.each do |n| -%>
      <% full_msg = n.message
         full_msg = h(full_msg) unless n.allow_html
         full_msg += "
"

         unless n.no_hide_button || @viewer.nil?
           full_msg += link_to_remote('Hide',
            :url => { :controller => 'notification_acknowledgments',
                      :action => 'create', :notification_id => n.id },
            :success => "$(\"notification_#{n.id}\").fade()"
           )
         end
        %>
      <%= content_tag :div, full_msg, :id => "notification_#{n.id}", :class => 'error flash' %>
    <% end -%>

     <% if @viewer && !@eg.nil? && !@viewer.is_student?(@eg) %>

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

    <% end %>

    <% if @title %>

<%=@title%>

    <% end %>

    <%= render_if_possible(controller.controller_name + "/menu") ||
           (@submenu && render_if_possible(@submenu + "/menu"))
    %>

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

          <%= submenu_items_html %>

    <% end %>

        <% if @form && params[:controller] != 'forms' %>
          <%= render_if_possible("qe_forms/form_#{@form}") || render_if_possible(:file => "layouts/form_#{@form}")%>
        <% else %>
          <%= yield %>
        <% end %>

    <% if @eg || @show_contact_emails_override %>

        Questions?

				Campus for Christ - projects@campusforchrist.org

				LeaderImpact Group - judyh@leaderimpactgroup.com

				Athletes in Action - morgank@athletesinaction.com

				Drime - info@drime.com

        MinistryNet - ministrynet@ccci.org

        GAiN - lifeteams@globalaid.net

			General Inquiries:pat.help@powertochange.org

			Online help can be found here.

    <% end %>

    <%= initialize_sortable_tables %>


adding profile information in url's

adding profile information in url's

<li id="<%= comment.anchor %>" class="article-comment">

  <div class="comment-content comment-logged-<%= comment.author ? 'in' : 'out' %> <%= 'comment-from-owner' if ( comment.author && (profile == comment.author) ) %>">

  <% if comment.author %>
    <%= link_to image_tag(profile_icon(comment.author, :minor)) +
                content_tag('span', comment.author_name, :class => 'comment-info'),
        comment.author.url,
        :class => 'comment-picture',
        :title => comment.author_name
    %>
  <% else %>
    <% url_image, status_class = comment.author_id ?
       [comment.removed_user_image, 'icon-user-removed'] :
       [str_gravatar_url_for( comment.email, :size => 50, :d=>404 ), 'icon-user-unknown'] %>

    <%= link_to(
          image_tag(url_image, :onerror=>'gravatarCommentFailback(this)',
                   'data-gravatar'=>str_gravatar_url_for(comment.email, :size=>50)) +
          content_tag('span', comment.author_name, :class => 'comment-info') +
          content_tag('span', comment.message,
                             :class => 'comment-user-status ' + status_class),
        gravatar_profile_url(comment.email),
        :target => '_blank',
        :class => 'comment-picture',
        :title => '%s %s' % [comment.author_name, comment.message]
    )%>
  <% end %>

  <% comment_balloon do %>

        <%= show_time(comment.created_at) %>

<%= comment.title.blank? && ' ' || comment.title %>

        <%= txt2html comment.body %>

      <% if @comment && @comment.errors.any? && @comment.reply_of_id.to_i == comment.id %>
        <%= error_messages_for :comment %>

      <% end %>
      <%= report_abuse(comment.author, :comment_link, comment) if comment.author %>

      <% if comment.spam? %>

        <%= link_to_function(_('Mark as NOT SPAM'), 'remove_comment(this, %s); return false;' % url_for(:profile => profile.identifier, :mark_comment_as_ham => comment.id).to_json, :class => 'comment-footer comment-footer-link comment-footer-hide')  %>
      <% else %>
        <% if (logged_in? && (user == profile || user.has_permission?(:moderate_comments, profile))) %>

          <%= link_to_function(_('Mark as SPAM'), 'remove_comment(this, %s, %s); return false;' % [url_for(:profile => profile.identifier, :controller => 'comment', :action => :mark_as_spam, :id => comment.id).to_json, _('Are you sure you want to mark this comment as SPAM?').to_json], :class => 'comment-footer comment-footer-link comment-footer-hide')  %>
        <% end %>
      <% end %>

      <% if comment.author && comment.author == user %>

        <%= expirable_comment_link comment, :edit, _('Edit'), url_for(:profile => profile.identifier, :controller => :comment, :action => :edit, :id => comment.id),:class => 'colorbox' %>
      <% end %>

      <% if logged_in? && (user == profile || user == comment.author || user.has_permission?(:moderate_comments, profile)) %>

        <%= link_to_function(_('Remove'), 'remove_comment(this, %s, %s); return false ;' % [url_for(:profile => profile.identifier, :controller => 'comment', :action => :destroy, :id => comment.id).to_json, _('Are you sure you want to remove this comment and all its replies?').to_json], :class => 'comment-footer comment-footer-link comment-footer-hide remove-children') %>
      <% end %>

      <% unless comment.spam? %>

        <%= link_to_function _('Reply'),
          "var f = add_comment_reply_form(this, %s); f.find('comment_title, textarea').val(''); return false" % comment.id,
          :class => 'comment-footer comment-footer-link comment-footer-hide',
          :id => 'comment-reply-to-' + comment.id.to_s
        %>
      <% end %>

  <% end %>

  <% unless comment.replies.blank? || comment.spam? %>

    <% comment.replies.each do |reply| %>
      <%= render :partial => 'comment/comment', :locals => { :comment => reply } %>
    <% end %>

  <% end %>

<li id="<%= comment.anchor %>" class="article-comment">

  <div class="comment-content comment-logged-<%= comment.author ? 'in' : 'out' %> <%= 'comment-from-owner' if ( comment.author && (profile == comment.author) ) %>">

  <% if comment.author %>
    <%= link_to image_tag(profile_icon(comment.author, :minor)) +
                content_tag('span', comment.author_name, :class => 'comment-info'),
        comment.author.url,
        :class => 'comment-picture',
        :title => comment.author_name
    %>
  <% else %>
    <% url_image, status_class = comment.author_id ?
       [comment.removed_user_image, 'icon-user-removed'] :
       [str_gravatar_url_for( comment.email, :size => 50, :d=>404 ), 'icon-user-unknown'] %>

    <%= link_to(
          image_tag(url_image, :onerror=>'gravatarCommentFailback(this)',
                   'data-gravatar'=>str_gravatar_url_for(comment.email, :size=>50)) +
          content_tag('span', comment.author_name, :class => 'comment-info') +
          content_tag('span', comment.message,
                             :class => 'comment-user-status ' + status_class),
        gravatar_profile_url(comment.email),
        :target => '_blank',
        :class => 'comment-picture',
        :title => '%s %s' % [comment.author_name, comment.message]
    )%>
  <% end %>

  <% comment_balloon do %>

        <%= show_time(comment.created_at) %>

<%= comment.title.blank? && ' ' || comment.title %>

        <%= txt2html comment.body %>

      <% if @comment && @comment.errors.any? && @comment.reply_of_id.to_i == comment.id %>
        <%= error_messages_for :comment %>

      <% end %>
      <%= report_abuse(comment.author, :comment_link, comment) if comment.author %>

      <% if comment.spam? %>

        <%= link_to_function(_('Mark as NOT SPAM'), 'remove_comment(this, %s); return false;' % url_for(:mark_comment_as_ham => comment.id).to_json, :class => 'comment-footer comment-footer-link comment-footer-hide')  %>
      <% else %>
        <% if (logged_in? && (user == profile || user.has_permission?(:moderate_comments, profile))) %>

          <%= link_to_function(_('Mark as SPAM'), 'remove_comment(this, %s, %s); return false;' % [url_for(:profile => profile.identifier, :controller => 'comment', :action => :mark_as_spam, :id => comment.id).to_json, _('Are you sure you want to mark this comment as SPAM?').to_json], :class => 'comment-footer comment-footer-link comment-footer-hide')  %>
        <% end %>
      <% end %>

      <% if comment.author && comment.author == user %>

        <%= expirable_comment_link comment, :edit, _('Edit'), url_for(:controller => :comment, :action => :edit, :id => comment.id),:class => 'colorbox' %>
      <% end %>

      <% if logged_in? && (user == profile || user == comment.author || user.has_permission?(:moderate_comments, profile)) %>

        <%= link_to_function(_('Remove'), 'remove_comment(this, %s, %s); return false ;' % [url_for(:controller => 'comment', :action => :destroy, :id => comment.id).to_json, _('Are you sure you want to remove this comment and all its replies?').to_json], :class => 'comment-footer comment-footer-link comment-footer-hide remove-children') %>
      <% end %>

      <% unless comment.spam? %>

        <%= link_to_function _('Reply'),
          "var f = add_comment_reply_form(this, %s); f.find('comment_title, textarea').val(''); return false" % comment.id,
          :class => 'comment-footer comment-footer-link comment-footer-hide',
          :id => 'comment-reply-to-' + comment.id.to_s
        %>
      <% end %>

  <% end %>

  <% unless comment.replies.blank? || comment.spam? %>

    <% comment.replies.each do |reply| %>
      <%= render :partial => 'comment/comment', :locals => { :comment => reply } %>
    <% end %>

  <% end %>


add headings to readonly view

add headings to readonly view

<% if heading.parent_id? -%>
  <%= heading.text%>

<% else -%>

<%= heading.text%>

<% end -%>


Add from existing combo is now consistent with other AS combos - "- select -".

<% url_options = params_for(:action => :add_existing) -%>
<% if request.xhr? -%>
<%= form_remote_tag :url => url_options,
                    :after => "$('#{loading_indicator_id(:action => :add_existing, :id => params[:id])}').style.visibility = 'visible'; Form.disable('#{element_form_id(:action => :add_existing)}');",
                    :complete => "$('#{loading_indicator_id(:action => :add_existing, :id => params[:id])}').style.visibility = 'hidden'; Form.enable('#{element_form_id(:action => :add_existing)}');",
                    :failure => "ActiveScaffold.report_500_response('#{active_scaffold_id}')",
                    :html => { :href => url_for(url_options),
                    :id => element_form_id(:action => :add_existing),
                    :class => 'create' } %>
<% else -%>
<%= form_tag url_options,
             :id => element_form_id(:action => :add_existing),
             :class => 'create' %>
<% end -%>

<%= active_scaffold_config.nested.label -%>

  <% if request.xhr? -%>
    <div id="<%= element_messages_id(:action => :add_existing) %>" class="messages-container">

  <% else -%>
    <%= render :partial => 'form_messages' %>
  <% end -%>

  <label for="<%= "record_#{active_scaffold_config.model}" %>"><%= active_scaffold_config.model %>
  <%# select_options = options_for_select(options_for_association(nested_association)) unless column.through_association? -%>
  <% select_options ||= options_for_select(active_scaffold_config.model.find(:all).collect {|c| [c.to_label, c.id]}) -%>
  <% unless select_options.empty? -%>
    <%= select_tag 'associated_id', '<option value="">' + as_('- select -') + '</option>' + select_options %>
  <% end -%>

    <%= submit_tag as_('Add'), :class => "submit" %>
    <%= link_to as_('Cancel'), params_for(:action => 'list'), :class => 'cancel' %>
    <%= loading_indicator_tag(:action => :add_existing, :id => params[:id]) %>

</form>

<% url_options = params_for(:action => :add_existing) -%>
<% if request.xhr? -%>
<%= form_remote_tag :url => url_options,
                    :after => "$('#{loading_indicator_id(:action => :add_existing, :id => params[:id])}').style.visibility = 'visible'; Form.disable('#{element_form_id(:action => :add_existing)}');",
                    :complete => "$('#{loading_indicator_id(:action => :add_existing, :id => params[:id])}').style.visibility = 'hidden'; Form.enable('#{element_form_id(:action => :add_existing)}');",
                    :failure => "ActiveScaffold.report_500_response('#{active_scaffold_id}')",
                    :html => { :href => url_for(url_options),
                    :id => element_form_id(:action => :add_existing),
                    :class => 'create' } %>
<% else -%>
<%= form_tag url_options,
             :id => element_form_id(:action => :add_existing),
             :class => 'create' %>
<% end -%>

<%= active_scaffold_config.nested.label -%>

  <% if request.xhr? -%>
    <div id="<%= element_messages_id(:action => :add_existing) %>" class="messages-container">

  <% else -%>
    <%= render :partial => 'form_messages' %>
  <% end -%>

  <label for="<%= "record_#{active_scaffold_config.model}" %>"><%= active_scaffold_config.model %>
  <% select_options = active_scaffold_config.model.find(:all).collect {|c| [c.to_label, c.id]} -%>
  <% unless select_options.empty? -%>
    <%= select_tag 'associated_id', options_for_select(select_options) %>
  <% end -%>

    <%= submit_tag as_('Add'), :class => "submit" %>
    <%= link_to as_('Cancel'), params_for(:action => 'list'), :class => 'cancel' %>
    <%= loading_indicator_tag(:action => :add_existing, :id => params[:id]) %>

</form>


woops

woops

  <% if page.respond_to?('enable_comments') %>

    <% if page.enable_comments %>
      <%= link_to "#{page.comments_count} comments", admin_page_comments_path(:page_id => page.id) %>
    <% else %>
      <%= link_to "Enable", admin_page_comments_path(:page_id => page.id, :action => :enable) %>
    <% end %>

  <% end %>

  <% if page.respond_to?(enable_comments) %>

    <% if page.enable_comments %>
      <%= link_to "#{page.comments_count} comments", admin_page_comments_path(:page_id => page.id) %>
    <% else %>
      <%= link_to "Enable", admin_page_comments_path(:page_id => page.id, :action => :enable) %>
    <% end %>

  <% end %>


fix img tag for EY logo so it shows up

fix img tag for EY logo so it shows up

git-svn-id: f1a1267e29db6ed751edc5bdb54cf7d87c16124a@3185 410327ef-2207-0410-a325-f78bbcb22a5a

---
extension: html
filter:    erb
---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <title>RSpec-<%= rspec_version %>: <%= @page.title %></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="RSpec, {title: }, BDD, behaviour driven development, behavior driven development, TDD, test driven development, Ruby, Rails, testing, watir, selenium"/>

    <link rel="stylesheet" href="/css/coderay.css" type="text/css" />

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

RSpec <%= rspec_version %>

  <%= breadcrumb_menu(@page) %>

    <%= @content %>

      Webdesign by JM

              Hosted by our
good friends at
Engine Yard


ActionItem1199: fixed conflict of strings to translate

<%= link_to(n_( 'One article published', '%s articles published', owner.articles.count) %
  content_tag('b', owner.articles.count), owner.public_profile_url.merge(:action => 'sitemap') ) %>

<%= link_to(n__('One friend', '%s friends', owner.friends.count) %
  content_tag('b', owner.friends.count), owner.public_profile_url.merge(:action => 'friends')) %>

<%= link_to(n__('One community', '%{num} communities', owner.communities.size) %
  {:num => content_tag('b', owner.communities.size)}, owner.public_profile_url.merge(:action => 'communities')) %>

<%= link_to(n_('One tag', '%s tags', owner.article_tags.size) %
  content_tag('b', owner.article_tags.size), owner.public_profile_url.merge(:action => 'tags')) %>

<%= link_to(n_( 'One article published', '%s articles published', owner.articles.count) %
  content_tag('b', owner.articles.count), owner.public_profile_url.merge(:action => 'sitemap') ) %>

<%= link_to(n__('One friend', '%s friends', owner.friends.count) %
  content_tag('b', owner.friends.count), owner.public_profile_url.merge(:action => 'friends')) %>

<%= link_to(n__('One community', '%s communities', owner.communities.size) %
  content_tag('b', owner.communities.size), owner.public_profile_url.merge(:action => 'communities')) %>

<%= link_to(n_('One tag', '%s tags', owner.article_tags.size) %
  content_tag('b', owner.article_tags.size), owner.public_profile_url.merge(:action => 'tags')) %>


Updating comment link text

Updating comment link text

---
extension: html
filter:    erb
layout:    index
dirty:     true
---

<a href="<%= @page.url %>"><%= Widont.widont @page.title %>

<%= @page.summary %>

    <abbr class='published' title='<%= @page.created_at.to_s %>'>Posted <%=  @page.created_at.strftime('%B %d, %Y') %>

    <%= @content %>

  View this post's comments.

---
extension: html
filter:    erb
layout:    index
dirty:     true
---

<a href="<%= @page.url %>"><%= Widont.widont @page.title %>

<%= @page.summary %>

    <abbr class='published' title='<%= @page.created_at.to_s %>'>Posted <%=  @page.created_at.strftime('%B %d, %Y') %>

    <%= @content %>

  View the comments.


Make sure the progress does not exceed 100%.

It looks strange. It makes sense to set a cap at 100%.

<%

    num_entries = PloggyHelper.log_items.length
    if @entries == :all
        @entries = num_entries
    end
    logged_time_s = PloggyHelper.log_time
    PloggyHelper.use_project_time!
    logged_time = PloggyHelper.time_to_s(logged_time_s)
    PloggyHelper.use_project_time!(false)
    tot_day_count = PloggyHelper.work_time(project_start_date, project_end_date)
    cur_day_count = PloggyHelper.work_time(project_start_date, Date.today)
    cur_day_count_s = cur_day_count.to_s + '' + PloggyHelper.sup_fix(cur_day_count) + ''
    day_perc = sprintf '%.1f', [(100.0 * cur_day_count / tot_day_count), 100].min
    logged_perc = sprintf '%.1f', [(100.0 * logged_time_s / (tot_day_count * project_hours_per_day)), 100].min

    if @overview == :yes
%>

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

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

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

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

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

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

<%
    end

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

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

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

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

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

        <%
            }
        %>

<%
    end
%>

<%

    num_entries = PloggyHelper.log_items.length
    if @entries == :all
        @entries = num_entries
    end
    logged_time_s = PloggyHelper.log_time
    PloggyHelper.use_project_time!
    logged_time = PloggyHelper.time_to_s(logged_time_s)
    PloggyHelper.use_project_time!(false)
    tot_day_count = PloggyHelper.work_time(project_start_date, project_end_date)
    cur_day_count = PloggyHelper.work_time(project_start_date, Date.today)
    cur_day_count_s = cur_day_count.to_s + '' + PloggyHelper.sup_fix(cur_day_count) + ''
    day_perc = sprintf '%.1f', (100.0 * cur_day_count / tot_day_count)
    logged_perc = sprintf '%.1f', (100.0 * logged_time_s / (tot_day_count * project_hours_per_day))

    if @overview == :yes
%>

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

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

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

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

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

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

<%
    end

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

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

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

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

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

        <%
            }
        %>

<%
    end
%>