-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add avatar templates, changing default from django-avatar to geonode-…
…base (#12842)
- Loading branch information
Showing
4 changed files
with
100 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{% extends "geonode_base.html" %} | ||
{% load i18n avatar_tags bootstrap_tags %} | ||
|
||
{% block body_outer %} | ||
<div class="page-header"> | ||
<h2>{% trans "Add Avatar" %}</h2> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h3>{% trans "Your current avatar: " %}</h3> | ||
{% avatar user %} | ||
{% if not avatars %} | ||
<p>{% trans "You haven't uploaded an avatar yet. Please upload one now." %}</p> | ||
{% endif %} | ||
<hr /> | ||
<h3>{% trans "Add new avatar" %}</h3> | ||
<form enctype="multipart/form-data" method="POST" action="{% url 'avatar:add' %}"> | ||
{{ upload_avatar_form|as_bootstrap_inline }} | ||
<p> | ||
{% csrf_token %} | ||
<input type="submit" class="btn btn-primary" value="{% trans "Upload New Image" %}" /> | ||
<a href="{% url 'profile_edit' user.username %}" class="btn btn-link"> {% trans "Go back to Edit Your Profile" %}</a> | ||
</p> | ||
</form> | ||
</div> | ||
</div> | ||
{% endblock %} |
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,42 @@ | ||
{% extends "geonode_base.html" %} | ||
{% load i18n avatar_tags bootstrap_tags %} | ||
|
||
{% block body_outer %} | ||
|
||
<div class="page-header"> | ||
<h2>{% trans "Change Avatar" %}</h2> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h3>{% trans "Your current avatar: " %}</h3> | ||
{% avatar user %} | ||
{% if not avatars %} | ||
<p>{% trans "You haven't uploaded an avatar yet. Please upload one now." %}</p> | ||
{% else %} | ||
<hr /> | ||
<h3>{% trans "Select default avatar"%}</h3> | ||
<form method="POST" action="{% url 'avatar:change' %}"> | ||
<ul> | ||
{{ primary_avatar_form|as_bootstrap_inline }} | ||
</ul> | ||
<p> | ||
{% csrf_token %} | ||
<input type="submit" class="btn btn-primary" value="{% trans 'Choose new Default' %}" /> | ||
<a href="{% url 'avatar:delete' %}" class="btn btn-danger"> {% trans "Delete avatar" %}</a> | ||
<a href="{% url 'profile_edit' user.username %}" class="btn btn-link"> {% trans "Go back to Edit Your Profile" %}</a> | ||
</p> | ||
</form> | ||
{% endif %} | ||
<hr /> | ||
<h3>{% trans "Add new avatar" %}</h3> | ||
<form enctype="multipart/form-data" method="POST" action="{% url 'avatar:add' %}"> | ||
{{ upload_avatar_form|as_bootstrap_inline }} | ||
<p> | ||
{% csrf_token %} | ||
<input type="submit" class="btn btn-primary" value="{% trans 'Upload New Image' %}" /> | ||
<a href="{% url 'profile_edit' user.username %}" class="btn btn-link"> {% trans "Go back to Edit Your Profile" %}</a> | ||
</p> | ||
</form> | ||
</div> | ||
</div> | ||
{% endblock %} |
26 changes: 26 additions & 0 deletions
26
geonode/people/templates/people/avatar/confirm_delete.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,26 @@ | ||
{% extends "geonode_base.html" %} | ||
{% load i18n bootstrap_tags %} | ||
|
||
{% block body_outer %} | ||
<div class="page-header"> | ||
<h2>{% trans "Delete Avatar" %}</h2> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
{% if not avatars %} | ||
{% url 'avatar_change' as avatar_change_url %} | ||
<p>{% blocktrans %}You have no avatars to delete. Please <a href="{{ avatar_change_url }}">upload one</a> now.{% endblocktrans %}</p> | ||
{% else %} | ||
<p>{% trans "Please select the avatars that you would like to delete." %}</p> | ||
<form method="POST" action="{% url 'avatar:delete' %}"> | ||
{{ delete_avatar_form|as_bootstrap_inline }} | ||
<p> | ||
{% csrf_token %} | ||
<input type="submit" class="btn btn-primary" value="{% trans 'Delete These' %}" /> | ||
<a href="{% url 'profile_edit' user.username %}" class="btn btn-link"> {% trans "Go back to Edit Your Profile" %}</a> | ||
</p> | ||
</form> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endblock %} |
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