<commit_before><?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/WEB-INF/templates/template.xhtml">
		
	<ui:define name="content">
	
	<f:metadata>
		<f:viewParam id="entryId" name="entryId" value="#{ruleEntryEdit.entryId}" />
    </f:metadata>
			
	<h2>
		<h:outputText value="Create a new discount rule entry" rendered="#{ruleEntryEdit.newEntry}" />
		<h:outputText value="Edit discount rule entry" rendered="#{not ruleEntryEdit.newEntry}" />		
	</h2>

	<h:form>
		<table>
				<tr>
					<td style="font-weight: bold;">rule name:</td>
					<td><h:inputText id="name" value="#{ruleEntryEdit.ruleEntry.name}" /></td>
					<td><h:message id="name_error" for="name" errorClass="invalid" /></td>
				</tr>
				<tr>
					<td style="font-weight: bold;">amount min (&gt;):</td>
					<td><h:inputText id="amountMin" value="#{ruleEntryEdit.ruleEntry.amountMin}" /></td>
					<td><h:message id="amountMin_error" for="amountMin" errorClass="invalid" /></td>
				</tr>
				<tr>
					<td style="font-weight: bold;">amount max (&lt;=):</td>
					<td><h:inputText id="amountMax" value="#{ruleEntryEdit.ruleEntry.amountMax}" /></td>
					<td><h:message id="amountMax_error" for="amountMax" errorClass="invalid" /></td>
				</tr>
				<tr>
					<td style="font-weight: bold;">discount:</td>
					<td><h:inputText id="discount" value="#{ruleEntryEdit.ruleEntry.discount}" /></td>
					<td><h:message id="discount_error" for="discount" errorClass="invalid" /></td>
				</tr>
				<tr>
					<td />
  					<td>
						<h:commandButton action="#{ruleEntryEdit.save()}" value="save" type="submit"  rendered="#{ruleEntryEdit.newEntry}"/>
						<h:commandButton action="#{ruleEntryEdit.update()}" value="update" type="submit" rendered="#{not ruleEntryEdit.newEntry}"/>
						<h:commandButton action="#{ruleEntryEdit.cancel()}" immediate="true" value="cancel" />
					</td>				
				</tr>
			</table>		
	</h:form>

	</ui:define>
</ui:composition><commit_msg>Pimped up the edit rule form with Bootstrap CSS<commit_after><?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/WEB-INF/templates/template.xhtml">
		
	<ui:define name="content">
	
	<f:metadata>
		<f:viewParam id="entryId" name="entryId" value="#{ruleEntryEdit.entryId}" />
    </f:metadata>

	<h:form class="form-horizontal">
        <legend>
            <h:outputText value="Create a new discount rule entry" rendered="#{ruleEntryEdit.newEntry}" />
            <h:outputText value="Edit discount rule entry" rendered="#{not ruleEntryEdit.newEntry}" />
        </legend>
        <div class="control-group">
            <label class="control-label" for="name">Rule name:</label>
            <div class="controls">
                <h:inputText id="name" value="#{ruleEntryEdit.ruleEntry.name}" />
                <h:message id="name_error" for="name" errorClass="invalid" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="amountMin">Amount min (&gt;):</label>
            <div class="controls">
                <h:inputText id="amountMin" value="#{ruleEntryEdit.ruleEntry.amountMin}" />
                <h:message id="amountMin_error" for="amountMin" errorClass="invalid" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="amountMax">Amount max (&lt;=):</label>
            <div class="controls">
                <h:inputText id="amountMax" value="#{ruleEntryEdit.ruleEntry.amountMax}" />
                <h:message id="amountMax_error" for="amountMax" errorClass="invalid" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="discount">Discount:</label>
            <div class="controls">
                <h:inputText id="discount" value="#{ruleEntryEdit.ruleEntry.discount}" />
                <h:message id="discount_error" for="discount" errorClass="invalid" />
            </div>
        </div>
        <div class="control-group">
            <div class="controls">
                <h:commandButton action="#{ruleEntryEdit.save()}" value="save" type="submit"  rendered="#{ruleEntryEdit.newEntry}" class="btn btn-primary"/>
                <h:commandButton action="#{ruleEntryEdit.update()}" value="update" type="submit" rendered="#{not ruleEntryEdit.newEntry}" class="btn btn-success"/>
                <h:commandButton action="#{ruleEntryEdit.cancel()}" value="cancel" type="submit" immediate="true" class="btn"/>
            </div>
        </div>
	</h:form>

	</ui:define>
</ui:composition>
{'fraction_non_alphanumeric': 0.19643588693158542, 'fraction_numerical': 0.0036870135190495697, 'mean_word_length': 3.325066430469442, 'pattern_counts': {'":': 0, '<': 120, '<?xml version=': 2, '>': 120, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 10}, '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': '5934148', 'n_tokens_mistral': 1743, 'n_tokens_neox': 1567, 'n_words': 263}