Skip to content

Commit

Permalink
Merge pull request #363 from CTPUG/feature/put-section-around-profile
Browse files Browse the repository at this point in the history
Add section tags around user profiles for more consistent HTML structure.
  • Loading branch information
hodgestar committed Aug 2, 2017
2 parents 6a07234 + f71cb63 commit 47ae432
Showing 1 changed file with 142 additions and 140 deletions.
282 changes: 142 additions & 140 deletions wafer/users/templates/wafer.users/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,147 +2,149 @@
{% load i18n %}
{% block title %}{{ object.userprofile.display_name }} - {{ WAFER_CONFERENCE_NAME }}{% endblock %}
{% block content %}
{% with profile=object.userprofile %}
<div class="row">
<div class="col-md-2" id="profile-avatar">
{% with profile.avatar_url as avatar_url %}
{% if avatar_url != None %}
<img src="{{ profile.avatar_url }}">
{% endif %}
{% endwith %}
{% if can_edit %}
<a class="btn btn-secondary btn-sm" href="#" rel="popover" data-toggle="popover"
data-title="{% trans 'Changing your mugshot' %}" data-html="true"
data-placement="bottom">{% trans 'Edit Mugshot' %}</a>
<div class="popover-contents">
{% blocktrans %}
Pictures provided by <a href="https://www.libravatar.org/">libravatar</a>
(which falls back to <a href="https://secure.gravatar.com/">Gravatar</a>).<br>
Change your picture there.
{% endblocktrans %}
</div>
{% endif %}
</div>
<div class="col-md-10">
{% if can_edit %}
<ul class="float-right btn-group btn-group-vertical profile-links">
<li><a href="{% url 'wafer_user_edit' object.username %}" class="btn btn-secondary">{% trans 'Edit User' %}</a></li>
<li><a href="{% url 'wafer_user_edit_profile' object.username %}" class="btn btn-secondary">{% trans 'Edit Profile' %}</a></li>
{% if WAFER_REGISTRATION_OPEN %}
{% if WAFER_REGISTRATION_MODE == 'form' %}
{% url 'wafer_register_view' object.username as register_url %}
{% elif WAFER_REGISTRATION_MODE == 'ticket' and not profile.is_registered %}
{% url 'wafer_ticket_claim' as register_url %}
{% endif %}
{% if register_url %}
<li><a href="{{ register_url }}" class="btn btn-secondary">{% trans 'Register' %}</a></li>
{% endif %}
{% endif %}
<li><a href="{% url 'wafer_talk_submit' %}" class="btn btn-secondary">{% trans 'Submit Talk Proposal' %}</a></li>
</ul>
{% endif %}
{% spaceless %}
<h1>
{% if profile.homepage %}
<a href="{{ profile.homepage_url }}">
{% endif %}
{{ profile.display_name }}
{% if profile.homepage %}
</a>
{% endif %}
</h1>
{% if profile.twitter_handle %}
<p>
<a href="https://twitter.com/{{ profile.twitter_handle }}" class="twitter-follow-button" data-show-count="false">
{% blocktrans with handle=profile.twitter_handle %}Follow @{{ handle }}{% endblocktrans %}
</a>
</p>
{% endif %}
{% if profile.github_username %}
<p>
<a href="https://github.com/{{ profile.github_username }}">
{% blocktrans with username=profile.github_username %}GitHub: {{ username }}{% endblocktrans %}
</a>
</p>
{% endif %}
{% endspaceless %}
</div>
</div>
{% if profile.bio %}
<div class="well">
{{ profile.bio|linebreaks }}
</div>
{% endif %}
{% if can_edit %}
{% if profile.pending_talks.exists or profile.accepted_talks.exists or profile.provisional_talks.exists%}
{% if profile.is_registered %}
<div class="alert alert-success">
{% blocktrans %}
Registered
{% endblocktrans %}
</div>
{% else %}
<div class="alert alert-danger">
{% blocktrans %}
<strong>WARNING:</strong>
Talk proposal submitted, but not registered.
{% endblocktrans %}
{% if WAFER_REGISTRATION_OPEN %}
{% trans "Register now!" %}
{% endif %}
</div>
{% endif %}
{% endif %}
{% endif %}
{# Accepted talks are globally visible #}
{% if profile.accepted_talks.exists %}
<h2>{% trans 'Accepted Talks:' %}</h2>
{% for talk in profile.accepted_talks %}
<div class="well">
<a href="{{ talk.get_absolute_url }}">{{ talk.title }}</a>
<p>{{ talk.abstract.rendered|safe }}</p>
</div>
{% endfor %}
{% endif %}
{% if profile.cancelled_talks.exists %}
<h2>{% trans 'Cancelled Talks:' %}</h2>
{% for talk in profile.cancelled_talks %}
<div class="well">
<a href="{{ talk.get_absolute_url }}">{{ talk.title }}</a>
<p>{{ talk.abstract.rendered|safe }}</p>
</div>
{% endfor %}
{% endif %}
{% if profile.provisional_talks.exists %}
<h2>{% trans 'Provisionally Accepted Talks:' %}</h2>
{% for talk in profile.provisional_talks %}
<div class="well">
<a href="{{ talk.get_absolute_url }}">{{ talk.title }}</a>
<p>{{ talk.abstract.rendered|safe }}</p>
</div>
{% endfor %}
{% endif %}
<section class="wafer wafer-profile">
{% with profile=object.userprofile %}
<div class="row">
<div class="col-md-2" id="profile-avatar">
{% with profile.avatar_url as avatar_url %}
{% if avatar_url != None %}
<img src="{{ profile.avatar_url }}">
{% endif %}
{% endwith %}
{% if can_edit %}
<a class="btn btn-secondary btn-sm" href="#" rel="popover" data-toggle="popover"
data-title="{% trans 'Changing your mugshot' %}" data-html="true"
data-placement="bottom">{% trans 'Edit Mugshot' %}</a>
<div class="popover-contents">
{% blocktrans %}
Pictures provided by <a href="https://www.libravatar.org/">libravatar</a>
(which falls back to <a href="https://secure.gravatar.com/">Gravatar</a>).<br>
Change your picture there.
{% endblocktrans %}
</div>
{% endif %}
</div>
<div class="col-md-10">
{% if can_edit %}
<ul class="float-right btn-group btn-group-vertical profile-links">
<li><a href="{% url 'wafer_user_edit' object.username %}" class="btn btn-secondary">{% trans 'Edit User' %}</a></li>
<li><a href="{% url 'wafer_user_edit_profile' object.username %}" class="btn btn-secondary">{% trans 'Edit Profile' %}</a></li>
{% if WAFER_REGISTRATION_OPEN %}
{% if WAFER_REGISTRATION_MODE == 'form' %}
{% url 'wafer_register_view' object.username as register_url %}
{% elif WAFER_REGISTRATION_MODE == 'ticket' and not profile.is_registered %}
{% url 'wafer_ticket_claim' as register_url %}
{% endif %}
{% if register_url %}
<li><a href="{{ register_url }}" class="btn btn-secondary">{% trans 'Register' %}</a></li>
{% endif %}
{% endif %}
<li><a href="{% url 'wafer_talk_submit' %}" class="btn btn-secondary">{% trans 'Submit Talk Proposal' %}</a></li>
</ul>
{% endif %}
{% spaceless %}
<h1>
{% if profile.homepage %}
<a href="{{ profile.homepage_url }}">
{% endif %}
{{ profile.display_name }}
{% if profile.homepage %}
</a>
{% endif %}
</h1>
{% if profile.twitter_handle %}
<p>
<a href="https://twitter.com/{{ profile.twitter_handle }}" class="twitter-follow-button" data-show-count="false">
{% blocktrans with handle=profile.twitter_handle %}Follow @{{ handle }}{% endblocktrans %}
</a>
</p>
{% endif %}
{% if profile.github_username %}
<p>
<a href="https://github.com/{{ profile.github_username }}">
{% blocktrans with username=profile.github_username %}GitHub: {{ username }}{% endblocktrans %}
</a>
</p>
{% endif %}
{% endspaceless %}
</div>
</div>
{% if profile.bio %}
<div class="well">
{{ profile.bio|linebreaks }}
</div>
{% endif %}
{% if can_edit %}
{% if profile.pending_talks.exists or profile.accepted_talks.exists or profile.provisional_talks.exists%}
{% if profile.is_registered %}
<div class="alert alert-success">
{% blocktrans %}
Registered
{% endblocktrans %}
</div>
{% else %}
<div class="alert alert-danger">
{% blocktrans %}
<strong>WARNING:</strong>
Talk proposal submitted, but not registered.
{% endblocktrans %}
{% if WAFER_REGISTRATION_OPEN %}
{% trans "Register now!" %}
{% endif %}
</div>
{% endif %}
{% endif %}
{% endif %}
{# Accepted talks are globally visible #}
{% if profile.accepted_talks.exists %}
<h2>{% trans 'Accepted Talks:' %}</h2>
{% for talk in profile.accepted_talks %}
<div class="well">
<a href="{{ talk.get_absolute_url }}">{{ talk.title }}</a>
<p>{{ talk.abstract.rendered|safe }}</p>
</div>
{% endfor %}
{% endif %}
{% if profile.cancelled_talks.exists %}
<h2>{% trans 'Cancelled Talks:' %}</h2>
{% for talk in profile.cancelled_talks %}
<div class="well">
<a href="{{ talk.get_absolute_url }}">{{ talk.title }}</a>
<p>{{ talk.abstract.rendered|safe }}</p>
</div>
{% endfor %}
{% endif %}
{% if profile.provisional_talks.exists %}
<h2>{% trans 'Provisionally Accepted Talks:' %}</h2>
{% for talk in profile.provisional_talks %}
<div class="well">
<a href="{{ talk.get_absolute_url }}">{{ talk.title }}</a>
<p>{{ talk.abstract.rendered|safe }}</p>
</div>
{% endfor %}
{% endif %}

{# Submitted talk proposals are only visible to the owner #}
{% if can_edit %}
{% if profile.pending_talks.exists %}
<h2>{% trans 'Submitted or Under Consideration Talks:' %}</h2>
{% for talk in profile.pending_talks %}
<div class="well">
<a href="{{ talk.get_absolute_url }}">{{ talk.title }}</a>
{% comment %}
Because this is one of the author's pending talks, we don't need to
check for edit permission's on the talk explictly. This doesn't show
the edit button for people with 'change-talk' permissions, but we
accept that tradeoff for simplicity here.
{% endcomment %}
<a href="{% url 'wafer_talk_edit' talk.pk %}" class="float-right btn btn-secondary btn-lg">{% trans 'Edit' %}</a>
<p>{{ talk.abstract.rendered|safe }}</p>
</div>
{% endfor %}
{% endif %}
{% endif %}
{% endwith %}
{# Submitted talk proposals are only visible to the owner #}
{% if can_edit %}
{% if profile.pending_talks.exists %}
<h2>{% trans 'Submitted or Under Consideration Talks:' %}</h2>
{% for talk in profile.pending_talks %}
<div class="well">
<a href="{{ talk.get_absolute_url }}">{{ talk.title }}</a>
{% comment %}
Because this is one of the author's pending talks, we don't need to
check for edit permission's on the talk explictly. This doesn't show
the edit button for people with 'change-talk' permissions, but we
accept that tradeoff for simplicity here.
{% endcomment %}
<a href="{% url 'wafer_talk_edit' talk.pk %}" class="float-right btn btn-secondary btn-lg">{% trans 'Edit' %}</a>
<p>{{ talk.abstract.rendered|safe }}</p>
</div>
{% endfor %}
{% endif %}
{% endif %}
{% endwith %}
</section>
{% endblock %}
{% block extra_foot %}
<script type="text/javascript">
Expand Down

0 comments on commit 47ae432

Please sign in to comment.