Skip to content

Commit

Permalink
feat(patients): accept any document upload
Browse files Browse the repository at this point in the history
This commit allows any document to be uploaded and attached to a
patient.  It also updates the document upload modal with the latest
header crumb and translate directives.
  • Loading branch information
jniles committed Jul 14, 2017
1 parent 72f909c commit f2f432b
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions client/src/modules/patients/documents/modals/documents.modal.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
<div class="modal-header">
<span class="glyphicon glyphicon-user"></span>
{{ 'FORM.LABELS.PATIENT' | translate }} / <b>{{ $ctrl.patient.reference }}</b> /
{{ 'FORM.LABELS.DOCUMENT' | translate }} / <span class="label label-primary"> {{ 'PATIENT_DOCUMENT.UPLOAD' | translate }}</span>
<ol class="headercrumb">
<li>
<span class="fa fa-user"></span>
<span translate>FORM.LABELS.PATIENT</span>
</li>
<li class="title">{{ $ctrl.patient.reference }}</li>
<li>
<span translate>FORM.LABELS.DOCUMENT</span>
<span class="label label-primary" translate>PATIENT_DOCUMENT.UPLOAD</span>
</li>
</ol>
</div>

<div class="modal-body">
<form class="form" name="documentForm" novalidate>

<div class="form-group">
<label class="control-label" for="title">{{ 'PATIENT_DOCUMENT.DOCUMENT_TITLE' | translate }}</label>
<label class="control-label" for="title" translate>PATIENT_DOCUMENT.DOCUMENT_TITLE</label>
<input
class="form-control"
type="text"
name="title"
autocomplete="off"
ng-model="$ctrl.title"
required>
</div>
Expand All @@ -26,22 +35,21 @@
<div class="progress" ng-show="$ctrl.file.progress >= 0">
<div class="progress-bar progress-bar-success progress-bar-striped active"
style="width:{{$ctrl.file.progress}}%"
ng-bind="$ctrl.file.progress + '%'"></div>
ng-bind="$ctrl.file.progress + '%'">
</div>
</div>

<div style="margin-top: 10px;" class="row">
<div class="form-group col-xs-8 col-md-10"
ng-class="{ 'has-error' : $ctrl.documentError }">
<!-- file upload -->
<input type="file"
class="form-control input-sm"
ngf-pattern="'image/*,application/pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv'"
ngf-select="$ctrl.setThumbnail($ctrl.file)"
name="file"
ng-model="$ctrl.file">
<!-- end file upload -->

<div class="help-block" data-error-message ng-show="$ctrl.documentError">
<i class="fa fa-warning"></i> {{ 'PATIENT_DOCUMENT.INVALID_DOCUMENT' | translate }}
<i class="fa fa-warning"></i> <span translate>PATIENT_DOCUMENT.INVALID_DOCUMENT</span>
</div>
</div>

Expand All @@ -50,9 +58,8 @@
<button
class="btn btn-danger btn-sm"
ng-disabled="!$ctrl.file"
ng-click="$ctrl.dismiss($ctrl.file)"
>
<span class="glyphicon glyphicon-trash"></span> {{ 'FORM.BUTTONS.DISMISS' | translate }}
ng-click="$ctrl.dismiss($ctrl.file)">
<span class="fa fa-trash"></span> <span translate>FORM.BUTTONS.DISMISS</span>
</button>
</div>
</div>
Expand All @@ -66,15 +73,16 @@
type="button"
class="btn btn-default"
data-method="close"
ng-click="$ctrl.close()">
{{ "FORM.BUTTONS.CLOSE" | translate }}
ng-click="$ctrl.close()" translate>
FORM.BUTTONS.CLOSE
</button>
<button
type="submit"
class="btn btn-primary"
data-method="submit"
ng-disabled="!$ctrl.title || $ctrl.uploadState === 'uploading'"
ng-click="$ctrl.submit(documentForm)">
{{ "FORM.BUTTONS.SUBMIT" | translate }}
ng-click="$ctrl.submit(documentForm)"
translate>
FORM.BUTTONS.SUBMIT
</button>
</div>

0 comments on commit f2f432b

Please sign in to comment.