-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #440 from CTPUG/customize-profile
Hooks for customizing profile pages + styling improvements
- Loading branch information
Showing
7 changed files
with
215 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
wafer/users/templates/wafer.users/snippets/profile_10-preamble.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{# Override this with anything you want to insert at the top of the page #} |
65 changes: 65 additions & 0 deletions
65
wafer/users/templates/wafer.users/snippets/profile_20-bio.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{% load i18n %} | ||
{% with profile=object.userprofile %} | ||
<section class="wafer-profile-bio"> | ||
<div class="row"> | ||
<div class="col-md-2" id="profile-avatar"> | ||
{% block mugshot %} | ||
{% 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-bs-toggle="popover" | ||
data-bs-title="{% trans 'Changing your mugshot' %}" data-bs-html="true" | ||
data-bs-placement="bottom">{% trans 'Edit Mugshot' %}</a> | ||
<div class="popover-contents"> | ||
{% blocktrans trimmed %} | ||
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 %} | ||
{% endblock mugshot %} | ||
</div> | ||
<div class="col-md-10"> | ||
{% include "wafer.users/snippets/profile_25-menu.html" %} | ||
{% spaceless %} | ||
{% block name %} | ||
<h1> | ||
{% if profile.homepage %} | ||
<a href="{{ profile.homepage_url }}"> | ||
{% endif %} | ||
{{ profile.display_name }} | ||
{% if profile.homepage %} | ||
</a> | ||
{% endif %} | ||
</h1> | ||
{% endblock name %} | ||
{% block social %} | ||
{% if profile.twitter_handle %} | ||
<p> | ||
<a href="https://twitter.com/{{ profile.twitter_handle }}" class="twitter-follow-button" data-bs-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 %} | ||
{% endblock social %} | ||
{% endspaceless %} | ||
</div> | ||
</div> | ||
{% if profile.bio %} | ||
<div class="bio"> | ||
{{ profile.bio|linebreaks }} | ||
</div> | ||
{% endif %} | ||
</section> | ||
{% endwith %} |
25 changes: 25 additions & 0 deletions
25
wafer/users/templates/wafer.users/snippets/profile_25-menu.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% load i18n %} | ||
{% with profile=object.userprofile %} | ||
{% block side_menu %} | ||
{% if can_edit %} | ||
<ul class="float-end btn-group btn-group-vertical profile-links"> | ||
<li><a href="{% url 'wafer_user_edit' object.username %}" class="btn btn-secondary">{% trans 'Edit Account' %}</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 == 'ticket' and not profile.is_registered %} | ||
{% url 'wafer_ticket_claim' as register_url %} | ||
{% endif %} | ||
{% if WAFER_REGISTRATION_MODE == 'custom' %} | ||
{% url 'register' as register_url %} | ||
{% endif %} | ||
{% if register_url %} | ||
<li><a href="{{ register_url }}" class="btn btn-secondary">{% if profile.is_registered %}{% trans 'Update registration' context "conference" %}{% else %}{% trans 'Register' context "conference" %}{% endif %}</a></li> | ||
{% endif %} | ||
{% endif %} | ||
{% if WAFER_TALKS_OPEN %} | ||
<li><a href="{% url 'wafer_talk_submit' %}" class="btn btn-secondary">{% trans 'Submit Talk Proposal' %}</a></li> | ||
{% endif %} | ||
</ul> | ||
{% endif %} | ||
{% endblock side_menu %} | ||
{% endwith %} |
31 changes: 31 additions & 0 deletions
31
wafer/users/templates/wafer.users/snippets/profile_30-registered.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{% load i18n %} | ||
{% with profile=object.userprofile %} | ||
{% if can_edit %} | ||
{% if profile.pending_talks.exists or profile.accepted_talks.exists or profile.provisional_talks.exists%} | ||
{% block speaker_registered %} | ||
{% if profile.is_registered %} | ||
<div class="alert alert-success"> | ||
{% blocktrans trimmed %} | ||
Registered | ||
{% endblocktrans %} | ||
</div> | ||
{% else %} | ||
<div class="alert alert-danger"> | ||
{% blocktrans trimmed %} | ||
<strong>WARNING:</strong> | ||
Talk proposal submitted, but speaker hasn't registered to attend. | ||
{% endblocktrans %} | ||
{% if WAFER_REGISTRATION_OPEN %} | ||
{% trans "Register now!" %} | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
{% if WAFER_REGISTRATION_MODE == 'ticket' and profile.is_registered %} | ||
<p>Tickets: | ||
{{ profile.ticket_types }} | ||
</p> | ||
{% endif %} | ||
{% endblock speaker_registered %} | ||
{% endif %} | ||
{% endif %} | ||
{% endwith %} |
Oops, something went wrong.