{% load url from future %}
{% load socialaccount %}
{{ file_upload_form.media }}
<section id=filepicker-form class="extend-form">
  <div class="row" id="filepicker_row">
    <div class="small-8 small-offset-1 columns large-10">
       {{ file_upload_form.as_p }}
    </div>
  </div> <!--.row -->
  <div class="row" >
    <div class="small-10 small-offset-1 columns">
      <div id="forms_container">
      </div>
      <div id="success" class="hide">
        <p>Thank you for sharing:</p>
        <ul id="uploaded_files">
        </ul>
        {% if not request.user.is_authenticated %}
          <p>It will take a minute for your notes to appear here.
            We'd love to have you sign up so you can <strong>claim the <span id="thank-points"></span> karma points
            you just got.</strong> With a KarmaNotes account,
            you can build a reputation by continuing to upload great notes.
            <a href="">Want to share again?</a></p>
          <div class="socialaccount_ballot">
            <ul class="socialaccount_providers">
              {% include "socialaccount/snippets/provider_list.html" with process="login" %}
            </ul>
            <a href="{{ signup_url }}">Sign up for a traditional account</a>
          </div>
        {% else %}
          <p>It will take a minute for your notes to appear. This page will refresh soon so you
            can see your new notes.
            You'll be awarded <strong><span id="thank-points"></span> karma points.</strong>
            <a href="">Want to share again?</a></p>
        {% endif %}
      </div>
    </div>

    <div id="form-template" class="row" style="display:none">
      <form class="inline-form" method="POST" action="{% url 'upload_post' %}">
        <div class="small-11 large-6 columns">
          <legend>Title of Note <small class="form">* Required</small></legend>
          <input type="text" class="intext" id="id_name" name="name"
                placeholder="">
        </div>
        <div class="small-12 large-5 columns">
          <legend>Tags (comma seperated)</legend>
          <input type="text" id="id_tags" name="tags" class="taggit-tags"
                placeholder="shakespeare, econ, physics">
        </div>
        <div class="show-for-small columns small-1 end">
          <i class="fa fa-times-circle awesome-action remove"></i>
        </div>
        <div class="hidden-fields" style="display:none;">
          <input type="text" id="id_fpfile" name="fpfile" class="fpurl">
          <input type="text" id="id_mimetype" name="mimetype" class="mimetype">
          <input type="text" id="id_course" name="course" value="{{ course.id }}"
            class="course_id">
          {% csrf_token %}
          <input type="text" class="csrf" value='{{ csrf_token }}'>
        </div>
        <div class="show-for-medium-up columns large-1 end">
          <i class="fa fa-times-circle awesome-action remove" id="icon-remove-sign"></i>
        </div>
      </form>
    </div>
  </div>
  <div class="small-8 small-offset-3 columns large-2">
    <div id="save-btn" class="hide">
      <i id="save-btn-icon" class="fa fa-save"></i> Save
    </div>
  </div>

  <script>
    var upload_post_url = '{% url 'upload_post' %}';
    {% if user.is_authenticated %}
      var user_is_authenicated = true;
    {% else %}
      var user_is_authenicated = false;
    {% endif %}
  </script>
  <script src="{{ STATIC_URL }}js/filepicker.js"></script>


</section>
