<commit_before><%
	/**
	* Template Editor overview template
	*
	* @author <NAME>
	* @since 20100422
	* @package wizard
	*
	* Revision information:
	* $Rev: 1430 $
	* $Author: <EMAIL> $
	* $Date: 2011-01-21 21:05:36 +0100 (Fri, 21 Jan 2011) $
	*/
%>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
	<head>
		<meta name="layout" content="${layout}"/>
		<title>template editor</title>
		<r:require module="templateEditor" />
		<r:script disposition='head'>
		  var standalone = ${extraparams?.standalone ? 'true' : 'false'};
		</r:script>
	</head>
	<body>

		<div class="templateEditorStep" id="step1_template">
			<h3>Select Template</h3>
			<p>Showing Templates for <b>${humanReadableEntity}</b><g:if test="${templates.size() > 0 }"> (<g:link controller="templateEditor" action="compare" params="${[entity: encryptedEntity] + extraparams}"><b>compare</b></g:link>)</g:if>.</p>
            <g:if test='${templateadmin}'>
                <p>Please select a template to edit or create a new template.</p>
            </g:if>
            <g:else>
                <p>Please select a template to view the templatefields within the template or request a new/modification to a template.</p>
            </g:else>

			<ul id="templates">
                <li class="empty ui-state-default" <g:if test="${templates.size() > 0 }">style='display: none;'</g:if>>
                <g:if test='${templateadmin}'>
                    There are no templates for ${humanReadableEntity}. Use the 'Add template' button to add fields.</li>
                </g:if>
                <g:else>
                    There are no templates for ${humanReadableEntity}. Use the 'Request new/modification to template' button to request fields.</li>
                </g:else>
                </li>
                <g:set var="templateService" bean="templateService"/>
                <g:set var="templateEntity" value="${templates[0].entity.simpleName.replaceAll(/\B[A-Z]/) { '_' + it }.toLowerCase()}" />
                <g:set var="countUses" value="${templateService.countUses(templateEntity)}" />
                <g:each in="${templates}" var="currentTemplate">
                    <g:set var="numUses" value="${countUses.find({it.template_id == currentTemplate.id})?.count}"/>
				  <g:render template="elements/liTemplate" model="['template': currentTemplate, 'numUses':numUses, 'extraparams': extraparams]"/>
				</g:each>
			</ul>

            <g:if test='${templateadmin}'>
                <div id="addNew">
                    <a href="#" onClick="editTemplate( 'new' ); this.blur(); window.scrollBy(0,1000); $('input#name').focus(); return false;">
                        <b>Create new template</b>
                    </a>

                    <form class="templateField_form" id="template_new_form" action="createTemplate">
                        <g:hiddenField name="entity" value="${encryptedEntity}" />
                        <g:hiddenField name="ontologies" value="${ontologies}" />
                        <g:hiddenField name="standalone" value="${extraparams?.standalone}" />
                        <g:render template="elements/templateForm" model="['template': null]"/>
                        <div class="templateFieldButtons">
                            <input type="button" value="Save" onClick="createTemplate( 'new' );">
                            <input type="button" value="Cancel" onClick="hideTemplateForm( 'new' );">
                        </div>
                    </form>
                </div>
            </g:if>

            <g:else>
                <div id="addNew">
                    <a href="#" onClick="editTemplate( 'requestTemplate' ); this.blur(); window.scrollBy(0,1000); $('input#name').focus(); return false;">
                          <b>Request new/modification to template</b>
                    </a>

                    <form class="templateField_form" id="template_requestTemplate_form" action="sendRequest">
                        <g:hiddenField name="entity" value="${encryptedEntity}" />
                        <g:hiddenField name="ontologies" value="${ontologies}" />
                        <g:hiddenField name="standalone" value="${extraparams?.standalone}" />
                        <g:render template="elements/requestTemplateForm" model="['templateType': humanReadableEntity]"/>
                        <g:set var='email' value="<EMAIL>"/>
                        <div class="templateFieldButtons">
                            <input type="button" value="Send" onClick="requestTemplate ( 'requestTemplate' );">
                            <input type="button" value="Cancel" onClick="hideTemplateForm( 'requestTemplate' );">
                        </div>
                    </form>
                </div>
            </g:else>

			<g:form action="template" name="templateChoice" method="GET">
				<g:hiddenField name="entity" value="${encryptedEntity}" />
				<g:hiddenField name="ontologies" value="${ontologies}" />
				<g:hiddenField name="standalone" value="${extraparams?.standalone}" />
				<input type="hidden" name="template" id="templateSelect" value="${template?.id}">
			</g:form>
		</div>
		<br clear="all" />
		<div id="wait" class="wait">
		  &nbsp;
		</div>
		<div class="wait_text wait">
		  <img src="<g:resource dir="images" file="spinner.gif" />"> Please wait
		</div>


	</body>
</html>
<commit_msg>Fix empty template list rendering error<commit_after><%
	/**
	* Template Editor overview template
	*
	* @author <NAME>
	* @since 20100422
	* @package wizard
	*
	* Revision information:
	* $Rev: 1430 $
	* $Author: <EMAIL> $
	* $Date: 2011-01-21 21:05:36 +0100 (Fri, 21 Jan 2011) $
	*/
