<commit_before>{% extends "base.html" %}

{% block body %}
<style>
  .topicPie {
    stroke-dasharray: {{ topic_progress }} 100;
  }
</style>

<div class="container">
  <h1>Topic</h1>
</div>

<div class="container">
  <div class="row">
    <div class="col-sm-8 card">
      <div class="card-block">
        <h4 class="card-title">{{topic.name}}</h4>
        <h6 class="card-subtitle mb-4 text-muted">Learning a language requires practice every day.</h6>
        <div class="card-deck">
          {% for quiz in topic.quizzes %}
            <div class="card mb-4" style="border-width:2px">
              <div class="card-block d-flex flex-column">
                <div class="topicCardTitle">
                  <h4 class="card-title">{{ quiz.name }}</h4>
                  {% if quiz.id < current_user.quiz.id %}
                    <img src="/static/images/checkmark.png" class="topicCardCheck">
                  {% endif %}
                </div>
                <p class="card-text comma ellipsis">
                  {% for sentence in quiz.sentences %}
                    {% if loop.index < 6 %}
                      <span>{{ sentence.text }}</span>
                    {% endif %}
                  {% endfor %}
                </p>

                {% if quiz.id < current_user.quiz.id %}
                  <a
                    href="{{ url_for('quiz.ask', id=quiz.id) }}"
                    class="btn btn-secondary align-self-center mt-auto"
                    role="button"
                   >
                    Redo
                  </a>
                {% elif quiz.id == current_user.quiz.id %}
                  <a
                    href="{{ url_for('quiz.ask', id=current_user.quiz.id) }}"
                    class="btn btn-primary align-self-center mt-auto"
                    role="button"
                  >
                    Begin
                  </a>
                {% else %}
                  <a
                    href="{{ url_for('quiz.ask', id=current_user.quiz.id) }}"
                    class="btn btn-secondary disabled align-self-center mt-auto"
                    role="button"
                  >
                    Locked
                  </a>
                {% endif %}
              </div>
            </div>
            {% if loop.index % 3 == 0 %}
              </div> <!-- Close current card-deck -->
              <div class="card-deck">
            {% endif %}
          {% endfor %}
        </div> <!-- Close last card-deck -->
      </div>
    </div><!-- /.blog-main -->

    <div class="col-sm-3 card offset-sm-1">
      <div class="card-block text-center">
        <h4 class="card-title">Progress</h4>
        <!--https://www.smashingmagazine.com/2015/07/designing-simple-pie-charts-with-css/-->
        <svg class="topicPieContainer" viewBox="0 0 32 32">
          <circle class="topicPie" r="15.915" cx="15.915" cy="15.915" />
        </svg>
        <br />
        {{ progress }} / {{ topic_size }} Quizzes completed
      </div>
      {% if current_user.username == None %}
        <div class="card card-block mt-5" style="border-width:2px">
          <h4 class="card-title">Sign up</h4>
          <h6 class="card-subtitle mb-3 text-muted">Create a profile to save your progress!</h6>
          <a class="btn btn-lg btn-success mb-2" href="{{ url_for('auth.register') }}" role="button">Create a profile</a>
          <a class="btn btn-lg btn-primary" href="{{ url_for('auth.login') }}" role="button">Sign in</a>
        </div>
      {% endif %}
    </div><!-- /.blog-sidebar -->
  </div><!-- /.row -->
</div><!-- /.container -->
{% endblock %}

{% block js %}
{% endblock %}
<commit_msg>Fix Topic signup panel layout<commit_after>{% extends "base.html" %}

{% block body %}
<style>
  .topicPie {
    stroke-dasharray: {{ topic_progress }} 100;
  }
</style>

<div class="container">
  <h1>Topic</h1>
</div>

<div class="container">
  <div class="row">
    <div class="col-sm-8 card">
      <div class="card-block">
        <h4 class="card-title">{{topic.name}}</h4>
        <h6 class="card-subtitle mb-4 text-muted">Learning a language requires practice every day.</h6>
        <div class="card-deck">
          {% for quiz in topic.quizzes %}
            <div class="card mb-4" style="border-width:2px">
              <div class="card-block d-flex flex-column">
                <div class="topicCardTitle">
                  <h4 class="card-title">{{ quiz.name }}</h4>
                  {% if quiz.id < current_user.quiz.id %}
                    <img src="/static/images/checkmark.png" class="topicCardCheck">
                  {% endif %}
                </div>
                <p class="card-text comma ellipsis">
                  {% for sentence in quiz.sentences %}
                    {% if loop.index < 6 %}
                      <span>{{ sentence.text }}</span>
                    {% endif %}
                  {% endfor %}
                </p>

                {% if quiz.id < current_user.quiz.id %}
                  <a
                    href="{{ url_for('quiz.ask', id=quiz.id) }}"
                    class="btn btn-secondary align-self-center mt-auto"
                    role="button"
                   >
                    Redo
                  </a>
                {% elif quiz.id == current_user.quiz.id %}
                  <a
                    href="{{ url_for('quiz.ask', id=current_user.quiz.id) }}"
                    class="btn btn-primary align-self-center mt-auto"
                    role="button"
                  >
                    Begin
                  </a>
                {% else %}
                  <a
                    href="{{ url_for('quiz.ask', id=current_user.quiz.id) }}"
                    class="btn btn-secondary disabled align-self-center mt-auto"
                    role="button"
                  >
                    Locked
                  </a>
                {% endif %}
              </div>
            </div>
            {% if loop.index % 3 == 0 %}
              </div> <!-- Close current card-deck -->
              <div class="card-deck">
            {% endif %}
          {% endfor %}
        </div> <!-- Close last card-deck -->
      </div>
    </div><!-- /.blog-main -->

    <div class="col-sm-3 offset-sm-1">
      <div class="card text-center">
        <div  class="card-block">
          <h4 class="card-title">Progress</h4>
          <!--https://www.smashingmagazine.com/2015/07/designing-simple-pie-charts-with-css/-->
          <svg class="topicPieContainer text-center" viewBox="0 0 32 32">
            <circle class="topicPie" r="15.915" cx="15.915" cy="15.915" />
          </svg>
          <br />
          {{ progress }} / {{ topic_size }} Quizzes completed
        </div>
      </div>
      {% if current_user.username == None %}
        <div class="card card-block mt-5">
          <h4 class="card-title">Sign up</h4>
          <h6 class="card-subtitle mb-3 text-muted">Create a profile to save your progress!</h6>
          <a class="btn btn-lg btn-success mb-2" href="{{ url_for('auth.register') }}" role="button">Create a profile</a>
          <a class="btn btn-lg btn-primary" href="{{ url_for('auth.login') }}" role="button">Sign in</a>
        </div>
      {% endif %}
    </div><!-- /.blog-sidebar -->
  </div><!-- /.row -->
</div><!-- /.container -->
{% endblock %}

{% block js %}
{% endblock %}

{'fraction_non_alphanumeric': 0.17012617012617012, 'fraction_numerical': 0.015330348663681997, 'mean_word_length': 1.405220228384992, 'pattern_counts': {'":': 0, '<': 147, '<?xml version=': 0, '>': 141, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '887771', 'n_tokens_mistral': 2368, 'n_tokens_neox': 2123, 'n_words': 452}