Skip to content
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Contributors Guide
Thanks for your interest in contributing to the project! As of January 2024, development has been permanently handed off to the ACM at FSU chapter. Please visit [FSU-ACM/Programming-Contest-Suite](https://github.com/FSU-ACM/Programming-Contest-Suite) for the latest version of the project, and up-to-date contribution information.
Thanks for your interest in contributing to the project!

## Frameworks and Tools

Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ django-hashid-field = "*"
django-celery-beat = "*"
flower = "*"
discord-py = "==2.5.0"
pillow = "*"

[dev-packages]

Expand Down
80 changes: 79 additions & 1 deletion Pipfile.lock

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

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The following assumes `Programming-Contest-Suite/src` is the working directory.

# Documentation

All project documentation is available in `docs/`, and on our [documentation website](https://mmcinnestaylor.github.io/Programming-Contest-Suite/).
All project documentation is available in `docs/`, and on our [documentation website](https://fsu-acm.github.io/Programming-Contest-Suite/).

# Contributing

Expand Down
8 changes: 4 additions & 4 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
title: Programming Contest Suite
description: Documentation for mmcinnestaylor/Programming-Contest-Suite
description: Documentation for FSU-ACM/Programming-Contest-Suite
theme: just-the-docs
repository: mmcinnestaylor/Programming-Contest-Suite
repository: FSU-ACM/Programming-Contest-Suite

url: https://mmcinnestaylor.github.io/Programming-Contest-Suite/
url: https://fsu-acm.github.io/Programming-Contest-Suite/

# Set a path/url to a favicon that will be displayed by the browser
favicon_ico: "/assets/images/favicon.ico"
Expand Down Expand Up @@ -41,7 +41,7 @@ enable_copy_code_button: true
# Aux links for the upper right navigation
aux_links:
"PCS on GitHub":
- "//github.com/mmcinnestaylor/Programming-Contest-Suite"
- "//github.com/FSU-ACM/Programming-Contest-Suite"

# Makes Aux links open in a new tab. Default is false
aux_links_new_tab: true
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ kombu==5.5.0; python_version >= '3.8'
multidict==6.1.0; python_version >= '3.8'
mysqlclient==2.2.7; python_version >= '3.8'
packaging==24.2; python_version >= '3.8'
pillow==11.1.0; python_version >= '3.9'
prometheus-client==0.21.1; python_version >= '3.8'
prompt-toolkit==3.0.50; python_full_version >= '3.8.0'
propcache==0.3.0; python_version >= '3.9'
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ kombu==5.5.0; python_version >= '3.8'
multidict==6.1.0; python_version >= '3.8'
mysqlclient==2.2.7; python_version >= '3.8'
packaging==24.2; python_version >= '3.8'
pillow==11.1.0; python_version >= '3.9'
prometheus-client==0.21.1; python_version >= '3.8'
prompt-toolkit==3.0.50; python_full_version >= '3.8.0'
propcache==0.3.0; python_version >= '3.9'
Expand Down
3 changes: 2 additions & 1 deletion src/contestsuite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def get_secret(key, default=None):
# https://docs.djangoproject.com/en/4.2/howto/static-files/

STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = 'static/'
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'assets'),
]
Expand All @@ -204,6 +204,7 @@ def get_secret(key, default=None):
# https://docs.djangoproject.com/en/4.2/topics/files/

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'


# Redirect to home URL after login (Default redirects to /accounts/profile/)
Expand Down
5 changes: 5 additions & 0 deletions src/contestsuite/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

from django.contrib import admin
from django.urls import include, path
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
path('', include('core.urls')),
Expand All @@ -28,3 +30,6 @@
path('manage/', include('manager.urls')),
path('register/', include('register.urls')),
]

if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
33 changes: 25 additions & 8 deletions src/core/admin.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,49 @@
from django.contrib import admin
from django.contrib.auth.models import User
from django.utils.html import mark_safe
from . import models

from import_export import resources
from import_export.admin import ImportExportModelAdmin


class UserResource(resources.ModelResource):
"""
Attach User model to Django-Import-Export
https://django-import-export.readthedocs.io/en/latest/getting_started.html#creating-a-resource
"""
class Meta:
model = User
fields = ('first_name', 'last_name', 'email', 'is_active', 'profile__checked_in')
"""
Attach User model to Django-Import-Export
https://django-import-export.readthedocs.io/en/latest/getting_started.html#creating-a-resource
"""
class Meta:
model = User
fields = ('first_name', 'last_name', 'email', 'is_active', 'profile__checked_in')


class UserAdmin(ImportExportModelAdmin):
"""
Django-Import-Export resource admin intrgration
https://django-import-export.readthedocs.io/en/latest/advanced_usage.html#admin-integration
"""
resource_class = UserResource
list_display = ("last_name", "first_name", "username", "email", "is_active",)
list_filter = ("is_active",)
search_fields = ["last_name", "first_name", "username", "email"]


class SponsorAdmin(admin.ModelAdmin):
"""
Define Sponsor model interface in Django Admin.
https://docs.djangoproject.com/en/4.2/ref/contrib/admin/#modeladmin-objects
"""

