{% extends "examples/base.html" %}
{% load static %}

  {% block title %}
    SmartDjango - Comments of my Site (A Page of Type {{ page_type }})
  {% endblock title %}

  {% block main_title %}
    Comments of my Site
  {% endblock main_title %}

  {% block main_content %}
    <div class="container">
      <div class="section">
        <div class="row">
          <div class="col s6">
            <ul class="collapsible with-header" data-collapsible="accordion">
              <li class="collection-header"><h5 class="center">Latest Comments</h5></li>
            {% for comment in latest_comments %}
              <li>
                <div class="collapsible-header">
                  {% if comment.is_spam %}
                  <span class="red-text text-darken-2"><i class="material-icons">bug_report</i></span>
                  {% else %}
                  <span class="light-blue-text"><i class="material-icons">comment</i></span>
                  {% endif %}
                [User n° {{ comment.user_id }}] {{ comment.comment|truncatechars:50 }}</div>
                <div class="collapsible-body"><span>{{ comment.comment }}</span></div>
              </li>
            {% endfor %}
            </ul>
          </div>
          <div class="col s6">
            <h5>Post a Comment</h5>
            <form method="post">
              {% csrf_token %}
              {{ form.as_p }}
              <button class="btn waves-effect waves-light" type="submit" name="action">Submit
                <i class="material-icons right">send</i>
              </button>
            </form>
          </div>
        </div>
      </div>
    </div>    
  {% endblock main_content %}

  {% block ai_info %}
    <p class="light">You are using the spam filter <b>{{ spam_filter.name }}</b> with the <b>{{ spam_filter.classifier }}</b> classifier{% if spam_filter.pretraining %}, pre-trained with <b>{{ spam_filter.pretraining }}</b>{% endif %}.</p>
  {% endblock ai_info %}

  {% block ai_not_initialized_message %}
    There is no inferece performed on the Bayesian Network for the metrics and / or the Spam Filter for Comments<br>
    You can run it from the corresponding admin's objects' change form.
  {% endblock ai_not_initialized_message %}