diff --git a/src/apps/announcements/__init__.py b/src/apps/announcements/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/apps/announcements/admin.py b/src/apps/announcements/admin.py new file mode 100644 index 000000000..e675dd528 --- /dev/null +++ b/src/apps/announcements/admin.py @@ -0,0 +1,6 @@ +from django.contrib import admin + +from . import models + +admin.site.register(models.Announcement) +admin.site.register(models.NewsPost) diff --git a/src/apps/announcements/apps.py b/src/apps/announcements/apps.py new file mode 100644 index 000000000..1a07a47b4 --- /dev/null +++ b/src/apps/announcements/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class AnnouncementsConfig(AppConfig): + name = 'announcements' diff --git a/src/apps/announcements/migrations/0001_initial.py b/src/apps/announcements/migrations/0001_initial.py new file mode 100644 index 000000000..a04637dc3 --- /dev/null +++ b/src/apps/announcements/migrations/0001_initial.py @@ -0,0 +1,32 @@ +# Generated by Django 2.2.17 on 2023-06-15 18:12 + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Announcement', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('text', models.TextField(blank=True, null=True)), + ], + ), + migrations.CreateModel( + name='NewsPost', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=40, unique=True)), + ('link', models.URLField()), + ('created_when', models.DateTimeField(default=django.utils.timezone.now)), + ('text', models.TextField(blank=True, null=True)), + ], + ), + ] diff --git a/src/apps/announcements/migrations/0002_auto_20230615_2012.py b/src/apps/announcements/migrations/0002_auto_20230615_2012.py new file mode 100644 index 000000000..1e446cb6c --- /dev/null +++ b/src/apps/announcements/migrations/0002_auto_20230615_2012.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.17 on 2023-06-15 20:12 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('announcements', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='newspost', + name='title', + field=models.CharField(max_length=40), + ), + ] diff --git a/src/apps/announcements/migrations/0003_auto_20230616_1326.py b/src/apps/announcements/migrations/0003_auto_20230616_1326.py new file mode 100644 index 000000000..c17efe978 --- /dev/null +++ b/src/apps/announcements/migrations/0003_auto_20230616_1326.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.17 on 2023-06-16 13:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('announcements', '0002_auto_20230615_2012'), + ] + + operations = [ + migrations.AlterField( + model_name='newspost', + name='link', + field=models.URLField(blank=True), + ), + ] diff --git a/src/apps/announcements/migrations/__init__.py b/src/apps/announcements/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/apps/announcements/models.py b/src/apps/announcements/models.py new file mode 100644 index 000000000..fbb0a4d1f --- /dev/null +++ b/src/apps/announcements/models.py @@ -0,0 +1,13 @@ +from django.db import models +from django.utils.timezone import now + + +class Announcement(models.Model): + text = models.TextField(null=True, blank=True) + + +class NewsPost(models.Model): + title = models.CharField(max_length=40) + link = models.URLField(max_length=200, blank=True) + created_when = models.DateTimeField(default=now) + text = models.TextField(null=True, blank=True) diff --git a/src/apps/pages/views.py b/src/apps/pages/views.py index 441cfe40e..7395d416a 100644 --- a/src/apps/pages/views.py +++ b/src/apps/pages/views.py @@ -7,6 +7,7 @@ from competitions.models import Competition, Submission, CompetitionParticipant from profiles.models import User +from announcements.models import Announcement, NewsPost from django.shortcuts import render @@ -36,6 +37,13 @@ def get_context_data(self, *args, **kwargs): {'label': "Competition Participants", 'count': competition_participants}, {'label': "Submissions", 'count': submissions}, ] + + announcement = Announcement.objects.all().first() + context['announcement'] = announcement.text if announcement else None + + news_posts = NewsPost.objects.all().order_by('-id') + context['news_posts'] = news_posts + return context diff --git a/src/settings/base.py b/src/settings/base.py index 64ab54589..1366a0cc8 100644 --- a/src/settings/base.py +++ b/src/settings/base.py @@ -58,6 +58,7 @@ 'queues', 'health', 'forums', + 'announcements', ) INSTALLED_APPS = THIRD_PARTY_APPS + OUR_APPS diff --git a/src/static/stylus/home.styl b/src/static/stylus/home.styl index 3a3e06601..d7e86a491 100644 --- a/src/static/stylus/home.styl +++ b/src/static/stylus/home.styl @@ -226,11 +226,30 @@ body .color-header color #4a4a4a +.news + margin-bottom 5em + clear both + +.news-heading + float left + +.news-heading-title + color darkslategray + + +.news-date + float right + color darkslategray + +.news-body + float left + clear left + text-align left + #cite-container padding 2em align-items left - #cite-container .row margin 2em padding 1em !important diff --git a/src/templates/pages/home.html b/src/templates/pages/home.html index 09e48f02b..fb586f5a4 100644 --- a/src/templates/pages/home.html +++ b/src/templates/pages/home.html @@ -15,19 +15,20 @@ {% endblock %} {% block content %} + + + {% if announcement %}

