<commit_before><%
=begin
%>

Copyright (C) 2018 <NAME>, http://www.wbhauck.com

This file is part of Project Useful.

Project Useful is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Project Useful is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with Project Useful.  If not, see <http://www.gnu.org/licenses/>.

<%
=end
%>


<p id="notice"><%= notice %></p>


<h1><%= @product.title %> <% if logged_in? %><%= link_to '(Edit)', edit_product_path(@product) %><% end %></h1>
<table class="table">
<tr><th>Status</th><td class="<%= @product.status.code %>"><%= @product.status.title %></td></tr>
<tr><th>Owner</th><td><%= link_to @product.owner.username, @product.owner %></td></tr>
<tr><th>Public</th><td><%= @product.public %></td></tr>
<tr><th>Description:</th><td><%= simple_format(@product.description) %></td></tr>
</table>


<% if @product.wikis.count > 0 %>
  <h2>Wikis</h2>
  <p>
    <% @product.wikis.each do |wiki| %>
      <%= link_to wiki.title, wiki %><br />
    <% end %>
  </p>
<% else %>
  <h2>No Wikis</h2>
<% end %>


<% if @product.projects %>
  <h2>Projects <% if logged_in? %><%= link_to '(Add)', controller: "projects", action: "new",  product: @product %><% end %></h2>
  <table class="table tablesorter">
    <thead>
	    <tr><th>Title</th><th>Status</th><th>Owner</th><th>SchedStart</th><th>ActualStart</th><th>SchedCompl</th><th>ActualCompl</th></tr>
    </thead>
    <tbody>
      <% @product.projects.each do |project| %>
        <tr>
          <td><%= link_to project.title, project %></td>
	  <td class="<%= project.status.code %>"><%= project.status.title %></td>
          <td><%= link_to project.owner.username, project.owner %></td>
          <td><%= project.sched_start_date %></td>
          <td><%= project.actual_start_date %></td>
          <td><%= project.sched_completion_date %></td>
          <td><%= project.actual_completion_date %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <h2>No Projects</h2>
  <% if logged_in? %><%= link_to 'Add Task', controller: "projects", action: "new",  product: @product %><br /><% end %>
<% end %>


<% if @product.notes %>
  <h2>Notes <% if logged_in? %><%= link_to '(Add)', controller: "notes", action: "new",  product: @product %><% end %></h2>
  <table class="table">
    <thead>
      <tr><th>Title</th><th>Owner</th><th>Created At</th><th>Modified At</th></tr>
    </thead>
    <tbody>
      <% @product.notes.each do |note| %>
        <tr>
          <td><%= link_to note.title, note %></td>
          <td><%= link_to note.creator.username, note.creator %></td>
          <td><%= note.created_at %></td>
          <td><%= note.updated_at %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <h2>No Notes</h2>
  <% if logged_in? %><%= link_to 'Add Task', controller: "notes", action: "new",  product: @product %><br /><% end %>
<% end %>


<% if @product.meetings %>
  <h2>Meetings <% if logged_in? %><%= link_to '(Add)', controller: "meetings", action: "new",  product: @product %><% end %></h2>
  <table class="table">
    <thead>
      <tr><th>Title</th><th>Organizer</th><th>Scheduled For</th></tr>
    </thead>
    <tbody>
      <% @product.meetings.each do |meeting| %>
        <tr>
          <td><%= link_to meeting.subject, meeting %></td>
          <td><%= link_to meeting.owner.username, meeting.owner %></td>
          <td><%= meeting.scheduled %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <h2>No Meetings</h2>
  <% if logged_in? %><%= link_to 'Add Task', controller: "meetings", action: "new",  product: @product %><br /><% end %>
<% end %>


<% if @product.stories.count > 0 %>
  <h2>Stories <% if logged_in? %><%= link_to '(Add Story)', controller: "stories", action: "new",  product: @product %><% end %></h2>
  <% @stories = @product.stories %>
  <%= render 'stories_listing' %>
<% else %>
  <h2>No Stories</h2>
  <% if logged_in? %><%= link_to 'Add Story', controller: "stories", action: "new",  product: @product %><br /><% end %>
<% end %>


<% if @product.tasks %><commit_msg>moved from if not... to unless. it is cleaner<commit_after><%
=begin
%>

Copyright (C) 2018 <NAME>, http://www.wbhauck.com

This file is part of Project Useful.

Project Useful is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Project Useful is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with Project Useful.  If not, see <http://www.gnu.org/licenses/>.

<%
=end
%>


<p id="notice"><%= notice %></p>


