<form name="clientdocumentform" novalidate="" class="row form-horizontal" ng-controller="ClientDocumentController"
      rc-submit="submit()">
    <div>
        <ul class="breadcrumb">
            <li><a href="#/clients">{{'label.anchor.clients' | translate}}</a></li>
            <li><a href="#/viewclient/{{clientId}}">{{'label.anchor.viewclient' | translate}}</a></li>
            <li class="active">{{'label.anchor.uploaddocument' | translate}}</li>
        </ul>
    </div>
    <api-validate></api-validate>
    <fieldset>
        <legend>{{'label.heading.uploadclientdocument' | translate}}</legend>
        <div class="form-group">
            <label class="control-label col-sm-2" for="name">{{'label.input.name' | translate}}<span
                    class="required">*</span></label>

            <div class="col-sm-3">
                <input ng-autofocus="true" type="text" id="name" name="name" ng-model="formData.name" class="form-control" required
                       late-Validate/>
            </div>
            <div class="col-sm-3">
                <form-validate valattributeform="clientdocumentform" valattribute="name"/>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-sm-2">{{'label.input.description' | translate}}</label>

            <div class="col-sm-3">
                <textarea rows="2" ng-model="formData.description" class="form-control"></textarea>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-sm-2" for="file">{{'label.input.selectfile' | translate}}<span
                    class="required">*</span></label>

            <div class="col-sm-3">
                <input type="file" id="file" ng-file-select="onFileSelect($files)">
            </div>
        </div>

        <div class="col-md-offset-3">
            <a id="cancel" href="#/viewclient/{{clientId}}">
                <button type="reset" class="btn btn-default">{{'label.button.cancel' | translate}}</button>
            </a>
            <button id="save" type="submit" has-permission='CREATE_DOCUMENT' class="btn btn-primary">{{'label.button.save' | translate}}</button>
        </div>
    </fieldset>
</form>
