annotate gpp/templates/bio/edit_elsewhere.html @ 505:a5d11471d031

Refactor the logic in the rate limiter decorator. Check to see if the request was ajax, as the ajax view always returns 200. Have to decode the JSON response to see if an error occurred or not.
author Brian Neal <bgneal@gmail.com>
date Sat, 03 Dec 2011 19:13:38 +0000
parents c99d8981068b
children
rev   line source
bgneal@29 1 {% extends 'bio/base.html' %}
bgneal@310 2 {% load url from future %}
bgneal@29 3 {% block title %}Edit Your Elsewhere Links{% endblock %}
bgneal@29 4 {% block content %}
bgneal@29 5 <h2>Edit Your Elsewhere Links</h2>
bgneal@29 6 <h3>Social Networks</h3>
bgneal@29 7 {% if request.user.social_network_profiles.all %}
bgneal@29 8 <ul>
bgneal@29 9 {% for profile in request.user.social_network_profiles.all %}
bgneal@29 10 <li>
bgneal@312 11 <img src="{{ STATIC_URL }}elsewhere/{{ profile.icon_name }}" alt="{{ profile.name }}" />
bgneal@29 12 <a href="{{ profile.url }}" rel="me">{{ profile.name }}</a>
bgneal@194 13 <form id="delete-network-{{ profile.id }}" method="post" action=".">{% csrf_token %}
bgneal@29 14 <input type="hidden" name="delete_id" value="{{ profile.id }}" />
bgneal@29 15 <input type="submit" name="delete-sn-form" value="Delete" class="button" />
bgneal@29 16 </form>
bgneal@29 17 </li>
bgneal@29 18 {% endfor %}
bgneal@29 19 </ul>
bgneal@29 20 {% else %}
bgneal@29 21 <p>No social network profiles.</p>
bgneal@29 22 {% endif %}
bgneal@29 23
bgneal@194 24 <form method="post" action=".">{% csrf_token %}
bgneal@137 25 <fieldset>
bgneal@137 26 <legend>Add a Social Network</legend>
bgneal@29 27 {{ sn_form.as_p }}
bgneal@405 28 <p>
bgneal@405 29 For Facebook, you must enter your profile ID in the <em>Username</em> box. Visit your
bgneal@405 30 Facebook profile. Look at your browser's URL (address) bar. If you see a link of the form
bgneal@405 31 http://www.facebook.com/profile.php?id=<strong>1234567890</strong>, you want that number after the
bgneal@405 32 <strong>id=</strong> part. If you don't see a link like that, hover your mouse over your
bgneal@405 33 profile picture, and a link of the above form should appear in your browser's status bar
bgneal@405 34 (usually at the bottom). You can right-click on your photo and choose "copy link address"
bgneal@405 35 (the exact message will vary by browser) to copy the link. Then paste into the
bgneal@405 36 <em>Username</em> box, then delete everything but the long number.
bgneal@405 37 </p>
bgneal@29 38 <p><input type="submit" name="sn-form" value="Add Social Network" class="button" /></p>
bgneal@137 39 </fieldset>
bgneal@29 40 </form>
bgneal@29 41 <hr />
bgneal@29 42 <h3>Instant Messengers</h3>
bgneal@29 43 {% if request.user.instant_messenger_profiles.all %}
bgneal@29 44 <ul>
bgneal@29 45 {% for profile in request.user.instant_messenger_profiles.all %}
bgneal@29 46 <li>
bgneal@312 47 <img src="{{ STATIC_URL }}elsewhere/{{ profile.icon_name }}" alt="{{ profile.name }}" />
bgneal@29 48 {{ profile.name }}: <a href="{{ profile.url }}">{{ profile.username }}</a>
bgneal@194 49 <form id="delete-messenger-{{ profile.id }}" method="post" action=".">{% csrf_token %}
bgneal@29 50 <input type="hidden" name="delete_id" value="{{ profile.id }}" />
bgneal@29 51 <input type="submit" name="delete-im-form" value="Delete" class="button" />
bgneal@29 52 </form>
bgneal@29 53 </li>
bgneal@29 54 {% endfor %}
bgneal@29 55 </ul>
bgneal@29 56 {% else %}
bgneal@29 57 <p>No instant messenger profiles.</p>
bgneal@29 58 {% endif %}
bgneal@29 59
bgneal@194 60 <form method="post" action=".">{% csrf_token %}
bgneal@137 61 <fieldset>
bgneal@137 62 <legend>Add an Instant Messenger</legend>
bgneal@29 63 {{ im_form.as_p }}
bgneal@29 64 <p><input type="submit" name="im-form" value="Add Instant Messenger" class="button" /></p>
bgneal@137 65 </fieldset>
bgneal@29 66 </form>
bgneal@29 67 <hr />
bgneal@29 68 <h3>Websites</h3>
bgneal@29 69 {% if request.user.website_profiles.all %}
bgneal@29 70 <ul>
bgneal@29 71 {% for profile in request.user.website_profiles.all %}
bgneal@29 72 <li>
bgneal@312 73 <img src="{{ STATIC_URL }}icons/world.png" alt="{{ profile.name }}" />
bgneal@29 74 <a href="{{ profile.url }}" rel="me">{{ profile.name }}</a>
bgneal@194 75 <form id="delete-website-{{ profile.id }}" method="post" action=".">{% csrf_token %}
bgneal@29 76 <input type="hidden" name="delete_id" value="{{ profile.id }}" />
bgneal@29 77 <input type="submit" name="delete-w-form" value="Delete" class="button" />
bgneal@29 78 </form>
bgneal@29 79 </li>
bgneal@29 80 {% endfor %}
bgneal@29 81 </ul>
bgneal@29 82 {% else %}
bgneal@29 83 <p>No website profiles.</p>
bgneal@29 84 {% endif %}
bgneal@29 85
bgneal@194 86 <form method="post" action=".">{% csrf_token %}
bgneal@137 87 <fieldset>
bgneal@137 88 <legend>Add a Website</legend>
bgneal@29 89 {{ w_form.as_p }}
bgneal@29 90 <p><input type="submit" name="w-form" value="Add Website" class="button" /></p>
bgneal@137 91 </fieldset>
bgneal@29 92 </form>
bgneal@29 93 <hr />
bgneal@310 94 <p><a href="{% url 'bio-edit_profile' %}">Back to Your Profile</a></p>
bgneal@29 95 {% endblock %}