<commit_before>
<style>
    /* Custom CSS for the custom homepage... */
    .lite-header {font-weight: normal;}
    div.hmpg-action-block {padding-top:2em;}
    div.search-widget {padding-bottom: 2em;}
    div.browse-subjects {padding:0 2px;}
    div.browse-subjects a {color: #C55B28;}
    div.browse-subjects a:focus, div.browse-subjects a:hover {color: #9F3502;}
    #dataversesBySubject {-webkit-column-count: 3; -moz-column-count: 3; column-count: 3;}
    div.hmpg-recent-col div.col-xs-2.hmpg-recent-thumb {padding-right:0 !important;}
    div.hmpg-recent-col div.hmpg-recent-thumb img {max-height:48px;max-width:48px;}
    div.hmpg-recent-col div.hmpg-recent-thumb span {font-size:38px;}
    div.hmpg-activity-block .row .lite-header {margin-left:1em;}

    .btn-harvard { 
      color: #A51C30;
      background: #FFFFFF;
      font-weight: bold;
    }
    .btn-harvard:hover, 
    .btn-harvard:focus, 
    .btn-harvard:active, 
    .btn-harvard.active, 
    .open .dropdown-toggle.btn-harvard { 
      color: #7F000A;
      background: #FFFFFF;
      font-weight: bold;
    } 
</style>

    <!-- ACTIONS -->
    <div class="row hmpg-action-block">
        <div class="col-xs-6">
            <div class="h4 lite-header">Deposit and share your data. Get academic credit.</div>
            <p class="text-muted margin-bottom">Harvard Dataverse is a digital repository. Deposit data and code here.</p>
            <a class="btn btn-default btn-harvard margin-top margin-bottom" href="/dataset.xhtml?ownerId=1">
                Add data to Harvard Dataverse <span class="glyphicon glyphicon-plus"></span>
            </a>
        </div>
        <div class="col-xs-6">
            <div class="h4 lite-header">Organize datasets and gather metrics in your own virtual archive.</div>
            <p class="text-muted margin-bottom">A dataverse is a virtual archive. A dataverse can contain dataverses, datasets, files and metadata.</p>
            <a class="btn btn-default btn-harvard margin-top margin-bottom" href="/dataverse.xhtml?ownerId=1">
                Create my own dataverse <span class="glyphicon glyphicon-chevron-right"></span>
            </a>
        </div>
    </div>

    <hr/>

    <!-- SEARCH + BROWSE + RECENT -->
    <div class="row hmpg-browse-block">
        
        <!-- SEARCH -->
        <div class="col-xs-12">
            <div class="h4 lite-header margin-bottom">Find data across research fields, preview metadata, and download files.</div>
            <div class="row">
                <div class="col-xs-4">
                    <div class="search-widget input-group">
                        <input id="inputDataverseSearch" class="form-control" type="text" placeholder="Search over 75,000 datasets..." onkeydown="if (event.keyCode == 13) document.getElementById('btnDataverseSearch').click();">
                        <span class="input-group-btn">
                            <button id="btnDataverseSearch" class="btn btn-default" type="button" onclick="window.location = '/dataverse/root?q=' + document.getElementById('inputDataverseSearch').value;return false;"><span class="glyphicon glyphicon-search"></span> Find</button>
                        </span>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- BROWSE -->
        <div class="col-xs-12">
            <p class="text-muted">Browse dataverses in this repository by subject.</p>
            <div class="row margin-bottom">
                <div id="dataversesBySubject" class="col-xs-12">

                </div>
            </div>
        </div>

        <!-- RECENT -->
        <div class="col-xs-12">
            <div class="row">
                <div class="col-xs-6 hmpg-recent-col">
                    <div class="h4 lite-header margin-bottom">Datasets from journal articles</div>

                    <hr class="col-xs-11 no-margin-top"/>

                    <!-- JOURNAL RESULTS -->
                    <div id="journals" class="row col-xs-12">Loading...</div>

                    <!-- VIEW ALL -->
                    <div class="col-xs-12">
                        <p class="small text-muted"><a href="/dataverse/root?q=%28categoryOfDataverse%3A%22Journal%22%29&types=datasets&sort=dateSort&order=desc">ALL RECENT JOURNAL ACTIVITY</a> <span class="glyphicon glyphicon-chevron-right"></span></p>
                    </div>
                </div>

                <div class="col-xs-6 hmpg-recent-col">
                    <div class="h4 lite-header margin-bottom">Datasets from research projects, groups and researchers</div>

                    <hr class="col-xs-11 no-margin-top"/>

                    <!-- RESEARCHERS RESULTS -->
                    <div id="researchers" class="row col-xs-12">Loading...</div>

                    <!-- VIEW ALL -->
                    <div class="col-xs-12">
                        <p class="small text-muted"><a href= "/dataverse/root?q=%28categoryOfDataverse%3A%22Research+Project%22+OR+categoryOfDataverse%3A%22Researcher%22+OR+category_of_dataverse%3A%22Research+Group%22%29&types=datasets&sort=dateSort&order=desc">ALL RECENT RESEARCHERS ACTIVITY</a> <span class="glyphicon glyphicon-chevron-right"></span></p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <hr/>

    <!-- ACTIVITY -->
    <div class="row hmpg-activity-block">
        <div class="col-xs-12">
            <div class="h4 lite-header margin-bottom">Activity</div>
        </div>
        <div class="col-xs-12 row">
            <div class="col-xs-6">
                <p><span class="highlightBold">All Files</span> <span class="h4 lite-header" id="activityAllTimeDatasetsValue"></span> datasets added <span class="h4 lite-header" id="activityAllTimeFilesValue"></span> file downloads</p>
            </div>
            <div class="col-xs-6">
                <p><span class="highlightBold">Past 30 Days</span> <span class="h4 lite-header" id="activity30DaysDatasetsValue"></span> datasets added <span class="h4 lite-header" id="activity30DaysFilesValue"></span> file downloads</p>
            </div>
        </div>
    </div>

    <hr/>

    <!-- OTHER LINKS -->
    <div class="row hmpg-other-block">
        <div class="col-xs-12">
            <div class="h4 lite-header margin-bottom">Looking for other online repositories at Harvard?</div>
            <p class="text-muted"><a href="https://dash.harvard.edu/" target="_blank">Harvard DASH article repository</a> <span class="glyphicon glyphicon-chevron-right"></span> &#160;&#160; <a href="https://library.harvard.edu/services-tools" target="_blank">All repositories at Harvard</a> <span class="glyphicon glyphicon-chevron-right"></span></p>
        </div>
    </div>

<script type="text/javascript">
//<![CDATA[

    //switch baseUrl to point to a different server than the local box
    var baseUrl = ""; 

    var thumbBaseURL = baseUrl + "/api/datasets/:persistentId/thumbnail" + "?persistentId=";
    var metricBaseUrl = baseUrl + "/api/info/metrics/";
    var simpleCatSearch = baseUrl + "/api/search?q=*&type=dataset&fq=categoryOfDataverse:";

    function writeRecentDatasetsInDataverses(fqString, resultCount, elm) {
        $.get(simpleCatSearch + fqString + "&per_page=" + resultCount, function(jData) {
            var resultHtml = "";
            jData.data.items.forEach(function(item){
                var date = new Date(item.published_at);
                resultHtml += "<div class=\"col-xs-12\">"           
                resultHtml += "<div class=\"col-xs-2 text-center hmpg-recent-thumb\"><a href=\"/dataset.xhtml?persistentId=" + item.global_id + "\">";
                resultHtml += "<object data=\"" + thumbBaseURL + item.global_id + "\" type=\"image/png\"/><span class=\"icon-dataset\"></span></object></div>";
                resultHtml += "<div class=\"col-xs-10\"><p><a href=\"/dataset.xhtml?persistentId=" + item.global_id + "\">" + item.name + "</a></p><p class=\"small text-muted\"><a href=\"/dataverse/" + item.identifier_of_dataverse + "\">" + item.name_of_dataverse + "</a> - " + date.toDateString() + "</p></div>";
                resultHtml += "<hr class=\"col-xs-12\"/></div>"
            });
            document.getElementById(elm).innerHTML = resultHtml;
        });
    }
    
    //For metrics that return simple json with a count
    function queryMetricSimple(metricRelPath, month, elm) {
        $.get(metricBaseUrl + metricRelPath + month, function(jData) {
            var resultCount = jData.data.count;
            document.getElementById(elm).innerHTML = resultCount;
        });
    }
    
    function queryMetricSearch(metricRelPath, month) {
        $.get(metricBaseUrl + metricRelPath + month, function(jData) {
            var resultCount = jData.data.count;
            var roundedDatasetCount = Math.floor(resultCount / 100) * 100;<commit_msg>Improve responsive layout of custom hmpg [ref #5053]<commit_after>
<style>
    /* Custom CSS for the custom homepage... */
    .lite-header {font-weight: normal;}
    div.hmpg-action-block {padding-top:2em;}
    div.search-widget {padding-bottom: 2em;}
    div.browse-subjects {padding:0 2px;}
    div.browse-subjects a {color: #C55B28;}
    div.browse-subjects a:focus, div.browse-subjects a:hover {color: #9F3502;}
    #dataversesBySubject {-webkit-column-count: 3; -moz-column-count: 3; column-count: 3;}
    div.hmpg-recent-col div.col-xs-2.hmpg-recent-thumb {width:48px !important; padding:0 !important;}
    div.hmpg-recent-col div.hmpg-recent-thumb img {max-height:48px;max-width:48px;}
    div.hmpg-recent-col div.hmpg-recent-thumb span {font-size:38px;}
    div.hmpg-activity-block .row .lite-header {margin-left:1em;}

    .btn-harvard { 
      color: #A51C30;
      background: #FFFFFF;
      font-weight: bold;
    }
    .btn-harvard:hover, 
    .btn-harvard:focus, 
    .btn-harvard:active, 
    .btn-harvard.active, 
    .open .dropdown-toggle.btn-harvard { 
      color: #7F000A;
      background: #FFFFFF;
      font-weight: bold;
    } 
</style>

    <!-- ACTIONS -->
    <div class="row hmpg-action-block">
        <div class="col-sm-6 col-xs-12">
            <div class="h4 lite-header">Deposit and share your data. Get academic credit.</div>
            <p class="text-muted margin-bottom">Harvard Dataverse is a digital repository. Deposit data and code here.</p>
            <a class="btn btn-default btn-harvard margin-top margin-bottom" href="/dataset.xhtml?ownerId=1">
                Add data to Harvard Dataverse <span class="glyphicon glyphicon-plus"></span>
            </a>
        </div>
        <div class="col-sm-6 col-xs-12">
            <div class="h4 lite-header">Organize datasets and gather metrics in your own virtual archive.</div>
            <p class="text-muted margin-bottom">A dataverse is a virtual archive. A dataverse can contain dataverses, datasets, files and metadata.</p>
            <a class="btn btn-default btn-harvard margin-top margin-bottom" href="/dataverse.xhtml?ownerId=1">
                Create my own dataverse <span class="glyphicon glyphicon-chevron-right"></span>
            </a>
        </div>
    </div>

    <hr/>

    <!-- SEARCH + BROWSE + RECENT -->
    <div class="row hmpg-browse-block">
        
        <!-- SEARCH -->
        <div class="col-xs-12">
            <div class="h4 lite-header margin-bottom">Find data across research fields, preview metadata, and download files.</div>
            <div class="row">
                <div class="col-md-5 col-sm-6 col-xs-11">
                    <div class="search-widget input-group">
                        <input id="inputDataverseSearch" class="form-control" type="text" placeholder="Search over 75,000 datasets..." onkeydown="if (event.keyCode == 13) document.getElementById('btnDataverseSearch').click();">
                        <span class="input-group-btn">
                            <button id="btnDataverseSearch" class="btn btn-default" type="button" onclick="window.location = '/dataverse/root?q=' + document.getElementById('inputDataverseSearch').value;return false;"><span class="glyphicon glyphicon-search"></span> Find</button>
                        </span>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- BROWSE -->
        <div class="col-xs-12">
            <p class="text-muted">Browse dataverses in this repository by subject.</p>
            <div class="row margin-bottom">
                <div id="dataversesBySubject" class="col-xs-12">

                </div>
            </div>
        </div>

        <!-- RECENT -->
        <div class="col-xs-12">
            <div class="row">
                <div class="col-sm-6 col-xs-12 hmpg-recent-col">
                    <div class="h4 lite-header margin-bottom">Datasets from journal articles</div>

                    <hr class="col-xs-11 no-margin-top"/>

                    <!-- JOURNAL RESULTS -->
                    <div id="journals" class="row col-xs-12">Loading...</div>

                    <!-- VIEW ALL -->
                    <div class="col-xs-12">
                        <p class="small text-muted"><a href="/dataverse/root?q=%28categoryOfDataverse%3A%22Journal%22%29&types=datasets&sort=dateSort&order=desc">ALL RECENT JOURNAL ACTIVITY</a> <span class="glyphicon glyphicon-chevron-right"></span></p>
                    </div>
                </div>

                <div class="col-sm-6 col-xs-12 hmpg-recent-col">
                    <div class="h4 lite-header margin-bottom">Datasets from research projects, groups and researchers</div>

                    <hr class="col-xs-11 no-margin-top"/>

                    <!-- RESEARCHERS RESULTS -->
                    <div id="researchers" class="row col-xs-12">Loading...</div>

                    <!-- VIEW ALL -->
                    <div class="col-xs-12">
                        <p class="small text-muted"><a href= "/dataverse/root?q=%28categoryOfDataverse%3A%22Research+Project%22+OR+categoryOfDataverse%3A%22Researcher%22+OR+category_of_dataverse%3A%22Research+Group%22%29&types=datasets&sort=dateSort&order=desc">ALL RECENT RESEARCHERS ACTIVITY</a> <span class="glyphicon glyphicon-chevron-right"></span></p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <hr/>

    <!-- ACTIVITY -->
    <div class="row hmpg-activity-block">
        <div class="col-xs-12">
            <div class="h4 lite-header margin-bottom">Activity</div>
        </div>
        <div class="col-xs-12 row">
            <div class="col-sm-6 col-xs-12">
                <p><span class="highlightBold">All Files</span> <span class="h4 lite-header" id="activityAllTimeDatasetsValue"></span> datasets added <span class="h4 lite-header" id="activityAllTimeFilesValue"></span> file downloads</p>
            </div>
            <div class="col-sm-6 col-xs-12">
                <p><span class="highlightBold">Past 30 Days</span> <span class="h4 lite-header" id="activity30DaysDatasetsValue"></span> datasets added <span class="h4 lite-header" id="activity30DaysFilesValue"></span> file downloads</p>
            </div>
        </div>
    </div>

    <hr/>

    <!-- OTHER LINKS -->
    <div class="row hmpg-other-block">
        <div class="col-xs-12">
            <div class="h4 lite-header margin-bottom">Looking for other online repositories at Harvard?</div>
            <p class="text-muted"><a href="https://dash.harvard.edu/" target="_blank">Harvard DASH article repository</a> <span class="glyphicon glyphicon-chevron-right"></span> &#160;&#160; <a href="https://library.harvard.edu/services-tools" target="_blank">All repositories at Harvard</a> <span class="glyphicon glyphicon-chevron-right"></span></p>
        </div>
    </div>

<script type="text/javascript">
//<![CDATA[

    //switch baseUrl to point to a different server than the local box
    var baseUrl = ""; 

    var thumbBaseURL = baseUrl + "/api/datasets/:persistentId/thumbnail" + "?persistentId=";
    var metricBaseUrl = baseUrl + "/api/info/metrics/";
    var simpleCatSearch = baseUrl + "/api/search?q=*&type=dataset&fq=categoryOfDataverse:";

    function writeRecentDatasetsInDataverses(fqString, resultCount, elm) {
        $.get(simpleCatSearch + fqString + "&per_page=" + resultCount, function(jData) {
            var resultHtml = "";
            jData.data.items.forEach(function(item){
                var date = new Date(item.published_at);
                resultHtml += "<div class=\"col-xs-12\">"           
                resultHtml += "<div class=\"col-xs-2 text-center hmpg-recent-thumb\"><a href=\"/dataset.xhtml?persistentId=" + item.global_id + "\">";
                resultHtml += "<object data=\"" + thumbBaseURL + item.global_id + "\" type=\"image/png\"/><span class=\"icon-dataset\"></span></object></div>";
                resultHtml += "<div class=\"col-xs-9\"><p><a href=\"/dataset.xhtml?persistentId=" + item.global_id + "\">" + item.name + "</a></p><p class=\"small text-muted\"><a href=\"/dataverse/" + item.identifier_of_dataverse + "\">" + item.name_of_dataverse + "</a> - " + date.toDateString() + "</p></div>";
                resultHtml += "<hr class=\"col-xs-12\"/></div>"
            });
            document.getElementById(elm).innerHTML = resultHtml;
        });
    }
    
    //For metrics that return simple json with a count
    function queryMetricSimple(metricRelPath, month, elm) {
        $.get(metricBaseUrl + metricRelPath + month, function(jData) {
            var resultCount = jData.data.count;
            document.getElementById(elm).innerHTML = resultCount;
        });
    }
    
    function queryMetricSearch(metricRelPath, month) {
        $.get(metricBaseUrl + metricRelPath + month, function(jData) {
            var resultCount = jData.data.count;
            var roundedDatasetCount = Math.floor(resultCount / 100) * 100;
{'fraction_non_alphanumeric': 0.1582504748072841, 'fraction_numerical': 0.016646184783823036, 'mean_word_length': 2.3135295206366835, 'pattern_counts': {'":': 0, '<': 333, '<?xml version=': 0, '>': 331, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2410912', 'n_tokens_mistral': 5744, 'n_tokens_neox': 5349, 'n_words': 1102}