diff --git a/website/common/migrations/0013_onlineaccount.py b/website/common/migrations/0013_onlineaccount.py new file mode 100644 index 0000000..bed3860 --- /dev/null +++ b/website/common/migrations/0013_onlineaccount.py @@ -0,0 +1,30 @@ +# Generated by Django 4.0.5 on 2022-07-14 20:56 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("common", "0012_referrallink_alter_contentpage_body_and_more"), + ] + + operations = [ + migrations.CreateModel( + name="OnlineAccount", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=64, unique=True)), + ("url", models.URLField()), + ("username", models.CharField(max_length=64)), + ], + ), + ] diff --git a/website/common/models.py b/website/common/models.py index aad4997..b005538 100644 --- a/website/common/models.py +++ b/website/common/models.py @@ -123,3 +123,19 @@ class ReferralLink(models.Model): def __str__(self) -> str: return self.name + + +@register_snippet +class OnlineAccount(models.Model): + name = models.CharField(max_length=64, unique=True) + url = models.URLField() + username = models.CharField(max_length=64) + + panels = [ + FieldPanel("name"), + FieldPanel("username"), + FieldPanel("url"), + ] + + def __str__(self) -> str: + return self.name diff --git a/website/common/templates/common/onlineaccount_snippet_link.html b/website/common/templates/common/onlineaccount_snippet_link.html new file mode 100644 index 0000000..01af643 --- /dev/null +++ b/website/common/templates/common/onlineaccount_snippet_link.html @@ -0,0 +1 @@ +