<commit_before><article class="module width_full">
  <header>
    <h3><%= t(:account_details) %></h3>
  </header>

  <div class="module_content">
    <table>
        <tr>
          <td><%= t(:date_joined) %></td>
          <td><%= time_ago_in_words(@user.created_at) + t(:ago) %></td>
        </tr>
        <tr>
          <td><%= t(:default_locale) %></td>
          <td><%= User::AVAILABLE_LANGUAGES[@user.locale ? @user.locale.to_sym : I18n.default_locale] %></td>
        </tr>
        <% if @user.role %>
        <tr>
          <td><%= t('role.name') %></td>
          <td><%= render 'shared/role', :role => @user.role_name %></td>
        </tr>
        <% end %>
    </table>
    <% if @my_profile %>
    <% content_for :on_ready_hook do %>
      $(".draggable").draggable({revert: 'invalid'});
      $("table.calendar td").droppable({
        drop: function(event, ui) {
          var col = $(this);
          
          var issue_id = ui.draggable.attr('data-id');
          var date = col.attr('data-value');

          $.post('/issues/' + issue_id + '/planning', {date: date}, function(response) {
            if (response['success']) {
              col.effect('highlight');
            } else {
              col.css('backgroundColor', 'red');
            }
          }, 'json');
        },
        accept: '.draggable'
      });
      
      $(".cancel_planning").droppable({
        drop: function(event, ui) {
          var issue_id = ui.draggable.attr('data-id');
          $.post('/issues/' + issue_id + '/planning', {date: ''}, function(response) {
            if (response['success']) {
              $("#my_assigned_issues").append(ui.draggable);
              ui.draggable.attr('style', 'position: relative;');
            }
          }, 'json');
        }
      });
    <% end %>
  <% end %>
  </div>
</article>

<article class="module width_full">
  <header>
    <h3><%= @my_profile ? t(:my_assigned_issues) : t('issue.issues_assigned_to', :username => @user.name) %></h3>
  </header>
  <div class="module_content">
    <% today = Date.today %>
    <% this_month = today.month %>
    <% beginning = today.beginning_of_week.yesterday %>
    <table border="0" class="calendar" cellspacing="0">
      <tr>
        <caption><%= t('date.month_names')[this_month] %></caption>
      </tr>
      <tr>
        <% (0..6).each do |i| %>
          <th><%= t('date.abbr_day_names')[i] %></th>
        <% end %>
      </tr>
      <% next_day = beginning.next %>
      <% 2.times do %>
      <tr>
        <% (0..6).each do %>
          <% class_name = '' %>
          <% if next_day.month != this_month %>
            <% class_name = 'other_month' %>
          <% end %>
          <% if next_day == today %>
            <% class_name = 'today' %>
          <% end %>
          <td class="<%= class_name %>" data-value="<%= next_day.to_s('%Y%M%d') %>">
            <span class="day"><%= next_day.day %></span>
            <%= render :partial => 'my_assigned_issue', :collection => @planned_issues[next_day] %>
          </td>
          <% next_day = next_day.next %>
        <% end %>
      </tr>
      <% end %>
    </table>
    <div class="cancel_planning"><%= t(:cancel_planning) %></div>
    <div id="my_assigned_issues">
      <%= render :partial => 'my_assigned_issue', :collection => @unplanned_issues %>
    </div>
  </div>
</article>

<article class="module width_full">
  <header>
    <h3><%= t(:recently_created_issues) %></h3>
  </header>

  <div class="module_content">
    <%= render :partial => 'issues/issue',
      :collection => @user.issues.order('created_at DESC').limit(5), :as => :issue %>
  </div>
