mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 22:23:23 +00:00
Merge branch 'family_rework' into 'master'
Edited the word "GodFather" to "Family" See merge request ae/Sith!286
This commit is contained in:
commit
7ac6dcf8a0
28
core/migrations/0036_auto_20211001_0248.py
Normal file
28
core/migrations/0036_auto_20211001_0248.py
Normal 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",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
18
core/migrations/0037_auto_20211105_1708.py
Normal file
18
core/migrations/0037_auto_20211105_1708.py
Normal 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"),
|
||||||
|
),
|
||||||
|
]
|
@ -227,8 +227,9 @@ class User(AbstractBaseUser):
|
|||||||
max_length=10,
|
max_length=10,
|
||||||
null=True,
|
null=True,
|
||||||
blank=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 = models.CharField(
|
||||||
_("tshirt size"),
|
_("tshirt size"),
|
||||||
max_length=5,
|
max_length=5,
|
||||||
@ -1491,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):
|
||||||
|
@ -55,6 +55,9 @@
|
|||||||
{% if user.nick_name %}
|
{% if user.nick_name %}
|
||||||
<div class="user_mini_profile_nick">« {{ user.nick_name }} »</div>
|
<div class="user_mini_profile_nick">« {{ user.nick_name }} »</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() }})
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
<div id="user_profile_infos_nick">« {{ profile.nick_name }} »</div>
|
<div id="user_profile_infos_nick">« {{ profile.nick_name }} »</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">{% trans %}Pronouns: {% endtrans %}</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 %}
|
||||||
|
|
||||||
|
@ -220,6 +220,7 @@ class UserProfileForm(forms.ModelForm):
|
|||||||
"avatar_pict",
|
"avatar_pict",
|
||||||
"scrub_pict",
|
"scrub_pict",
|
||||||
"sex",
|
"sex",
|
||||||
|
"pronouns",
|
||||||
"second_email",
|
"second_email",
|
||||||
"address",
|
"address",
|
||||||
"parent_address",
|
"parent_address",
|
||||||
|
@ -202,7 +202,7 @@ class UserTabsMixin(TabedViewMixin):
|
|||||||
"core:user_godfathers", kwargs={"user_id": self.object.id}
|
"core:user_godfathers", kwargs={"user_id": self.object.id}
|
||||||
),
|
),
|
||||||
"slug": "godfathers",
|
"slug": "godfathers",
|
||||||
"name": _("Godfathers"),
|
"name": _("Family"),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
tab_list.append(
|
tab_list.append(
|
||||||
@ -474,7 +474,7 @@ class UserGodfathersTreePictureView(CanViewMixin, DetailView):
|
|||||||
if self.param == "godchildren":
|
if self.param == "godchildren":
|
||||||
self.graph.graph_attr["label"] = _("Godchildren")
|
self.graph.graph_attr["label"] = _("Godchildren")
|
||||||
elif self.param == "godfathers":
|
elif self.param == "godfathers":
|
||||||
self.graph.graph_attr["label"] = _("Godfathers")
|
self.graph.graph_attr["label"] = _("Family")
|
||||||
else:
|
else:
|
||||||
self.graph.graph_attr["label"] = _("Family")
|
self.graph.graph_attr["label"] = _("Family")
|
||||||
img = self.graph.draw(format="png", prog="dot")
|
img = self.graph.draw(format="png", prog="dot")
|
||||||
|
@ -2060,7 +2060,7 @@ msgstr "blouse"
|
|||||||
|
|
||||||
#: core/models.py:226
|
#: core/models.py:226
|
||||||
msgid "sex"
|
msgid "sex"
|
||||||
msgstr "sexe"
|
msgstr "Genre"
|
||||||
|
|
||||||
#: core/models.py:228 matmat/views.py:74
|
#: core/models.py:228 matmat/views.py:74
|
||||||
msgid "Man"
|
msgid "Man"
|
||||||
@ -2070,7 +2070,11 @@ msgstr "Homme"
|
|||||||
msgid "Woman"
|
msgid "Woman"
|
||||||
msgstr "Femme"
|
msgstr "Femme"
|
||||||
|
|
||||||
#: core/models.py:232
|
#:core/models.py:232
|
||||||
|
msgid "pronouns"
|
||||||
|
msgstr "pronoms"
|
||||||
|
|
||||||
|
#: core/models.py:209
|
||||||
msgid "tshirt size"
|
msgid "tshirt size"
|
||||||
msgstr "taille de tshirt"
|
msgstr "taille de tshirt"
|
||||||
|
|
||||||
@ -3108,6 +3112,10 @@ msgstr "Profil de %(user_name)s"
|
|||||||
msgid "Born: "
|
msgid "Born: "
|
||||||
msgstr "Né le : "
|
msgstr "Né le : "
|
||||||
|
|
||||||
|
#: core/templates/core/user_detail.jinja:27
|
||||||
|
msgid "Pronouns: "
|
||||||
|
msgstr "Pronoms : "
|
||||||
|
|
||||||
#: core/templates/core/user_detail.jinja:34
|
#: core/templates/core/user_detail.jinja:34
|
||||||
msgid "Department: "
|
msgid "Department: "
|
||||||
msgstr "Département : "
|
msgstr "Département : "
|
||||||
@ -3235,9 +3243,9 @@ msgid "Show family picture"
|
|||||||
msgstr "Voir une image de la famille"
|
msgstr "Voir une image de la famille"
|
||||||
|
|
||||||
#: core/templates/core/user_godfathers.jinja:12 core/views/user.py:205
|
#: core/templates/core/user_godfathers.jinja:12 core/views/user.py:205
|
||||||
#: core/views/user.py:477
|
#: core/views/user.py:477 core/views/user.py:479
|
||||||
msgid "Godfathers"
|
msgid "Family"
|
||||||
msgstr "Parrains"
|
msgstr "Famille"
|
||||||
|
|
||||||
#: core/templates/core/user_godfathers.jinja:20
|
#: core/templates/core/user_godfathers.jinja:20
|
||||||
msgid "Show ancestors tree"
|
msgid "Show ancestors tree"
|
||||||
@ -3685,10 +3693,6 @@ msgstr "Utilisateurs à ajouter au groupe"
|
|||||||
msgid "Pictures"
|
msgid "Pictures"
|
||||||
msgstr "Photos"
|
msgstr "Photos"
|
||||||
|
|
||||||
#: core/views/user.py:479
|
|
||||||
msgid "Family"
|
|
||||||
msgstr "Famille"
|
|
||||||
|
|
||||||
#: core/views/user.py:621
|
#: core/views/user.py:621
|
||||||
msgid "User already has a profile picture"
|
msgid "User already has a profile picture"
|
||||||
msgstr "L'utilisateur a déjà une photo de profil"
|
msgstr "L'utilisateur a déjà une photo de profil"
|
||||||
|
@ -44,6 +44,7 @@ def merge_users(u1, u2):
|
|||||||
u1.date_of_birth = u1.date_of_birth or u2.date_of_birth
|
u1.date_of_birth = u1.date_of_birth or u2.date_of_birth
|
||||||
u1.home = u1.home or u2.home
|
u1.home = u1.home or u2.home
|
||||||
u1.sex = u1.sex or u2.sex
|
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.tshirt_size = u1.tshirt_size or u2.tshirt_size
|
||||||
u1.role = u1.role or u2.role
|
u1.role = u1.role or u2.role
|
||||||
u1.department = u1.department or u2.department
|
u1.department = u1.department or u2.department
|
||||||
|
Loading…
Reference in New Issue
Block a user