From c75e058f41df5e771f617ee663164b4a6e17e712 Mon Sep 17 00:00:00 2001 From: Ihsan Ullah Date: Sun, 28 May 2023 15:06:39 +0500 Subject: [PATCH 1/5] separate tab for submissions --- .../migrations/0006_auto_20230528_0829.py | 19 + src/static/riot/datasets/management.tag | 42 +-- src/static/riot/management.tag | 8 +- .../riot/submissions/resource_submissions.tag | 344 ++++++++++++++++++ 4 files changed, 387 insertions(+), 26 deletions(-) create mode 100644 src/apps/datasets/migrations/0006_auto_20230528_0829.py create mode 100644 src/static/riot/submissions/resource_submissions.tag diff --git a/src/apps/datasets/migrations/0006_auto_20230528_0829.py b/src/apps/datasets/migrations/0006_auto_20230528_0829.py new file mode 100644 index 000000000..8e51ba6c3 --- /dev/null +++ b/src/apps/datasets/migrations/0006_auto_20230528_0829.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.17 on 2023-05-28 08:29 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('datasets', '0005_auto_20230527_0837'), + ] + + operations = [ + migrations.AlterField( + model_name='data', + name='competition', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='submission', to='competitions.Competition'), + ), + ] diff --git a/src/static/riot/datasets/management.tag b/src/static/riot/datasets/management.tag index 3940c6c69..b25bf6032 100644 --- a/src/static/riot/datasets/management.tag +++ b/src/static/riot/datasets/management.tag @@ -1,7 +1,5 @@ - +
@@ -25,14 +23,11 @@ Delete Selected Datasets - + - @@ -46,12 +41,7 @@ - - - - - - + @@ -82,11 +72,9 @@ - + - - @@ -124,10 +111,6 @@ - - - - @@ -223,7 +206,6 @@ "reference_data", "scoring_program", "starting_kit", - "submission", ] self.errors = [] self.datasets = [] @@ -299,6 +281,7 @@ CODALAB.api.get_datasets(filters) .done(function (data) { self.datasets = data.results + self.datasets = self.filter_out_submissions(self.datasets) self.pagination = { "count": data.count, "next": data.next, @@ -457,6 +440,17 @@ } } + // Function to remove submissions from datasets + self.filter_out_submissions = function(datasets) { + datasets_to_return = [] + datasets.forEach(dataset => { + if (dataset.type != "submission"){ + datasets_to_return.push(dataset) + } + }) + return datasets_to_return + } + // Function to format file size self.format_file_size = function(file_size) { // parse file size from string to float diff --git a/src/static/riot/management.tag b/src/static/riot/management.tag index ab481e475..904093abf 100644 --- a/src/static/riot/management.tag +++ b/src/static/riot/management.tag @@ -2,7 +2,8 @@ -
+
+ +
+
diff --git a/src/static/riot/submissions/resource_submissions.tag b/src/static/riot/submissions/resource_submissions.tag new file mode 100644 index 000000000..f1b082add --- /dev/null +++ b/src/static/riot/submissions/resource_submissions.tag @@ -0,0 +1,344 @@ + + + +
+ + +
+ + + +
File NameCompetition in Type Size Uploaded
{ dataset.file_name || dataset.name }{ dataset.competition.title }{ dataset.name } { dataset.type } { format_file_size(dataset.file_size) } { timeSince(Date.parse(dataset.created_when)) } ago
+
KeyCompetition in Created By Created Type
{selected_row.key}{ selected_row.competition.title } {selected_row.created_by} {pretty_date(selected_row.created_when)} {_.startCase(selected_row.type)}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
File NameCompetition inSizeUploadedPublicDelete?
{ submission.file_name || submission.name }{ submission.competition.title }{ format_file_size(submission.file_size) }{ timeSince(Date.parse(submission.created_when)) } ago + + + + +
+ + +
+
+ No Submissions Yet! +
+ +
+ + + + + + + From 57fd67560ea6dbaadb931150e46bc7a8f7a68e80 Mon Sep 17 00:00:00 2001 From: Ihsan Ullah Date: Sun, 28 May 2023 15:14:36 +0500 Subject: [PATCH 2/5] Add Dataset changed to Add Dataset/Program --- src/static/riot/datasets/management.tag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/riot/datasets/management.tag b/src/static/riot/datasets/management.tag index b25bf6032..7daac8cf6 100644 --- a/src/static/riot/datasets/management.tag +++ b/src/static/riot/datasets/management.tag @@ -16,7 +16,7 @@
+