<commit_before><ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:s="http://jboss.org/schema/seam/taglib"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:zanata="http://java.sun.com/jsf/composite/zanata"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:rich="http://richfaces.org/rich">

<div class="panels--2">
<div class="panels__panel panel">
<div class="panels__panel__header panel__header">
  <div class="panel__header__actions">
    <zanata:sortlist id="documents-document_sorting"
      sortAction="#{versionHomeAction.sortSourceDocumentList()}"
      oncomplete="refreshTooltip('#{rich:clientId('documents-document_form')}')"
      render="documents-document_form, documentsTabDocumentSearch-pager, documentsTabDocumentSearch-page-info, documentsTabDocumentSearchBottom-pager, documentsTabDocumentSearchBottom-page-info"
      sortingList="#{versionHomeAction.sourceDocumentSortingList}"
      onbegin="clearHTML('#{rich:clientId('documents-document_form')}')"
      status="documentsTab-documentsLoader"/>

    <s:fragment
      rendered="#{versionHomeAction.documentUploadAllowed or s:hasPermission(versionHomeAction.version, 'update')}">
      <div
        class="dropdown dropdown--header dropdown--small dropdown--right dropdown--inline js-dropdown">
        <a class="dropdown__toggle js-dropdown__toggle" href="#"
          title="#{msgs['jsf.tooltip.MoreActions']}"><i
          class="i i--ellipsis"></i></a>
        <ul class="dropdown__content js-dropdown__content" role="content"
          aria-labelledby="dropdownContent">
          <s:fragment rendered="#{versionHomeAction.documentUploadAllowed}">
            <li>
              <a href="#" class="i__item--right"
                id="button--upload-new-document"
                title="#{msgs['jsf.SupportedUploadFormats']}"
                onclick="openUploadSourceDocPanel()">
                #{msgs['jsf.iteration.files.UploadNewSourceDocument']}
                <i class="i i--import i__item__icon"></i>
              </a>
            </li>
          </s:fragment>

          <s:fragment
            rendered="#{s:hasPermission(versionHomeAction.version, 'update')}">
            <li>
              <a href="#{request.contextPath}/iteration/view/#{versionHomeAction.projectSlug}/#{versionHomeAction.versionSlug}/settings/documents"
                onclick="changeBrowserUrl(this.href, true);return false;">
                #{msgs['jsf.ManageDocuments']} <i
                class="i i--settings i__item__icon"></i>
              </a>
            </li>
          </s:fragment>
        </ul>
      </div>
    </s:fragment>
  </div>
  <h2 class="panel__heading">#{msgs['jsf.Documents']}</h2>
</div>

<div class="panel__sub-header js-reveal">
  <zanata:list-filter status="documentsTab-documentsLoader"
    listId="documents-document_form"
    render="documents-document_form, documentsTabDocumentSearchBottom-pager, documentsTabDocumentSearchBottom-page-info"
    id="documentsTabDocumentSearch" iconClass="i--document"
    placeholder="#{msgs['jsf.document.search.placeholder']}"
    actionBean="#{versionHomeAction.documentsTabDocumentFilter}"/>
</div>

<a4j:status name="documentsTab-documentsLoader">
  <f:facet name="start"><zanata:loader/></f:facet>
</a4j:status>

<h:form id="documents-document_form" styleClass="l--push-bottom-1">
  <s:div styleClass="l--pad-all-half"
    rendered="#{empty versionHomeAction.documents}">
    <p
      class="txt--meta">#{msgs['jsf.iteration.NoDocumentInVersion']}</p>
    <s:fragment
      rendered="#{versionHomeAction.documentUploadAllowed}">
      <p>
        <a href="#" class="button--primary"
          title="#{msgs['jsf.SupportedUploadFormats']}"
          onclick="openUploadSourceDocPanel()">
          #{msgs['jsf.iteration.files.UploadNewSourceDocument']}
        </a>
      </p>
    </s:fragment>
  </s:div>

  <s:div styleClass="l--pad-all-half"
    rendered="#{not empty versionHomeAction.documents and empty versionHomeAction.documentsTabDocumentFilter.currentPage}">
    <p class="txt--meta">#{msgs['jsf.search.NoResult']}</p>
  </s:div>

  <s:fragment
    rendered="#{not empty versionHomeAction.documentsTabDocumentFilter.currentPage}">
    <ul class="list--stats" id="documents-document_list">
      <ui:repeat
        value="#{versionHomeAction.documentsTabDocumentFilter.currentPage}"
        var="document">
        <ui:param name="hasActions"
          value="#{versionHomeAction.isPoDocument(document.docId) or !versionHomeAction.isPoDocument(document.docId) or versionHomeAction.hasOriginal(document.path, document.name) or versionHomeAction.documentUploadAllowed or versionHomeAction.documentRemovalAllowed}"/>
        <li id="#{versionHomeAction.encodeDocId(document.docId)}"
          class="progress-bar__expander #{hasActions ? 'list__item--actionable' : ''}" >
          <s:div styleClass="list__item__action" rendered="#{hasActions}">
            <div<commit_msg>Fix document access from version page, documents' tab.<commit_after><ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:s="http://jboss.org/schema/seam/taglib"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:zanata="http://java.sun.com/jsf/composite/zanata"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:rich="http://richfaces.org/rich">