</article><commit_msg>hide cancel_planning area on other users' profile<commit_after><article class="module width_full">
  <header>
    <h3><%= t(:account_details) %></h3>
  </header>

  <div class="module_content">
    <table>
        <tr>
          <td><%= t(:date_joined) %></td>
          <td><%= time_ago_in_words(@user.created_at) + t(:ago) %></td>
        </tr>
        <tr>
          <td><%= t(:default_locale) %></td>
          <td><%= User::AVAILABLE_LANGUAGES[@user.locale ? @user.locale.to_sym : I18n.default_locale] %></td>
        </tr>
        <% if @user.role %>
        <tr>
          <td><%= t('role.name') %></td>
          <td><%= render 'shared/role', :role => @user.role_name %></td>
        </tr>
        <% end %>
    </table>
    <% if @my_profile %>
    <% content_for :on_ready_hook do %>
      $(".draggable").draggable({revert: 'invalid'});
      $("table.calendar td").droppable({
        drop: function(event, ui) {
          var col = $(this);
          
          var issue_id = ui.draggable.attr('data-id');
          var date = col.attr('data-value');

          $.post('/issues/' + issue_id + '/planning', {date: date}, function(response) {
            if (response['success']) {
              col.effect('highlight');
            } else {
              col.css('backgroundColor', 'red');
            }
          }, 'json');
        },
        accept: '.draggable'
      });
      
      $(".cancel_planning").droppable({
        drop: function(event, ui) {
          var issue_id = ui.draggable.attr('data-id');
          $.post('/issues/' + issue_id + '/planning', {date: ''}, function(response) {
            if (response['success']) {
              $("#my_assigned_issues").append(ui.draggable);
              ui.draggable.attr('style', 'position: relative;');
            }
          }, 'json');
        }
      });
    <% end %>
  <% end %>
  </div>
</article>

<article class="module width_full">
  <header>
    <h3><%= @my_profile ? t(:my_assigned_issues) : t('issue.issues_assigned_to', :username => @user.name) %></h3>
  </header>
  <div class="module_content">
    <% today = Date.today %>
    <% this_month = today.month %>
    <% beginning = today.beginning_of_week.yesterday %>
    <table border="0" class="calendar" cellspacing="0">
      <tr>
        <caption><%= t('date.month_names')[this_month] %></caption>
      </tr>
      <tr>
        <% (0..6).each do |i| %>
          <th><%= t('date.abbr_day_names')[i] %></th>
        <% end %>
      </tr>
      <% next_day = beginning.next %>
      <% 2.times do %>
      <tr>
        <% (0..6).each do %>
          <% class_name = '' %>
          <% if next_day.month != this_month %>
            <% class_name = 'other_month' %>
          <% end %>
          <% if next_day == today %>
            <% class_name = 'today' %>
          <% end %>
          <td class="<%= class_name %>" data-value="<%= next_day.to_s('%Y%M%d') %>">
            <span class="day"><%= next_day.day %></span>
            <%= render :partial => 'my_assigned_issue', :collection => @planned_issues[next_day] %>
          </td>
          <% next_day = next_day.next %>
        <% end %>
      </tr>
      <% end %>
    </table>
    <% if @my_profile %>
    <div class="cancel_planning"><%= t(:cancel_planning) %></div>
    <% end %>
    <div id="my_assigned_issues">
      <%= render :partial => 'my_assigned_issue', :collection => @unplanned_issues %>
    </div>
  </div>
</article>

<article class="module width_full">
  <header>
    <h3><%= t(:recently_created_issues) %></h3>
  </header>

  <div class="module_content">
    <%= render :partial => 'issues/issue',
      :collection => @user.issues.order('created_at DESC').limit(5), :as => :issue %>
  </div>
</article>
{'fraction_non_alphanumeric': 0.20935593220338983, 'fraction_numerical': 0.004338983050847458, 'mean_word_length': 2.128074639525021, 'pattern_counts': {'":': 0, '<': 217, '<?xml version=': 0, '>': 235, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '96855', 'n_tokens_mistral': 2618, 'n_tokens_neox': 2449, 'n_words': 442}