<commit_before><?php
  $userId = $sf_user->getUserId();
  $restudyCount = ReviewsPeer::getRestudyKanjiCount($userId);
  $learnedCount = LearnedKanjiPeer::getCount($userId);
?>

<h2>Restudy List</h2>

<div class="row md:items-stretch mb-8">
  <div class="col-md-6 mb-4 md:mb-0">
<?php if ($restudyCount): ?>
    <div class="ko-Box ko-Box--stroke ko-Box--danger md:h-full">
      <h3 class="text-md font-bold text-danger-dark"><?= $restudyCount; ?> Kanji to Restudy</h3>
<?php else: ?>
    <div class="ko-Box ko-Box--stroke ko-Box--success">
      <h3 class="text-md font-bold text-success-darker">No Forgotten Kanji - Hooray!</h3>
<?php endif; ?>

      <p>Restudy your forgotten kanji, <em>in index order</em>. <?= link_to('Learn More', '@learnmore#restudy-list', ['class' => 'whitespace-nowrap']); ?>

      <div class="flex items-center">
<?php
      $restudyLabel = $learnedCount ? 'Continue Restudy' : 'Begin Restudy';
      if ($restudyCount)
      {
        echo _bs_button(
          $restudyLabel.'<i class="fa fa-book-open ml-2"></i>',
          'study/edit',
          ['query_string' => 'restudy', 'class' => 'ko-Btn ko-Btn--danger ko-Btn--large']
        );
      }
      else
      {
        echo _bs_button(
          'Begin Restudy<i class="fa fa-book-open ml-2"></i>',
          '@review',
          [
            'query_string' => 'box=1',
            'class' => 'ko-Btn ko-Btn--danger ko-Btn--large is-disabled',
            'disabled' => true,
          ]
        );
      }
?>
<?php
      if ($restudyCount)
      {
        echo _bs_button(
          'Review All<i class="fa fa-arrow-right ml-2"></i>',
          '@review',
          ['query_string' => 'box=1', 'class' => 'ko-Btn ko-Btn--danger ko-Btn--large is-ghost ml-4']
        );
      }
?>
      </div>
    </div>
  </div>

  <div class="col-md-6">
    <div class="ko-Box md:h-full">

      <div class="flex">
        <h3 class="text-md font-bold text-body">Learned Kanji</h3>
        <?php if ($learnedCount): ?>
          <?= link_to(
          '<i class="fa fa-times mr-2"></i>Clear learned list ',
          'study/clear?goto=restudy',
          ['class' => 'leading-1 text-danger-darker hover:underline ml-auto']
        ); ?>
        <?php endif; ?>
      </div>
      
      <?php if ($learnedCount): ?>
        <p><strong><?= $learnedCount; ?></strong> learned kanji are ready for review.</p>

<?= _bs_button(
          'Review Learned Kanji<i class="fa fa-arrow-right ml-2"></i>',
          '@review',
          [
            'query_string' => 'box=1',
            'class' => 'ko-Btn ko-Btn--success ko-Btn--large',
          ]
        ); ?>
      <?php endif; ?>

    </div>
  </div>

</div>

<?php if (!$restudyCount): ?>

  <div class="ko-Box  min-h-[336px] flex mb-8"><commit_msg>(Restudy List): Learned Kanji empty state, fix review url<commit_after><?php
  $userId = $sf_user->getUserId();
  $restudyCount = ReviewsPeer::getRestudyKanjiCount($userId);
  $learnedCount = LearnedKanjiPeer::getCount($userId);
?>

<h2>Restudy List</h2>

<div class="row md:items-stretch mb-8">
  <div class="col-md-6 mb-4 md:mb-0">
<?php if ($restudyCount): ?>
    <div class="ko-Box ko-Box--stroke ko-Box--danger md:h-full">
      <h3 class="text-md font-bold text-danger-dark"><?= $restudyCount; ?> Kanji to Restudy</h3>
<?php else: ?>
    <div class="ko-Box ko-Box--stroke ko-Box--success">
      <h3 class="text-md font-bold text-success-darker">No Forgotten Kanji - Hooray!</h3>
<?php endif; ?>

      <p>Restudy your forgotten kanji, <em>in index order</em>. <?= link_to('Learn More', '@learnmore#restudy-list', ['class' => 'whitespace-nowrap']); ?>

      <div class="flex items-center">
<?php
      $restudyLabel = $learnedCount ? 'Continue Restudy' : 'Begin Restudy';
      if ($restudyCount)
      {
        echo _bs_button(
          $restudyLabel.'<i class="fa fa-book-open ml-2"></i>',
          'study/edit',
          ['query_string' => 'restudy', 'class' => 'ko-Btn ko-Btn--danger ko-Btn--large']
        );
      }
      else
      {
        echo _bs_button(
          'Begin Restudy<i class="fa fa-book-open ml-2"></i>',
          '@review',
          [
            'query_string' => 'box=1',
            'class' => 'ko-Btn ko-Btn--danger ko-Btn--large is-disabled',
            'disabled' => true,
          ]
        );
      }
?>
<?php
      if ($restudyCount)
      {
        echo _bs_button(
          'Review All<i class="fa fa-arrow-right ml-2"></i>',
          '@review',
          ['query_string' => 'box=1', 'class' => 'ko-Btn ko-Btn--danger ko-Btn--large is-ghost ml-4']
        );
      }
?>
      </div>
    </div>
  </div>

  <div class="col-md-6">
    <div class="ko-Box md:h-full">

      <div class="flex">
        <h3 class="text-md font-bold text-body">Learned Kanji</h3>
<?php if ($learnedCount): ?>
          <?= link_to(
  '<i class="fa fa-times mr-2"></i>Clear learned list ',
  'study/clear?goto=restudy',
  ['class' => 'leading-1 text-danger-darker hover:underline ml-auto']
); ?>
<?php endif; ?>
      </div>
      
<?php if ($learnedCount): ?>
        <p>You have learned kanji ready for review!</p>
<?php else: ?>
        <p>No learned kanji to review.</p>
<?php endif; ?>
<?php
      if ($learnedCount)
      {
        echo _bs_button(
          "Review <strong>{$learnedCount}</strong> Learned Kanji".'<i class="fa fa-arrow-right ml-2"></i>',
          '@review',
          [
            'query_string' => 'type=relearned',
            'class' => 'ko-Btn ko-Btn--success ko-Btn--large',
          ]
        );
      }
      else {
        echo _bs_button(
          'Review Learned Kanji<i class="fa fa-arrow-right ml-2"></i>',
          '@review',
          [
            'query_string' => 'type=relearned',
            'class' => 'ko-Btn ko-Btn--success ko-Btn--large is-disabled',
            'disabled' => true,
          ]
        );
      }
?>

    </div>
  </div>

</div>

<?php if (!$restudyCount): ?>

  <div class="ko-Box  min-h-[336px] flex mb-8">
{'fraction_non_alphanumeric': 0.19585214918882757, 'fraction_numerical': 0.009031610637230306, 'mean_word_length': 2.1859350026638253, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 148, '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': '5627581', 'n_tokens_mistral': 2159, 'n_tokens_neox': 2151, 'n_words': 426}