Skip to content

Commit 3757137

Browse files
wiktor-kjelly
authored andcommitted
Add social field to user's profiles
1 parent 5e33be4 commit 3757137

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from django.db import migrations, models
2+
3+
4+
class Migration(migrations.Migration):
5+
6+
dependencies = [
7+
('devel', '0010_merge_20230312_1527'),
8+
]
9+
10+
operations = [
11+
migrations.AddField(
12+
model_name='userprofile',
13+
name='social',
14+
field=models.CharField(blank=True, max_length=200, null=True),
15+
),
16+
]

devel/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class UserProfile(models.Model):
4040
website = models.URLField(max_length=200, null=True, blank=True)
4141
website_rss = models.URLField(max_length=200, null=True, blank=True,
4242
help_text='RSS Feed of your website for planet.archlinux.org')
43+
social = models.URLField(max_length=200, null=True, blank=True,
44+
verbose_name="Social account URL",
45+
help_text="Mastodon or Fediverse account URL")
4346
yob = models.IntegerField("Year of birth", null=True, blank=True,
4447
validators=[MinValueValidator(1950), MaxValueValidator(2500)])
4548
country = CountryField(blank=True)

templates/public/developer_list.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ <h3>{{ dev.get_full_name }}{% if prof.latin_name %} ({{ prof.latin_name}}){% end
4949
<td>{% if prof.website %}<a itemprop="url" href="{{ prof.website }}"
5050
title="Visit the website for {{ dev.get_full_name }}">
5151
{{ prof.website }}</a>{% endif %}</td>
52+
</tr><tr>
53+
<th>Social:</th>
54+
<td>{% if prof.social %}<a itemprop="url" href="{{ prof.social }}"
55+
title="Visit social account for {{ dev.get_full_name }}" rel="me">
56+
{{ prof.social }}</a>{% endif %}</td>
5257
</tr><tr>
5358
<th>Occupation:</th>
5459
<td>{{ prof.occupation }}</td>

0 commit comments

Comments
 (0)