<commit_before>{% extends 'base.html' %}
{% block head %}
    <title>{{ pubdata['title'] }}</title>
    <meta NAME="title" content="{{ pubdata['title'] }}" />
    <meta name="description" content="{% if pubdata['docAbstract']  %}{{ pubdata['docAbstract'].split(' ')[0:150]|join(' ')|striptags }}...{% endif %}" />
    <META NAME="abstract" CONTENT="{% if pubdata['docAbstract']  %}{{ pubdata['docAbstract']|striptags }}{% endif %}" />
    {% for author in pubdata['authorsList'] %}<meta NAME="author" content="{{ author }}"/>
    {% endfor %}
    <meta name = "revised" content="{{ pubdata['lastModifiedDate'] }}"/>
    <meta name = "created" content="{{ pubdata['displaytoPublicDate'] }}"/>
    <meta name = "date" content="{{ pubdata['publicationYear'] }}"/>
    {% block page_script %}
       {%- if pubdata["geographicExtents"] -%}
        <link rel="stylesheet" href="{{ url_for('static', filename = 'css/leaflet.css') }}">
        <script type="text/javascript" src="{{ url_for('static', filename='js/vendor/leaflet-0.7.3/leaflet.js') }}"></script>
        <script type="text/javascript" src="{{ url_for('static', filename='js/vendor/esri-leaflet-basemaps.js') }}"></script>
        <script type="text/javascript" src="{{ url_for('static', filename='js/vendor/esri-leaflet-basemaps.js.map') }}"></script>
       {% endif %}
    {% endblock page_script %}


