Skip to content
Open
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
18 changes: 18 additions & 0 deletions apps/jobs/migrations/0027_add_is_cli_field.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django on 2024-01-01

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("jobs", "0026_auto_20230804_1946"),
]

operations = [
migrations.AddField(
model_name="submission",
name="is_cli",
field=models.BooleanField(default=False, db_index=True),
),
]
1 change: 1 addition & 0 deletions apps/jobs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class Submission(TimeStampedModel):
# Store the values of meta attributes for the submission here.
submission_metadata = JSONField(blank=True, null=True)
is_verified_by_host = models.BooleanField(default=False)
is_cli = models.BooleanField(default=False, db_index=True)

def __str__(self):
return "{}".format(self.id)
Expand Down
2 changes: 2 additions & 0 deletions apps/jobs/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Meta:
"job_name",
"submission_metadata",
"is_verified_by_host",
"is_cli",
)

# Cache for challenge_hosts_pk to avoid repeated queries within same
Expand Down Expand Up @@ -169,6 +170,7 @@ class Meta:
"publication_url",
"project_url",
"is_verified_by_host",
"is_cli",
)

def get_participant_team(self, obj):
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/css/modules/my-challenge-all-submission.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@
.all-submission-table-scroll {
overflow-x: scroll;
}

/* Highlight style for submission rows in My Submissions tab */
.highlightSubmissionEntry {
border-color: #fff3e0;
box-shadow: 0 0 0 0.2em #ffcc80 !important;
border: 1px solid #d1d5da;
border-radius: 3px;
background-color: #f2f2f2;
}
32 changes: 31 additions & 1 deletion frontend/src/js/controllers/challengeCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@

vm.subErrors = {};
vm.currentHighlightedLeaderboardEntry = null;
vm.currentHighlightedSubmissionEntry = null;

vm.isChallengeLeaderboardPrivate = false;
vm.previousPublicSubmissionId = null;
Expand Down Expand Up @@ -275,7 +276,7 @@
$interval.cancel(vm.logs_poller);
};

// highlight the specific entry of the leaderboard
// highlight the specific entry of the leaderboard
vm.highlightSpecificLeaderboardEntry = function (key) {
key = '#' + key;
// Remove highlight from previous clicked entry
Expand All @@ -289,6 +290,32 @@
$scope.isHighlight = false;
};

// highlight the specific submission entry in My Submissions tab
vm.highlightSpecificSubmissionEntry = function (key) {
key = '#' + key;
// Remove highlight from previous clicked entry
if (vm.currentHighlightedSubmissionEntry != null) {
let prevEntry = angular.element(vm.currentHighlightedSubmissionEntry)[0];
prevEntry.setAttribute("class", "result-val fs-16 w-300");
}
let entry = angular.element(key)[0];
entry.setAttribute("class", "highlightSubmissionEntry");
vm.currentHighlightedSubmissionEntry = key;
};

// scroll to the selected submission entry after page has been rendered
vm.scrollToEntryAfterSubmissionsLoads = function () {
// get unique submission id from the url & if exists highlight the entry
$timeout(function() {
var elementId = $location.absUrl().split('?')[0].split('#')[1];
if (elementId && elementId.indexOf("submission-") !== -1) {
$anchorScroll.yOffset = 90;
$anchorScroll(elementId);
vm.highlightSpecificSubmissionEntry(elementId.replace("submission-", ""));
}
}, 500);
};

// get names of the team that has participated in the current challenge
vm.getTeamName = function(challengeId) {
parameters.url = 'challenges/' + challengeId + '/participant_team/team_detail';
Expand Down Expand Up @@ -1336,6 +1363,9 @@

vm.start();

// Scroll to and highlight the submission entry if specified in URL
vm.scrollToEntryAfterSubmissionsLoads();

if (vm.submissionResult.count === 0) {
vm.showPagination = false;
vm.paginationMsg = "No results found";
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/web/challenge/my-submission.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h6>My Participated Team: {{challenge.participated_team_name}}</h6>
<th class="fs-18 w-300" ng-if="challenge.allowParticipantsResubmissions && challenge.allowResumingSubmissions" data-field="button">Resume submission</th>
</thead>
<tbody>
<tr ng-repeat="key in challenge.submissionResult.results" class="result-val fs-16 w-300">
<tr id="submission-{{key.id}}" ng-repeat="key in challenge.submissionResult.results" class="result-val fs-16 w-300">
<td>{{$index + 1 + (challenge.currentRefPage - 1) * 150}}</td>
<td ng-if="key.method_name != '' && challenge.currentPhaseMetaAttributesVisibility['method_name'] != false">{{key.method_name}}</td>
<td ng-if="key.method_name == '' && challenge.currentPhaseMetaAttributesVisibility['method_name'] != false"> None </td>
Expand Down