<commit_before><!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns="http://www.w3.org/1999/xhtml">

<body th:fragment="results_table">
<table id="mainTable" class="table table-hover table-bordered" style="font-size: small">
    <caption id="total" th:text="'Total: '+ ${totalStudies}"></caption>
    <thead>
    <tr>
        <th></th>
        <th class="col-md-1">Author
            <div>
                <a th:href="@{${uri}(sorttype=authorsortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=authorsortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-1">Title
            <div>
                <a th:href="@{${uri}(sorttype=titlesortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=titlesortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-1">Publication Date (YYYY-MM-DD)
            <div>
                <a th:href="@{${uri}(sorttype=publicationdatesortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=publicationdatesortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-1">Pubmed ID
            <div>
                <a th:href="@{${uri}(sorttype=pubmedsortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=pubmedsortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-1">Publication
            <div>
                <a th:href="@{${uri}(sorttype=publicationsortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=publicationsortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>

        <th class="col-md-1">Disease/Trait
            <div th:if="${totalStudies &gt; 1 and #bools.isTrue(pagination) }">
                <a th:href="@{${uri}(sorttype=diseasetraitsortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=diseasetraitsortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-1">EFO Trait</th>
        <th class="col-md-2">Curator
            <div th:if="${totalStudies &gt; 1 and #bools.isTrue(pagination) }">
                <a th:href="@{${uri}(sorttype=curatorsortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=curatorsortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-2">Curation Status
            <div th:if="${totalStudies &gt; 1 and #bools.isTrue(pagination) }">
                <a th:href="@{${uri}(sorttype=curationstatussortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=curationstatussortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-1">Notes</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="study : ${studies}">
        <td>
            <div class="btn-group">
                            <button type="button" data-toggle="dropdown" class="btn btn-default btn-sm dropdown-toggle">
                                Action<span class="caret"></span></button>

                <ul class="dropdown-menu">
                    <li><a th:href="@{/studies/{studyId}(studyId=${study.id})}">View</a></li>
                    <li><a th:href="@{/studies/{studyId}/delete(studyId=${study.id})}">Delete</a>
                    </li>
                    <li>
                        <a th:href="@{/studies/{studyId}/duplicate(studyId=${study.id})}">Duplicate</a>
                    </li>
                </ul>
            </div>
        </td>

        <!-- Use a conditional here as a study can have a null attributes-->
        <!-- Using thymeleaf elvis operator for string, date attributes-->

        <td th:text="${study.author} ?: '' "></td>
        <td th:text="${study.title} ?: ''"></td>
        <td th:text="${study.publicationDate != null } ? ${#dates.format(study.publicationDate,'yyyy-MM-dd')} : ''"></td>
        <td><p th:text="${study.pubmedId} ?: ''"></p>

            <div class="btn-group">
                            <button type="button"
                                    data-toggle="dropdown"
                                    class="btn btn-sm btn-default dropdown-toggle">
                                View paper<span class="caret"></span></button>

                <ul class="dropdown-menu">
                    <li>
                        <a th:href="@{http://europepmc.org/abstract/MED/{pubmedId}(pubmedId=${study.pubmedId})}"
                           target="_blank">View in Europe PMC</a></li>
                    <li>
                        <a th:href="@{http://www.ncbi.nlm.nih.gov/pubmed/?term={pubmedId}(pubmedId=${study.pubmedId})}"
                           target="_blank">View in PubMed</a></li>

                </ul>
            </div>
        </td>


        <td th:text="${study.publication} ?: ''"></td>

        <!--If study has associated disease trait or EFO trait return traits name-->
        <td th:text="${study.diseaseTrait != null} ? ${study.diseaseTrait.trait} : ''"></td>
        <td><span th:each="efoTrait: ${study.efoTraits}"
                  th:if="${#arrays.length(study.efoTraits) &gt; 1}"
                  th:text="${efoTrait.trait}+', ' ?: ''"></span>
                            <span th:each="efoTrait: ${study.efoTraits}"
                                  th:if="${#arrays.length(study.efoTraits) == 1}"
                                  th:text="${efoTrait.trait} ?: ''"></span>
        </td>

        <!--If study has associated housekeeping object then get the following attributes -->
        <td>
            <p th:text="${study.housekeeping != null and study.housekeeping.curator !=null } ? ${study.housekeeping.curator.lastName} : ''"></p>

            <div id="assignCuratorForm">

                <form class="form-inline" name="assignCuratorForm" role="form" method="post"
                      th:action="@{/studies/{studyId}/assign(studyId=${study.id})}"
                      th:object="${assignee}">
                    <div class="form-group">
                        <input type="hidden" class="form-control" id="uri"
                               th:field="*{uri}"/>
                    </div>

                    <div class="form-group">
                        <label for="curator" class="control-label"></label>
                        <select name="curator" th:field="*{curatorId}"
                                class="form-control select2-select" id="curator">
                            <!--Empty value for first entry-->
                            <option value=""></option>
                            <option th:each="curator : ${curators}"
                                    th:value="${curator.id}"
                                    th:text="${curator.lastName}"></option>
                        </select>
                                    <button type="submit"
                                            class="btn btn-primary btn-sm">Save
                                    </button>
                    </div>
                </form>
            </div>
        </td>

        <td>
            <p th:text="${study.housekeeping != null and study.housekeeping.curationStatus != null } ? ${study.housekeeping.curationStatus.status} : ''"></p>

            <div id="assignStatusForm">

                <form class="form-inline" name="assignStatusForm" role="form" method="post"
                      th:action="@{/studies/{studyId}/status_update(studyId=${study.id})}"
                      th:object="${statusAssignment}">
                    <div class="form-group">
                        <input type="hidden" class="form-control" id="uri"
                               th:field="*{uri}"/>
                    </div>
