Cloud-CV/EvalAI

View on GitHub
frontend/src/views/web/challenge/update-submission-metadata.html

Summary

Maintainability
Test Coverage
<section class="ev-md-container text-center">
    <div class="row">
        <div class="col s12 m12">
            <div class="ev-md-container ev-card-body update-profile-card">
                <form name="updateSubmissionMetaDataForm" ng-submit="challenge.updateSubmissionMetaData(updateSubmissionMetaDataForm.$valid)">
                    <div class="pass-title">Update Submission Details</div>
                    <div class="input-field align-left">
                        <input id="methodName" name="methodName" type="text" class="text-dark-black dark-autofill w-400" ng-model="challenge.method_name" value="{{challenge.method_name}}" focus-if="challenge.method_name" />
                        <span class="form-icon form-icon-dark">
                            <i class="fa fa-pencil"></i>
                        </span>
                        <label class="active" for="methodName">Method Name</label>
                    </div>
                    <div class="input-field align-left">
                        <textarea id="methodDesc" name="methodDesc" type="text" class="materialize-textarea" ng-model="challenge.method_description" value="{{challenge.method_description}}" focus-if="challenge.method_description"></textarea>
                        <span class="form-icon form-icon-dark">
                            <i class="fa fa-pencil"></i>
                        </span>
                        <label for="methodDesc">Method Description</label>
                    </div>
                    <div class="input-field align-left">
                        <input id="projectUrl" name="projectUrl" type="text" class="text-dark-black dark-autofill w-400" ng-model="challenge.project_url" value="{{challenge.project_url}}" focus-if="challenge.project_url" />
                        <span class="form-icon form-icon-dark">
                            <i class="fa fa-pencil"></i>
                        </span>
                        <label for="projectUrl">Project Url</label>
                    </div>
                    <div class="input-field align-left">
                        <input id="publicationUrl" name="publicationUrl" type="text" class="text-dark-black dark-autofill w-400" ng-model="challenge.publication_url" value="{{challenge.publication_url}}" focus-if="challenge.publication_url" />
                        <span class="form-icon form-icon-dark">
                            <i class="fa fa-pencil"></i>
                        </span>
                        <label for="publicationUrl">Publication Url</label>
                    </div>
                    <div ng-if="challenge.currentSubmissionMetaData != null" ng-repeat="attribute in challenge.currentSubmissionMetaData">
                        <div ng-if="attribute.type == 'text'" class="input-field align-left">
                            <input type="text" ng-model="attribute.value" name="{{attribute.name}}" id="{{attribute.name}}" ng-required="attribute.required === true" />
                            <span class="form-icon"><i class="fa fa-text"></i></span>
                            <label for="{{attribute.name}}" class="active">
                                {{attribute.name}} ({{attribute.description}})
                                <span ng-if="attribute.required === true" class="color-orange"> * </span>
                            </label>
                        </div>
                        <div ng-if="attribute.type == 'radio'" class="align-left">
                            <label class="label-radio" for="{{attribute.name}}">
                                {{attribute.name}} ({{attribute.description}})
                                <span ng-if="attribute.required === true" class="color-orange"> * </span>
                            </label>
                            <div class="input-field">
                                <md-radio-group ng-model="attribute.value" id="{{attribute.name}}" name="{{attribute.name}}">
                                    <md-radio-button ng-repeat="option in attribute.options" ng-value="option" ng-model="attribute.value">
                                        <span class="fs-16">{{option}}</span>
                                    </md-radio-button>
                                </md-radio-group>
                            </div>
                        </div>
                        <div ng-if="attribute.type == 'checkbox'" class="align-left">
                            <label class="label-checkbox" for="{{attribute.name}}">
                                {{attribute.name}} ({{attribute.description}})
                                <span ng-if="attribute.required === true" class="color-orange"> * </span>
                            </label>
                            <div class="input-field">
                                <div class="submission-options" ng-repeat="option in attribute.options" id="{{attribute.name}}" name="{{attribute.name}}">
                                    <input type="checkbox" ng-checked="challenge.isOptionChecked(option,attribute)" ng-click="challenge.toggleSelection(attribute, option);" id="{{option}}" ng-value="option" />
                                    <label for="{{option}}"></label>
                                    <span class="fs-16 w-300">{{option}}</span>
                                </div>
                            </div>
                        </div>
                        <div ng-if="attribute.type == 'boolean'" class="align-left">
                            <label class="label-radio" for="{{attribute.name}}">
                                {{attribute.name}} ({{attribute.description}})
                                <span ng-if="attribute.required === true" class="color-orange"> * </span>
                            </label>
                            <div class="input-field">
                                <md-radio-group ng-model="attribute.value" id="{{attribute.name}}" name="{{attribute.name}}">
                                    <md-radio-button ng-value="'True'"> True </md-radio-button>
                                    <md-radio-button ng-value="'False'"> False </md-radio-button>
                                </md-radio-group>
                            </div>
                        </div>
                    </div>
                    <ul class="inline-list pointer">
                        <li>
                            <a class="dark-link" type="button" ng-click="challenge.updateSubmissionMetaData(false)">
                                <strong>Cancel</strong>
                            </a>
                        </li>
                        <li>
                            <button class="btn ev-btn-dark waves-effect waves-dark grad-btn grad-btn-dark fs-14" type="submit" value="Submit">Submit</button>
                        </li>
                    </ul>
                </form>
            </div>
        </div>
    </div>
</section>