Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add challenge phase detail edit feature for more fields #3491

Merged
merged 13 commits into from
Jul 11, 2021
1 change: 1 addition & 0 deletions apps/challenges/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class Meta:
"allowed_submission_file_types",
"default_submission_meta_attributes",
"allowed_email_ids",
"is_submission_public",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
</div>
</div>

<div class="row row-lr-margin">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting seems a bit off in this file, please fix it.

<div class="col-lg-4 col-md-4 col-sm-12 col-lr-pad">
<div class="input-field align-left">
<span class="text-med-black fw-regular fs-16">Submissions/day</span>
Expand Down Expand Up @@ -134,6 +135,43 @@
></app-input>
</div>
</div>
</div>

<div class="row row-lr-margin">
<div class="col-lg-5 col-md-6 col-sm-6 col-lr-pad">
<div class="input-field align-left">
<span class="text-med-black fw-regular fs-16">Max Concurrent Submissions Allowed</span>
<app-input
class="mt-20"
[editPhaseDetails]="editPhaseDetails"
[name]="'max_concurrent_submissions_allowed'"
[isRequired]="true"
[label]="'max_concurrent_submissions_allowed'"
[placeholder]="''"
[type]="'number'"
[value]="maxConcurrentSubmissionsAllowed"
#formmodal
></app-input>
</div>
</div>

<div class="col-lg-6 col-md-6 col-sm-6 col-lr-pad">
<div class="input-field align-left">
<div class="fs-16 fw-regular text-med-black">Allowed Submission File Types</div>
<app-input
class="mt-20"
[isRequired]="true"
[editPhaseDetails]="editPhaseDetails"
[label]="'allowed_submission_file_types'"
[placeholder]="''"
[type]="'text'"
[icon]=""
[value]="allowedSubmissionFileTypes"
#formmodal
></app-input>
</div>
</div>
</div>

<div class="row row-lr-margin">
<div class="col-lg-6 col-md-6 col-sm-12 col-lr-pad">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export class EditphasemodalComponent implements OnInit {
* Challenge phase name
*/
name = '';

/**
* Challenge phase allowed submission file types
*/
allowedSubmissionFileTypes = '';

/**
* Challenge phase description
Expand Down Expand Up @@ -58,6 +63,11 @@ export class EditphasemodalComponent implements OnInit {
*/
maxSubmissions: number;

/**
* Challenge phase max concurrent submissions allowed
*/
maxConcurrentSubmissionsAllowed: number;

/**
* If editor error message
*/
Expand Down Expand Up @@ -141,7 +151,9 @@ export class EditphasemodalComponent implements OnInit {
* Constructor.
* @param globalService GlobalService Injection.
*/
constructor(private globalService: GlobalService) {}
constructor(
private globalService: GlobalService,
) {}

ngOnInit() {
if (this.params) {
Expand Down Expand Up @@ -172,6 +184,12 @@ export class EditphasemodalComponent implements OnInit {
if (this.params['maxSubmissions']) {
this.maxSubmissions = this.params['maxSubmissions'];
}
if (this.params['maxConcurrentSubmissionsAllowed']) {
this.maxConcurrentSubmissionsAllowed = this.params['maxConcurrentSubmissionsAllowed'];
}
if (this.params['allowedSubmissionFileTypes']) {
this.allowedSubmissionFileTypes = this.params['allowedSubmissionFileTypes'];
}
if (this.params['confirm']) {
this.confirm = this.params['confirm'];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,41 @@ <h5 class="fw-light">Challenge Settings</h5>
<br />
<div class="ev-action">
<div class="col-sm-6 col-xs-12 col-lg-6 col-lr-pad phase-select-box" *ngIf="isChallengeHost">
<app-selectphase
[phases]="phases"
[phaseSelectionListType]="phaseSelectionListType"
[phaseSelectionType]="phaseSelectionType"
[phaseSelected]="phaseSelected()"
#phaseselect
></app-selectphase>
</div>
</div>
<div class="row margin-bottom-cancel phase-card">
<app-selectphase
[phases]="phases"
[phaseSelectionListType]="phaseSelectionListType"
[phaseSelectionType]="phaseSelectionType"
[phaseSelected]="phaseSelected()"
#phaseselect
></app-selectphase>
<button
*ngIf="selectedPhase"
class="btn ev-btn-dark waves-effect waves-dark grad-btn grad-btn-dark fs-12 phase-button"
(click)="editPhaseDetails()"
>
Phase Details
<i class="fa fa-pencil" aria-hidden="true"> </i>
</button>
</div>

<div class="row margin-bottom-cancel phase-card " *ngIf="selectedPhase">
<span class="fs-16 fw-light">
<strong class="text-light-black">Is Public </strong>
</span>
<a class="pointer fs-20" (click)="togglePhaseVisibility()">
<i class="{{ phaseVisibility.icon }}" aria-hidden="true"> </i>
</a>&nbsp;&nbsp;&nbsp;&nbsp;
<span class="fs-16 fw-light">
<strong class="text-light-black">Submission Visibility </strong>
</span>
<a class="pointer fs-20" (click)="toggleSubmissionVisibility()">
<i class="{{ submissionVisibility.icon }}" aria-hidden="true"> </i>
</a>
</div>
</div>
</div>
</div>

<!-- Evaluations and Annotations -->
<div class="row settings-section">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
}
}

.phase-card {
width:50vw;
}

.phase-button {
margin-left: 25px;
}

@include screen-medium {
.settings-section {
padding: 10px 20px !important;
Expand Down
Loading