<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:param name="headTitle" value="#{catalogBean.selectedBook.title}"/>
    <ui:param name="headDescription" value="#{catalogBean.selectedBook.title} - #{catalogBean.selectedBook.authors}"/>
    <ui:define name="content">
        <div class="ui-grid ui-grid-responsive">
            <div class="ui-grid-row">
                <!-- Naviagation of the bookDetails -->
                <h:form id="frmDetailsBookNaviagation">
                    <p:commandButton action="catalogSearch?faces-redirect=true" value="#{i18n.backToSearch}"/>
                    <p:commandButton action="#{catalogBean.navigateOnBookList(-1)}" value="#{i18n.previous}" disabled="#{!catalogBean.hasPrevious()}"/>
                    <p:commandButton action="#{catalogBean.navigateOnBookList(1)}" value="#{i18n.next}" disabled="#{!catalogBean.hasNext()}"/>
                </h:form>
            </div>
            <p:spacer height="20"/>
            <!-- Book detail -->
            <div class="ui-grid-row">
                <p:panelGrid rendered="#{not empty catalogBean.selectedBook}">
                    <f:facet name="header">
                        <p:row>
                            <p:column colspan="4">
                                <h:outputText id="otTitle" value="#{catalogBean.selectedBook.title}"/>
                            </p:column>
                            <!-- Button add to shopping cart -->
                            <p:column>
                                <h:form id="frmAddToShoppingCat">
                                    <p:growl id="growl" showDetail="true" sticky="false" life="5000" />
                                    <p:commandButton update="frmAddToShoppingCat growl" action="#{shoppingCartBean.addBookToShoppingCart(catalogBean.selectedBook)}" value="#{i18n.addToCart}" icon="ui-icon-cart"/>
                                    <p:commandButton icon="ui-icon-trash" update="frmAddToShoppingCat" rendered="#{shoppingCartBean.shoppingCartContainsBook(catalogBean.selectedBook)}" action="#{shoppingCartBean.removeBookFromShoppingCart(catalogBean.selectedBook)}"/>
                                </h:form><commit_msg>Add confirm dialog to the details 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:param name="headTitle" value="#{catalogBean.selectedBook.title}"/>
    <ui:param name="headDescription" value="#{catalogBean.selectedBook.title} - #{catalogBean.selectedBook.authors}"/>
    <ui:define name="content">
        <div class="ui-grid ui-grid-responsive">
            <div class="ui-grid-row">
                <!-- Naviagation of the bookDetails -->
                <h:form id="frmDetailsBookNaviagation">
                    <p:commandButton action="catalogSearch?faces-redirect=true" value="#{i18n.backToSearch}"/>
                    <p:commandButton action="#{catalogBean.navigateOnBookList(-1)}" value="#{i18n.previous}" disabled="#{!catalogBean.hasPrevious()}"/>
                    <p:commandButton action="#{catalogBean.navigateOnBookList(1)}" value="#{i18n.next}" disabled="#{!catalogBean.hasNext()}"/>
                </h:form>
            </div>
            <p:spacer height="20"/>
            <!-- Book detail -->
            <div class="ui-grid-row">
                <p:panelGrid rendered="#{not empty catalogBean.selectedBook}">
                    <f:facet name="header">
                        <p:row>
                            <p:column colspan="4">
                                <h:outputText id="otTitle" value="#{catalogBean.selectedBook.title}"/>
                            </p:column>
                            <!-- Button add to shopping cart -->
                            <p:column>
                                <h:form id="frmAddToShoppingCat">
                                    <p:growl id="growl" showDetail="true" sticky="false" life="5000" />
                                    <p:commandButton update="frmAddToShoppingCat growl" action="#{shoppingCartBean.addBookToShoppingCart(catalogBean.selectedBook)}" value="#{i18n.addToCart}" icon="ui-icon-cart"/>
                                    <p:commandButton icon="ui-icon-trash" update="frmAddToShoppingCat" rendered="#{shoppingCartBean.shoppingCartContainsBook(catalogBean.selectedBook)}" action="#{shoppingCartBean.removeBookFromShoppingCart(catalogBean.selectedBook)}">
                                        <p:confirm header="#{i18n.remove}" message="#{i18n.confirmRemoveFromShoppingCart}" icon="ui-icon-alert"/>
                                    </p:commandButton>

                                    <!-- 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>
{'fraction_non_alphanumeric': 0.1543713572023314, 'fraction_numerical': 0.011656952539550375, 'mean_word_length': 1.9383561643835616, 'pattern_counts': {'":': 0, '<': 72, '<?xml version=': 2, '>': 72, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '502650', 'n_tokens_mistral': 1743, 'n_tokens_neox': 1647, 'n_words': 215}