Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

AS#145923029536741, Filestack: restyle interface #828

Merged
merged 2 commits into from
Jun 22, 2016
Merged
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
2 changes: 2 additions & 0 deletions app/directives/tc-fp-file-input/tc-fp-file-input.jade
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
span.tc-label__asterisk.lowercase(ng-if="mandatory") #[span *]mandatory
input.tc-file-field__input(
type="filepicker-dragdrop",
data-fp-button-text="Pick A File",
data-fp-drag-text=" ",
on-success="onFileSeleted(event.fpfile)"
)
127 changes: 65 additions & 62 deletions app/submissions/submit-design-files/submit-design-files.jade
Original file line number Diff line number Diff line change
Expand Up @@ -26,68 +26,71 @@
a(ng-href="https://help.{{DOMAIN}}/hc/en-us/articles/219122667-Formatting-Your-Submission-for-Design-Challenges") Learn more about formatting your submission file

.form-block__fields
.fieldset
tc-fp-file-input(
label-text="Submission",
field-id="SUBMISSION_ZIP",
file-type="zip",
button-text="Add File",
services="COMPUTER,GOOGLE_DRIVE,BOX,DROPBOX",
show-file-type="true",
placeholder="Attach all visible files as a single .zip file",
mandatory="true",
ng-model="vm.submissionForm.submissionZip",
set-file-reference="vm.setFileReference(file, fieldId)"
)

.tc-error-messages(
ng-show="submissionForm['SUBMISSION_ZIP'].$touched && submissionForm['SUBMISSION_ZIP'].$invalid",
ng-messages="submissionForm['SUBMISSION_ZIP'].$error"
)
p(ng-message="filesize") File size may not exceed 500MB.

p(ng-message="required") This is not the correct file format. Please select a .zip file.

tc-fp-file-input.tc-file-field(
label-text="Source",
field-id="SOURCE_ZIP",
file-type="zip",
button-text="Add File",
services="COMPUTER,GOOGLE_DRIVE,BOX,DROPBOX",
show-file-type="true",
placeholder="Attach all visible files as a single .zip file",
mandatory="true",
set-file-reference="vm.setFileReference(file, fieldId)",
ng-model="vm.submissionForm.sourceZip"
)

.tc-error-messages(
ng-show="submissionForm['SOURCE_ZIP'].$touched && submissionForm['SOURCE_ZIP'].$invalid",
ng-messages="submissionForm['SOURCE_ZIP'].$error"
)
p(ng-message="filesize") File size may not exceed 500MB.

p(ng-message="required") This is not the correct file format. Please select a .zip file.

tc-fp-file-input.tc-file-field(
label-text="Preview Image",
field-id="DESIGN_COVER",
file-type=".jpg,.jpeg,.png",
button-text="Add File",
services="COMPUTER,GOOGLE_DRIVE,BOX,DROPBOX",
placeholder="Image file as .jpg or .png",
mandatory="true",
set-file-reference="vm.setFileReference(file, fieldId)",
ng-model="vm.submissionForm.designCover"
)

.tc-error-messages(
ng-show="submissionForm['DESIGN_COVER'].$touched && submissionForm['DESIGN_COVER'].$invalid",
ng-messages="submissionForm['DESIGN_COVER'].$error"
)
p(ng-message="filesize") File size may not exceed 500MB.

p(ng-message="required") This is not the correct file format. Please select a .jpg or .png file.
.fieldset.files
.upload
.file-picker
tc-fp-file-input(
label-text="Submission",
field-id="SUBMISSION_ZIP",
file-type="zip",
button-text="Add File",
services="COMPUTER,GOOGLE_DRIVE,BOX,DROPBOX",
show-file-type="true",
placeholder="Attach all visible files as a single .zip file",
mandatory="true",
ng-model="vm.submissionForm.submissionZip",
set-file-reference="vm.setFileReference(file, fieldId)"
)

.tc-error-messages(
ng-show="submissionForm['SUBMISSION_ZIP'].$touched && submissionForm['SUBMISSION_ZIP'].$invalid",
ng-messages="submissionForm['SUBMISSION_ZIP'].$error"
)
p(ng-message="filesize") File size may not exceed 500MB.

p(ng-message="required") This is not the correct file format. Please select a .zip file.

.file-picker
tc-fp-file-input.tc-file-field(
label-text="Source",
field-id="SOURCE_ZIP",
file-type="zip",
button-text="Add File",
services="COMPUTER,GOOGLE_DRIVE,BOX,DROPBOX",
show-file-type="true",
placeholder="Attach all visible files as a single .zip file",
mandatory="true",
set-file-reference="vm.setFileReference(file, fieldId)",
ng-model="vm.submissionForm.sourceZip"
)

.tc-error-messages(
ng-show="submissionForm['SOURCE_ZIP'].$touched && submissionForm['SOURCE_ZIP'].$invalid",
ng-messages="submissionForm['SOURCE_ZIP'].$error"
)
p(ng-message="filesize") File size may not exceed 500MB.

p(ng-message="required") This is not the correct file format. Please select a .zip file.
.file-picker
tc-fp-file-input.tc-file-field(
label-text="Preview Image",
field-id="DESIGN_COVER",
file-type=".jpg,.jpeg,.png",
button-text="Add File",
services="COMPUTER,GOOGLE_DRIVE,BOX,DROPBOX",
placeholder="Image file as .jpg or .png",
mandatory="true",
set-file-reference="vm.setFileReference(file, fieldId)",
ng-model="vm.submissionForm.designCover"
)

.tc-error-messages(
ng-show="submissionForm['DESIGN_COVER'].$touched && submissionForm['DESIGN_COVER'].$invalid",
ng-messages="submissionForm['DESIGN_COVER'].$error"
)
p(ng-message="filesize") File size may not exceed 500MB.

p(ng-message="required") This is not the correct file format. Please select a .jpg or .png file.

tc-input.fieldset__input.submitterRank(
label-text="Rank #",
Expand Down
49 changes: 49 additions & 0 deletions assets/css/directives/tc-fp-file-input.directive.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,60 @@
@import 'topcoder/tc-includes';

tc-fp-file-input {

.tc-file-field__label {
width: 240px;
}

.tc-file-field__inputs {
width: 240px;
div {
width: 240px;
}
}

.tc-file-field__input {
height: 190px;
width: 240px;
}

.tc-file-field__input::after {
content: 'or';
font-size: 12px;
line-height: 15px;
color: $tc-gray-30;
bottom: 85px;
position: absolute;
left: 50%;
transform: translateX(-50%)
}

.tc-btn {
margin-bottom: 5px;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 20px;
z-index: 1;
}

.tc-fp-file-drag-drop {
width: calc(100% - 4px);
position: absolute;
left: 0;
top: 0;
height: 190px;
width: 240px;
}

.tc-fp-file-drag-drop::after {
content: 'Drag and drop your .zip file here';
color: $tc-gray-50;
top: 25px;
position: absolute;
width: 198px;
text-align: center;
left: 50%;
transform: translateX(-50%)
}
}
16 changes: 15 additions & 1 deletion assets/css/submissions/submit-file.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
max-width: 500px;
}

tc-file-input {
tc-file-input,
tc-fp-file-input {
.tc-file-field__label, .tc-file-field__inputs {
margin: 0 auto;
@media screen and (min-width: 1000px) {
Expand All @@ -69,6 +70,19 @@ tc-file-input {
}
}

.files {
width: 100%;
}

.upload {
display: flex;
flex-wrap: wrap;
justify-content: space-around;

@media screen and (min-width: 1000px) {
justify-content: space-between;
}
}

.submitterRank {
width: 100px;
Expand Down