<commit_before>{% extends "base.html" %}
{% load url from future %}


{% block pagescripts %}
  <script src="{{ STATIC_URL }}js/setup-ajax.js"></script>
  <script>
    var json_school_course_list = "{% url 'json_school_course_list' %}";
    var json_school_course_instructor_list = "{% url 'json_school_course_instructor_list' %}";
    var csrf_token = "{{ csrf_token }}";
    var course_flag_url = "{% url 'flag_course' course.id %}";
    var course_edit_url = "{% url 'edit_course' course.id %}";
    var dataTable_sDom = '<"top">rt<"bottom"p><"clear">';
  </script>
{% endblock %}

{% block pagestyle %}
  <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/note_course_pages.css">
  <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/datatables-css/jquery.dataTables.css">
{% endblock %}

{% block bodyscripts %}
  <script src="{{ STATIC_URL }}js/jquery.dataTables.min.js"></script>
  <script src="{{ STATIC_URL }}js/course.js"></script>
  <script src="{{ STATIC_URL }}js/course-detail.js" ></script>
  <script src="{{ STATIC_URL }}js/note-list.js" ></script>
{% endblock %}


{% block title %}
  Share Notes for {{ course.name }} | {{ course.school.name }}
{% endblock %}

{% block raw_content %}
  <section id="course_content">

    <div id="course-header">
      <div class="row header-byline">
        <div class="small-12 columns">
          <span id="course-header-school">{{ course.school.name }}</span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
          {% if course.department %}<span class="course-header-department">{{ course.department.name }}</span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;{% endif %}
          <span id="course-header-instructor">{{ course.instructor_name }}</span>
        </div>
      </div>

      <div class="row museo700">
        <div class="small-12 columns">
          <span id="course-header-name" class="header-title">{{ course.name }}</span>

          &nbsp;&nbsp;
          <div class="hide-for-large-up"></div>

          <span style="display: inline;">
            <span class="show-for-large-up">
              {% if user.is_authenticated %}
                {% if user.get_profile.can_edit_items %}
                  <button id="edit-button" data-reveal-id="edit-course-form" class="modify-button"> <i class="fa fa-edit"></i> Edit this course</button>&nbsp;&nbsp;
                {% endif %}

                {% if already_flagged %}
                  <i class="fa fa-flag"></i> You have reported this course as inappropriate
                {% else %}
                  <button id="flag-button" class="modify-button"><i class="fa fa-flag"></i> Report course as inappropriate</button>
                {% endif %}
              {% else %}
                <button id="flag-button-disabled" class="modify-button disabled opentip"
                        data-ot="Log in to report a course"
                        {% include 'partial/opentip_settings.html' %}>
                        <i class="fa fa-flag"></i> Report course as inappropriate</button>
              {% endif %}
            </span>
          </span>

        </div>
      </div>

      <div class="row {% if not course.url %}hide{% endif %}">
        <div id="course_link" class="small-12 columns">
          <a id="course_url" rel="nofollow" target="_blank" href="{{ course.url }}">
            {{ course.url|slice:":50" }}
            <i class="fa fa-external-link-square"></i>
          </a>
        </div>
      </div>

      <div id="end-header" class="row">
      </div>

    </div><!-- /course_header -->

    {% if user.get_profile.can_edit_items %}
      <section id="edit-course-form" class="reveal-modal" data-reveal>
        <a class="close-reveal-modal">&#215;</a>
        <form>
          {% csrf_token %}

          <div class="row">
            <div id="course_form_errors" class="small-12 columns">
              {{ course_form.non_field_errors }}
            </div>
          </div>

          <div class="row hide">
            <div class="small-12 columns">
              <label for="id_school">School</label>
              <div>
                <input id="id_school" value="{{ course.school.id }}" name="school" type='hidden'/>
              </div>
            </div>
          </div> <!-- .row -->

          <div class="row">
            <div class="small-12 columns">
              <label for="id_name">Course Name:</label>
              <input id="id_name" class="" type="text" name="name" maxlength="255" value="{{ course.name }}"/>
            </div>
          </div> <!-- .row -->

          <div class="row">
            <div class="small-12 columns large-6">
              <label for="id_instructor_name">Instructor Name:</label>
              <input id="id_instructor_name" class="" type="text" name="instructor_name" maxlength="75" value="{{ course.instructor_name }}"/>
            </div>

            <div class="small-12 columns large-6">
              <label for="id_instructor_email">Instructor Email:</label>
              <input id="id_instructor_email" class="" type="text" name="instructor_email" maxlength="75" value="{{ course.instructor_email }}"/>
            </div>
          </div> <!-- .row -->

          <div class="row">
            <div class="small-12 columns">
              <label for="id_url">Course url:</label>
              <input id="id_url" class="" type="text" name="url" maxlength="255" value="{{ course.url }}"/>
            </div>
          </div> <!-- .row -->

          <div class="row">
            <div class="small-4 large-8 columns small-centered text-center">
              <button id="edit-save-btn" type=button><i class="fa fa-save"></i> Save</button>
            </div>
          </div>
        </form>
      </section>
    {% endif %}

    <div id="note-search-bar" class="row">
      <div class="large-2 columns show-for-large-up">
        {{ file_upload_form.fp_file }}
      </div>
      <div class="small-12 large-6 columns">
        <form class="search-notes" action="{% url 'note_search' %}" method="GET">
          <span>
          <input type="hidden" name="course_id" value="{{ course.id }}" />
          <input name="query" class="search-notes" type="text" placeholder="Search Notes" />
          </span>
        </form>
      </div>
      <div class="large-4 columns show-for-large-up">
        <div id="note-sort-wrapper">
          Sort By
          <select class="note-sort">
            <option value="0">Date</option>
            <option value="1" selected>Popularity</option>
          </select>
        </div>
      </div>
      <div class="small-12 columns">
        {% include 'partial/filepicker.html' %}
      </div>
    </div>

    <div id="course_container">
      <div class="row">
        <div class="small-12 columns">
          <!-- Main course table -->
          <table id="data_table_list">
            <thead class="hide">
              <tr>
                <th class="no-display" id="data-table-date"> Date </th>
                <th class="no-display" id="data-table-thanks"> Popularity </th>
                <th class="no-display" id="data-table-note"> Note </th>
              </tr><commit_msg>Sort notes by date by default<commit_after>{% extends "base.html" %}
{% load url from future %}


