diff --git a/app/directives/tc-fp-file-input/tc-fp-file-input.jade b/app/directives/tc-fp-file-input/tc-fp-file-input.jade index 4a5843e03..155d8124d 100644 --- a/app/directives/tc-fp-file-input/tc-fp-file-input.jade +++ b/app/directives/tc-fp-file-input/tc-fp-file-input.jade @@ -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)" ) diff --git a/app/submissions/submit-design-files/submit-design-files.jade b/app/submissions/submit-design-files/submit-design-files.jade index 0da471c4e..1b1713083 100644 --- a/app/submissions/submit-design-files/submit-design-files.jade +++ b/app/submissions/submit-design-files/submit-design-files.jade @@ -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 #", diff --git a/assets/css/directives/tc-fp-file-input.directive.scss b/assets/css/directives/tc-fp-file-input.directive.scss index be82035ae..d27f9cfef 100644 --- a/assets/css/directives/tc-fp-file-input.directive.scss +++ b/assets/css/directives/tc-fp-file-input.directive.scss @@ -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%) } } \ No newline at end of file diff --git a/assets/css/submissions/submit-file.scss b/assets/css/submissions/submit-file.scss index 5c0396302..0c2b73b71 100644 --- a/assets/css/submissions/submit-file.scss +++ b/assets/css/submissions/submit-file.scss @@ -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) { @@ -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;