{% extends subsite.theme %}
{% load comments %}

{% block content %}

<div id="idea">
    {% include "brainstorm/idea_vote.html" %}
</div>

{% get_comment_list for idea as comments %}
<a name="comments"></a>
<div id="comments">
<h3>{{ comments|length }} Comments</h3>
<ol>
    {% for comment in comments %}
    <a name="c{{comment.id}}"><li></a>
        <div class="commentMeta">
        <span class="commentMetaAuthor">
            {% if comment.user_url %}<a href="{{comment.user_url}}">{% endif %}
                {{comment.user_name}}
            {% if comment.user_url %}</a>{% endif %}
            </span>
            <span class="commentMetaDate">{{comment.submit_date|date:"m/d P"}}</span>
        </div>
        <div class="commentContent">
            <p>{{comment.comment|urlize}}</p>
        </div>
    </li>
    {% endfor %}
</ol>

<form method="post" action="{% url submit_idea_comment %}">
    <input name="idea_id" type="hidden" value="{{idea.id}}" />
    <p>
        <label for="name">Name</label>
        <input id="name" class="text" type="text" name="name" size="50"/>
    </p>
    <p>
        <label for="email">Email</label>
        <input id="email" class="text" type="text" name="email" size="50"/>
    </p>
    <p>
        <label for="url">URL</label>
        <input id="url" class="text" type="text" name="url" size="50"/>
    </p>
    <p id="commentForm">
        <label for="comment">Comment</label>
        <textarea class="textarea" name="comment" cols="48" rows="12"></textarea>
    </p>
    <button class="btnSubmit" type="submit">Submit</button>
</form>
</div>

{% endblock content %}
