diff --git a/codalab/apps/teams/migrations/0004_auto_20220409_2242.py b/codalab/apps/teams/migrations/0004_auto_20220409_2242.py new file mode 100644 index 000000000..74fea6916 --- /dev/null +++ b/codalab/apps/teams/migrations/0004_auto_20220409_2242.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2022-04-09 22:42 +from __future__ import unicode_literals + +import codalab.azure_storage +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('teams', '0003_auto_20220328_1713'), + ] + + operations = [ + migrations.AlterField( + model_name='team', + name='image', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='public'), upload_to='team_logo', verbose_name='Logo'), + ), + ] diff --git a/codalab/apps/web/admin.py b/codalab/apps/web/admin.py index e5bdbc1e5..f6dbfa094 100644 --- a/codalab/apps/web/admin.py +++ b/codalab/apps/web/admin.py @@ -81,3 +81,5 @@ class PageAdmin(admin.ModelAdmin): admin.site.register(models.CompetitionSubmission) admin.site.register(models.CompetitionSubmissionMetadata) admin.site.register(models.CompetitionDefBundle) + +admin.site.register(models.NewsPost) \ No newline at end of file diff --git a/codalab/apps/web/migrations/0006_auto_20220409_2242.py b/codalab/apps/web/migrations/0006_auto_20220409_2242.py new file mode 100644 index 000000000..96e09b68f --- /dev/null +++ b/codalab/apps/web/migrations/0006_auto_20220409_2242.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2022-04-09 22:42 +from __future__ import unicode_literals + +import apps.web.models +import codalab.azure_storage +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('web', '0005_auto_20220328_1713'), + ] + + operations = [ + 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()), + ('date', models.DateTimeField(blank=True, null=True, verbose_name='Post Date (UTC)')), + ('post', models.TextField(blank=True, null=True)), + ], + ), + migrations.AlterField( + model_name='competition', + name='image', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='public'), upload_to=apps.web.models._uuidify('logos'), verbose_name='Logo'), + ), + migrations.AlterField( + model_name='competitiondefbundle', + name='config_bundle', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('competition-bundles')), + ), + migrations.AlterField( + model_name='competitiondump', + name='data_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('competition_dump'), verbose_name='Data file'), + ), + migrations.AlterField( + model_name='competitionphase', + name='ingestion_program', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('ingestion_program')), + ), + migrations.AlterField( + model_name='competitionphase', + name='input_data', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('phase_input_data_file'), verbose_name='Input Data'), + ), + migrations.AlterField( + model_name='competitionphase', + name='public_data', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('public_data'), verbose_name='Public Data'), + ), + migrations.AlterField( + model_name='competitionphase', + name='reference_data', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('phase_reference_data_file'), verbose_name='Reference Data'), + ), + migrations.AlterField( + model_name='competitionphase', + name='scoring_program', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('phase_scoring_program_file'), verbose_name='Scoring Program'), + ), + migrations.AlterField( + model_name='competitionphase', + name='starting_kit', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('starting_kit'), verbose_name='Starting Kit'), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='coopetition_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_coopetition')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='detailed_results_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_detailed_results')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_file_name')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='history_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_history')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='ingestion_program_stderr_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('predict_submission_stderr')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='ingestion_program_stdout_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('predict_submission_stdout')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='inputfile', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_inputfile')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='output_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_output')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='prediction_output_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_prediction_output')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='prediction_runfile', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_prediction_runfile')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='prediction_stderr_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('predict_submission_stderr')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='prediction_stdout_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('predict_submission_stdout')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='private_output_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_private_output')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='runfile', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_runfile')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='scores_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_scores')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='stderr_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_stderr')), + ), + migrations.AlterField( + model_name='competitionsubmission', + name='stdout_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('submission_stdout')), + ), + migrations.AlterField( + model_name='organizerdataset', + name='data_file', + field=models.FileField(blank=True, null=True, storage=codalab.azure_storage.AzureStorage(account_key='qY4fuziQqP0N63JurVsEvp7rioAsqnwPdRRgpLKDoCTNrVj1Xwt0l/EJVP3Yxn2IySXqjgMFYnvWd+B1mgPUAA==', account_name='codalabpython3test', azure_container='bundles'), upload_to=apps.web.models._uuidify('dataset_data_file'), verbose_name='Data file'), + ), + ] diff --git a/codalab/apps/web/models.py b/codalab/apps/web/models.py index f7ff1db53..8835c0e71 100644 --- a/codalab/apps/web/models.py +++ b/codalab/apps/web/models.py @@ -2722,3 +2722,21 @@ def filename(self): def competitiondump_post_delete_handler(sender, **kwargs): comp_dump = kwargs['instance'] delete_key_from_storage(comp_dump, 'data_file') + +class NewsPost(models.Model): + """ + News section on /highlights page + + Attributes or columns include: + * Title + """ + title = models.CharField(max_length=40, unique=True) + link = models.URLField(max_length=200) + date = models.DateTimeField(null=True, blank=True, verbose_name="Post Date (UTC)") + post = models.TextField(null=True, blank=True) + + def __unicode__(self): + return self.title + + def __str__(self): + return self.title \ No newline at end of file diff --git a/codalab/apps/web/templates/web/highlights.html b/codalab/apps/web/templates/web/highlights.html index ad97426a1..9f54c47ee 100644 --- a/codalab/apps/web/templates/web/highlights.html +++ b/codalab/apps/web/templates/web/highlights.html @@ -390,6 +390,15 @@
{{ news_component.date|date:'F Y' }}: {{ news_component.post|safe }} +
+