Announcement

-

- -

Welcome to Codabench!

-

+ {{ announcement | safe }}
+ {% endif %}
@@ -195,139 +196,26 @@

Codalab in Research

+

News

- -

Codalab statistics

-

- August 2020: Codalab - exceeds 50,000 users, 1000 competitions (over 400 in - the last year), and ~600 submissions per day! -

- -

L2RPN

-

- July - 2020: We launched a new Learning to Run a - Power Network competition, in collaboration with ChaLearn and - RTE. We - have a robustness - and an adaptability - track. This is an NeurIPS - 2020 competition. -

- -

Chagrade

-

- May 2020: We released a - new application to help instructors use challenges in - the classroom and grade them called Chagrade. -

- -

AutoDL

-

- April 2020: The NeurIPS - AutoDL challenge ended. But the series of challenges - on Automated Deep Learning, in collaboration with ChaLearn, Google - Zurich, and 4Paradigm - continues with AutoSeries - and AutoGraph. -

- -

Data Science Africa 2019

-

- June 2019: We organized a data science - bootcamp at Data - Science Africa 2019 in the form of a challenge - to detect Malaria parasites in microscope images. -

- -
-

TrackML

-

- September 2018: - The LAL and CERN are organizing a challenge to reconstruct - particle trajectories in high energy physics detectors. After the success of the - first phase with result submission only, a second phase with code submission will be - run on Codalab. TrackML is an officially selected - challenge of the NIPS 2018 conference. -

-
- -
-

AutoML3

-

- August 2018: - Codalab is proud to host the third challenge on Automatic Machine Learning: - Lifelong Machine Learning - with drift. - AutoML3 is an officially selected challenge of the NIPS 2018 conference. -

-
- -
-

See.4C

-

February 2018: 2 million Euro Big Data EU prize powered by Codalab.

-
- -
-

DataIA

-

February 2018: Isabelle Guyon presents Codalab at the newly formed Institute of - Convergence DataIA

-
- -
-

Student - Projects

-

January 2018: Paris-Saclay master students create challenges for L2 students.

-
- -
- -

Homework

-

January 2018: Paris-Saclay instructors create reinforcement learning homework.

-
- -
-

10,000 Users

-

December 2017: Codalab exceeds 10000 users with 480 competitions (145 public)

-
- -
-

CiML workshop

-

- December 2017: Codalab presented at the Challenges in Machine Learning workshop [slides]. -

-
- -
-

Version 1.5 is out!

-
-

- November 2017: Explore the new features: scale up your code submission - competition with - your own compute workers (full privacy, dockers); organize RL challenges and hook up - simulators - providing data on demand (with your own "ingestion program"); use the ChaLab wizard to - create - competitions in minutes. Thanks! -

+ {% for post in news_posts %} +
+ {{post.created_when|date:"M d, Y"}} +
+ {% if post.link %} +

{{post.title}}

+ {% else %} +

{{post.title}}

+ {% endif %} +
+
+ {{ post.text | safe }} +
+ {% endfor %}