Merge branch 'family_rework' into 'master'

Edited the word "GodFather" to "Family"

See merge request ae/Sith!286
This commit is contained in:
Ailé 2021-11-10 10:35:40 +00:00
commit 7ac6dcf8a0
9 changed files with 78 additions and 17 deletions

View File

@ -0,0 +1,28 @@
# Generated by Django 2.2.24 on 2021-10-01 00:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("core", "0035_auto_20200216_1743")]
operations = [
migrations.AddField(
model_name="user",
name="pronouns",
field=models.CharField(default="", max_length=64, verbose_name="pronouns"),
preserve_default=False,
),
migrations.AlterField(
model_name="user",
name="sex",
field=models.CharField(
blank=True,
choices=[("MAN", "Man"), ("WOMAN", "Woman"), ("OTHER", "Other")],
max_length=10,
null=True,
verbose_name="sex",
),
),
]

View File

@ -0,0 +1,18 @@
# Generated by Django 2.2.24 on 2021-11-05 16:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("core", "0036_auto_20211001_0248"),
]
operations = [
migrations.AlterField(
model_name="user",
name="pronouns",
field=models.CharField(default="", max_length=64, verbose_name="pronouns"),
),
]

View File

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

View File

@ -55,6 +55,9 @@
{% if user.nick_name %}
<div class="user_mini_profile_nick">&laquo; {{ user.nick_name }} &raquo;</div>
{% endif %}
{% if user.pronouns %}
<div class="user_mini_profile_pronouns">{{ user.pronouns }}</div>
{% endif %}
{% if user.date_of_birth %}
<div class="user_mini_profile_dob">
{{ 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>
{% endif %}
{% if profile.quote %}
<div id="user_profile_infos_quote">
{{ profile.quote }}
@ -22,6 +24,12 @@
{% endif %}
<div id="user_profile_infos_items">
{% if profile.pronouns %}
<div>
<span class="user_profile_infos_item">{% trans %}Pronouns: {% endtrans %}</span>
<span class="user_profile_infos_item_value">{{ profile.pronouns }}</span>
</div>
{% endif %}
{% if profile.date_of_birth %}
<div>
<span class="user_profile_infos_item">{% trans %}Born: {% endtrans %}</span>
@ -230,4 +238,3 @@ $(function(){
});
</script>
{% endblock %}

View File

@ -220,6 +220,7 @@ class UserProfileForm(forms.ModelForm):
"avatar_pict",
"scrub_pict",
"sex",
"pronouns",
"second_email",
"address",
"parent_address",

View File

@ -202,7 +202,7 @@ class UserTabsMixin(TabedViewMixin):
"core:user_godfathers", kwargs={"user_id": self.object.id}
),
"slug": "godfathers",
"name": _("Godfathers"),
"name": _("Family"),
}
)
tab_list.append(
@ -474,7 +474,7 @@ class UserGodfathersTreePictureView(CanViewMixin, DetailView):
if self.param == "godchildren":
self.graph.graph_attr["label"] = _("Godchildren")
elif self.param == "godfathers":
self.graph.graph_attr["label"] = _("Godfathers")
self.graph.graph_attr["label"] = _("Family")
else:
self.graph.graph_attr["label"] = _("Family")
img = self.graph.draw(format="png", prog="dot")

View File

@ -2060,7 +2060,7 @@ msgstr "blouse"
#: core/models.py:226
msgid "sex"
msgstr "sexe"
msgstr "Genre"
#: core/models.py:228 matmat/views.py:74
msgid "Man"
@ -2071,6 +2071,10 @@ msgid "Woman"
msgstr "Femme"
#:core/models.py:232
msgid "pronouns"
msgstr "pronoms"
#: core/models.py:209
msgid "tshirt size"
msgstr "taille de tshirt"
@ -3108,6 +3112,10 @@ msgstr "Profil de %(user_name)s"
msgid "Born: "
msgstr "Né le : "
#: core/templates/core/user_detail.jinja:27
msgid "Pronouns: "
msgstr "Pronoms : "
#: core/templates/core/user_detail.jinja:34
msgid "Department: "
msgstr "Département : "
@ -3235,9 +3243,9 @@ msgid "Show family picture"
msgstr "Voir une image de la famille"
#: core/templates/core/user_godfathers.jinja:12 core/views/user.py:205
#: core/views/user.py:477
msgid "Godfathers"
msgstr "Parrains"
#: core/views/user.py:477 core/views/user.py:479
msgid "Family"
msgstr "Famille"
#: core/templates/core/user_godfathers.jinja:20
msgid "Show ancestors tree"
@ -3685,10 +3693,6 @@ msgstr "Utilisateurs à ajouter au groupe"
msgid "Pictures"
msgstr "Photos"
#: core/views/user.py:479
msgid "Family"
msgstr "Famille"
#: core/views/user.py:621
msgid "User already has a profile picture"
msgstr "L'utilisateur a déjà une photo de profil"

View File

@ -44,6 +44,7 @@ def merge_users(u1, u2):
u1.date_of_birth = u1.date_of_birth or u2.date_of_birth
u1.home = u1.home or u2.home
u1.sex = u1.sex or u2.sex
u1.pronouns = u1.pronouns or u2.pronouns
u1.tshirt_size = u1.tshirt_size or u2.tshirt_size
u1.role = u1.role or u2.role
u1.department = u1.department or u2.department