Make pronouns visible on profile and miniprofile

This commit is contained in:
Celeste 2021-10-13 08:59:40 +02:00
parent 677a9da469
commit 4fbee9c3de
4 changed files with 27 additions and 15 deletions

View File

@ -5,20 +5,24 @@ from django.db import migrations, models
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [("core", "0035_auto_20200216_1743")]
('core', '0035_auto_20200216_1743'),
]
operations = [ operations = [
migrations.AddField( migrations.AddField(
model_name='user', model_name="user",
name='pronouns', name="pronouns",
field=models.CharField(default='', max_length=64, verbose_name='pronouns'), field=models.CharField(default="", max_length=64, verbose_name="pronouns"),
preserve_default=False, preserve_default=False,
), ),
migrations.AlterField( migrations.AlterField(
model_name='user', model_name="user",
name='sex', name="sex",
field=models.CharField(blank=True, choices=[('MAN', 'Man'), ('WOMAN', 'Woman'), ('OTHER', 'Other')], max_length=10, null=True, verbose_name='sex'), field=models.CharField(
blank=True,
choices=[("MAN", "Man"), ("WOMAN", "Woman"), ("OTHER", "Other")],
max_length=10,
null=True,
verbose_name="sex",
),
), ),
] ]

View File

@ -229,7 +229,7 @@ class User(AbstractBaseUser):
blank=True, blank=True,
choices=[("MAN", _("Man")), ("WOMAN", _("Woman")), ("OTHER", _("Other"))], choices=[("MAN", _("Man")), ("WOMAN", _("Woman")), ("OTHER", _("Other"))],
) )
pronouns = models.CharField(_("pronouns"), max_length=64, default='') pronouns = models.CharField(_("pronouns"), max_length=64, default="")
tshirt_size = models.CharField( tshirt_size = models.CharField(
_("tshirt size"), _("tshirt size"),
max_length=5, max_length=5,
@ -1492,9 +1492,7 @@ class OperationLog(models.Model):
User, related_name="logs", on_delete=models.SET_NULL, null=True User, related_name="logs", on_delete=models.SET_NULL, null=True
) )
operation_type = models.CharField( operation_type = models.CharField(
_("operation type"), _("operation type"), max_length=40, choices=settings.SITH_LOG_OPERATION_TYPE
max_length=40,
choices=settings.SITH_LOG_OPERATION_TYPE,
) )
def is_owned_by(self, user): def is_owned_by(self, user):

View File

@ -55,6 +55,9 @@
{% if user.nick_name %} {% if user.nick_name %}
<div class="user_mini_profile_nick">&laquo; {{ user.nick_name }} &raquo;</div> <div class="user_mini_profile_nick">&laquo; {{ user.nick_name }} &raquo;</div>
{% endif %} {% endif %}
{% if user.pronouns %}
<div class="user_mini_profile_pronouns">{{ user.pronouns }}</div>
{% endif %}
{% if user.date_of_birth %} {% if user.date_of_birth %}
<div class="user_mini_profile_dob"> <div class="user_mini_profile_dob">
{{ user.date_of_birth|date("d/m/Y") }} ({{ user.get_age() }}) {{ user.date_of_birth|date("d/m/Y") }} ({{ user.get_age() }})

View File

@ -15,6 +15,8 @@
<div id="user_profile_infos_nick">&laquo; {{ profile.nick_name }} &raquo;</div> <div id="user_profile_infos_nick">&laquo; {{ profile.nick_name }} &raquo;</div>
{% endif %} {% endif %}
{% if profile.quote %} {% if profile.quote %}
<div id="user_profile_infos_quote"> <div id="user_profile_infos_quote">
{{ profile.quote }} {{ profile.quote }}
@ -22,6 +24,12 @@
{% endif %} {% endif %}
<div id="user_profile_infos_items"> <div id="user_profile_infos_items">
{% if profile.pronouns %}
<div>
<span class="user_profile_infos_item"> </span>
<span class="user_profile_infos_item_value">{{ profile.pronouns }}</span>
</div>
{% endif %}
{% if profile.date_of_birth %} {% if profile.date_of_birth %}
<div> <div>
<span class="user_profile_infos_item">{% trans %}Born: {% endtrans %}</span> <span class="user_profile_infos_item">{% trans %}Born: {% endtrans %}</span>
@ -230,4 +238,3 @@ $(function(){
}); });
</script> </script>
{% endblock %} {% endblock %}