<commit_msg>Studies now also no longer editable from main page<commit_after><!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns="http://www.w3.org/1999/xhtml">

<body th:fragment="results_table">
<table id="mainTable" class="table table-hover table-bordered" style="font-size: small">
    <caption id="total" th:text="'Total: '+ ${totalStudies}"></caption>
    <thead>
    <tr>
        <th></th>
        <th class="col-md-1">Author
            <div>
                <a th:href="@{${uri}(sorttype=authorsortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=authorsortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-1">Title
            <div>
                <a th:href="@{${uri}(sorttype=titlesortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=titlesortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-1">Publication Date (YYYY-MM-DD)
            <div>
                <a th:href="@{${uri}(sorttype=publicationdatesortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=publicationdatesortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-1">Pubmed ID
            <div>
                <a th:href="@{${uri}(sorttype=pubmedsortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=pubmedsortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-1">Publication
            <div>
                <a th:href="@{${uri}(sorttype=publicationsortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=publicationsortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>

        <th class="col-md-1">Disease/Trait
            <div th:if="${totalStudies &gt; 1 and #bools.isTrue(pagination) }">
                <a th:href="@{${uri}(sorttype=diseasetraitsortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=diseasetraitsortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-1">EFO Trait</th>
        <th class="col-md-2">Curator
            <div th:if="${totalStudies &gt; 1 and #bools.isTrue(pagination) }">
                <a th:href="@{${uri}(sorttype=curatorsortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=curatorsortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-2">Curation Status
            <div th:if="${totalStudies &gt; 1 and #bools.isTrue(pagination) }">
                <a th:href="@{${uri}(sorttype=curationstatussortasc)}"
                   class="btn btn-default btn-xs"><span class="glyphicon glyphicon-sort-by-alphabet"></span></a>
                <a th:href="@{${uri}(sorttype=curationstatussortdesc)}"
                   class="btn btn-default btn-xs"><span
                        class="glyphicon glyphicon-sort-by-alphabet-alt"></span></a>
            </div>
        </th>
        <th class="col-md-1">Notes</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="study : ${studies}">
        <td>
            <div class="btn-group">
                            <button type="button" data-toggle="dropdown" class="btn btn-default btn-sm dropdown-toggle">
                                Action<span class="caret"></span></button>

                <ul class="dropdown-menu">
                    <li><a th:href="@{/studies/{studyId}(studyId=${study.id})}">View</a></li>
                    <li><a th:href="@{/studies/{studyId}/delete(studyId=${study.id})}">Delete</a>
                    </li>
                    <li>
                        <a th:href="@{/studies/{studyId}/duplicate(studyId=${study.id})}">Duplicate</a>
                    </li>
                </ul>
            </div>
        </td>

        <!-- Use a conditional here as a study can have a null attributes-->
        <!-- Using thymeleaf elvis operator for string, date attributes-->

        <td th:text="${study.author} ?: '' "></td>
        <td th:text="${study.title} ?: ''"></td>
        <td th:text="${study.publicationDate != null } ? ${#dates.format(study.publicationDate,'yyyy-MM-dd')} : ''"></td>
        <td><p th:text="${study.pubmedId} ?: ''"></p>

            <div class="btn-group">
                            <button type="button"
                                    data-toggle="dropdown"
                                    class="btn btn-sm btn-default dropdown-toggle">
                                View paper<span class="caret"></span></button>

                <ul class="dropdown-menu">
                    <li>
                        <a th:href="@{http://europepmc.org/abstract/MED/{pubmedId}(pubmedId=${study.pubmedId})}"
                           target="_blank">View in Europe PMC</a></li>
                    <li>
                        <a th:href="@{http://www.ncbi.nlm.nih.gov/pubmed/?term={pubmedId}(pubmedId=${study.pubmedId})}"
                           target="_blank">View in PubMed</a></li>

                </ul>
            </div>
        </td>


        <td th:text="${study.publication} ?: ''"></td>

        <!--If study has associated disease trait or EFO trait return traits name-->
        <td th:text="${study.diseaseTrait != null} ? ${study.diseaseTrait.trait} : ''"></td>
        <td><span th:each="efoTrait: ${study.efoTraits}"
                  th:if="${#arrays.length(study.efoTraits) &gt; 1}"
                  th:text="${efoTrait.trait}+', ' ?: ''"></span>
                            <span th:each="efoTrait: ${study.efoTraits}"
                                  th:if="${#arrays.length(study.efoTraits) == 1}"
                                  th:text="${efoTrait.trait} ?: ''"></span>
        </td>

        <!--If study has associated housekeeping object then get the following attributes -->
        <td>
            <p th:text="${study.housekeeping != null and study.housekeeping.curator !=null } ? ${study.housekeeping.curator.lastName} : ''"></p>

            <div id="assignCuratorForm"
                 th:if="*{#bools.isFalse(study.housekeeping.isPublished)}">

                <form class="form-inline" name="assignCuratorForm" role="form" method="post"
                      th:action="@{/studies/{studyId}/assign(studyId=${study.id})}"
                      th:object="${assignee}">
                    <div class="form-group">
                        <input type="hidden" class="form-control" id="uri"
                               th:field="*{uri}"/>
                    </div>

                    <div class="form-group">
                        <label for="curator" class="control-label"></label>
                        <select name="curator" th:field="*{curatorId}"
                                class="form-control select2-select" id="curator">
                            <!--Empty value for first entry-->
                            <option value=""></option>
                            <option th:each="curator : ${curators}"
                                    th:value="${curator.id}"
                                    th:text="${curator.lastName}"></option>
                        </select>
                                    <button type="submit"
                                            class="btn btn-primary btn-sm">Save
                                    </button>
                    </div>
                </form>
            </div>
        </td>

        <td>
            <p th:text="${study.housekeeping != null and study.housekeeping.curationStatus != null } ? ${study.housekeeping.curationStatus.status} : ''"></p>

            <div id="assignStatusForm"
                 th:if="*{#bools.isFalse(study.housekeeping.isPublished)}">

                <form class="form-inline" name="assignStatusForm" role="form" method="post"
                      th:action="@{/studies/{studyId}/status_update(studyId=${study.id})}"
                      th:object="${statusAssignment}">
                    <div class="form-group">
                        <input type="hidden" class="form-control" id="uri"
                               th:field="*{uri}"/>
                    </div>

{'fraction_non_alphanumeric': 0.1742721237781611, 'fraction_numerical': 0.0021953896816684962, 'mean_word_length': 1.6429064787954137, 'pattern_counts': {'":': 0, '<': 419, '<?xml version=': 0, '>': 419, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1571450', 'n_tokens_mistral': 5739, 'n_tokens_neox': 5323, 'n_words': 862}