Skip to content

Organizations: allow uploading avatar #614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
{% block organization_header_title %}
<div class="eight wide computer eight wide tablet sixteen wide mobile middle aligned column">
<img class="ui micro rounded right spaced inline image"
src="{% gravatar_url organization.email 48 %}"
src="{{ organization.get_avatar_url }}"
height="48"
width="48"
Comment on lines +32 to +33
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need either attribute here? The CSS classes should control dimensions on this, the 48 pixels on the gravatar tag was mostly to reduce the response size I think.

alt="{% blocktrans trimmed with organization_name=organization.name %}{{ organization_name }} organization{% endblocktrans %}" />
<a class="ui medium text" href="{{ organization.get_absolute_url }}">
{{ organization.name }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{% extends "includes/crud/table_list.html" %}

{% load i18n %}
{% load humanize %}
{% load gravatar %}

{% load organizations %}
{% load privacy_tags %}
{% load trans blocktrans from i18n %}
{% load has_sso_enabled from organizations %}
{% load is_admin from privacy_tags %}

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

{% block list_placeholder_icon_class %}fad fa-building icon{% endblock %}
{% block list_placeholder_icon_class %}
fad fa-building icon
{% endblock list_placeholder_icon_class %}
{% block list_placeholder_header_filtered %}
{% trans "No matching organizations found" %}
{% endblock list_placeholder_header_filtered %}
Expand Down Expand Up @@ -66,7 +65,11 @@
{% endblock list_item_right_buttons %}

{% block list_item_image %}
<img class="ui image" src="{% gravatar_url object.email 48 %}" />
<img class="ui image"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might want the same micro rounded classes here:

Suggested change
<img class="ui image"
<img class="ui micro rounded image"

I'd check the social account listing template and maybe try what is there too.

src="{{ object.get_avatar_url }}"
height="48"
width="48"
Comment on lines +70 to +71
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here on attributes, you might be able to remove this with CSS classes added above

alt="{% blocktrans trimmed with organization_name=object.name %}{{ organization_name }} organization{% endblocktrans %}" />
{% endblock list_item_image %}

{% block list_item_header %}
Expand All @@ -81,8 +84,7 @@
{% include "includes/components/config_label.html" with icon="fad fa-user-check" text=text popup=popup %}
{% endif %}
</a>
<div class="sub header">
</div>
<div class="sub header"></div>
{% endblock list_item_header %}

{% block list_item_meta %}
Expand All @@ -95,7 +97,8 @@
{% endblocktrans %}
</a>
{% if not object|has_sso_enabled:"allauth" %}
<a class="item" href="{% url "organization_team_list" slug=object.slug %}">
<a class="item"
href="{% url "organization_team_list" slug=object.slug %}">
{% blocktrans trimmed with team_count=object.teams.count %}
{{ team_count }} teams
{% endblocktrans %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
{% endblock organization_edit_content_header %}

{% block organization_edit_content %}
<form class="ui form" method="post" action=".">
<form class="ui form"
method="post"
enctype="multipart/form-data"
action=".">
{% csrf_token %}
{{ form|crispy }}
<input class="ui primary button" type="submit" value="{% trans "Save" %}" />
Expand Down