<commit_before><!-- datail start -->
<%@ include file="/include/directive.jsp" %>
<html ng-app="main" ng-controller="MainController">
<div class="container-fluid">

	<ol class="breadcrumb">
		<li><a href ng-click="gotoDocumentBreadcrumb(-1, jbDetailFormDocument)"><fmt:message key="jsp.document.label"/></a></li>
		<li class="active" ng-show="currentRownum == null"><fmt:message key="jsp.document.insert"/></li>
		<li ng-repeat="d in documentBreadcrumbs">
		  <a ng-if="!$last" href ng-click="gotoDocumentBreadcrumb($index, jbDetailFormDocument)">{{d.description}}</a>
		  <span ng-if="$last">{{d.description}}</span>
		</li>
	</ol>
	<div class="page-header ">
		<div class="pull-right">
			<button ng-if="!isReadOnly()" class="btn btn-primary" type="button" ng-click="jbValidate.checkForm(jbDetailFormDocument) && saveDetail(jbDetailFormDocument)">
				<span ng-hide="currentRownum == null"><i class="fa fa-floppy-o"></i> <fmt:message key="jsp.detail.update.submit"/></span>
				<span ng-show="currentRownum == null"><i class="fa fa-floppy-o"></i> <fmt:message key="jsp.detail.insert.submit"/></span>
			</button>
			<button ng-hide="currentRownum == null || isItem" class="btn btn-default" type="button" ng-click="jbDetailFormDocument.print()"><i class="fa fa-download"></i> <fmt:message key="jsp.detail.download"/></button>
			<button class="btn btn-default" type="button" ng-click="gotoDocumentBreadcrumb(breadCrumbIndex-1, jbDetailFormDocument)"><i class="fa fa-times"></i> <fmt:message key="js.dialog.back"/></button>
		</div>
			<span ng-hide="currentRownum == null"><h1><b>{{documentEditing.description}}</b></h1></span>
			<span ng-show="currentRownum == null"><h1><b><fmt:message key="jsp.detail.insert.submit"/></b></h1></span>
	</div>
	<div>

	</div>
	<div class="row form-group">
		<!-- Preview -->
		<div class="col-sm-8" ng-if="!isItem">
			
			<div  ng-if="currentFileName != null" ng-bind-html="getDocumentObjectHTML() | trusted">
			
			</div>
		</div>
		<!-- Fine Preview -->
		<!-- Dettaglio -->
		<div class="col-sm-4">
			<!-- Informazioni di dettaglio -->
			<form name="jbDetailFormDocument" class="form-horizontal" novalidate jb-print="a/Document/{{documentEditing.id}}/content">
				<input ng-if="currentRownum != null" type="hidden" name="id" ng-model="documentEditing.id"/>
			
				<div ng-if="currentRownum == null" class="row jb-form-group">
					<label for="jbDetailFormDocument-file" class="control-label col-sm-4" title="<fmt:message key="jsp.document.file.title"/>"><fmt:message key="jsp.document.file.title"/></label>
					<div class="col-sm-8">
						<div class="input-group">
						 <input id="jbDetailFormDocument-file" class="form-control" title="<fmt:message key="jsp.document.name.title"/>" type="file" name="file" jb-upload="setCurrentFileName(newUrl, uploaded, userFilename)" />
						 <span class="input-group-btn">
						   <button class="btn btn-default" type="button" promise-btn="uploadPromise"><i class="fa fa-upload"></i> Upload</button>
						 </span>
						</div>
					</div>
				</div>
				
				<div class="row jb-form-group">
				  <label for="jbDetailFormDocument-name" class="control-label col-sm-4" title="<fmt:message key="jsp.document.name.title"/>"><fmt:message key="jsp.document.name.label" /></label>
				  <div class="col-sm-8">
				  	<p ng-if="isReadOnly()" class="form-control-static">{{documentEditing.name}}</p>
				  	<input  ng-if="!isReadOnly()" ng-required="true" id="jbDetailFormDocument-name" class="form-control" title="<fmt:message key="jsp.document.name.title"/>" type="text" name="name" ng-model="documentEditing.name" pattern="^\w+[\w\s\.-]*$"/>
				  	<label class="text-danger" ng-show="jbValidate.showMessage(jbDetailFormDocument.name)"><fmt:message key="js.validate.filename"/></label>
				  </div>
				</div>
				
				<div class="row jb-form-group">
				  <label for="jbDetailFormDocument-description" class="control-label col-sm-4" title="<fmt:message key="jsp.document.description.title"/>"><fmt:message key="jsp.document.description.label" /></label>
				  <div class="col-sm-8">
				    <p ng-if="isReadOnly()" class="form-control-static">{{documentEditing.description}}</p>
				  	<input ng-if="!isReadOnly()" ng-required="true" id="jbDetailFormDocument-description" class="form-control" title="<fmt:message key="jsp.document.description.title"/>" type="text" name="description" ng-model="documentEditing.description"/>
				  	<label class="text-danger" ng-show="jbValidate.showMessage(jbDetailFormDocument.description)"><fmt:message key="js.validate.required"/></label>
				  </div>
				</div>
				
				<div  class="row jb-form-group">
				  <label for="jbDetailFormDocument-type" class="control-label col-sm-4" title="<fmt:message key="jsp.document.type.title"/>"><fmt:message key="jsp.document.type.label" /></label>
				  <div class="col-sm-8">
				  	<div ng-if="currentRownum != null"><p class="form-control-static">{{documentEditing.typeName}}</p></div>
				  	<div ng-if="currentRownum == null">
						<select ng-required="true" class="form-control" id="jbDetailFormDocument-type" name="type" title="<fmt:message key="jsp.document.type.title"/>" ng-model="documentEditing.type" ng-change="typeChangedInsert(jbDetailFormDocument)">
					  	  	<option></option>
					   		<option ng-repeat="t in userDocumentTypes" value="{{t.id}}">{{t.name}}</option>
					 	</select>
					</div>
					<label class="text-danger" ng-show="jbValidate.showMessage(jbDetailFormDocument.type)"><fmt:message key="js.validate.required"/></label>
				  </div>
				</div>	
				
				<div ng-if="currentRownum != null" class="row jb-form-group">
				  <label for="jbDetailFormDocument-version" class="control-label col-sm-4" title="<fmt:message key="jsp.document.version.title"/>"><fmt:message key="jsp.document.version.label" /></label>
				  <div class="col-sm-8">
				  <p class="form-control-static">{{documentEditing.version}}</p>
				  </div>
				</div>	
					
				<div ng-if="currentRownum != null" class="row jb-form-group">
				  <label for="jbDetailFormDocument-created" class="control-label col-sm-4" title="<fmt:message key="jsp.document.created.title"/>"><fmt:message key="jsp.document.created.label" /></label>
				  <div class="col-sm-8">
					<p class="form-control-static">{{documentEditing.created | date: '${localePatternTimestamp}'}}</p>  
				  </div>
				</div>
					
				<div ng-if="currentRownum != null" class="row jb-form-group">
				  <label for="jbDetailFormDocument-createdBy" class="control-label col-sm-4" title="<fmt:message key="jsp.document.createdBy.title"/>"><fmt:message key="jsp.document.createdBy.label" /></label>
				  <div class="col-sm-8">
				 	 <p class="form-control-static">{{documentEditing.createdBy}}</p>
				  </div>
				</div>
				
				<!-- Propriet aggiuntive -->
				<div class="row jb-form-group" ng-repeat="p in documentTypeEdit.propertyList ">
				  <label for="jbDetailFormDocument-{{jbUtil.sanitize(p.queryName)}}" class="control-label col-sm-4" title="{{p.description}}">{{p.displayName}}</label>
				  <div class="col-sm-8">
					 
					  <div ng-if="p.propertyType == 'STRING'">
					  	<div ng-if="!readOnly" ng-class="jbValidate.getClass(jbDetailFormDocument[p.queryName])">
					  		
					  		<p ng-if="isReadOnly()" class="form-control-static">{{documentEditing.properties[p.queryName].value}}</p>
					  	    <input ng-required="p.required" ng-if="!isReadOnly() && jbUtil.isEmptyObject(p.choices) && !p.linkType" id="jbDetailFormDocument-{{jbUtil.sanitize(p.queryName)}}" class="form-control" title="{{p.description}}" type="text" name="{{p.queryName}}" ng-model="documentEditing.properties[p.queryName].value" />
					  	  	<select ng-required="p.required" ng-if="!isReadOnly() && !jbUtil.isEmptyObject(p.choices)" class="form-control" id="jbDetailFormDocument-{{jbUtil.sanitize(p.queryName)}}" title="{{p.description}}" name="{{p.queryName}}" ng-model="documentEditing.properties[p.queryName].value">
						        <option></option>
						    	<option ng-repeat="c in p.choices" value="{{c}}">{{c}}</option> 
						    	
						  	</select>
							<label class="text-danger" ng-show="jbValidate.showMessage(jbDetailFormDocument[p.queryName])"><fmt:message key="js.validate.required"/></label>
						</div>
						<div ng-if="readOnly || p.linkType">
							<p ng-if="!p.linkType" class="form-control-static">{{documentEditing.properties[p.queryName].value}}</p>
							<p ng-if="p.linkType" class="form-control-static">
								<a ng-click="showDocument(documentEditing.properties[p.queryName].value)">{{documentEditing.properties[queryName].value.split('|')[1]}}</a>
							</p>
						</div>
					  </div>
					  
					  <div ng-if="p.propertyType == 'INTEGER'">
					  	<div ng-if="!readOnly"  ng-class="jbValidate.getClass(jbDetailFormDocument[p.queryName])">
					  	<p ng-if="isReadOnly()" class="form-control-static">{{documentEditing.properties[p.queryName].value}}</p>
						  	<input ng-if="!isReadOnly()" ng-required="p.required" id="jbDetailFormDocument-{{jbUtil.sanitize(p.queryName)}}" class="form-control" title="{{p.description}}" type="text" name="{{p.queryName}}" ng-model="documentEditing.properties[p.queryName].value" ng-pattern="jbPatterns.number(0)" jb-number="0"/>
						 	<label class="text-danger" ng-show="jbValidate.showMessage(jbDetailFormDocument[p.queryName])"><fmt:message key="js.validate.number"/></label>
						</div>
						<div ng-if="readOnly">
							<p class="form-control-static">{{documentEditing.properties[p.queryName].value}}</p>
						</div>
					  	
					  </div>
					  
					  <div ng-if="p.propertyType == 'BOOLEAN'">
					  	<div ng-if="!readOnly">
					  		<p ng-if="isReadOnly()" class="form-control-static">{{documentEditing.properties[p.queryName].value |yesOrNo}}</p>
					  		 <select  ng-if="!isReadOnly()" ng-required="p.required" id="jbDetailFormDocument-{{jbUtil.sanitize(p.queryName)}}" class="form-control" title="{{p.description}}" name="{{p.queryName}}" ng-model="documentEditing.properties[p.queryName].value" jb-boolean>
					  			<option></option>
								<option value="true"><fmt:message key="jsp.boolean.1"/></option>
								<option value="false"><fmt:message key="jsp.boolean.0"/></option>
				  			</select> 
				  			<label class="text-danger" ng-show="jbValidate.showMessage(jbDetailFormDocument[p.queryName])"><fmt:message key="js.validate.required"/></label>
					  	</div>
				  		<div ng-if="readOnly">
							<p ng-if="documentEditing.properties[$index].value" class="form-control-static"><fmt:message key="jsp.boolean.1"/></p><commit_msg>Fixata visualizzazione documenti in readOnly<commit_after><!-- datail start -->
