Skip to content

Commit

Permalink
Improvements to the comment form.
Browse files Browse the repository at this point in the history
  • Loading branch information
harrislapiroff committed Mar 4, 2014
1 parent a75ab30 commit 47c320a
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions clickclick/templates/comments/clickclick/form.html
@@ -1,4 +1,4 @@
{% load comments %}
{% load comments gravatar %}
<form role="form" action="{% comment_form_target %}" method="post" class="margin-trailer">
{% csrf_token %}
{% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}
Expand All @@ -12,21 +12,33 @@
</div>
{% endif %}
{% endfor %}
<div class="row">
<div class="form-group col-md-6 {% if form.name.errors %}error{% endif %}">
<label for="{{ form.name.id_for_label }}" class="sr-only">{{ form.name.label }}</label>
<input class="form-control" type="text" id="{{ form.name.id_for_label }}" name="{{ form.name.name }}" placeholder="Name" maxlength=50 required />
</div>
<div class="form-group col-md-6 {% if form.email.errors %}error{% endif %}">
<label for="{{ form.email.id_for_label }}" class="sr-only">{{ form.email.label }}</label>
<input class="form-control" type="email" id="{{ form.email.id_for_label }}" name="{{ form.email.name }}" placeholder="Email" required />
{% if not user.is_authenticated %}
<div class="row">
<div class="form-group col-md-6 {% if form.name.errors %}error{% endif %}">
<label for="{{ form.name.id_for_label }}" class="sr-only">{{ form.name.label }}</label>
<input class="form-control" type="text" id="{{ form.name.id_for_label }}" name="{{ form.name.name }}" placeholder="Name" maxlength=50 required />
</div>
<div class="form-group col-md-6 {% if form.email.errors %}error{% endif %}">
<label for="{{ form.email.id_for_label }}" class="sr-only">{{ form.email.label }}</label>
<input class="form-control" type="email" id="{{ form.email.id_for_label }}" name="{{ form.email.name }}" placeholder="Email" required />
</div>
</div>
</div>
{% endif %}
<div class="form-group">
<textarea id="{{ form.comment.id_for_label }}" name="{{ form.comment.name }}" class="form-control" placeholder="Your comment here." required></textarea>
{% if user.is_authenticated %}
<div class="media">
<span class="pull-left">
<img src="{% gravatar_url user.email 80 "identicon" "pg" %}" width="40" height="40" />
</span>
<div class="media-body">
<textarea id="{{ form.comment.id_for_label }}" name="{{ form.comment.name }}" class="form-control" placeholder="Your comment here." required></textarea>
</div>
</div>
{% else %}
<textarea id="{{ form.comment.id_for_label }}" name="{{ form.comment.name }}" class="form-control" placeholder="Your comment here." required></textarea>
{% endif %}
</div>
{% if photo.photoset.comments_enabled == "MD" %}
<div class="text-muted margin-trailer"><small>Comments will be approved before being published.</small></div>
{% endif %}
<div class="text-muted margin-trailer"><small>{% if photo.photoset.comments_enabled == "MD" %}
Comments will be approved before being published.{% endif %} Your email address will not be shared.</small></div>
<button class="btn btn-primary btn-block">Add a Comment</button>
</form>

0 comments on commit 47c320a

Please sign in to comment.