Skip to content

Commit 3c08cd3

Browse files
committed
Organizations: allow uploading avatar
Matches readthedocs/readthedocs.org#12254
1 parent 1bc6150 commit 3c08cd3

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

readthedocsext/theme/templates/organizations/partials/header.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
{% block organization_header_title %}
2929
<div class="eight wide computer eight wide tablet sixteen wide mobile middle aligned column">
3030
<img class="ui micro rounded right spaced inline image"
31-
src="{% gravatar_url organization.email 48 %}"
31+
src="{{ organization.get_avatar_url }}"
32+
height="48"
33+
width="48"
3234
alt="{% blocktrans trimmed with organization_name=organization.name %}{{ organization_name }} organization{% endblocktrans %}" />
3335
<a class="ui medium text" href="{{ organization.get_absolute_url }}">
3436
{{ organization.name }}

readthedocsext/theme/templates/organizations/partials/organization_list.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
{% extends "includes/crud/table_list.html" %}
22

3-
{% load i18n %}
4-
{% load humanize %}
5-
{% load gravatar %}
6-
7-
{% load organizations %}
8-
{% load privacy_tags %}
3+
{% load trans blocktrans from i18n %}
4+
{% load has_sso_enabled from organizations %}
5+
{% load is_admin from privacy_tags %}
96

107
{% block top_left_menu_items %}
118
<div data-bind="using: FilterView()">
@@ -23,9 +20,11 @@
2320
{% url "organization_create" as create_url %}
2421
{% include "includes/crud/create_button.html" with url=create_url text=create_text %}
2522
{% endif %}
26-
{% endblock %}
23+
{% endblock create_button %}
2724

28-
{% block list_placeholder_icon_class %}fad fa-building icon{% endblock %}
25+
{% block list_placeholder_icon_class %}
26+
fad fa-building icon
27+
{% endblock list_placeholder_icon_class %}
2928
{% block list_placeholder_header_filtered %}
3029
{% trans "No matching organizations found" %}
3130
{% endblock list_placeholder_header_filtered %}
@@ -66,7 +65,11 @@
6665
{% endblock list_item_right_buttons %}
6766

6867
{% block list_item_image %}
69-
<img class="ui image" src="{% gravatar_url object.email 48 %}" />
68+
<img class="ui image"
69+
src="{{ object.get_avatar_url }}"
70+
height="48"
71+
width="48"
72+
alt="{% blocktrans trimmed with organization_name=object.name %}{{ organization_name }} organization{% endblocktrans %}" />
7073
{% endblock list_item_image %}
7174

7275
{% block list_item_header %}
@@ -81,8 +84,7 @@
8184
{% include "includes/components/config_label.html" with icon="fad fa-user-check" text=text popup=popup %}
8285
{% endif %}
8386
</a>
84-
<div class="sub header">
85-
</div>
87+
<div class="sub header"></div>
8688
{% endblock list_item_header %}
8789

8890
{% block list_item_meta %}
@@ -95,7 +97,8 @@
9597
{% endblocktrans %}
9698
</a>
9799
{% if not object|has_sso_enabled:"allauth" %}
98-
<a class="item" href="{% url "organization_team_list" slug=object.slug %}">
100+
<a class="item"
101+
href="{% url "organization_team_list" slug=object.slug %}">
99102
{% blocktrans trimmed with team_count=object.teams.count %}
100103
{{ team_count }} teams
101104
{% endblocktrans %}

readthedocsext/theme/templates/organizations/settings/organization_edit.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
{% endblock organization_edit_content_header %}
1616

1717
{% block organization_edit_content %}
18-
<form class="ui form" method="post" action=".">
18+
<form class="ui form"
19+
method="post"
20+
enctype="multipart/form-data"
21+
action=".">
1922
{% csrf_token %}
2023
{{ form|crispy }}
2124
<input class="ui primary button" type="submit" value="{% trans "Save" %}" />

0 commit comments

Comments
 (0)