view gpp/templates/shoutbox/shoutbox.html @ 150:b43e1288ff80

Fix #33; use $.ajax instead of $.post so we can handle errors. Also, for some reason comparing objects in a template doesn't work now. Have to compare id fields.
author Brian Neal <bgneal@gmail.com>
date Thu, 17 Dec 2009 04:14:16 +0000
parents 48621ba5c385
children e1d1a70d312d
line wrap: on
line source
{% extends 'side_block.html' %}
{% load smiley_tags %}
{% block block_title %}Shoutbox{% endblock %}
{% block block_content %}
<div id="shoutbox-shout-container">
   {% for shout in shouts %}
      <p>
      <span class="shoutbox-user">{{ shout.user.username }}:</span>
      <span class="shoutbox-shout">{{ shout.shout|smiley_html|urlizetrunc:15 }}</span>
      <span class="shoutbox-date">{{ shout.shout_date|date:"D M d Y H:i:s" }}</span>
      </p>
   {% endfor %}
</div>
<center><a href="{% url shoutbox-history page=1 %}">Shout History</a></center>
{% if user.is_authenticated %}
<center>
<form action="{% url shoutbox-shout %}" method="post">
   <input type="text" maxlength="2048" size="13" name="msg" value="" id="shoutbox-smiley-input" />
   <br />
   <input id="shoutbox-submit" type="submit" value="Shout" />
   <input id="shoutbox-smilies" type="button" value="Smilies" />
</form>
<div id="shoutbox-smiley-frame" style="display:none;">
<img id="shoutbox-busy-icon" src="{{ MEDIA_URL }}icons/ajax_busy.gif" alt="Please wait" />
</div>
</center>
{% else %}
<p>
Please <a href="{% url accounts-login %}">login</a> or
<a href="{% url accounts-register %}">register</a> to shout.
</p>
{% endif %}
{% endblock %}