view gpp/templates/bio/edit_elsewhere.html @ 265:1ba2c6bf6eb7

Closing #98. Animated GIFs were losing their transparency and animated properties when saved as avatars. Reworked the avatar save process to only run the avatar through PIL if it is too big. This preserves the original uploaded file if it is within the desired size settings. This may still mangle big animated gifs. If this becomes a problem, then maybe look into calling the PIL Image.resize() method directly. Moved the PIL image specific functions from bio.forms to a new module: core.image for better reusability in the future.
author Brian Neal <bgneal@gmail.com>
date Fri, 24 Sep 2010 02:12:09 +0000
parents 6a5549c2efb5
children daa2916f5b34
line wrap: on
line source
{% extends 'bio/base.html' %}
{% block title %}Edit Your Elsewhere Links{% endblock %}
{% block content %}
<h2>Edit Your Elsewhere Links</h2>
<h3>Social Networks</h3>
{% if request.user.social_network_profiles.all %}
    <ul>
    {% for profile in request.user.social_network_profiles.all %}
        <li>
        <img src="{{ MEDIA_URL }}elsewhere/{{ profile.icon_name }}" alt="{{ profile.name }}" />
            <a href="{{ profile.url }}" rel="me">{{ profile.name }}</a>
            <form id="delete-network-{{ profile.id }}" method="post" action=".">{% csrf_token %}
                <input type="hidden" name="delete_id" value="{{ profile.id }}" />
                <input type="submit" name="delete-sn-form" value="Delete" class="button" />
            </form>
        </li>
    {% endfor %}
    </ul>
{% else %}
    <p>No social network profiles.</p>
{% endif %}

<form method="post" action=".">{% csrf_token %}
<fieldset>
<legend>Add a Social Network</legend>
    {{ sn_form.as_p }}
    <p>For MySpace, you must enter your 
    <a href="http://faq.myspace.com/app/answers/detail/a_id/278" target="_blank">Myspace Friend ID</a>
    in the <i>Username</i> box.</p>
    <p><input type="submit" name="sn-form" value="Add Social Network" class="button" /></p>
</fieldset>
</form>
<hr />
<h3>Instant Messengers</h3>
{% if request.user.instant_messenger_profiles.all %}
    <ul>
    {% for profile in request.user.instant_messenger_profiles.all %}
        <li>
        <img src="{{ MEDIA_URL }}elsewhere/{{ profile.icon_name }}" alt="{{ profile.name }}" />
            {{ profile.name }}: <a href="{{ profile.url }}">{{ profile.username }}</a>
            <form id="delete-messenger-{{ profile.id }}" method="post" action=".">{% csrf_token %}
                <input type="hidden" name="delete_id" value="{{ profile.id }}" />
                <input type="submit" name="delete-im-form" value="Delete" class="button" />
            </form>
        </li>
    {% endfor %}
    </ul>
{% else %}
    <p>No instant messenger profiles.</p>
{% endif %}

<form method="post" action=".">{% csrf_token %}
<fieldset>
<legend>Add an Instant Messenger</legend>
    {{ im_form.as_p }}
    <p><input type="submit" name="im-form" value="Add Instant Messenger" class="button" /></p>
</fieldset>
</form>
<hr />
<h3>Websites</h3>
{% if request.user.website_profiles.all %}
    <ul>
    {% for profile in request.user.website_profiles.all %}
        <li>
           <img src="{{ MEDIA_URL }}icons/world.png" alt="{{ profile.name }}" />
            <a href="{{ profile.url }}" rel="me">{{ profile.name }}</a>
            <form id="delete-website-{{ profile.id }}" method="post" action=".">{% csrf_token %}
                <input type="hidden" name="delete_id" value="{{ profile.id }}" />
                <input type="submit" name="delete-w-form" value="Delete" class="button" />
            </form>
        </li>
    {% endfor %}
    </ul>
{% else %}
    <p>No website profiles.</p>
{% endif %}

<form method="post" action=".">{% csrf_token %}
<fieldset>
<legend>Add a Website</legend>
    {{ w_form.as_p }}
    <p><input type="submit" name="w-form" value="Add Website" class="button" /></p>
</fieldset>
</form>
<hr />
<p><a href="{% url bio-edit_profile %}">Back to Your Profile</a></p>
{% endblock %}