<commit_before><ui:composition template="/template.xhtml" xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://xmlns.jcp.org/jsf/passthrough">
    <f:metadata>
        <f:viewAction action="#{postController.prepareEdit()}"/>
    </f:metadata>
    <ui:define name="secondmessagepanel">
        <h:panelGroup id="secondMessagePanel" layout="block">
            <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
        </h:panelGroup>
    </ui:define>
    <ui:define name="pretitle">
        <h:panelGroup rendered="#{topicController.selected.locked}">
            <span><i class="fa fa-lock"></i> </span>
        </h:panelGroup>
    </ui:define>
    <ui:define name="title">
        <h:outputText value="#{topicController.selected.title}"></h:outputText>
    </ui:define>
    <ui:define name="secondtitle">
        <h:outputText value="#{topicController.selected.category.name}"></h:outputText>
    </ui:define>
    <ui:define name="content">
        <ui:repeat value="#{postController.getItems(topicController.selected)}" var="post" varStatus="status">
            <h:panelGroup rendered="#{not post.creator.equals(current_user)}">
                <table class="pure-table pure-u-1 pure-table-horizontal">
                    <thead>
                        <tr>
                            <th><h:outputText value="#{localization.Author}"/></th>
                            <th style="width: 100%"><h:outputText value="#{localization.Post}"/></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>
                                <h:panelGroup rendered="#{post.creator.banned}">
                                    <span><i class="fa fa-ban"></i> </span>
                                </h:panelGroup>
                                <h:link outcome="#{userController.userViewFullURLJSF(post.creator)}" value="#{post.creator.username}"/>
                            </td>
                            <td>
                                <h:outputText value="##{post.id} - " />
                                <h:outputText value="#{post.createdDate}">
                                    <f:convertDateTime pattern="#{localization.DatePatern}" timeZone="Europe/Zurich" locale="locale.US"/>
                                </h:outputText>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:graphicImage value="#{post.creator.getGravatarURL(100)}" class="circular-100"/>
                            </td>
                            <td>
                                <h:outputText value="#{post.content}" />
                            </td>
                        </tr>
                        <h:panelGroup rendered="#{moderator or post.edited}">
                            <tr>
                                <td>
                                    <h:form rendered="#{moderator}">
                                        <h:link outcome="#{postController.postEditFullURL(post)}" value="#{localization.Edit}"/>
                                        <h:outputText rendered="#{post.getCanDelete(topicController.selected)}" value=" | "/>
                                        <h:commandLink rendered="#{post.getCanDelete(topicController.selected)}" action="#{postController.delete(post, topicController.selected)}" value="#{localization.Delete}" onclick="if (!confirm('Are you sure?'))
                                                    return false"/>
                                    </h:form>
                                </td>
                                <td>
                                    <h:panelGroup rendered="#{post.edited}">
                                        <h:outputText value="#{localization.EditedBy} #{post.lastEditor.username} " />
                                        <h:outputText value="#{post.editedDate}">
                                            <f:convertDateTime pattern="#{localization.DatePatern}" timeZone="Europe/Zurich" locale="locale.US"/>
                                        </h:outputText>
                                    </h:panelGroup>
                                </td>
                            </tr>
                        </h:panelGroup>
                    </tbody>
                </table>
            </h:panelGroup>
            <h:panelGroup rendered="#{post.creator.equals(current_user)}">
                <table class="pure-table pure-u-1 pure-table-horizontal">
                    <thead>
                        <tr>
                            <th style="width: 100%"><h:outputText value="#{localization.Post}"/></th>
                            <th><h:outputText value="#{localization.Author}"/></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>
                                <h:outputText value="##{post.id} - " />
                                <h:outputText value="#{post.createdDate}">
                                    <f:convertDateTime pattern="#{localization.DatePatern}" timeZone="Europe/Zurich" locale="locale.US"/>
                                </h:outputText>
                            </td>
                            <td>
                                <h:panelGroup rendered="#{post.creator.banned}">
                                    <span><i class="fa fa-ban"></i> </span>
                                </h:panelGroup>
                                <h:link outcome="#{userController.userViewFullURLJSF(post.creator)}" value="#{post.creator.username}"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="#{post.content}" />
                            </td>

                            <td>
                                <h:graphicImage value="#{post.creator.getGravatarURL(100)}" class="circular-100"/>
                            </td>
                        </tr>
                        <h:panelGroup rendered="#{moderator or post.edited}">
                            <tr>
                                <td>
                                    <h:panelGroup rendered="#{post.edited}">
                                        <h:outputText value="#{localization.EditedBy} #{post.lastEditor.username} " />
                                        <h:outputText value="#{post.editedDate}">
                                            <f:convertDateTime pattern="#{localization.DatePatern}" timeZone="Europe/Zurich" locale="locale.US"/>
                                        </h:outputText>
                                    </h:panelGroup>
                                </td>
                                <td>
                                    <h:form rendered="#{moderator}">
                                        <h:link outcome="#{postController.postEditFullURL(post)}" value="#{localization.Edit}"/>
                                        <h:outputText rendered="#{post.getCanDelete(topicController.selected) or moderator}" value=" | "/>
                                        <h:commandLink rendered="#{post.getCanDelete(topicController.selected) or moderator}" action="#{postController.delete(post, topicController.selected)}" value="#{localization.Delete}" onclick="if (!confirm('Are you sure?'))
                                                    return false"/>
                                    </h:form>
                                </td>
                            </tr>
                        </h:panelGroup>
                    </tbody>
                </table>
            </h:panelGroup>
            <br /><br />
        </ui:repeat>
        <h:form class="pure-form" rendered="#{logged and not topicController.selected.locked}" id="formPost">
            <h:inputTextarea rows="4" id="content" value="#{postController.selected.content}" p:placeholder="#{localization.Content}" required="true" requiredMessage="#{localization.CreatePostRequiredMessage_content}" style="width: 100%;"/>
            <br /><br />
            <h:commandLink action="#{postController.create(topicController.selected)}" value="#{localization.Post}" class="button-success pure-button"/>
            <br /><br />
        </h:form>
        <h:form>
            <ul class="pure-paginator" style="text-align:center;">
                <li><h:commandLink action="#{postController.previous(topicController.selected)}" value="#{localization.Previous}" class="prev pure-button pure-button-primary #{postController.getPagination(topicController.selected).hasPreviousPage ? '' : 'pure-button-disabled'}"/></li>
                <ui:repeat value="#{postController.getPagination(topicController.selected).previousPages}" var="page_number">
                    <li><h:commandLink action="#{postController.setPage(page_number, topicController.selected)}" value="#{page_number}" class="pure-button pure-button-primary" /></li>
                </ui:repeat>
                <li><h:outputText value="#{postController.getPagination(topicController.selected).currentPage}" class="pure-button pure-button-active pure-button-primary" /></li>
                <ui:repeat value="#{postController.getPagination(topicController.selected).nextPages}" var="page_number">
                    <li><h:commandLink action="#{postController.setPage(page_number, topicController.selected)}" value="#{page_number}" class="pure-button pure-button-primary" /></li>
                </ui:repeat>
                <li><h:commandLink action="#{postController.next(topicController.selected)}" value="#{localization.Next}" class="next pure-button pure-button-primary #{postController.getPagination(topicController.selected).hasNextPage ? '' : 'pure-button-disabled'}" /></li>
            </ul>
        </h:form>
    </ui:define>
