Commit ed03bd4e authored by Jean Michel Rouly's avatar Jean Michel Rouly Committed by Chris Reffett
Browse files

Bootstrapped index page.

parent 4542ea40
......@@ -7,52 +7,109 @@ Go - A URL Shortener
{% block content %}
<h3>~Shorten URL~</h3>
{% for error in form.non_field_errors %}
<p class="error">{{ error }}</p>
{% 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 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>
<input type="submit" value="Shorten" />
<br/><br/>
{% 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>
</form>
<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 %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment