view templates/profile/user.djhtml @ 130:5ab229c9d348

Add back ability to edit account settings * Account/profile editing is now done with a ModelForm, instead of processing the data manually. Help text and verbose names have been moved to the Profile model and to the UserForm (in the latter case, it's because we can't edit the User model directly). * The profile page now shows pygments style information and sections of the profile that are not filled are now hidden. * Some parts of apps/profiles/views.py have been rewritten (the getprofile() method has been removed, as it's no longer necessary, and the editprofile() view was rewritten in accordance with the switch to using ModelForms). * The styling for forms has been modified slightly.
author dellsystem <ilostwaldo@gmail.com>
date Sat, 22 Sep 2012 11:18:23 -0400
parents 0fd8fb20033e
children 9294cf4097d8
line wrap: on
line source

{% extends "base.djhtml" %}

{% block breadcrumbs %}
Viewing profile: {{ profile.user }}
{% endblock %}


{% block content %}

<h1>{{ profile.user }}'s profile</h1>

<dl>
    {% if profile.user.first_name or profile.user.last_name %}
    <dt>Name:</dt>
    <dd>{{ name|default:"N/A" }}</dd>
    {% endif %}

    <dt>Preferred license:</dt>
    <dd>{{ profile.preferred_license }}</dd>

    <dt>Syntax highlighting style:</dt>
    <dd>{{ profile.pygments_style }}</dd>
</dl>

{% if profile.interests %}
<h2>Interests</h2>

<p>{{ profile.interests }}</p>
{% endif %}

{% if profile.blurb %}
<h2>About {{ name }}</h2>

<p>{{ profile.blurb }}</p>
{% endif %}
{% endblock %}

{% block content-related %}
{% if bundles or snippets %}
<div id="info">
  <h3>
    Contributions by {{name}}
  </h3>
  <div class="whitebox">
    {% if bundles %}
    <h5>
      Bundles
    </h5>
    <ul>
      {% for b in bundles %}
      <li>
        <a href="{% url agora.apps.bundle.views.detail profile.user b %}">
          {{b.name}}
        </a>
      </li>
      {% endfor %}
    </ul>
    {% endif %}
    {% if snippets %}
    <h5>
      Snippets
    </h5>
    <ul>
      {% for s in snippets %}
      <li><a href="{% url snippet_details s %}">
          {% if s.title %}
          {{s.title}}
          {% else %}
          Snippet #{{s.pk}}
          {% endif %}
      </a></li>
      {% endfor %}
    </ul>
    {% endif %}
  </div>
</div>
{% endif %}
{% endblock content-related %}