index.html 2.88 KB
Newer Older
1 2 3 4
{% extends 'layouts/base.html' %}


{% block title %}
5
Go - A University Branded URL Shortener
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
{% endblock %}


{% block content %}

<div class="page-header" id="banner">
  <div class="row">
    <div class="col-md-12">

      <h1><strong>Shorten URL</strong></h1>

    </div>
  </div>
</div>

<div class="row">
  <div class="col-md-6">
    <div class="well">

      <form class="form-horizontal" method="post" action="{%url 'index'%}">
      {% csrf_token %}
        <fieldset>

          {% if form.non_field_errors %}
          <div class="form-group has-error">
            <div class="col-md-12">
            {% for error in form.non_field_errors %}
              <span class="help-block">{{ error }}</p>
            {% endfor %}
            </div>
          </div>
          {% endif %}

          {% if form.target.errors %}
          <div class="form-group has-error">
          {% else %}
          <div class="form-group">
          {% endif %}
            <div class="col-md-4">
              <label class="control-label" for="{{ form.target.id_for_label }}">
              {{ form.target.label }}</label>
            </div>

            <div class="col-md-8">
              {{ form.target }}

              {% for error in form.target.errors %}
              <span class="help-block">{{error}}</span>
              {% endfor %}
            </div>
          </div>

          {% if form.short.errors %}
          <div class="form-group has-error">
          {% else %}
          <div class="form-group">
          {% endif %}
            <div class="col-md-4">
              <label class="control-label" for="{{ form.short.id_for_label }}">
              {{ form.short.label }}</label>
            </div>

            <div class="col-md-8">
              {{ form.short }}

              {% for error in form.short.errors %}
              <span class="help-block">{{error}}</span>
              {% endfor %}
            </div>
          </div>

          {% if form.expires.errors %}
          <div class="form-group has-error">
          {% else %}
          <div class="form-group">
          {% endif %}
            <div class="col-md-4">
              <label class="control-label" for="{{ form.expires.id_for_label }}">
              {{ form.expires.label }}</label>
            </div>

            <div class="col-md-8">

              {% for option in form.expires %}
                <p>
                {{ option }}
                </p>
              {% endfor %}

              {% for error in form.expires.errors %}
              <span class="help-block">{{error}}</span>
              {% endfor %}
            </div>
          </div>

          <div class="form-group">
            <div class="col-md-12">
              <input type="submit" value="Shorten"
              class="btn btn-primary btn-lg btn-block" />
            </div>
          </div>

        </fieldset>
      </form>

    </div>
  </div>
</div>

{% endblock %}