mirror of
https://github.com/sismics/docs.git
synced 2025-12-21 13:41:37 +00:00
#65: Publisher, format, source metadata
This commit is contained in:
@@ -2,70 +2,99 @@
|
||||
|
||||
<div ng-show="document || !isEdit()">
|
||||
<form name="documentForm" class="form-horizontal">
|
||||
<div class="form-group" ng-class="{ 'has-error': !documentForm.title.$valid }">
|
||||
<label class="col-sm-2 control-label" for="inputTitle">Title</label>
|
||||
<div class="col-sm-10">
|
||||
<input required ng-maxlength="100" class="form-control" type="text" id="inputTitle"
|
||||
placeholder="Title" name="title" ng-model="document.title" autocomplete="off"
|
||||
typeahead="document for document in getTitleTypeahead($viewValue) | filter: $viewValue"
|
||||
typeahead-wait-ms="200" ng-disabled="fileIsUploading" />
|
||||
<fieldset>
|
||||
<legend>Primary metadata</legend>
|
||||
<div class="form-group" ng-class="{ 'has-error': !documentForm.title.$valid }">
|
||||
<label class="col-sm-2 control-label" for="inputTitle">Title</label>
|
||||
<div class="col-sm-10">
|
||||
<input required ng-maxlength="100" class="form-control" type="text" id="inputTitle"
|
||||
placeholder="The nature or genre of the resource" name="title" ng-model="document.title" autocomplete="off"
|
||||
typeahead="document for document in getTitleTypeahead($viewValue) | filter: $viewValue"
|
||||
typeahead-wait-ms="200" ng-disabled="fileIsUploading" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" ng-class="{ 'has-error': !documentForm.description.$valid }">
|
||||
<label class="col-sm-2 control-label" for="inputDescription">Description</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea ng-maxlength="4000" class="form-control" rows="5" id="inputDescription"
|
||||
name="description" ng-model="document.description" ng-disabled="fileIsUploading"></textarea>
|
||||
<div class="form-group" ng-class="{ 'has-error': !documentForm.description.$valid }">
|
||||
<label class="col-sm-2 control-label" for="inputDescription">Description</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea ng-maxlength="4000" class="form-control" rows="5" id="inputDescription" placeholder="An account of the resource"
|
||||
name="description" ng-model="document.description" ng-disabled="fileIsUploading"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" ng-class="{ 'has-error': !documentForm.subject.$valid }">
|
||||
<label class="col-sm-2 control-label" for="inputSubject">Subject</label>
|
||||
<div class="col-sm-10">
|
||||
<input ng-maxlength="500" class="form-control" type="text" id="inputSubject"
|
||||
placeholder="Subject" name="subject" ng-model="document.subject" ng-disabled="fileIsUploading" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="inputCreateDate">Creation date</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="inputCreateDate" ng-readonly="true" datepicker-popup="yyyy-MM-dd" class="form-control"
|
||||
ng-model="document.create_date" starting-day="1" show-weeks="false" ng-disabled="fileIsUploading" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" ng-class="{ 'has-error': !documentForm.identifier.$valid }">
|
||||
<label class="col-sm-2 control-label" for="inputIdentifier">Identifier</label>
|
||||
<div class="col-sm-10">
|
||||
<input ng-maxlength="500" class="form-control" type="text" id="inputIdentifier"
|
||||
placeholder="Identifier" name="identifier" ng-model="document.identifier" ng-disabled="fileIsUploading" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="inputLanguage">Language</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" id="inputLanguage" ng-model="document.language" ng-disabled="fileIsUploading">
|
||||
<option value="fra">French</option>
|
||||
<option value="eng">English</option>
|
||||
<option value="jpn">Japanese</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="inputCreateDate">Creation date</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="inputCreateDate" ng-readonly="true" datepicker-popup="yyyy-MM-dd" class="form-control"
|
||||
ng-model="document.create_date" starting-day="1" show-weeks="false" ng-disabled="fileIsUploading" />
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="inputFiles">New files</label>
|
||||
<div class="col-sm-6">
|
||||
<file class="form-control" id="inputFiles" multiple="multiple" ng-model="newFiles"
|
||||
accept="image/png,image/jpg,image/jpeg,image/gif,application/pdf,application/vnd.oasis.opendocument.text,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||
ng-disabled="fileIsUploading"></file>
|
||||
</div>
|
||||
<div class="col-sm-4" ng-if="orphanFiles.length > 0">
|
||||
+ {{ orphanFiles.length }} file{{ orphanFiles.length > 1 ? 's' : '' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="inputLanguage">Language</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" id="inputLanguage" ng-model="document.language" ng-disabled="fileIsUploading">
|
||||
<option value="fra">French</option>
|
||||
<option value="eng">English</option>
|
||||
<option value="jpn">Japanese</option>
|
||||
</select>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="inputTags">Tags</label>
|
||||
<div class="col-sm-10">
|
||||
<select-tag tags="document.tags" ref="inputTags" ng-disabled="fileIsUploading"></select-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="inputFiles">New files</label>
|
||||
<div class="col-sm-6">
|
||||
<file class="form-control" id="inputFiles" multiple="multiple" ng-model="newFiles"
|
||||
accept="image/png,image/jpg,image/jpeg,image/gif,application/pdf,application/vnd.oasis.opendocument.text,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||
ng-disabled="fileIsUploading"></file>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>Additional metadata</legend>
|
||||
<div class="form-group" ng-class="{ 'has-error': !documentForm.subject.$valid }">
|
||||
<label class="col-sm-2 control-label" for="inputSubject">Subject</label>
|
||||
<div class="col-sm-10">
|
||||
<input ng-maxlength="500" class="form-control" type="text" id="inputSubject"
|
||||
placeholder="The topic of the resource" name="subject" ng-model="document.subject" ng-disabled="fileIsUploading" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4" ng-if="orphanFiles.length > 0">
|
||||
+ {{ orphanFiles.length }} file{{ orphanFiles.length > 1 ? 's' : '' }}
|
||||
<div class="form-group" ng-class="{ 'has-error': !documentForm.identifier.$valid }">
|
||||
<label class="col-sm-2 control-label" for="inputIdentifier">Identifier</label>
|
||||
<div class="col-sm-10">
|
||||
<input ng-maxlength="500" class="form-control" type="text" id="inputIdentifier"
|
||||
placeholder="An unambiguous reference to the resource within a given context" name="identifier" ng-model="document.identifier" ng-disabled="fileIsUploading" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="inputTags">Tags</label>
|
||||
<div class="col-sm-10">
|
||||
<select-tag tags="document.tags" ref="inputTags" ng-disabled="fileIsUploading"></select-tag>
|
||||
<div class="form-group" ng-class="{ 'has-error': !documentForm.publisher.$valid }">
|
||||
<label class="col-sm-2 control-label" for="inputPublisher">Publisher</label>
|
||||
<div class="col-sm-10">
|
||||
<input ng-maxlength="500" class="form-control" type="text" id="inputPublisher"
|
||||
placeholder="An entity responsible for making the resource available" name="publisher" ng-model="document.publisher" ng-disabled="fileIsUploading" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" ng-class="{ 'has-error': !documentForm.format.$valid }">
|
||||
<label class="col-sm-2 control-label" for="inputFormat">Format</label>
|
||||
<div class="col-sm-10">
|
||||
<input ng-maxlength="500" class="form-control" type="text" id="inputFormat"
|
||||
placeholder="The file format, physical medium, or dimensions of the resource" name="format" ng-model="document.format" ng-disabled="fileIsUploading" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" ng-class="{ 'has-error': !documentForm.source.$valid }">
|
||||
<label class="col-sm-2 control-label" for="inputSource">Source</label>
|
||||
<div class="col-sm-10">
|
||||
<input ng-maxlength="500" class="form-control" type="text" id="inputSource"
|
||||
placeholder="A related resource from which the described resource is derived" name="source" ng-model="document.source" ng-disabled="fileIsUploading" />
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-primary" ng-disabled="!documentForm.$valid || fileIsUploading" ng-click="edit()">{{ isEdit() ? 'Edit' : 'Add' }}</button>
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
<dd ng-if="document.subject">{{ document.subject }}</dd>
|
||||
<dt ng-if="document.identifier">Identifier</dt>
|
||||
<dd ng-if="document.identifier">{{ document.identifier }}</dd>
|
||||
<dt ng-if="document.publisher">Publisher</dt>
|
||||
<dd ng-if="document.publisher">{{ document.publisher }}</dd>
|
||||
<dt ng-if="document.format">Format</dt>
|
||||
<dd ng-if="document.format">{{ document.format }}</dd>
|
||||
<dt ng-if="document.source">Source</dt>
|
||||
<dd ng-if="document.source">{{ document.source }}</dd>
|
||||
</dl>
|
||||
|
||||
<div ng-file-drop drag-over-class="bg-success" ng-multiple="true" allow-dir="false" ng-model="dropFiles"
|
||||
|
||||
Reference in New Issue
Block a user