Update Submissions and add fields
This commit is contained in:
@@ -22,6 +22,7 @@ const ERROR_TABLE = {
|
||||
uploadError: "One or more files failed to upload.",
|
||||
notAllFilesDone: "Not all the files have finished uploading yet.",
|
||||
noModifications: "Please select at least a type of hack.",
|
||||
noSystems: "Please select at least a system.",
|
||||
noDescription: "Please provide a description.",
|
||||
noGame: "Please provide a game or create a new one and fill all the required fields.",
|
||||
noLanguages: "Please select at least a language.",
|
||||
@@ -117,6 +118,10 @@ window.SubmissionVerifications = {
|
||||
return verifyCheckboxes( document.querySelector( '#modifications-group' ) );
|
||||
},
|
||||
|
||||
step5_UtilitiesSystemsCheckboxes: function(){
|
||||
return verifyCheckboxes( document.querySelector( '#systems-group' ) );
|
||||
},
|
||||
|
||||
/**
|
||||
* Verify if the description field has at least one character.
|
||||
* @returns {boolean}
|
||||
@@ -132,6 +137,10 @@ window.SubmissionVerifications = {
|
||||
*/
|
||||
step7_VerifyGame: function( element ){
|
||||
|
||||
const GAME_SELECTOR_MODE = document.querySelector('input[name="game_selection_mode"]')?.value ?? "game";
|
||||
if( GAME_SELECTOR_MODE === 'platform' || GAME_SELECTOR_MODE === 'none' )
|
||||
return true;
|
||||
|
||||
// Check if we have an already existent selected game.
|
||||
const GAME_ID_INPUT = document.querySelector('input[name="game_id"]');
|
||||
if( GAME_ID_INPUT ){
|
||||
@@ -283,12 +292,18 @@ window.Submission = function(){
|
||||
return false;
|
||||
}
|
||||
|
||||
if( SECTION() === "romhacks" ){
|
||||
if( SECTION() === "romhacks" || SECTION() === "lua-scripts" ){
|
||||
console.log( "Step 5" );
|
||||
if( !SubmissionVerifications.step5_RomhacksModificationsCheckboxes()){
|
||||
this.errorKey = "noModifications";
|
||||
return false;
|
||||
}
|
||||
} else if( SECTION() === "utilities" ){
|
||||
console.log( "Step 5" );
|
||||
if( !SubmissionVerifications.step5_UtilitiesSystemsCheckboxes()){
|
||||
this.errorKey = "noSystems";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
console.log( "Step 6" );
|
||||
@@ -341,6 +356,7 @@ window.Submission = function(){
|
||||
notAllFilesDone: 'uploadTarget',
|
||||
uploadError: 'uploadTarget',
|
||||
noModifications: 'modificationsGroup',
|
||||
noSystems: 'systemsGroup',
|
||||
noDescription: 'descriptionField',
|
||||
noGame: 'gameSelector',
|
||||
noLanguages: 'languagesGroup',
|
||||
|
||||
Reference in New Issue
Block a user