<h1><%= @product.title %> <% if logged_in? %><%= link_to '(Edit)', edit_product_path(@product) %><% end %></h1>
<table class="table">
<tr><th>Status</th><td class="<%= @product.status.code %>"><%= @product.status.title %></td></tr>
<tr><th>Owner</th><td><%= link_to @product.owner.username, @product.owner %></td></tr>
<tr><th>Public</th><td><%= @product.public %></td></tr>
<tr><th>Description:</th><td><%= simple_format(@product.description) %></td></tr>
</table>


<% unless @product.wikis.blank? %>
  <h2>Wikis <% if logged_in? %><%= link_to '(Add)', controller: "wikis", action: "new",  product: @product %><% end %></h2>
  <p>
    <% @product.wikis.each do |wiki| %>
      <%= link_to wiki.title, wiki %><br />
    <% end %>
  </p>
<% else %>
  <h2>No Wikis</h2>
  <% if logged_in? %><%= link_to 'Add Wiki', controller: "wikis", action: "new",  product: @product %><br /><% end %>
<% end %>


<% unless @product.projects.blank? %>
  <h2>Projects <% if logged_in? %><%= link_to '(Add)', controller: "projects", action: "new",  product: @product %><% end %></h2>
  <table class="table tablesorter">
    <thead>
	    <tr><th>Title</th><th>Status</th><th>Owner</th><th>SchedStart</th><th>ActualStart</th><th>SchedCompl</th><th>ActualCompl</th></tr>
    </thead>
    <tbody>
      <% @product.projects.each do |project| %>
        <tr>
          <td><%= link_to project.title, project %></td>
	  <td class="<%= project.status.code %>"><%= project.status.title %></td>
          <td><%= link_to project.owner.username, project.owner %></td>
          <td><%= project.sched_start_date %></td>
          <td><%= project.actual_start_date %></td>
          <td><%= project.sched_completion_date %></td>
          <td><%= project.actual_completion_date %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <h2>No Projects</h2>
  <% if logged_in? %><%= link_to 'Add Task', controller: "projects", action: "new",  product: @product %><br /><% end %>
<% end %>


<% unless @product.notes.blank? %>
  <h2>Notes <% if logged_in? %><%= link_to '(Add)', controller: "notes", action: "new",  product: @product %><% end %></h2>
  <table class="table">
    <thead>
      <tr><th>Title</th><th>Owner</th><th>Created At</th><th>Modified At</th></tr>
    </thead>
    <tbody>
      <% @product.notes.each do |note| %>
        <tr>
          <td><%= link_to note.title, note %></td>
          <td><%= link_to note.creator.username, note.creator %></td>
          <td><%= note.created_at %></td>
          <td><%= note.updated_at %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <h2>No Notes</h2>
  <% if logged_in? %><%= link_to 'Add Task', controller: "notes", action: "new",  product: @product %><br /><% end %>
<% end %>


<% unless @product.meetings.blank? %>
  <h2>Meetings <% if logged_in? %><%= link_to '(Add)', controller: "meetings", action: "new",  product: @product %><% end %></h2>
  <table class="table">
    <thead>
      <tr><th>Title</th><th>Organizer</th><th>Scheduled For</th></tr>
    </thead>
    <tbody>
      <% @product.meetings.each do |meeting| %>
        <tr>
          <td><%= link_to meeting.subject, meeting %></td>
          <td><%= link_to meeting.owner.username, meeting.owner %></td>
          <td><%= meeting.scheduled %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <h2>No Meetings</h2>
  <% if logged_in? %><%= link_to 'Add Task', controller: "meetings", action: "new",  product: @product %><br /><% end %>
<% end %>


<% unless @product.stories.blank? %>
  <h2>Stories <% if logged_in? %><%= link_to '(Add Story)', controller: "stories", action: "new",  product: @product %><% end %></h2>
  <% @stories = @product.stories %>
  <%= render 'stories_listing' %>
<% else %>
  <h2>No Stories</h2>
  <% if logged_in? %><%= link_to 'Add Story', controller: "stories", action: "new",  product: @product %><br /><% end %>
<% end %>


<% unless @product.tasks.blank? %>
{'fraction_non_alphanumeric': 0.2200365473503171, 'fraction_numerical': 0.006019563581640331, 'mean_word_length': 3.468780019212296, 'pattern_counts': {'":': 0, '<': 456, '<?xml version=': 0, '>': 458, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3929514', 'n_tokens_mistral': 3527, 'n_tokens_neox': 3236, 'n_words': 841}