%>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
	<head>
		<meta name="layout" content="${layout}"/>
		<title>template editor</title>
		<r:require module="templateEditor" />
		<r:script disposition='head'>
		  var standalone = ${extraparams?.standalone ? 'true' : 'false'};
		</r:script>
	</head>
	<body>

		<div class="templateEditorStep" id="step1_template">
			<h3>Select Template</h3>
			<p>Showing Templates for <b>${humanReadableEntity}</b><g:if test="${templates.size() > 0 }"> (<g:link controller="templateEditor" action="compare" params="${[entity: encryptedEntity] + extraparams}"><b>compare</b></g:link>)</g:if>.</p>
            <g:if test='${templateadmin}'>
                <p>Please select a template to edit or create a new template.</p>
            </g:if>
            <g:else>
                <p>Please select a template to view the templatefields within the template or request a new/modification to a template.</p>
            </g:else>

			<ul id="templates">
                <li class="empty ui-state-default" <g:if test="${templates.size() > 0 }">style='display: none;'</g:if>>
                <g:if test='${templateadmin}'>
                    There are no templates for ${humanReadableEntity}. Use the 'Add template' button to add fields.</li>
                </g:if>
                <g:else>
                    There are no templates for ${humanReadableEntity}. Use the 'Request new/modification to template' button to request fields.</li>
                </g:else>
                </li>
                <g:if test="${templates.size() > 0 }">
                    <g:set var="templateService" bean="templateService"/>
                    <g:set var="templateEntity" value="${templates[0].entity.simpleName.replaceAll(/\B[A-Z]/) { '_' + it }.toLowerCase()}" />
                    <g:set var="countUses" value="${templateService.countUses(templateEntity)}" />
                    <g:each in="${templates}" var="currentTemplate">
                        <g:set var="numUses" value="${countUses.find({it.template_id == currentTemplate.id})?.count}"/>
                        <g:render template="elements/liTemplate" model="['template': currentTemplate, 'numUses':numUses, 'extraparams': extraparams]"/>
                    </g:each>
                </g:if>
			</ul>

            <g:if test='${templateadmin}'>
                <div id="addNew">
                    <a href="#" onClick="editTemplate( 'new' ); this.blur(); window.scrollBy(0,1000); $('input#name').focus(); return false;">
                        <b>Create new template</b>
                    </a>

                    <form class="templateField_form" id="template_new_form" action="createTemplate">
                        <g:hiddenField name="entity" value="${encryptedEntity}" />
                        <g:hiddenField name="ontologies" value="${ontologies}" />
                        <g:hiddenField name="standalone" value="${extraparams?.standalone}" />
                        <g:render template="elements/templateForm" model="['template': null]"/>
                        <div class="templateFieldButtons">
                            <input type="button" value="Save" onClick="createTemplate( 'new' );">
                            <input type="button" value="Cancel" onClick="hideTemplateForm( 'new' );">
                        </div>
                    </form>
                </div>
            </g:if>

            <g:else>
                <div id="addNew">
                    <a href="#" onClick="editTemplate( 'requestTemplate' ); this.blur(); window.scrollBy(0,1000); $('input#name').focus(); return false;">
                          <b>Request new/modification to template</b>
                    </a>

                    <form class="templateField_form" id="template_requestTemplate_form" action="sendRequest">
                        <g:hiddenField name="entity" value="${encryptedEntity}" />
                        <g:hiddenField name="ontologies" value="${ontologies}" />
                        <g:hiddenField name="standalone" value="${extraparams?.standalone}" />
                        <g:render template="elements/requestTemplateForm" model="['templateType': humanReadableEntity]"/>
                        <g:set var='email' value="<EMAIL>"/>
                        <div class="templateFieldButtons">
                            <input type="button" value="Send" onClick="requestTemplate ( 'requestTemplate' );">
                            <input type="button" value="Cancel" onClick="hideTemplateForm( 'requestTemplate' );">
                        </div>
                    </form>
                </div>
            </g:else>

			<g:form action="template" name="templateChoice" method="GET">
				<g:hiddenField name="entity" value="${encryptedEntity}" />
				<g:hiddenField name="ontologies" value="${ontologies}" />
				<g:hiddenField name="standalone" value="${extraparams?.standalone}" />
				<input type="hidden" name="template" id="templateSelect" value="${template?.id}">
			</g:form>
		</div>
		<br clear="all" />
		<div id="wait" class="wait">
		  &nbsp;
		</div>
		<div class="wait_text wait">
		  <img src="<g:resource dir="images" file="spinner.gif" />"> Please wait
		</div>


	</body>
</html>

{'fraction_non_alphanumeric': 0.1685785078461962, 'fraction_numerical': 0.009819216298063687, 'mean_word_length': 2.2609216038300417, 'pattern_counts': {'":': 0, '<': 221, '<?xml version=': 0, '>': 226, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6958616', 'n_tokens_mistral': 3293, 'n_tokens_neox': 2974, 'n_words': 633}