list_display = ('name', 'url', 'logo_thumbnail', 'message')
search_fields = ['name', 'message']

def logo_thumbnail(self, obj):
if obj.logo:
return mark_safe(f'<img src="{obj.logo.url}" style="width: 300px; height: auto;" />')
return '-'

# Re-register User model for django-import-export integration
admin.site.unregister(User)
admin.site.register(User, UserAdmin)
admin.site.register(models.Sponsor, SponsorAdmin)
24 changes: 24 additions & 0 deletions src/core/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 4.2.20 on 2025-03-30 15:49

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Sponsor',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200, unique=True)),
('logo', models.ImageField(upload_to='sponsors')),
('url', models.URLField(blank=True)),
('message', models.TextField(blank=True)),
],
),
]
18 changes: 18 additions & 0 deletions src/core/migrations/0002_sponsor_ranking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.20 on 2025-09-15 19:12

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='sponsor',
name='ranking',
field=models.PositiveIntegerField(blank=True, help_text='Lower numbers appear first. Blank rankings appear last.', null=True),
),
]
25 changes: 25 additions & 0 deletions src/core/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
from django.db import models

# Create your models here.

class Sponsor(models.Model):
"""
Contest sponsor model. Each model stores the details of a contest sponsor, including
name, logo, link to sponsor's website, message, and ranking.

name (CharField): the sponsor name (unique)

logo (ImageField): the sponsor logo

url (URLField): the sponsor URL

message (TextField): the sponsor message

ranking (PositiveIntegerField): the sponsor display ranking (optional, lower numbers appear first)
"""

name = models.CharField(max_length=200, unique=True)
logo = models.ImageField(upload_to='sponsors')
url = models.URLField(blank=True)
message = models.TextField(blank=True)
ranking = models.PositiveIntegerField(blank=True, null=True, help_text="Lower numbers appear first. Blank rankings appear last.")

def __str__(self):
return self.name
22 changes: 22 additions & 0 deletions src/core/static/core/css/sponsors.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.sponsor-card {
height: 180px;
transition: transform 0.3s ease;
background-color: #189cc5;
}

.sponsor-card-no-link:hover {
cursor: default;
}

.sponsor-overlay {
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.75);
transform: translateY(100%);
transition: transform 0.4s ease;
}

.sponsor-card:hover .sponsor-overlay {
transform: translateY(0);
}
34 changes: 24 additions & 10 deletions src/core/templates/core/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,35 @@ <h4 class="text-center">Format</h4>
</div>
<!-- Sponsors Column -->
<div class="col-md-4 border-left border-secondary d-none d-md-block my-3">
<h4 class="text-center">Sponsors</h4>
<a href="{% url 'sponsors' %}" class="text-decoration-none text-reset disabled">
<h4 class="text-center">Sponsors</h4>
</a>
<div class="text-center">
<img src="{% static 'core/img/fsucslogo.png' %}" class="img-fluid w-75 my-2" alt="FSU CS Logo">
<img src="{% static 'core/img/L3Harris_logo.png' %}" class="img-fluid w-75 my-2" alt="L3Harris Logo">
<img src="{% static 'core/img/i2x.png' %}" class="img-fluid w-75 my-2" alt="i2x Solutions Logo">
<img src="{% static 'core/img/raymond_james.png' %}" class="img-fluid w-75 mt-2 mb-3" alt="Raymond James Logo">
{% for sponsor in sponsors|slice:":4" %}
{% if sponsor.url %}
<a href="{{ sponsor.url }}" target="_blank">
{% endif %}
<img src="{{ sponsor.logo.url }}" class="img-fluid w-75 my-2" alt="{{ sponsor.name }}">
{% if sponsor.url %}
</a>
{% endif %}
{% endfor %}
</div>
</div>
<div class="col-md-4 d-block d-md-none">
<h4 class="text-center mt-3">Sponsors</h4>
<a href="{% url 'sponsors' %}" class="text-decoration-none text-reset disabled">
<h4 class="text-center mt-3">Sponsors</h4>
</a>
<div class="text-center">
<img src="{% static 'core/img/fsucslogo.png' %}" class="img-fluid w-75 my-2" alt="FSU CS Logo">
<img src="{% static 'core/img/L3Harris_logo.png' %}" class="img-fluid w-75 my-2" alt="L3Harris Logo">
<img src="{% static 'core/img/i2x.png' %}" class="img-fluid w-75 my-2" alt="i2x Solutions Logo">
<img src="{% static 'core/img/raymond_james.png' %}" class="img-fluid w-75 mt-2 mb-3" alt="Raymond James Logo">
{% for sponsor in sponsors|slice:":4" %}
{% if sponsor.url %}
<a href="{{ sponsor.url }}" target="_blank">
{% endif %}
<img src="{{ sponsor.logo.url }}" class="img-fluid w-75 my-2" alt="{{ sponsor.name }}">
{% if sponsor.url %}
</a>
{% endif %}
{% endfor %}
</div>
</div>
</div>
Expand Down
Loading