<%@ include file="/include/directive.jsp" %>
<html ng-app="main" ng-controller="MainController">
<div class="container-fluid">

	<ol class="breadcrumb">
		<li><a href ng-click="gotoDocumentBreadcrumb(-1, jbDetailFormDocument)"><fmt:message key="jsp.document.label"/></a></li>
		<li class="active" ng-show="currentRownum == null"><fmt:message key="jsp.document.insert"/></li>
		<li ng-repeat="d in documentBreadcrumbs">
		  <a ng-if="!$last" href ng-click="gotoDocumentBreadcrumb($index, jbDetailFormDocument)">{{d.description}}</a>
		  <span ng-if="$last">{{d.description}}</span>
		</li>
	</ol>
	<div class="page-header ">
		<div class="pull-right">
			<button ng-if="!readOnly && !isReadOnly()" class="btn btn-primary" type="button" ng-click="jbValidate.checkForm(jbDetailFormDocument) && saveDetail(jbDetailFormDocument)">
				<span ng-hide="currentRownum == null"><i class="fa fa-floppy-o"></i> <fmt:message key="jsp.detail.update.submit"/></span>
				<span ng-show="currentRownum == null"><i class="fa fa-floppy-o"></i> <fmt:message key="jsp.detail.insert.submit"/></span>
			</button>
			<button ng-hide="currentRownum == null || isItem" class="btn btn-default" type="button" ng-click="jbDetailFormDocument.print()"><i class="fa fa-download"></i> <fmt:message key="jsp.detail.download"/></button>
			<button class="btn btn-default" type="button" ng-click="gotoDocumentBreadcrumb(breadCrumbIndex-1, jbDetailFormDocument)"><i class="fa fa-times"></i> <fmt:message key="js.dialog.back"/></button>
		</div>
			<span ng-hide="currentRownum == null"><h1><b>{{documentEditing.description}}</b></h1></span>
			<span ng-show="currentRownum == null"><h1><b><fmt:message key="jsp.detail.insert.submit"/></b></h1></span>
	</div>
	<div>

	</div>
	<div class="row form-group">
		<!-- Preview -->
		<div class="col-sm-8" ng-if="!isItem">
			
			<div  ng-if="currentFileName != null" ng-bind-html="getDocumentObjectHTML() | trusted">
			
			</div>
		</div>
		<!-- Fine Preview -->
		<!-- Dettaglio -->
		<div class="col-sm-4">
			<!-- Informazioni di dettaglio -->
			<form name="jbDetailFormDocument" class="form-horizontal" novalidate jb-print="a/Document/{{documentEditing.id}}/content">
				<input ng-if="currentRownum != null" type="hidden" name="id" ng-model="documentEditing.id"/>
			
				<div ng-if="currentRownum == null" class="row jb-form-group">
					<label for="jbDetailFormDocument-file" class="control-label col-sm-4" title="<fmt:message key="jsp.document.file.title"/>"><fmt:message key="jsp.document.file.title"/></label>
					<div class="col-sm-8">
						<div class="input-group">
						 <input id="jbDetailFormDocument-file" class="form-control" title="<fmt:message key="jsp.document.name.title"/>" type="file" name="file" jb-upload="setCurrentFileName(newUrl, uploaded, userFilename)" />
						 <span class="input-group-btn">
						   <button class="btn btn-default" type="button" promise-btn="uploadPromise"><i class="fa fa-upload"></i> Upload</button>
						 </span>
						</div>
					</div>
				</div>
				
				<div class="row jb-form-group">
				  <label for="jbDetailFormDocument-name" class="control-label col-sm-4" title="<fmt:message key="jsp.document.name.title"/>"><fmt:message key="jsp.document.name.label" /></label>
				  <div class="col-sm-8">
				  	<p ng-if="readOnly || isReadOnly()" class="form-control-static">{{documentEditing.name}}</p>
				  	<input  ng-if="!readOnly && !isReadOnly()" ng-required="true" id="jbDetailFormDocument-name" class="form-control" title="<fmt:message key="jsp.document.name.title"/>" type="text" name="name" ng-model="documentEditing.name" pattern="^\w+[\w\s\.-]*$"/>
				  	<label class="text-danger" ng-show="jbValidate.showMessage(jbDetailFormDocument.name)"><fmt:message key="js.validate.filename"/></label>
				  </div>
				</div>
				
				<div class="row jb-form-group">
				  <label for="jbDetailFormDocument-description" class="control-label col-sm-4" title="<fmt:message key="jsp.document.description.title"/>"><fmt:message key="jsp.document.description.label" /></label>
				  <div class="col-sm-8">
				    <p ng-if="readOnly || isReadOnly()" class="form-control-static">{{documentEditing.description}}</p>
				  	<input ng-if="!readOnly && !isReadOnly()" ng-required="true" id="jbDetailFormDocument-description" class="form-control" title="<fmt:message key="jsp.document.description.title"/>" type="text" name="description" ng-model="documentEditing.description"/>
				  	<label class="text-danger" ng-show="jbValidate.showMessage(jbDetailFormDocument.description)"><fmt:message key="js.validate.required"/></label>
				  </div>
				</div>
				
				<div  class="row jb-form-group">
				  <label for="jbDetailFormDocument-type" class="control-label col-sm-4" title="<fmt:message key="jsp.document.type.title"/>"><fmt:message key="jsp.document.type.label" /></label>
				  <div class="col-sm-8">
				  	<div ng-if="currentRownum != null"><p class="form-control-static">{{documentEditing.typeName}}</p></div>
				  	<div ng-if="currentRownum == null">
						<select ng-required="true" class="form-control" id="jbDetailFormDocument-type" name="type" title="<fmt:message key="jsp.document.type.title"/>" ng-model="documentEditing.type" ng-change="typeChangedInsert(jbDetailFormDocument)">
					  	  	<option></option>
					   		<option ng-repeat="t in userDocumentTypes" value="{{t.id}}">{{t.name}}</option>
					 	</select>
					</div>
					<label class="text-danger" ng-show="jbValidate.showMessage(jbDetailFormDocument.type)"><fmt:message key="js.validate.required"/></label>
				  </div>
				</div>	
				
				<div ng-if="currentRownum != null" class="row jb-form-group">
				  <label for="jbDetailFormDocument-version" class="control-label col-sm-4" title="<fmt:message key="jsp.document.version.title"/>"><fmt:message key="jsp.document.version.label" /></label>
				  <div class="col-sm-8">
				  <p class="form-control-static">{{documentEditing.version}}</p>
				  </div>
				</div>	
					
				<div ng-if="currentRownum != null" class="row jb-form-group">
				  <label for="jbDetailFormDocument-created" class="control-label col-sm-4" title="<fmt:message key="jsp.document.created.title"/>"><fmt:message key="jsp.document.created.label" /></label>
				  <div class="col-sm-8">
					<p class="form-control-static">{{documentEditing.created | date: '${localePatternTimestamp}'}}</p>  
				  </div>
				</div>
					
				<div ng-if="currentRownum != null" class="row jb-form-group">
				  <label for="jbDetailFormDocument-createdBy" class="control-label col-sm-4" title="<fmt:message key="jsp.document.createdBy.title"/>"><fmt:message key="jsp.document.createdBy.label" /></label>
				  <div class="col-sm-8">
				 	 <p class="form-control-static">{{documentEditing.createdBy}}</p>
				  </div>
				</div>
				
				<!-- Propriet aggiuntive -->
				<div class="row jb-form-group" ng-repeat="p in documentTypeEdit.propertyList ">
				  <label for="jbDetailFormDocument-{{jbUtil.sanitize(p.queryName)}}" class="control-label col-sm-4" title="{{p.description}}">{{p.displayName}}</label>
				  <div class="col-sm-8">
					 
					  <div ng-if="p.propertyType == 'STRING'">
					  	<div ng-if="!readOnly" ng-class="jbValidate.getClass(jbDetailFormDocument[p.queryName])">
					  		
					  		<p ng-if="isReadOnly()" class="form-control-static">{{documentEditing.properties[p.queryName].value}}</p>
					  	    <input ng-required="p.required" ng-if="!isReadOnly() && jbUtil.isEmptyObject(p.choices) && !p.linkType" id="jbDetailFormDocument-{{jbUtil.sanitize(p.queryName)}}" class="form-control" title="{{p.description}}" type="text" name="{{p.queryName}}" ng-model="documentEditing.properties[p.queryName].value" />
					  	  	<select ng-required="p.required" ng-if="!isReadOnly() && !jbUtil.isEmptyObject(p.choices)" class="form-control" id="jbDetailFormDocument-{{jbUtil.sanitize(p.queryName)}}" title="{{p.description}}" name="{{p.queryName}}" ng-model="documentEditing.properties[p.queryName].value">
						        <option></option>
						    	<option ng-repeat="c in p.choices" value="{{c}}">{{c}}</option> 
						    	
						  	</select>
							<label class="text-danger" ng-show="jbValidate.showMessage(jbDetailFormDocument[p.queryName])"><fmt:message key="js.validate.required"/></label>
						</div>
						<div ng-if="readOnly || p.linkType">
							<p ng-if="!p.linkType" class="form-control-static">{{documentEditing.properties[p.queryName].value}}</p>
							<p ng-if="p.linkType" class="form-control-static">
								<a ng-click="showDocument(documentEditing.properties[p.queryName].value)">{{documentEditing.properties[queryName].value.split('|')[1]}}</a>
							</p>
						</div>
					  </div>
					  
					  <div ng-if="p.propertyType == 'INTEGER'">
					  	<div ng-if="!readOnly"  ng-class="jbValidate.getClass(jbDetailFormDocument[p.queryName])">
					  		<p ng-if="isReadOnly()" class="form-control-static">{{documentEditing.properties[p.queryName].value}}</p>
						  	<input ng-if="!isReadOnly()" ng-required="p.required" id="jbDetailFormDocument-{{jbUtil.sanitize(p.queryName)}}" class="form-control" title="{{p.description}}" type="text" name="{{p.queryName}}" ng-model="documentEditing.properties[p.queryName].value" ng-pattern="jbPatterns.number(0)" jb-number="0"/>
						 	<label class="text-danger" ng-show="jbValidate.showMessage(jbDetailFormDocument[p.queryName])"><fmt:message key="js.validate.number"/></label>
						</div>
						<div ng-if="readOnly">
							<p class="form-control-static">{{documentEditing.properties[p.queryName].value}}</p>
						</div>
					  	
					  </div>
					  
					  <div ng-if="p.propertyType == 'BOOLEAN'">
					  	<div ng-if="!readOnly">
					  		<p ng-if="isReadOnly()" class="form-control-static">{{documentEditing.properties[p.queryName].value |yesOrNo}}</p>
					  		 <select  ng-if="!isReadOnly()" ng-required="p.required" id="jbDetailFormDocument-{{jbUtil.sanitize(p.queryName)}}" class="form-control" title="{{p.description}}" name="{{p.queryName}}" ng-model="documentEditing.properties[p.queryName].value" jb-boolean>
					  			<option></option>
								<option value="true"><fmt:message key="jsp.boolean.1"/></option>
								<option value="false"><fmt:message key="jsp.boolean.0"/></option>
				  			</select> 
				  			<label class="text-danger" ng-show="jbValidate.showMessage(jbDetailFormDocument[p.queryName])"><fmt:message key="js.validate.required"/></label>
					  	</div>
				  		<div ng-if="readOnly">
							<p ng-if="documentEditing.properties[$index].value" class="form-control-static"><fmt:message key="jsp.boolean.1"/></p>
{'fraction_non_alphanumeric': 0.20796188859016085, 'fraction_numerical': 0.0028300551860761286, 'mean_word_length': 4.356745831227893, 'pattern_counts': {'":': 0, '<': 483, '<?xml version=': 0, '>': 483, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6885974', 'n_tokens_mistral': 8296, 'n_tokens_neox': 6993, 'n_words': 952}