<commit_before><% 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 ||= {}

 priority << " #{task.project.to_css_name}"

%>

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

<span>
  <% unless task.done?
    %>
    <%= check_box("task", "done", { "title" => _("Close <b>%s</b>", 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 <b>%s</b>.", 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 <b>%s</b>. 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 -%>
     <img src="/images/spacer.gif" width="16" height="16" border="0"/>
   <% end -%>
   <%= link_to_task(task) -%>

   <small>
     <%= "(#{worked_nice(task.worked_minutes)} / #{worked_nice( task.duration )})" if (@session[:user].option_tracktime == 1 && task.duration > 0) %>
     <%= "<span class=\"task_milestone\">[#{task.milestone.name}]</span>" unless task.milestone.nil? -%>
   </small>
   <br/>
   <% name = _("No one")
      name = task.users.collect{|u| u.name}.join(', ') unless task.users.empty?
   %>



   <% if session[:user].option_tracktime == 1 %>
     <div class="task_info description">
   <% else %>
     <div class="task_info_no_icon description">
   <% end %>
   <%= task.full_name %>
   <%= "<span class=\"otheruser\">[#{name}]</span>" %>
   <%= due_in_words(task) if (task.due_at != nil || task.milestone_id.to_i > 0)%>
     </div>
  <% else %>
  <%#
    # Task is complete
    #%>
    <%= check_box("task", "done", {"title" => _("Revert <b>%s</b> 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 <b>%s</b>.", 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 <b>%s</b>. 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 -%>
     <img src="/images/spacer.gif" width="16" height="16" border="0"/><% end -%>
     <%= link_to_task(task) -%>
     <small><% if @session[:user].option_tracktime == 1%>(<%= worked_nice(task.worked_minutes) %> / <%= worked_nice( task.duration ) %>)<% end %> <em>[<%=tz.utc_to_local(task.completed_at).strftime(session[:user].date_format) %>]</em></small>
     <% if session[:user].option_tracktime == 1 %>
       <div class="task_info description"><%= h(task.full_name) %></div>
     <% else %>
       <div class="task_info_no_icon description"><%= h(task.full_name) %></div>
     <% end %>

  <% end %>

  <%#
    # Always printed
    #%>

  <div style="position: absolute; left: -59px; top: 0px; z-index:10; width:55px;" align="right">

    <span id="edit_task_<%=task.id%>" style="display: none;"><commit_msg>[ClockingIT @ Don't escape tags list for completed tasks.]<commit_after><% 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 ||= {}

 priority << " #{task.project.to_css_name}"

%>

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

<span>
  <% unless task.done?
    %>
    <%= check_box("task", "done", { "title" => _("Close <b>%s</b>", 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 <b>%s</b>.", 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 <b>%s</b>. 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 -%>
     <img src="/images/spacer.gif" width="16" height="16" border="0"/>
   <% end -%>
   <%= link_to_task(task) -%>

   <small>
     <%= "(#{worked_nice(task.worked_minutes)} / #{worked_nice( task.duration )})" if (@session[:user].option_tracktime == 1 && task.duration > 0) %>
     <%= "<span class=\"task_milestone\">[#{task.milestone.name}]</span>" unless task.milestone.nil? -%>
   </small>
   <br/>
   <% name = _("No one")
      name = task.users.collect{|u| u.name}.join(', ') unless task.users.empty?
   %>



   <% if session[:user].option_tracktime == 1 %>
     <div class="task_info description">
   <% else %>
     <div class="task_info_no_icon description">
   <% end %>
   <%= task.full_name %>
   <%= "<span class=\"otheruser\">[#{name}]</span>" %>
   <%= due_in_words(task) if (task.due_at != nil || task.milestone_id.to_i > 0)%>
     </div>
  <% else %>
  <%#
    # Task is complete
    #%>
    <%= check_box("task", "done", {"title" => _("Revert <b>%s</b> 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 <b>%s</b>.", 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 <b>%s</b>. 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 -%>
     <img src="/images/spacer.gif" width="16" height="16" border="0"/><% end -%>
     <%= link_to_task(task) -%>
     <small><% if @session[:user].option_tracktime == 1%>(<%= worked_nice(task.worked_minutes) %> / <%= worked_nice( task.duration ) %>)<% end %> <em>[<%=tz.utc_to_local(task.completed_at).strftime(session[:user].date_format) %>]</em></small>
     <% if session[:user].option_tracktime == 1 %>
       <div class="task_info description"><%= task.full_name %></div>
     <% else %>
       <div class="task_info_no_icon description"><%= task.full_name %></div>
     <% end %>

  <% end %>

  <%#
    # Always printed
    #%>

  <div style="position: absolute; left: -59px; top: 0px; z-index:10; width:55px;" align="right">

    <span id="edit_task_<%=task.id%>" style="display: none;">
{'fraction_non_alphanumeric': 0.23098468271334793, 'fraction_numerical': 0.008927789934354486, 'mean_word_length': 3.009122807017544, 'pattern_counts': {'":': 0, '<': 197, '<?xml version=': 0, '>': 307, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4016453', 'n_tokens_mistral': 4046, 'n_tokens_neox': 3787, 'n_words': 710}