index.html 1.14 KB
Newer Older
Jean Michel Rouly's avatar
Jean Michel Rouly committed
1 2 3 4 5 6 7 8 9
{% extends 'base.html' %}


{% block title %}
Go - A URL Shortener
{% endblock %}


{% block content %}
10 11 12
<h3>~Shorten URL~</h3>

{% for error in form.non_field_errors %}
13
  <p class="error">{{ error }}</p>
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
{% endfor %}

<form method="post" action="{%url 'index'%}">
{% csrf_token %}

  <label for="{{ form.target.id_for_label }}">{{ form.target.label }}</label>
  <br/>
  {% for error in form.target.errors %}
    <p class="error">{{error}}</p>
  {% empty %}
  <br />
  {% endfor %}
  {{ form.target }}
  <br/><br/>

  <label for="{{ form.short.id_for_label }}">{{ form.short.label }}</label>
  <br/>
  {% for error in form.short.errors %}
    <p class="error">{{error}}</p>
  {% empty %}
  <br />
  {% endfor %}
  {{ form.short }}
  <br/><br/>

  <div class="radio-container">
    <label for="{{ form.expires.id_for_label }}">{{ form.expires.label }}</label>
    <br/>
    {% for error in form.expires.errors %}
      <p class="error">{{error}}</p>
    {% empty %}
    <br/>
    {% endfor %}
    {% for option in form.expires %}
      {{ option }}
    {% endfor %}
    <br/><br/>
  </div>

  <input type="submit" value="Shorten" />
  <br/><br/>

</form>

Jean Michel Rouly's avatar
Jean Michel Rouly committed
58
{% endblock %}