</ui:composition>
<commit_msg>Hide delete button for first post<commit_after><ui:composition template="/template.xhtml" xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://xmlns.jcp.org/jsf/passthrough">
    <f:metadata>
        <f:viewAction action="#{postController.prepareEdit()}"/>
    </f:metadata>
    <ui:define name="secondmessagepanel">
        <h:panelGroup id="secondMessagePanel" layout="block">
            <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
        </h:panelGroup>
    </ui:define>
    <ui:define name="pretitle">
        <h:panelGroup rendered="#{topicController.selected.locked}">
            <span><i class="fa fa-lock"></i> </span>
        </h:panelGroup>
    </ui:define>
    <ui:define name="title">
        <h:outputText value="#{topicController.selected.title}"></h:outputText>
    </ui:define>
    <ui:define name="secondtitle">
        <h:outputText value="#{topicController.selected.category.name}"></h:outputText>
    </ui:define>
    <ui:define name="content">
        <ui:repeat value="#{postController.getItems(topicController.selected)}" var="post" varStatus="status">
            <h:panelGroup rendered="#{not post.creator.equals(current_user)}">
                <table class="pure-table pure-u-1 pure-table-horizontal">
                    <thead>
                        <tr>
                            <th><h:outputText value="#{localization.Author}"/></th>
                            <th style="width: 100%"><h:outputText value="#{localization.Post}"/></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>
                                <h:panelGroup rendered="#{post.creator.banned}">
                                    <span><i class="fa fa-ban"></i> </span>
                                </h:panelGroup>
                                <h:link outcome="#{userController.userViewFullURLJSF(post.creator)}" value="#{post.creator.username}"/>
                            </td>
                            <td>
                                <h:outputText value="##{post.id} - " />
                                <h:outputText value="#{post.createdDate}">
                                    <f:convertDateTime pattern="#{localization.DatePatern}" timeZone="Europe/Zurich" locale="locale.US"/>
                                </h:outputText>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:graphicImage value="#{post.creator.getGravatarURL(100)}" class="circular-100"/>
                            </td>
                            <td>
                                <h:outputText value="#{post.content}" />
                            </td>
                        </tr>
                        <h:panelGroup rendered="#{moderator or post.edited}">
                            <tr>
                                <td>
                                    <h:form rendered="#{moderator}">
                                        <h:link outcome="#{postController.postEditFullURL(post)}" value="#{localization.Edit}"/>
                                        <h:outputText rendered="#{post.getCanDelete(topicController.selected)}" value=" | "/>
                                        <h:commandLink rendered="#{post.getCanDelete(topicController.selected)}" action="#{postController.delete(post, topicController.selected)}" value="#{localization.Delete}" onclick="if (!confirm('Are you sure?'))
                                                    return false"/>
                                    </h:form>
                                </td>
                                <td>
                                    <h:panelGroup rendered="#{post.edited}">
                                        <h:outputText value="#{localization.EditedBy} #{post.lastEditor.username} " />
                                        <h:outputText value="#{post.editedDate}">
                                            <f:convertDateTime pattern="#{localization.DatePatern}" timeZone="Europe/Zurich" locale="locale.US"/>
                                        </h:outputText>
                                    </h:panelGroup>
                                </td>
                            </tr>
                        </h:panelGroup>
                    </tbody>
                </table>
            </h:panelGroup>
            <h:panelGroup rendered="#{post.creator.equals(current_user)}">
                <table class="pure-table pure-u-1 pure-table-horizontal">
                    <thead>
                        <tr>
                            <th style="width: 100%"><h:outputText value="#{localization.Post}"/></th>
                            <th><h:outputText value="#{localization.Author}"/></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>
                                <h:outputText value="##{post.id} - " />
                                <h:outputText value="#{post.createdDate}">
                                    <f:convertDateTime pattern="#{localization.DatePatern}" timeZone="Europe/Zurich" locale="locale.US"/>
                                </h:outputText>
                            </td>
                            <td>
                                <h:panelGroup rendered="#{post.creator.banned}">
                                    <span><i class="fa fa-ban"></i> </span>
                                </h:panelGroup>
                                <h:link outcome="#{userController.userViewFullURLJSF(post.creator)}" value="#{post.creator.username}"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="#{post.content}" />
                            </td>

                            <td>
                                <h:graphicImage value="#{post.creator.getGravatarURL(100)}" class="circular-100"/>
                            </td>
                        </tr>
                        <h:panelGroup rendered="#{moderator or post.edited}">
                            <tr>
                                <td>
                                    <h:panelGroup rendered="#{post.edited}">
                                        <h:outputText value="#{localization.EditedBy} #{post.lastEditor.username} " />
                                        <h:outputText value="#{post.editedDate}">
                                            <f:convertDateTime pattern="#{localization.DatePatern}" timeZone="Europe/Zurich" locale="locale.US"/>
                                        </h:outputText>
                                    </h:panelGroup>
                                </td>
                                <td>
                                    <h:form rendered="#{moderator}">
                                        <h:link outcome="#{postController.postEditFullURL(post)}" value="#{localization.Edit}"/>
                                        <h:outputText rendered="#{post.getCanDelete(topicController.selected)}" value=" | "/>
                                        <h:commandLink rendered="#{post.getCanDelete(topicController.selected)}" action="#{postController.delete(post, topicController.selected)}" value="#{localization.Delete}" onclick="if (!confirm('Are you sure?'))
                                                    return false"/>
                                    </h:form>
                                </td>
                            </tr>
                        </h:panelGroup>
                    </tbody>
                </table>
            </h:panelGroup>
            <br /><br />
        </ui:repeat>
        <h:form class="pure-form" rendered="#{logged and not topicController.selected.locked}" id="formPost">
            <h:inputTextarea rows="4" id="content" value="#{postController.selected.content}" p:placeholder="#{localization.Content}" required="true" requiredMessage="#{localization.CreatePostRequiredMessage_content}" style="width: 100%;"/>
            <br /><br />
            <h:commandLink action="#{postController.create(topicController.selected)}" value="#{localization.Post}" class="button-success pure-button"/>
            <br /><br />
        </h:form>
        <h:form>
            <ul class="pure-paginator" style="text-align:center;">
                <li><h:commandLink action="#{postController.previous(topicController.selected)}" value="#{localization.Previous}" class="prev pure-button pure-button-primary #{postController.getPagination(topicController.selected).hasPreviousPage ? '' : 'pure-button-disabled'}"/></li>
                <ui:repeat value="#{postController.getPagination(topicController.selected).previousPages}" var="page_number">
                    <li><h:commandLink action="#{postController.setPage(page_number, topicController.selected)}" value="#{page_number}" class="pure-button pure-button-primary" /></li>
                </ui:repeat>
                <li><h:outputText value="#{postController.getPagination(topicController.selected).currentPage}" class="pure-button pure-button-active pure-button-primary" /></li>
                <ui:repeat value="#{postController.getPagination(topicController.selected).nextPages}" var="page_number">
                    <li><h:commandLink action="#{postController.setPage(page_number, topicController.selected)}" value="#{page_number}" class="pure-button pure-button-primary" /></li>
                </ui:repeat>
                <li><h:commandLink action="#{postController.next(topicController.selected)}" value="#{localization.Next}" class="next pure-button pure-button-primary #{postController.getPagination(topicController.selected).hasNextPage ? '' : 'pure-button-disabled'}" /></li>
            </ul>
        </h:form>
    </ui:define>
</ui:composition>

{'fraction_non_alphanumeric': 0.14263353551164157, 'fraction_numerical': 0.0028370181960477403, 'mean_word_length': 1.3543298019345924, 'pattern_counts': {'":': 0, '<': 369, '<?xml version=': 0, '>': 369, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 64, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4585931', 'n_tokens_mistral': 5112, 'n_tokens_neox': 4859, 'n_words': 675}