{% endblock head %}



        {% block main %}
        <main role ="main">
            <article itemscope itemtype="http://schema.org/ScholarlyArticle">
                {# this image is being dynamically resized to 200 pixels from whatever it might have been #}
                <img id="thumbnail" src="{{ wsgi_str }}{{ url_for('images', filename=pubdata['displayLinks']['Thumbnail'][0]['url'], width=200) }}" alt="thumbnail"/>

                <hgroup>
                    <h3 itemprop="name">{{ pubdata['title']|safe }}</h3>
                    {% if pubdata['seriesTitle'] %}
                    <h4>{{ pubdata['seriesTitle']['text'] }} {{ pubdata['seriesNumber'] }}{% if pubdata['chapter'] %}-{{ pubdata['chapter'] }}{% endif %}{% if pubdata['subChapter'] %}-{{ pubdata['subChapter'] }}{% endif %}</h4>
                    {% endif %}
                    {% if pubdata['subSeriesTitle'] %}
                    <h5>{{ pubdata['subSeriesTitle'] }}</h5>
                    {% endif %}
                    {% if pubdata['collaboration'] %}
                    <h6>{{ pubdata['collaboration']|safe }}</h6>
                    {% endif %}
                </hgroup>

                <section>
                    <dl id="contributors">
                      <dt>By:</dt>
                        <dd>
                      {%- for contributor in pubdata['authorsListTyped']  -%}
                          {%- if contributor['type'] == "person"  -%}
                        <span itemprop="author" itemtype="http://schema.org/Person">{{ contributor['text'] }}</span>
                          {%- else -%}
                         <span itemprop="author" itemtype="http://schema.org/Organization">{{ contributor['text'] }}</span>
                          {%- endif -%}
                          {% if not loop.last %}, {% endif %}

                      {%-  endfor -%}
                        </dd>
                      {% if pubdata['editorsList'] %}
                      <dt class="clear">Edited by:</dt>
                      <dd>
                          {%- for contributor in pubdata['editorsListTyped']  -%}
                          {%- if contributor['type'] == "person"  -%}
                        <span itemprop="editor" itemtype="http://schema.org/Person">{{ contributor['text'] }}</span>
                          {%- else -%}
                         <span itemprop="editor" itemtype="http://schema.org/Organization">{{ contributor['text'] }}</span>
                          {%- endif -%}
                          {% if not loop.last %}, {% endif %}
                      {%-  endfor -%}
                          </dd>
                      {%- endif -%}
                    </dl>
                </section>
                <section>
                    {% if pubdata['doi'] %}<h6>DOI: <a itemprop="sameAs" href="http://dx.doi.org/{{ pubdata['doi'] }}">{{ pubdata['doi'] }}</a></h6>{% endif %}
                    <a href="https://twitter.com/share" class="twitter-share-button" data-text="USGS Pub" data-via="USGS_Pubs" data-dnt="true">Tweet</a>
                    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
                </section>
                
                <section id="suggested">
                    {% macro linkdisplay(link) -%}
                        <a href="{{ link['url'] }}" target="_blank" title="{% if link['description'] %}{{ link['description'] }}{% else %}{{ link['type']['text'] }}{% endif -%}">
                            <strong>
                            {%- if link['text'] -%}
                                {{- link['text'] -}}
                            {%- else -%}
                                {{- link['type']['text'] -}}
                            {%- endif -%}
                            </strong>
                            {%- if link["linkFileType"] and link["size"]   %}
                                 ({{ link["size"] }} {{ link["linkFileType"]["text"] }})
                            {% elif link["linkFileType"] %}
                                ({{ link["linkFileType"]["text"] }})
                            {%- elif link["size"]   %}
                                 ({{ link["size"] }})
                            {% endif -%}
                            </a>
                    {%- endmacro %}

                    {%- macro linkdisplaylists(link_type, link_type_text_single, link_type_text_multiple) -%}
                        {% if pubdata['displayLinks'][link_type]|length == 1  %}
                            <li>{{ link_type_text_single }}: {{ linkdisplay(pubdata['displayLinks'][link_type][0]) }}</li>
                        {%- elif pubdata['displayLinks'][link_type]|length > 1 -%}
                            <li>{{ link_type_text_multiple }}</li>
                            <ul class="filessublist">
                            {%- for link in pubdata['displayLinks'][link_type]|sort(attribute='rank') -%}
                                <li>{{ linkdisplay(link) }}</li>
                            {%- endfor -%}
                            </ul>
                        {% endif %}
                    {%- endmacro -%}
                    <h4>Links</h4>
                    <ul class="fileslist">
                        {{- linkdisplaylists('Index Page','More information','More Information') -}}
                        {{- linkdisplaylists('Document','Document','Documents') -}}
                        {{- linkdisplaylists('Plate', 'Plate','Plates')  -}}
                        {{- linkdisplaylists('Abstract','Abstract','Abstracts') -}}
                        {{- linkdisplaylists('Additional Report Piece','Additional Report Piece','Additional Report Pieces') -}}
                        {{- linkdisplaylists('Appendix', 'Appendix', 'Appendices') -}}
                        {{- linkdisplaylists('Application Site','Application Site','Application Sites') -}}
                        {{- linkdisplaylists('Authors Website','Authors Website','Authors Website') -}}
                        {{- linkdisplaylists('Chapter','Chapter','Chapters') -}}
                        {{- linkdisplaylists('Companion Files','Companion File','Companion Files') -}}
                        {{- linkdisplaylists('Cover','Cover','Covers') -}}
                        {{- linkdisplaylists('Database','Database','Databases') -}}
                        {{- linkdisplaylists('Errata','Errata','Errata') -}}
                        {{- linkdisplaylists('Illustration','Illustration','Illustration') -}}
                        {{- linkdisplaylists('Image','Image','Image') -}}
                        {{- linkdisplaylists('Metadata','Metadata','Metadata') -}}
                        {{- linkdisplaylists('Project Site','Project Site','Project Sites') -}}
                        {{- linkdisplaylists('Raw Data', 'Raw Data', 'Raw Data') -}}
                        {{- linkdisplaylists('Read Me','Read Me','Read Me') -}}
                        {{- linkdisplaylists('Referenced Work','Referenced Work','Referenced Work') -}}
                        {{- linkdisplaylists('Related Work','Related Work','Related Works') -}}
                        {{- linkdisplaylists('Spatial Data','Spatial Data','Spatial Data') -}}
                        {{- linkdisplaylists('Version History','Version History','Version History') -}}
                    </ul>
                </section>
                <section itemprop="description" id="abstract" >
                    <h4 id="abstract_head">Abstract</h4>
                    {{ pubdata['docAbstract']|safe }}
                </section>
                {%- if pubdata["geographicExtents"] -%}
                <section>
                    <h4>Geospatial Extents</h4>
                    <div id="mymap" style="width:90%;height:450px;"></div>

                </section>
                {%- endif -%}

                <section id="details">
                    <h4 id="" class="dark">Additional Publication Details</h4>
                    <dl id="publication_details">
                      {% for detail in pubdata['details'] %}
                          <dt class="{{ loop.cycle('', 'dark') }}">{{ detail.keys()[0] }}</dt>
                          <dd class="{{ loop.cycle('', 'dark') }}">{{ detail.values()[0] }}</dd>
                      {% endfor %}
                    </dl>
                </section>
            </article>
        </main>
        {% endblock %}

        {% block url %}<a href="{{ url_for('publication', indexId = pubdata['indexId']) }}">http://pubs.er.usgs.gov{{ url_for('publication', indexId = pubdata['indexId']) }}</a>{% endblock %}
        {% block modtime %}{{ pubdata['formattedModifiedDateTime'] }}{% endblock %}
        {% block page_footer_script %}
        {%- if pubdata["geographicExtents"] -%}
        <script type=text/javascript>




                        //add esri basemap layers
                        var topo = L.esri.basemapLayer('Topographic',{ detectRetina: true, zIndex: 3}),
                         oceans = L.esri.basemapLayer('Oceans',{ detectRetina: true, zIndex: 1});
                        // create a map
                        map = new L.Map('mymap', {layers:[topo]});

                        var baseMaps = {
                            "esri Oceans": oceans,
                            "esri Topographic": topo

                        };

                        L.control.layers(baseMaps).addTo(map);
                        L.esri.basemapLayer('OceansLabels',{zIndex: 2}).addTo(map);


                        // include GeoJSON inside this JavaScript
                        var pubextent = {{ pubdata["geographicExtents"]|tojson|safe }};
                        L.geoJson( pubextent ).addTo(map);

<commit_msg>map fiddling<commit_after>{% extends 'base.html' %}
{% block head %}
    <title>{{ pubdata['title'] }}</title>
    <meta NAME="title" content="{{ pubdata['title'] }}" />
    <meta name="description" content="{% if pubdata['docAbstract']  %}{{ pubdata['docAbstract'].split(' ')[0:150]|join(' ')|striptags }}...{% endif %}" />
    <META NAME="abstract" CONTENT="{% if pubdata['docAbstract']  %}{{ pubdata['docAbstract']|striptags }}{% endif %}" />
    {% for author in pubdata['authorsList'] %}<meta NAME="author" content="{{ author }}"/>
    {% endfor %}
    <meta name = "revised" content="{{ pubdata['lastModifiedDate'] }}"/>
    <meta name = "created" content="{{ pubdata['displaytoPublicDate'] }}"/>
    <meta name = "date" content="{{ pubdata['publicationYear'] }}"/>
    {% block page_script %}
       {%- if pubdata["geographicExtents"] -%}
        <link rel="stylesheet" href="{{ url_for('static', filename = 'css/leaflet.css') }}">
        <script type="text/javascript" src="{{ url_for('static', filename='js/vendor/leaflet-0.7.3/leaflet.js') }}"></script>
        <script type="text/javascript" src="{{ url_for('static', filename='js/vendor/esri-leaflet-basemaps.js') }}"></script>
        <script type="text/javascript" src="{{ url_for('static', filename='js/vendor/esri-leaflet-basemaps.js.map') }}"></script>
       {% endif %}
    {% endblock page_script %}


{% endblock head %}



        {% block main %}
        <main role ="main">
            <article itemscope itemtype="http://schema.org/ScholarlyArticle">
                {# this image is being dynamically resized to 200 pixels from whatever it might have been #}
                <img id="thumbnail" src="{{ wsgi_str }}{{ url_for('images', filename=pubdata['displayLinks']['Thumbnail'][0]['url'], width=200) }}" alt="thumbnail"/>

                <hgroup>
                    <h3 itemprop="name">{{ pubdata['title']|safe }}</h3>
                    {% if pubdata['seriesTitle'] %}
                    <h4>{{ pubdata['seriesTitle']['text'] }} {{ pubdata['seriesNumber'] }}{% if pubdata['chapter'] %}-{{ pubdata['chapter'] }}{% endif %}{% if pubdata['subChapter'] %}-{{ pubdata['subChapter'] }}{% endif %}</h4>
                    {% endif %}
                    {% if pubdata['subSeriesTitle'] %}
                    <h5>{{ pubdata['subSeriesTitle'] }}</h5>
                    {% endif %}
                    {% if pubdata['collaboration'] %}
                    <h6>{{ pubdata['collaboration']|safe }}</h6>
                    {% endif %}
                </hgroup>

                <section>
                    <dl id="contributors">
                      <dt>By:</dt>
                        <dd>
                      {%- for contributor in pubdata['authorsListTyped']  -%}
                          {%- if contributor['type'] == "person"  -%}
                        <span itemprop="author" itemtype="http://schema.org/Person">{{ contributor['text'] }}</span>
                          {%- else -%}
                         <span itemprop="author" itemtype="http://schema.org/Organization">{{ contributor['text'] }}</span>
                          {%- endif -%}
                          {% if not loop.last %}, {% endif %}

                      {%-  endfor -%}
                        </dd>
                      {% if pubdata['editorsList'] %}
                      <dt class="clear">Edited by:</dt>
                      <dd>
                          {%- for contributor in pubdata['editorsListTyped']  -%}
                          {%- if contributor['type'] == "person"  -%}
                        <span itemprop="editor" itemtype="http://schema.org/Person">{{ contributor['text'] }}</span>
                          {%- else -%}
                         <span itemprop="editor" itemtype="http://schema.org/Organization">{{ contributor['text'] }}</span>
                          {%- endif -%}
                          {% if not loop.last %}, {% endif %}
                      {%-  endfor -%}
                          </dd>
                      {%- endif -%}
                    </dl>
                </section>
                <section>
                    {% if pubdata['doi'] %}<h6>DOI: <a itemprop="sameAs" href="http://dx.doi.org/{{ pubdata['doi'] }}">{{ pubdata['doi'] }}</a></h6>{% endif %}
                    <a href="https://twitter.com/share" class="twitter-share-button" data-text="USGS Pub" data-via="USGS_Pubs" data-dnt="true">Tweet</a>
                    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
                </section>
                
                <section id="suggested">
                    {% macro linkdisplay(link) -%}
                        <a href="{{ link['url'] }}" target="_blank" title="{% if link['description'] %}{{ link['description'] }}{% else %}{{ link['type']['text'] }}{% endif -%}">
                            <strong>
                            {%- if link['text'] -%}
                                {{- link['text'] -}}
                            {%- else -%}
                                {{- link['type']['text'] -}}
                            {%- endif -%}
                            </strong>
                            {%- if link["linkFileType"] and link["size"]   %}
                                 ({{ link["size"] }} {{ link["linkFileType"]["text"] }})
                            {% elif link["linkFileType"] %}
                                ({{ link["linkFileType"]["text"] }})
                            {%- elif link["size"]   %}
                                 ({{ link["size"] }})
                            {% endif -%}
                            </a>
                    {%- endmacro %}

                    {%- macro linkdisplaylists(link_type, link_type_text_single, link_type_text_multiple) -%}
                        {% if pubdata['displayLinks'][link_type]|length == 1  %}
                            <li>{{ link_type_text_single }}: {{ linkdisplay(pubdata['displayLinks'][link_type][0]) }}</li>
                        {%- elif pubdata['displayLinks'][link_type]|length > 1 -%}
                            <li>{{ link_type_text_multiple }}</li>
                            <ul class="filessublist">
                            {%- for link in pubdata['displayLinks'][link_type]|sort(attribute='rank') -%}
                                <li>{{ linkdisplay(link) }}</li>
                            {%- endfor -%}
                            </ul>
                        {% endif %}
                    {%- endmacro -%}
                    <h4>Links</h4>
                    <ul class="fileslist">
                        {{- linkdisplaylists('Index Page','More information','More Information') -}}
                        {{- linkdisplaylists('Document','Document','Documents') -}}
                        {{- linkdisplaylists('Plate', 'Plate','Plates')  -}}
                        {{- linkdisplaylists('Abstract','Abstract','Abstracts') -}}
                        {{- linkdisplaylists('Additional Report Piece','Additional Report Piece','Additional Report Pieces') -}}
                        {{- linkdisplaylists('Appendix', 'Appendix', 'Appendices') -}}
                        {{- linkdisplaylists('Application Site','Application Site','Application Sites') -}}
                        {{- linkdisplaylists('Authors Website','Authors Website','Authors Website') -}}
                        {{- linkdisplaylists('Chapter','Chapter','Chapters') -}}
                        {{- linkdisplaylists('Companion Files','Companion File','Companion Files') -}}
                        {{- linkdisplaylists('Cover','Cover','Covers') -}}
                        {{- linkdisplaylists('Database','Database','Databases') -}}
                        {{- linkdisplaylists('Errata','Errata','Errata') -}}
                        {{- linkdisplaylists('Illustration','Illustration','Illustration') -}}
                        {{- linkdisplaylists('Image','Image','Image') -}}
                        {{- linkdisplaylists('Metadata','Metadata','Metadata') -}}
                        {{- linkdisplaylists('Project Site','Project Site','Project Sites') -}}
                        {{- linkdisplaylists('Raw Data', 'Raw Data', 'Raw Data') -}}
                        {{- linkdisplaylists('Read Me','Read Me','Read Me') -}}
                        {{- linkdisplaylists('Referenced Work','Referenced Work','Referenced Work') -}}
                        {{- linkdisplaylists('Related Work','Related Work','Related Works') -}}
                        {{- linkdisplaylists('Spatial Data','Spatial Data','Spatial Data') -}}
                        {{- linkdisplaylists('Version History','Version History','Version History') -}}
                    </ul>
                </section>
                <section itemprop="description" id="abstract" >
                    <h4 id="abstract_head">Abstract</h4>
                    {{ pubdata['docAbstract']|safe }}
                </section>
                {%- if pubdata["geographicExtents"] -%}
                <section>
                    <h4>Geospatial Extents</h4>
                    <div id="mymap" style="width:90%;height:450px;"></div>

                </section>
                {%- endif -%}

                <section id="details">
                    <h4 id="" class="dark">Additional Publication Details</h4>
                    <dl id="publication_details">
                      {% for detail in pubdata['details'] %}
                          <dt class="{{ loop.cycle('', 'dark') }}">{{ detail.keys()[0] }}</dt>
                          <dd class="{{ loop.cycle('', 'dark') }}">{{ detail.values()[0] }}</dd>
                      {% endfor %}
                    </dl>
                </section>
            </article>
        </main>
        {% endblock %}

        {% block url %}<a href="{{ url_for('publication', indexId = pubdata['indexId']) }}">http://pubs.er.usgs.gov{{ url_for('publication', indexId = pubdata['indexId']) }}</a>{% endblock %}
        {% block modtime %}{{ pubdata['formattedModifiedDateTime'] }}{% endblock %}
        {% block page_footer_script %}
        {%- if pubdata["geographicExtents"] -%}
        <script type=text/javascript>




                        //add esri basemap layers
                        var topo = L.esri.basemapLayer('Topographic',{ zIndex: 3}),
                         oceans = L.esri.basemapLayer('Oceans',{ detectRetina: true, zIndex: 1}),
                                streets = L.esri.basemapLayer('Streets', {zIndex: 3});

                        var oceanlabels =  L.esri.basemapLayer('OceansLabels',{zIndex: 2})

                        // create a map

                        map = new L.Map('mymap', {layers:[topo]});

                        var baseMaps = {
                            "Oceans": oceans,
                            "Topographic": topo,
                            "Streets": streets

                        };

                        var overlayMaps = {
                            "Ocean Labels": oceanlabels
                        };

                        L.control.layers(baseMaps, overlayMaps).addTo(map);


                        // include GeoJSON inside this JavaScript
                        var pubextent = {{ pubdata["geographicExtents"]|tojson|safe }};
                        L.geoJson( pubextent ).addTo(map);


{'fraction_non_alphanumeric': 0.17933051106358835, 'fraction_numerical': 0.004058831231178807, 'mean_word_length': 1.5474152306837132, 'pattern_counts': {'":': 6, '<': 207, '<?xml version=': 0, '>': 209, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '5609783', 'n_tokens_mistral': 6469, 'n_tokens_neox': 5812, 'n_words': 997}