view gpp/templates/shoutbox/shoutbox.html @ 507:8631d32e6b16

Some users are still having problems with the pop-up login. I think they are actually getting 403s because of the CSRF protection. So I have modified the base template to always have a javascript variable called csrf_token available when they aren't logged in. The ajax_login.js script was then modified to send this value with the ajax post. Fingers crossed.
author Brian Neal <bgneal@gmail.com>
date Sun, 04 Dec 2011 03:05:21 +0000
parents 88b2b9cb8c1f
children
line wrap: on
line source
{% extends 'side_block.html' %}
{% load url from future %}
{% load core_tags %}
{% block block_title %}Shoutbox{% endblock %}
{% block block_content %}
<div id="shoutbox-shout-container">
   {% for shout in shouts reversed %}
      <p>
      <span class="shoutbox-user">{{ shout.user.username }}:</span>
      <span class="shoutbox-shout">{{ shout.html|safe }}</span><br />
      <span class="shoutbox-date">{{ shout.shout_date|elapsed }}</span>
      </p>
   {% endfor %}
</div>
<center>
   <button type="button" id="shoutbox-prev" title="Previous">&laquo;</button>
   <a href="{% url 'shoutbox-history' %}">Shout History</a>
   <button type="button" id="shoutbox-next" title="Next">&raquo;</button>
</center>
{% if user.is_authenticated %}
<center>
<div>
   <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" />
</div>
<div id="shoutbox-smiley-frame" style="display:none;">
<img id="shoutbox-busy-icon" src="{{ STATIC_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 %}