<div class="panels--2">
<div class="panels__panel panel">
<div class="panels__panel__header panel__header">
  <div class="panel__header__actions">
    <zanata:sortlist id="documents-document_sorting"
      sortAction="#{versionHomeAction.sortSourceDocumentList()}"
      oncomplete="refreshTooltip('#{rich:clientId('documents-document_form')}')"
      render="documents-document_form, documentsTabDocumentSearch-pager, documentsTabDocumentSearch-page-info, documentsTabDocumentSearchBottom-pager, documentsTabDocumentSearchBottom-page-info"
      sortingList="#{versionHomeAction.sourceDocumentSortingList}"
      onbegin="clearHTML('#{rich:clientId('documents-document_form')}')"
      status="documentsTab-documentsLoader"/>

    <s:fragment
      rendered="#{versionHomeAction.documentUploadAllowed or s:hasPermission(versionHomeAction.version, 'update')}">
      <div
        class="dropdown dropdown--header dropdown--small dropdown--right dropdown--inline js-dropdown">
        <a class="dropdown__toggle js-dropdown__toggle" href="#"
          title="#{msgs['jsf.tooltip.MoreActions']}"><i
          class="i i--ellipsis"></i></a>
        <ul class="dropdown__content js-dropdown__content" role="content"
          aria-labelledby="dropdownContent">
          <s:fragment rendered="#{versionHomeAction.documentUploadAllowed}">
            <li>
              <a href="#" class="i__item--right"
                id="button--upload-new-document"
                title="#{msgs['jsf.SupportedUploadFormats']}"
                onclick="openUploadSourceDocPanel()">
                #{msgs['jsf.iteration.files.UploadNewSourceDocument']}
                <i class="i i--import i__item__icon"></i>
              </a>
            </li>
          </s:fragment>

          <s:fragment
            rendered="#{s:hasPermission(versionHomeAction.version, 'update')}">
            <li>
              <a href="#{request.contextPath}/iteration/view/#{versionHomeAction.projectSlug}/#{versionHomeAction.versionSlug}/settings/documents"
                onclick="changeBrowserUrl(this.href, true);return false;">
                #{msgs['jsf.ManageDocuments']} <i
                class="i i--settings i__item__icon"></i>
              </a>
            </li>
          </s:fragment>
        </ul>
      </div>
    </s:fragment>
  </div>
  <h2 class="panel__heading">#{msgs['jsf.Documents']}</h2>
</div>

<div class="panel__sub-header js-reveal">
  <zanata:list-filter status="documentsTab-documentsLoader"
    listId="documents-document_form"
    render="documents-document_form, documentsTabDocumentSearchBottom-pager, documentsTabDocumentSearchBottom-page-info"
    id="documentsTabDocumentSearch" iconClass="i--document"
    placeholder="#{msgs['jsf.document.search.placeholder']}"
    actionBean="#{versionHomeAction.documentsTabDocumentFilter}"/>
</div>

<a4j:status name="documentsTab-documentsLoader">
  <f:facet name="start"><zanata:loader/></f:facet>
</a4j:status>

<h:form id="documents-document_form" styleClass="l--push-bottom-1">
  <s:div styleClass="l--pad-all-half"
    rendered="#{empty versionHomeAction.documents}">
    <p
      class="txt--meta">#{msgs['jsf.iteration.NoDocumentInVersion']}</p>
    <s:fragment
      rendered="#{versionHomeAction.documentUploadAllowed}">
      <p>
        <a href="#" class="button--primary"
          title="#{msgs['jsf.SupportedUploadFormats']}"
          onclick="openUploadSourceDocPanel()">
          #{msgs['jsf.iteration.files.UploadNewSourceDocument']}
        </a>
      </p>
    </s:fragment>
  </s:div>

  <s:div styleClass="l--pad-all-half"
    rendered="#{not empty versionHomeAction.documents and empty versionHomeAction.documentsTabDocumentFilter.currentPage}">
    <p class="txt--meta">#{msgs['jsf.search.NoResult']}</p>
  </s:div>

  <s:fragment
    rendered="#{not empty versionHomeAction.documentsTabDocumentFilter.currentPage}">
    <ul class="list--stats" id="documents-document_list">
      <ui:repeat
        value="#{versionHomeAction.documentsTabDocumentFilter.currentPage}"
        var="document">
        <ui:param name="hasActions"
          value="#{versionHomeAction.isPoDocument(document.docId) or !versionHomeAction.isPoDocument(document.docId) or versionHomeAction.hasOriginal(document.path, document.name) or versionHomeAction.documentUploadAllowed or versionHomeAction.documentRemovalAllowed}"/>
        <li id="#{document.docId}"
          class="progress-bar__expander #{hasActions ? 'list__item--actionable' : ''}" >
          <s:div styleClass="list__item__action" rendered="#{hasActions}">
            <div
{'fraction_non_alphanumeric': 0.1589866347496509, 'fraction_numerical': 0.002593257530420906, 'mean_word_length': 3.788443170964661, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 133, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 16}, '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': '4741481', 'n_tokens_mistral': 3113, 'n_tokens_neox': 3030, 'n_words': 364}