Mercurial > hg > LGDataverses
comparison src/main/webapp/metadataFragment.xhtml @ 10:a50cf11e5178
Rewrite LGDataverse completely upgrading to dataverse4.0
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Tue, 08 Sep 2015 17:00:21 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 9:5926d6419569 | 10:a50cf11e5178 |
|---|---|
| 1 <ui:composition xmlns="http://www.w3.org/1999/xhtml" | |
| 2 xmlns:h="http://java.sun.com/jsf/html" | |
| 3 xmlns:f="http://java.sun.com/jsf/core" | |
| 4 xmlns:ui="http://java.sun.com/jsf/facelets" | |
| 5 xmlns:c="http://java.sun.com/jsp/jstl/core" | |
| 6 xmlns:p="http://primefaces.org/ui" | |
| 7 xmlns:o="http://omnifaces.org/ui" | |
| 8 xmlns:jsf="http://xmlns.jcp.org/jsf"> | |
| 9 | |
| 10 <!-- View Mode --> | |
| 11 | |
| 12 <div class="panel-group" jsf:rendered="${empty editMode or managePage}"> | |
| 13 <o:importFunctions type="edu.harvard.iq.dataverse.util.MarkupChecker" /> | |
| 14 <ui:repeat value="#{metadataBlocks}" | |
| 15 var="metadataBlockVal" varStatus="block"> | |
| 16 <div class="panel panel-default"> | |
| 17 <div data-toggle="collapse" data-target="#panelCollapse#{block.index}" class="panel-heading text-info"> | |
| 18 #{metadataBlockVal.key.displayName}  <span class="glyphicon #{block.first?'glyphicon-chevron-up':'glyphicon-chevron-down'}"/> | |
| 19 </div> | |
| 20 <div id="panelCollapse#{block.index}" class="collapse #{block.first?'in':''}"> | |
| 21 <div class="panel-body"> | |
| 22 <ui:fragment rendered="#{block.index == '0' and datasetPage}"> | |
| 23 <div class="form-group"> | |
| 24 <label for="metadata_publicationDate" class="col-sm-3 control-label"> | |
| 25 <span data-toggle="tooltip" data-placement="auto right" class="tooltiplabel text-info" data-original-title="#{bundle['dataset.metadata.persistentId.tip']}"> | |
| 26 #{bundle['dataset.metadata.persistentId']} | |
| 27 </span> | |
| 28 </label> | |
| 29 <div class="col-sm-9"> | |
| 30 #{globalId} | |
| 31 </div> | |
| 32 </div> | |
| 33 <div class="form-group" jsf:rendered="#{!empty publicationDate}"> | |
| 34 <label for="metadata_publicationDate" class="col-sm-3 control-label"> | |
| 35 <span data-toggle="tooltip" data-placement="auto right" class="tooltiplabel text-info" data-original-title="#{bundle['dataset.metadata.publicationDate.tip']}"> | |
| 36 #{bundle['dataset.metadata.publicationDate']} | |
| 37 </span> | |
| 38 </label> | |
| 39 <div class="col-sm-9"> | |
| 40 #{publicationDate} | |
| 41 </div> | |
| 42 </div> | |
| 43 </ui:fragment> | |
| 44 <ui:repeat value="#{metadataBlockVal.value}" var="dsf"> | |
| 45 <div class="form-group"> | |
| 46 <label for="metadata_#{dsf.datasetFieldType.name}" class="col-sm-3 control-label"> | |
| 47 <span data-toggle="tooltip" data-placement="auto right" class="tooltiplabel text-info" data-original-title="#{dsf.datasetFieldType.description}"> | |
| 48 #{dsf.datasetFieldType.title} | |
| 49 </span> | |
| 50 </label> | |
| 51 <!-- Primitive datasetFields --> | |
| 52 <div class="col-sm-9" jsf:rendered="#{dsf.datasetFieldType.primitive}"> | |
| 53 <h:outputText value="#{dsf.datasetFieldType.fieldType ne 'TEXTBOX' ? dsf.value : MarkupChecker:sanitizeBasicHTML(dsf.value) }" rendered="#{!dsf.datasetFieldType.allowMultiples}" | |
| 54 escape="#{dsf.datasetFieldType.fieldType ne 'TEXTBOX'}"/> | |
| 55 <ui:repeat value="#{dsf.values}" var="value" varStatus="loop" rendered="#{dsf.datasetFieldType.allowMultiples}"> | |
| 56 <h:outputText value="#{loop.first?'':'; '}#{dsf.datasetFieldType.fieldType ne 'TEXTBOX' ? value : MarkupChecker:sanitizeBasicHTML(value)}" | |
| 57 escape="#{dsf.datasetFieldType.fieldType ne 'TEXTBOX'}"/> | |
| 58 </ui:repeat> | |
| 59 </div> | |
| 60 <!-- Compound datasetFields --> | |
| 61 <div class="col-sm-9" jsf:rendered="#{dsf.datasetFieldType.compound}"> | |
| 62 <ui:fragment rendered="#{dsf.datasetFieldType.name == 'datasetContact'}"> | |
| 63 <p class="help-block"> | |
| 64 <span class="glyphicon glyphicon-info-sign"/> | |
| 65 <h:outputText value=" #{bundle['dataset.contact.tip']}"/> | |
| 66 </p> | |
| 67 </ui:fragment> | |
| 68 <ui:repeat value="#{dsf.datasetFieldCompoundValues}" var="compoundValue"> | |
| 69 <ui:repeat value="#{compoundValue.displayValueMap.entrySet().toArray()}" var="cvPart" varStatus="partStatus"> | |
| 70 <h:outputText value="#{dsf.datasetFieldType.displayFormat} " rendered="${!partStatus.first}"/> | |
| 71 <h:outputText value="#{cvPart.key.datasetFieldType.fieldType ne 'URL' and | |
| 72 cvPart.key.datasetFieldType.fieldType ne 'TEXTBOX' ? cvPart.value : MarkupChecker:sanitizeBasicHTML(cvPart.value)}" | |
| 73 escape="#{cvPart.key.datasetFieldType.fieldType ne 'URL' and | |
| 74 cvPart.key.datasetFieldType.fieldType ne 'TEXTBOX'}"/> | |
| 75 </ui:repeat> | |
| 76 <br/> | |
| 77 </ui:repeat> | |
| 78 </div> | |
| 79 </div> | |
| 80 </ui:repeat> | |
| 81 </div> | |
| 82 </div> | |
| 83 </div> | |
| 84 </ui:repeat> | |
| 85 </div> | |
| 86 | |
| 87 <!-- Edit Mode --> | |
| 88 <ui:fragment rendered="${(!empty editMode)}"> | |
| 89 <o:importFunctions type="java.util.Collections" /> | |
| 90 <div class="panel-group"> | |
| 91 <ui:repeat value="#{metadataBlocks}" var="metadataBlockVal" varStatus="block"> | |
| 92 <div class="panel panel-default" jsf:rendered="#{(editMode == 'METADATA' or metadataBlockVal.key.displayOnCreate or !metadataBlockVal.key.isEmpty() | |
| 93 or metadataBlockVal.key.isHasRequired()) | |
| 94 or (!datasetPage) }"> | |
| 95 | |
| 96 <div data-toggle="collapse" data-target="#panelCollapse#{block.index}" class="panel-heading text-info"> | |
| 97 #{metadataBlockVal.key.displayName} <span class="glyphicon #{block.first?'glyphicon-chevron-up':'glyphicon-chevron-down'}"/> | |
| 98 </div> | |
| 99 <div id="panelCollapse#{block.index}" class="collapse #{block.first || editMode == 'CREATE'?'in':''}"> | |
| 100 <div class="panel-body"> | |
| 101 <ui:repeat value="#{metadataBlockVal.value}" var="dsf"> | |
| 102 <ui:fragment rendered="#{((editMode == 'METADATA' | |
| 103 or dsf.datasetFieldType.displayOnCreate or !dsf.isEmpty() or dsf.required or dsf.datasetFieldType.hasRequiredChildren) and dsf.include) | |
| 104 or (!datasetPage and dsf.include)}"> | |
| 105 | |
| 106 <div class="form-group"> | |
| 107 <label for="metadata_#{dsf.datasetFieldType.name}" class="col-sm-3 control-label"> | |
| 108 <span data-toggle="tooltip" data-placement="auto right" class="tooltiplabel text-info" data-original-title="#{dsf.datasetFieldType.description}"> | |
| 109 #{dsf.datasetFieldType.title} | |
| 110 </span> | |
| 111 <h:outputText styleClass="glyphicon glyphicon-asterisk text-danger" value="" rendered="#{dsf.required or dsf.datasetFieldType.hasRequiredChildren }" /> | |
| 112 </label> | |
| 113 | |
| 114 <!-- Primitive fields --> | |
| 115 <p:fragment autoUpdate="true" rendered="#{dsf.datasetFieldType.primitive}"> | |
| 116 <div class="form-group"> | |
| 117 <ui:remove><!-- There is an issue with the dynamic +/- and the primefaces autoupdate where they are not working | |
| 118 well together for the primitive fields, but are for the compound fields. So as a workaround for the primitive, | |
| 119 we wrap them in a ui:repeat that iterates on a single list. Note: dummyVar is never used--></ui:remove> | |
| 120 <ui:repeat value="#{Collections:singletonList('')}" var="dummyVar"> | |
| 121 <div class="form-col-container col-sm-12"> | |
| 122 <ui:repeat value="#{dsf.datasetFieldValues}" var="dsfv" varStatus="valCount" > | |
| 123 <div class="form-group dataset-field-values"> | |
| 124 <div class="form-col-container col-sm-9 edit-field"> | |
| 125 <ui:include src="datasetFieldForEditFragment.xhtml"> | |
| 126 <ui:param name="dsfv" value="#{dsfv}"/> | |
| 127 <ui:param name="dsfvIndex" value="#{valCount.index}"/> | |
| 128 </ui:include> | |
| 129 </div> | |
| 130 <!-- Add / Remove buttons --> | |
| 131 <div class="col-xs-3 field-add-delete" jsf:rendered="#{dsf.datasetFieldType.allowMultiples and !dsf.datasetFieldType.controlledVocabulary}"> | |
| 132 <p:commandLink tabindex="#{block.index+1}" title="#{bundle.add}" | |
| 133 styleClass="btn btn-default btn-sm bootstrap-button-tooltip #{dsf.datasetFieldType.compound ? 'compound-field-btn' : ''}" | |
| 134 actionListener="#{dsf.addDatasetFieldValue(valCount.index + 1)}" | |
| 135 oncomplete="javascript:bind_bsui_components();"> | |
| 136 <span class="glyphicon glyphicon-plus no-text"/> | |
| 137 </p:commandLink> | |
| 138 <p:commandLink tabindex="#{block.index+1}" title="#{bundle.delete}" | |
| 139 styleClass="btn btn-default btn-sm bootstrap-button-tooltip #{dsf.datasetFieldType.compound ? 'compound-field-btn' : ''}" | |
| 140 rendered="#{dsf.datasetFieldValues.size() > 1}" | |
| 141 actionListener="#{dsf.removeDatasetFieldValue(valCount.index)}" | |
| 142 oncomplete="javascript:bind_bsui_components();"> | |
| 143 <span class="glyphicon glyphicon-minus no-text"/> | |
| 144 </p:commandLink> | |
| 145 </div> | |
| 146 </div> | |
| 147 </ui:repeat> | |
| 148 <ui:fragment rendered="#{dsf.datasetFieldType.controlledVocabulary}"> | |
| 149 <p:selectOneMenu tabindex="#{block.index+1}" | |
| 150 value="#{dsf.singleControlledVocabularyValue}" converter="controlledVocabularyValueConverter" style="width: auto !important; max-width:100%; min-width:200px;" styleClass="form-control primitive SELECT TESTTEST" | |
| 151 rendered="#{!dsf.datasetFieldType.allowMultiples}"> | |
| 152 <f:selectItem itemLabel="#{bundle.select}" itemValue="" noSelectionOption="true"/> | |
| 153 <f:selectItems value="#{dsf.datasetFieldType.controlledVocabularyValues}" var="cvv" itemLabel="#{cvv.strValue}" itemValue="#{cvv}" /> | |
| 154 </p:selectOneMenu> | |
| 155 <div class="ui-inputfield form-control select-scroll-block" jsf:rendered="#{dsf.datasetFieldType.allowMultiples}"> | |
| 156 <p:selectManyCheckbox value="#{dsf.controlledVocabularyValues}" converter="controlledVocabularyValueConverter" | |
| 157 layout="pageDirection"> | |
| 158 <f:selectItem itemLabel="#{bundle.select}" class="chkbox-label-margin" itemValue="" noSelectionOption="true"/> | |
| 159 <f:selectItems value="#{dsf.datasetFieldType.controlledVocabularyValues}" var="cvv" itemLabel="#{cvv.strValue}" itemValue="#{cvv}" /> | |
| 160 </p:selectManyCheckbox> | |
| 161 </div> | |
| 162 <div class="alert-danger" jsf:rendered="#{!empty dsf.validationMessage}"> | |
| 163 <strong>#{dsf.validationMessage}</strong> | |
| 164 </div> | |
| 165 </ui:fragment> | |
| 166 </div> | |
| 167 </ui:repeat> | |
| 168 </div> | |
| 169 </p:fragment> | |
| 170 | |
| 171 <!-- Compound fields --> | |
| 172 <p:fragment autoUpdate="true" rendered="#{dsf.datasetFieldType.compound}"> | |
| 173 <div class="form-group form-col-container col-sm-9 dataset-field-values"> | |
| 174 <ui:repeat value="#{dsf.datasetFieldCompoundValues}" var="compoundValue" varStatus="valCount"> | |
| 175 <div class="form-group form-col-container col-sm-9 edit-compound-field"> | |
| 176 <!-- Sub Fields --> | |
| 177 <ui:repeat value="#{compoundValue.childDatasetFields}" var="subdsf"> | |
| 178 <div class="form-col-container #{(subdsf.datasetFieldType.fieldType == 'TEXTBOX') ? 'col-sm-12' : 'col-sm-6'}"> | |
| 179 <ui:fragment rendered="#{subdsf.datasetFieldType.name == 'dsDescriptionValue'}"> | |
| 180 <p class="help-block"> | |
| 181 <span class="glyphicon glyphicon-info-sign"/> | |
| 182 <h:outputFormat value=" #{bundle.htmlAllowedMsg}" escape="false"> | |
| 183 <f:param value="#{bundle.htmlAllowedTags}"/> | |
| 184 </h:outputFormat> | |
| 185 </p> | |
| 186 </ui:fragment> | |
| 187 <label class="control-label" for="metadata_#{subdsf.datasetFieldType.name}"> | |
| 188 <span data-toggle="tooltip" data-placement="auto right" class="tooltiplabel text-info" data-original-title="#{subdsf.datasetFieldType.description}">#{subdsf.datasetFieldType.title}</span> | |
| 189 <h:outputText styleClass="glyphicon glyphicon-asterisk text-danger" value="" rendered="#{subdsf.required}" /> | |
| 190 </label> | |
| 191 <ui:fragment rendered="#{!subdsf.datasetFieldType.controlledVocabulary}"> | |
| 192 <ui:include src="datasetFieldForEditFragment.xhtml"> | |
| 193 <ui:param name="dsfv" value="#{subdsf.singleValue}"/> | |
| 194 <ui:param name="dsfvIndex" value="0"/> | |
| 195 </ui:include> | |
| 196 </ui:fragment> | |
| 197 <!-- MOVED SELECT ONE TO dataFieldForEdit --> | |
| 198 <div jsf:rendered="#{subdsf.datasetFieldType.controlledVocabulary}"> | |
| 199 <p:selectOneMenu tabindex="#{block.index+1}" value="#{subdsf.singleControlledVocabularyValue}" converter="controlledVocabularyValueConverter" style="width: auto !important; max-width:100%; min-width:200px;" | |
| 200 rendered="#{!subdsf.datasetFieldType.allowMultiples}"> | |
| 201 <f:selectItem itemLabel="#{bundle.select}" itemValue="" noSelectionOption="true"/> | |
| 202 <f:selectItems value="#{subdsf.datasetFieldType.controlledVocabularyValues}" var="cvv" itemLabel="#{cvv.strValue}" itemValue="#{cvv}" /> | |
| 203 </p:selectOneMenu> | |
| 204 <div class="ui-inputfield form-control select-scroll-block" jsf:rendered="#{subdsf.datasetFieldType.allowMultiples}"> | |
| 205 <p:selectManyCheckbox value="#{subdsf.controlledVocabularyValues}" converter="controlledVocabularyValueConverter" | |
| 206 layout="pageDirection"> | |
| 207 <f:selectItems value="#{subdsf.datasetFieldType.controlledVocabularyValues}" var="cvv" itemLabel="#{cvv.strValue}" itemValue="#{cvv}" /> | |
| 208 </p:selectManyCheckbox> | |
| 209 </div> | |
| 210 <div class="alert-danger" jsf:rendered="#{!empty subdsf.validationMessage}"> | |
| 211 <strong>#{subdsf.validationMessage}</strong> | |
| 212 </div> | |
| 213 </div> | |
| 214 </div> | |
| 215 </ui:repeat> | |
| 216 </div> | |
| 217 <div class="col-sm-3 field-add-delete" jsf:rendered="#{dsf.datasetFieldType.allowMultiples and !dsf.datasetFieldType.controlledVocabulary}"> | |
| 218 <p:commandLink tabindex="#{block.index+1}" title="#{bundle.add}" | |
| 219 styleClass="btn btn-default btn-sm bootstrap-button-tooltip #{dsf.datasetFieldType.compound ? 'compound-field-btn' : ''}" | |
| 220 actionListener="#{dsf.addDatasetFieldCompoundValue(valCount.index + 1)}" | |
| 221 oncomplete="javascript:bind_bsui_components();"> | |
| 222 <span class="glyphicon glyphicon-plus no-text"/> | |
| 223 </p:commandLink> | |
| 224 <p:commandLink tabindex="#{block.index+1}" title="#{bundle.delete}" | |
| 225 styleClass="btn btn-default btn-sm bootstrap-button-tooltip #{dsf.datasetFieldType.compound ? 'compound-field-btn' : ''}" | |
| 226 rendered="#{dsf.datasetFieldCompoundValues.size() > 1}" | |
| 227 actionListener="#{dsf.removeDatasetFieldCompoundValue(valCount.index)}" | |
| 228 oncomplete="javascript:bind_bsui_components();"> | |
| 229 <span class="glyphicon glyphicon-minus no-text"/> | |
| 230 </p:commandLink> | |
| 231 </div> | |
| 232 </ui:repeat> | |
| 233 </div> | |
| 234 </p:fragment> | |
| 235 </div> | |
| 236 </ui:fragment> | |
| 237 </ui:repeat> | |
| 238 </div> | |
| 239 </div> | |
| 240 </div> | |
| 241 </ui:repeat> | |
| 242 </div> | |
| 243 </ui:fragment> | |
| 244 </ui:composition> |
