<commit_before><?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="templates/template.xhtml"  
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">
    <ui:define name="content">
        <h:form>
            <!-- Search box -->
            <div class="search-box">
                <div class="ui-grid ui-grid-fixed">
                    <div class="ui-grid-row">
                        <div class="ui-grid-col-4">
                            <p:commandButton value="#{i18n.search}" actionListener="#{catalogBean.findBooks()}" 
                                             onclick="PrimeFaces.cleanWatermarks();" 
                                             oncomplete="PrimeFaces.showWatermarks();" 
                                             update="@form" icon="ui-icon-search"/>
                            <p:inputText id="it_keywords" value="#{catalogBean.searchString}" required="true" requiredMessage="#{i18n.missingWords}"/>
                            <p:watermark for="it_keywords" value="#{i18n.keywordsIsbn}" id="wm_keywords"/>
                        </div>
                        <div class="ui-grid-col-3">
                            <p:message id="msg_it_keywords" for="it_keywords"/>
                        </div>
                    </div>
                </div>
            </div>
            <!-- Empty message -->
            <p:messages id="msg_booklist" globalOnly="true"/>
            <!-- Results -->
            <p:dataTable id="dt_booklist" value="#{catalogBean.booksInfoList}" var="book" rendered="#{not empty catalogBean.booksInfoList}">
                <p:column>
                    <!-- column header -->
                    <f:facet name="header"><h:outputText value="#{i18n.book}"/></f:facet>
                    <!-- row record -->
                    <p:commandLink action="#{catalogBean.setDetail(book)}" value="#{book.title}"/>
                </p:column>
                <p:column>
                    <!-- column header -->
                    <f:facet name="header"><h:outputText value="#{i18n.price}"/></f:facet>
                    <!-- row record -->
                    <h:outputText value="#{book.price}"/>
                </p:column>
                <p:column styleClass="colum-action-search">
                    <p:outputPanel id="btn_action">
                        <p:commandButton id="btn_add" icon="ui-icon-plusthick" update="btn_action" action="#{shoppingCartBean.addBookInfoToShoppingCart(book)}"/>
                        <p:commandButton id="btn_remove" icon="ui-icon-trash" update="btn_action" rendered="#{shoppingCartBean.shoppingCartContainsBookInfo(book)}" action="#{shoppingCartBean.removeBookInfoFromShoppingCart(book)}"/>
                    </p:outputPanel>
                </p:column>
            </p:dataTable>
        </h:form>
    </ui:define>
</ui:composition><commit_msg>Add confirm dialog to the search page<commit_after><?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="templates/template.xhtml"  
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">
    <ui:define name="content">
        <h:form>
            <!-- Search box -->
            <div class="search-box">
                <div class="ui-grid ui-grid-fixed">
                    <div class="ui-grid-row">
                        <div class="ui-grid-col-4">
                            <p:commandButton value="#{i18n.search}" actionListener="#{catalogBean.findBooks()}" 
                                             onclick="PrimeFaces.cleanWatermarks();" 
                                             oncomplete="PrimeFaces.showWatermarks();" 
                                             update="@form" icon="ui-icon-search"/>
                            <p:inputText id="it_keywords" value="#{catalogBean.searchString}" required="true" requiredMessage="#{i18n.missingWords}"/>
                            <p:watermark for="it_keywords" value="#{i18n.keywordsIsbn}" id="wm_keywords"/>
                        </div>
                        <div class="ui-grid-col-3">
                            <p:message id="msg_it_keywords" for="it_keywords"/>
                        </div>
                    </div>
                </div>
            </div>
            <!-- Empty message -->
            <p:messages id="msg_booklist" globalOnly="true"/>
            <!-- Results -->
            <p:dataTable id="dt_booklist" value="#{catalogBean.booksInfoList}" var="book" rendered="#{not empty catalogBean.booksInfoList}">
                <p:column>
                    <!-- column header -->
                    <f:facet name="header"><h:outputText value="#{i18n.book}"/></f:facet>
                    <!-- row record -->
                    <p:commandLink action="#{catalogBean.setDetail(book)}" value="#{book.title}"/>
                </p:column>
                <p:column>
                    <!-- column header -->
                    <f:facet name="header"><h:outputText value="#{i18n.price}"/></f:facet>
                    <!-- row record -->
                    <h:outputText value="#{book.price}"/>
                </p:column>
                <p:column styleClass="colum-action-search">
                    <p:outputPanel id="btn_action">
                        <p:commandButton id="btn_add" icon="ui-icon-plusthick" update="btn_action" action="#{shoppingCartBean.addBookInfoToShoppingCart(book)}"/>
                        <p:commandButton id="btn_remove" icon="ui-icon-trash" update="btn_action" rendered="#{shoppingCartBean.shoppingCartContainsBookInfo(book)}" action="#{shoppingCartBean.removeBookInfoFromShoppingCart(book)}">
                            <p:confirm header="#{i18n.remove}" message="#{i18n.confirmRemoveFromShoppingCart}" icon="ui-icon-alert"/>
                        </p:commandButton>
                    </p:outputPanel>
                </p:column>
            </p:dataTable>
            <!-- Confirm dialog -->
            <p:confirmDialog global="true">
                <p:commandButton value="#{i18n.gl_yes}" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
                <p:commandButton value="#{i18n.gl_no}" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
            </p:confirmDialog>
        </h:form>
    </ui:define>
</ui:composition>
{'fraction_non_alphanumeric': 0.16196477158814263, 'fraction_numerical': 0.008592295574967778, 'mean_word_length': 1.6424517593643586, 'pattern_counts': {'":': 0, '<': 110, '<?xml version=': 2, '>': 110, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5546127', 'n_tokens_mistral': 2031, 'n_tokens_neox': 1897, 'n_words': 255}