#381: date fields manually editable

This commit is contained in:
bgamard 2020-03-07 00:36:03 +01:00
parent 19ac90688e
commit 8a85830bd3
7 changed files with 32 additions and 23 deletions

View File

@ -104,7 +104,7 @@ $provide.value("$locale", {
"mediumDate": "dd.MM.y", "mediumDate": "dd.MM.y",
"mediumTime": "HH:mm:ss", "mediumTime": "HH:mm:ss",
"short": "dd.MM.yy HH:mm", "short": "dd.MM.yy HH:mm",
"shortDate": "dd.MM.yy", "shortDate": "dd.MM.yyyy",
"shortTime": "HH:mm" "shortTime": "HH:mm"
}, },
"NUMBER_FORMATS": { "NUMBER_FORMATS": {

View File

@ -104,7 +104,7 @@ $provide.value("$locale", {
"mediumDate": "MMM d, y", "mediumDate": "MMM d, y",
"mediumTime": "h:mm:ss a", "mediumTime": "h:mm:ss a",
"short": "M/d/yy h:mm a", "short": "M/d/yy h:mm a",
"shortDate": "M/d/yy", "shortDate": "MM/dd/yyyy",
"shortTime": "h:mm a" "shortTime": "h:mm a"
}, },
"NUMBER_FORMATS": { "NUMBER_FORMATS": {

View File

@ -86,7 +86,7 @@ $provide.value("$locale", {
"mediumDate": "d MMM y", "mediumDate": "d MMM y",
"mediumTime": "H:mm:ss", "mediumTime": "H:mm:ss",
"short": "d/M/yy H:mm", "short": "d/M/yy H:mm",
"shortDate": "d/M/yy", "shortDate": "dd/MM/yyyy",
"shortTime": "H:mm" "shortTime": "H:mm"
}, },
"NUMBER_FORMATS": { "NUMBER_FORMATS": {

View File

@ -86,7 +86,7 @@ $provide.value("$locale", {
"mediumDate": "d MMM y", "mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss", "mediumTime": "HH:mm:ss",
"short": "dd/MM/y HH:mm", "short": "dd/MM/y HH:mm",
"shortDate": "dd/MM/y", "shortDate": "dd/MM/yyyy",
"shortTime": "HH:mm" "shortTime": "HH:mm"
}, },
"NUMBER_FORMATS": { "NUMBER_FORMATS": {

View File

@ -86,7 +86,7 @@ $provide.value("$locale", {
"mediumDate": "y\u5e74M\u6708d\u65e5", "mediumDate": "y\u5e74M\u6708d\u65e5",
"mediumTime": "ah:mm:ss", "mediumTime": "ah:mm:ss",
"short": "y/M/d ah:mm", "short": "y/M/d ah:mm",
"shortDate": "y/M/d", "shortDate": "yyyy/MM/dd",
"shortTime": "ah:mm" "shortTime": "ah:mm"
}, },
"NUMBER_FORMATS": { "NUMBER_FORMATS": {

View File

@ -86,7 +86,7 @@ $provide.value("$locale", {
"mediumDate": "y\u5e74M\u6708d\u65e5", "mediumDate": "y\u5e74M\u6708d\u65e5",
"mediumTime": "ah:mm:ss", "mediumTime": "ah:mm:ss",
"short": "y/M/d ah:mm", "short": "y/M/d ah:mm",
"shortDate": "y/M/d", "shortDate": "yyyy/MM/dd",
"shortTime": "ah:mm" "shortTime": "ah:mm"
}, },
"NUMBER_FORMATS": { "NUMBER_FORMATS": {

View File

@ -36,16 +36,21 @@
<p class="help-block" ng-show="documentForm.description.$error.maxlength && documentForm.$dirty">{{ 'validation.too_long' | translate }}</p> <p class="help-block" ng-show="documentForm.description.$error.maxlength && documentForm.$dirty">{{ 'validation.too_long' | translate }}</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group" ng-class="{ 'has-error': !documentForm.createDate.$valid }">
<label class="col-sm-2 control-label" for="inputCreateDate">{{ 'document.creation_date' | translate }}</label> <label class="col-sm-2 control-label" for="inputCreateDate">{{ 'document.creation_date' | translate }}</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" id="inputCreateDate" <div class="input-group">
<input type="text" id="inputCreateDate" name="createDate"
current-text="{{ 'directive.datepicker.current' | translate }}" current-text="{{ 'directive.datepicker.current' | translate }}"
clear-text="{{ 'directive.datepicker.clear' | translate }}" clear-text="{{ 'directive.datepicker.clear' | translate }}"
close-text="{{ 'directive.datepicker.close' | translate }}" close-text="{{ 'directive.datepicker.close' | translate }}"
ng-readonly="true" uib-datepicker-popup="{{ dateFormat }}" class="form-control" uib-datepicker-popup="{{ dateFormat }}" class="form-control"
ng-model="document.create_date" datepicker-options="{ startingDay: 1, showWeeks: false }" ng-model="document.create_date" datepicker-options="{ startingDay: 1, showWeeks: false }"
ng-click="datepickerOpened = true" is-open="datepickerOpened" ng-disabled="fileIsUploading" /> is-open="datepickerOpened" ng-disabled="fileIsUploading" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="datepickerOpened = true" ng-disabled="fileIsUploading"><i class="fas fa-calendar"></i></button>
</span>
</div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -58,7 +63,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label" for="inputFiles">{{ 'document.edit.new_files' | translate }}</label> <label class="col-sm-2 control-label" for="inputFiles">{{ 'document.edit.new_files' | translate }}</label>
<div class="col-sm-6"> <div class="col-sm-10">
<input type="file" ngf-select class="form-control" id="inputFiles" ngf-multiple="true" ng-model="newFiles" ng-disabled="fileIsUploading"></input> <input type="file" ngf-select class="form-control" id="inputFiles" ngf-multiple="true" ng-model="newFiles" ng-disabled="fileIsUploading"></input>
</div> </div>
<div class="col-sm-4" ng-if="orphanFiles.length > 0" <div class="col-sm-4" ng-if="orphanFiles.length > 0"
@ -84,14 +89,18 @@
name="{{ meta.id }}" ng-model="meta.value" autocomplete="off" name="{{ meta.id }}" ng-model="meta.value" autocomplete="off"
ng-disabled="fileIsUploading" /> ng-disabled="fileIsUploading" />
<input ng-if="meta.type == 'DATE'" <div class="input-group" ng-if="meta.type == 'DATE'">
type="text" id="input{{ meta.id }}" name="{{ meta.id }}" <input type="text" id="input{{ meta.id }}" name="{{ meta.id }}"
current-text="{{ 'directive.datepicker.current' | translate }}" current-text="{{ 'directive.datepicker.current' | translate }}"
clear-text="{{ 'directive.datepicker.clear' | translate }}" clear-text="{{ 'directive.datepicker.clear' | translate }}"
close-text="{{ 'directive.datepicker.close' | translate }}" close-text="{{ 'directive.datepicker.close' | translate }}"
ng-readonly="true" uib-datepicker-popup="{{ dateFormat }}" class="form-control" uib-datepicker-popup="{{ dateFormat }}" class="form-control"
ng-model="meta.value" datepicker-options="{ startingDay: 1, showWeeks: false }" ng-model="meta.value" datepicker-options="{ startingDay: 1, showWeeks: false }"
ng-click="datepickerOpenedMeta[meta.id] = true" is-open="datepickerOpenedMeta[meta.id]" ng-disabled="fileIsUploading" /> is-open="datepickerOpenedMeta[meta.id]" ng-disabled="fileIsUploading" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="datepickerOpenedMeta[meta.id] = true" ng-disabled="fileIsUploading"><i class="fas fa-calendar"></i></button>
</span>
</div>
<input ng-if="meta.type == 'INTEGER'" <input ng-if="meta.type == 'INTEGER'"
ng-pattern="/^[0-9]*$/" class="form-control" type="text" id="input{{ meta.id }}" ng-pattern="/^[0-9]*$/" class="form-control" type="text" id="input{{ meta.id }}"