{% block pagescripts %}
  <script src="{{ STATIC_URL }}js/setup-ajax.js"></script>
  <script>
    var json_school_course_list = "{% url 'json_school_course_list' %}";
    var json_school_course_instructor_list = "{% url 'json_school_course_instructor_list' %}";
    var csrf_token = "{{ csrf_token }}";
    var course_flag_url = "{% url 'flag_course' course.id %}";
    var course_edit_url = "{% url 'edit_course' course.id %}";
    var dataTable_sDom = '<"top">rt<"bottom"p><"clear">';
  </script>
{% endblock %}

{% block pagestyle %}
  <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/note_course_pages.css">
  <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/datatables-css/jquery.dataTables.css">
{% endblock %}

{% block bodyscripts %}
  <script src="{{ STATIC_URL }}js/jquery.dataTables.min.js"></script>
  <script src="{{ STATIC_URL }}js/course.js"></script>
  <script src="{{ STATIC_URL }}js/course-detail.js" ></script>
  <script src="{{ STATIC_URL }}js/note-list.js" ></script>
{% endblock %}


{% block title %}
  Share Notes for {{ course.name }} | {{ course.school.name }}
{% endblock %}

{% block raw_content %}
  <section id="course_content">

    <div id="course-header">
      <div class="row header-byline">
        <div class="small-12 columns">
          <span id="course-header-school">{{ course.school.name }}</span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;
          {% if course.department %}<span class="course-header-department">{{ course.department.name }}</span>&nbsp;&nbsp;&bull;&nbsp;&nbsp;{% endif %}
          <span id="course-header-instructor">{{ course.instructor_name }}</span>
        </div>
      </div>

      <div class="row museo700">
        <div class="small-12 columns">
          <span id="course-header-name" class="header-title">{{ course.name }}</span>

          &nbsp;&nbsp;
          <div class="hide-for-large-up"></div>

          <span style="display: inline;">
            <span class="show-for-large-up">
              {% if user.is_authenticated %}
                {% if user.get_profile.can_edit_items %}
                  <button id="edit-button" data-reveal-id="edit-course-form" class="modify-button"> <i class="fa fa-edit"></i> Edit this course</button>&nbsp;&nbsp;
                {% endif %}

                {% if already_flagged %}
                  <i class="fa fa-flag"></i> You have reported this course as inappropriate
                {% else %}
                  <button id="flag-button" class="modify-button"><i class="fa fa-flag"></i> Report course as inappropriate</button>
                {% endif %}
              {% else %}
                <button id="flag-button-disabled" class="modify-button disabled opentip"
                        data-ot="Log in to report a course"
                        {% include 'partial/opentip_settings.html' %}>
                        <i class="fa fa-flag"></i> Report course as inappropriate</button>
              {% endif %}
            </span>
          </span>

        </div>
      </div>

      <div class="row {% if not course.url %}hide{% endif %}">
        <div id="course_link" class="small-12 columns">
          <a id="course_url" rel="nofollow" target="_blank" href="{{ course.url }}">
            {{ course.url|slice:":50" }}
            <i class="fa fa-external-link-square"></i>
          </a>
        </div>
      </div>

      <div id="end-header" class="row">
      </div>

    </div><!-- /course_header -->

    {% if user.get_profile.can_edit_items %}
      <section id="edit-course-form" class="reveal-modal" data-reveal>
        <a class="close-reveal-modal">&#215;</a>
        <form>
          {% csrf_token %}

          <div class="row">
            <div id="course_form_errors" class="small-12 columns">
              {{ course_form.non_field_errors }}
            </div>
          </div>

          <div class="row hide">
            <div class="small-12 columns">
              <label for="id_school">School</label>
              <div>
                <input id="id_school" value="{{ course.school.id }}" name="school" type='hidden'/>
              </div>
            </div>
          </div> <!-- .row -->

          <div class="row">
            <div class="small-12 columns">
              <label for="id_name">Course Name:</label>
              <input id="id_name" class="" type="text" name="name" maxlength="255" value="{{ course.name }}"/>
            </div>
          </div> <!-- .row -->

          <div class="row">
            <div class="small-12 columns large-6">
              <label for="id_instructor_name">Instructor Name:</label>
              <input id="id_instructor_name" class="" type="text" name="instructor_name" maxlength="75" value="{{ course.instructor_name }}"/>
            </div>

            <div class="small-12 columns large-6">
              <label for="id_instructor_email">Instructor Email:</label>
              <input id="id_instructor_email" class="" type="text" name="instructor_email" maxlength="75" value="{{ course.instructor_email }}"/>
            </div>
          </div> <!-- .row -->

          <div class="row">
            <div class="small-12 columns">
              <label for="id_url">Course url:</label>
              <input id="id_url" class="" type="text" name="url" maxlength="255" value="{{ course.url }}"/>
            </div>
          </div> <!-- .row -->

          <div class="row">
            <div class="small-4 large-8 columns small-centered text-center">
              <button id="edit-save-btn" type=button><i class="fa fa-save"></i> Save</button>
            </div>
          </div>
        </form>
      </section>
    {% endif %}

    <div id="note-search-bar" class="row">
      <div class="large-2 columns show-for-large-up">
        {{ file_upload_form.fp_file }}
      </div>
      <div class="small-12 large-6 columns">
        <form class="search-notes" action="{% url 'note_search' %}" method="GET">
          <span>
          <input type="hidden" name="course_id" value="{{ course.id }}" />
          <input name="query" class="search-notes" type="text" placeholder="Search Notes" />
          </span>
        </form>
      </div>
      <div class="large-4 columns show-for-large-up">
        <div id="note-sort-wrapper">
          Sort By
          <select class="note-sort">
            <option value="0" selected>Date</option>
            <option value="1">Popularity</option>
          </select>
        </div>
      </div>
      <div class="small-12 columns">
        {% include 'partial/filepicker.html' %}
      </div>
    </div>

    <div id="course_container">
      <div class="row">
        <div class="small-12 columns">
          <!-- Main course table -->
          <table id="data_table_list">
            <thead class="hide">
              <tr>
                <th class="no-display" id="data-table-date"> Date </th>
                <th class="no-display" id="data-table-thanks"> Popularity </th>
                <th class="no-display" id="data-table-note"> Note </th>
              </tr>
{'fraction_non_alphanumeric': 0.18150062875506498, 'fraction_numerical': 0.007125890736342043, 'mean_word_length': 2.1754658385093166, 'pattern_counts': {'":': 2, '<': 327, '<?xml version=': 0, '>': 327, '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': '246178', 'n_tokens_mistral': 4529, 'n_tokens_neox': 4240, 'n_words': 902}