Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production Release - 2025-01-10 #443

Merged
merged 3 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion home/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from django.contrib import admin
from django.urls import reverse
from django.utils.html import escape
from django.utils.safestring import mark_safe

from .models import Event
from .models import Event, ResourceLink
from .models import Question
from .models import Session
from .models import SessionMembership
Expand All @@ -13,6 +16,25 @@ class EventAdmin(admin.ModelAdmin):
filter_horizontal = ("speakers", "rsvped_members", "organizers")


@admin.register(ResourceLink)
class ResourceLinkAdmin(admin.ModelAdmin):
list_display = (
"path",
"link",
"url",
"permanent",
"updated",
"created",
)
ordering = ("path",)
search_fields = ("path", "url")

@admin.display(description="Link", ordering="path")
def link(self, obj):
href = reverse("resource_link", kwargs={"path": obj.path})
return mark_safe(f'<a href="{href}">Copy to share</a>')


class SessionMembershipInline(admin.TabularInline):
model = SessionMembership
extra = 0
Expand Down
10 changes: 9 additions & 1 deletion home/factories.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import factory

from accounts.factories import UserFactory
from home.models import Event
from home.models import Event, ResourceLink
from home.models import Question
from home.models import Session
from home.models import Survey
Expand All @@ -22,6 +22,14 @@ class Meta:
status = Event.SCHEDULED


class ResourceLinkFactory(factory.django.DjangoModelFactory):
class Meta:
model = ResourceLink

path = factory.Sequence(lambda n: "path/resource-%d" % n)
url = factory.Sequence(lambda n: "https://testserver/%d/resource" % n)


class SessionFactory(factory.django.DjangoModelFactory):
class Meta:
model = Session
Expand Down
43 changes: 43 additions & 0 deletions home/migrations/0030_resourcelink.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Generated by Django 4.1.13 on 2025-01-07 13:52

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("home", "0029_alter_generalpage_content_listblock"),
]

operations = [
migrations.CreateModel(
name="ResourceLink",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
("permanent", models.BooleanField(default=False)),
(
"path",
models.TextField(
help_text="The relative path for requests to the djangonaut.space web app.",
unique=True,
),
),
(
"url",
models.URLField(
help_text="The final URL it directs to.", max_length=2000
),
),
],
),
]
1 change: 1 addition & 0 deletions home/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .blog import *
from .event import *
from .resource import *
from .session import *
from .survey import *
15 changes: 15 additions & 0 deletions home/models/resource.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from django.db import models


class ResourceLink(models.Model):
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
permanent = models.BooleanField(default=False)
path = models.TextField(
help_text="The relative path for requests to the djangonaut.space web app.",
unique=True,
)
url = models.URLField(help_text="The final URL it directs to.", max_length=2000)

def __str__(self):
return self.path
6 changes: 0 additions & 6 deletions home/static/fontawesome-6.4.2/css/brands.min.css

This file was deleted.

9 changes: 0 additions & 9 deletions home/static/fontawesome-6.4.2/css/fontawesome.min.css

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ as SVG and JS file types.
In the Font Awesome Free download, the SIL OFL license applies to all icons
packaged as web and desktop font files.

Copyright (c) 2023 Fonticons, Inc. (https://fontawesome.com)
Copyright (c) 2024 Fonticons, Inc. (https://fontawesome.com)
with Reserved Font Name: "Font Awesome".

This Font Software is licensed under the SIL Open Font License, Version 1.1.
Expand Down Expand Up @@ -123,7 +123,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
In the Font Awesome Free download, the MIT license applies to all non-font and
non-icon files.

Copyright 2023 Fonticons, Inc.
Copyright 2024 Fonticons, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Expand Down
6 changes: 6 additions & 0 deletions home/static/fontawesome-6.7.1/css/brands.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading