<commit_before><!--check this for options https://docs.djangoproject.com/en/1.4/obsolete/admin-css/




-->

{% extends "admin/base_site.html" %}
{% load admin_extras %}
{% load staticfiles %}
{% load static %}



{% load i18n admin_static admin_shortcuts_tags %}

{# django-admin-shortcuts changes these blocks #}

{% block breadcrumbs %}
    {% if authenticated %}
        <div class="admin_shortcuts">
            {% admin_shortcuts %}
        </div>
    {% endif %}
{% endblock %}

{% block extrastyle %}
    <style type="text/css">{% admin_shortcuts_css %}</style>
	{{ block.super }}
    <link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}"/>

	{% endblock %}


{% block extrahead %}<script src="https://use.fontawesome.com/57b6c04fb7.js"></script>
    {{ block.super }}<title>
    {% block title %}{% endblock %}
</title>
    <script src="https://use.fontawesome.com/eb9894ac79.js"></script>
    <link rel="stylesheet" href="https://npmcdn.com/leaflet@1.0.0-rc.2/dist/leaflet.css"/>
    <script src="https://npmcdn.com/leaflet@1.0.0-rc.2/dist/leaflet.js"></script>

    <link rel="stylesheet" href="http://leaflet.github.io/Leaflet.markercluster/dist/MarkerCluster.Default.css" />
	<link rel="stylesheet" href="http://leaflet.github.io/Leaflet.markercluster/dist/MarkerCluster.css" />
	<script src="http://leaflet.github.io/Leaflet.markercluster/dist/leaflet.markercluster-src.js"></script>
    <link rel="stylesheet" href="http://code.ionicframework.com/ionicons/1.5.2/css/ionicons.min.css">

    <link rel="stylesheet"
          href="https://dl.dropboxusercontent.com/u/64841654/leaflet-awesome-marker/css/leaflet.awesome-markers.css">
    <script src="https://dl.dropboxusercontent.com/u/64841654/leaflet-awesome-marker/js/leaflet.awesome-markers.js"></script>
	
	<style type="text/css">
        .leaflet-google-layer {
            z-index: 0;
        }

        .leaflet-map-pane {
            z-index: 100;
        }

        .legend {
            line-height: 18px;
            color: #555;
            background-color: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: -1px 3px 10px -1px rgba(0, 0, 0, 0.4);
            opacity: 0.9;
        }

        .legend-icon {
            background-image: url(https://dl.dropboxusercontent.com/u/64841654/leaflet-awesome-marker/img/markers-soft.png);
            background-repeat: no-repeat;
            width: 35px;
            height: 46px;
            text-align: center;
            float: left;
        }

        .legend-icon > i {
            color: #fff;
            margin-top: 10px;
            display: inline-block;
            font-size: 14px;
        }

        .legend-item {
            clear: both;
        }

        .legend-text {
            float: left;
            padding-top: 10px;
        }

        html, body {
            width: 100%;
            height: 100%;
        }
    </style>
    {% admin_shortcuts_js %}{% endblock %}

{# end changes #}

{% block coltype %}colM{% endblock %}

{% block bodyclass %}{{ block.super }} dashboard{% endblock %}




{% block content %}

    <div id='content-main'> {% csrf_token %}</div>
    <div style="width:100%; height:900px;" id="map"></div>
    <script type='text/javascript'>
        var feature_list = [];
        {% for feats in legends %}
            feature_list.push(
                    {
                        "name": "{{ feats.feature_type }}",
                        "styleclass": "{{ feats.style_class }}",
                        "icon": "{{ feats.icon }}",
                        "color": "{{ feats.color }}"
                    }
            );
        {% endfor %}

        // Create Map and set view to LatLong: 18.28263, -65.77458 with zoom level 14
        var myMap = L.map('map').setView([ 18.28263, -65.77458], 14);
		//var results = {{ results | safe }};
        var osm = L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=<KEY>', {
            maxZoom: 22,
            attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
            '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
            'Imagery &copy; <a href="http://mapbox.com">Mapbox</a>', id: 'mapbox.streets'
        }).addTo(myMap);

        var markerClusters = L.markerClusterGroup(singleMarkerMode=true);
        {% for site in features|filter_coords %}
            var feat_obj = feature_list.filter(
                    function( obj ){
                        return obj.name == '{{ site.sampling_feature_type.name }}'
                    });
            var popup = '';
            {% if  site.sampling_feature_type.name == "Site" or site.sampling_feature_type.name == "Observation well" %}
                popup = '<br><h2>Sampling Feature: {{ site.samplingfeaturename }}</h2>'
                        + '<hr />'
                        + '<p>Sampling Feature Code: {{ site.samplingfeaturecode }}'
                        + '<br>Sampling Feature Type: {{ site.sampling_feature_type.name }}'
                        + '<br>Coordinates: [{{ site.featuregeometry|get_lat_lng:'lat' }},{{ site.featuregeometry|get_lat_lng:'lon' }}]'
                        + '<br> {{ site.sampling_feature_type.name}}'
                        + '<br> <a  target="_blank" href="{{prefixpath}}../graphfa/samplingfeature&#61;{{site.samplingfeatureid}}/startdate=2016-03-01/enddate=2016-03-10">view times series data in new page</a></p><iframe  width=600, height=600, src="{{prefixpath}}../graphfa/samplingfeature&#61;{{site.samplingfeatureid}}/startdate=2016-03-01/enddate=2016-03-10/popup=true" name="iframe_A"></iframe></p>';
            {% elif  site.sampling_feature_type.name == "Excavation" %}
                popup = '<br><h2>Sampling Feature: {{ site.samplingfeaturename }}</h2>'
                        + '<hr />'
                        + '<p>Sampling Feature Code: {{ site.samplingfeaturecode }}'
                        + '<br>Sampling Feature Type: {{ site.sampling_feature_type.name }}'
                        + '<br>Coordinates: [{{ site.featuregeometry|get_lat_lng:'lat' }},{{ site.featuregeometry|get_lat_lng:'lon' }}]'
                        + '<br> {{ site.sampling_feature_type.name}}'
                        + '<br><a  target="_blank" href="{{prefixpath}}../profilegraph/samplingfeature&#61;{{site.samplingfeatureid}}/popup=true">view times series data in new page</a></p><iframe  width=600, height=600, src="{{prefixpath}}../profilegraph/samplingfeature&#61;{{site.samplingfeatureid}}/popup=true" name="iframe_A"></iframe></p>';
            {% else %}
                popup = '<br><h2>Sampling Feature: {{ site.samplingfeaturename }}</h2>'
                        + '<hr />'
                        + '<p>Sampling Feature Code: {{ site.samplingfeaturecode }}'
                        + '<br>Sampling Feature Type: {{ site.sampling_feature_type.name }}'
                        + '<br>Coordinates: [{{ site.featuregeometry|get_lat_lng:'lat' }},{{ site.featuregeometry|get_lat_lng:'lon' }}]</p>';

            {% endif %}

            var myIcon = L.AwesomeMarkers.icon({
                    icon: feat_obj[0].icon,
                    prefix: 'fa',
                    markerColor: feat_obj[0].color
                });

            var m = L.marker([{{ site.featuregeometry|get_lat_lng:'lat' }}, {{ site.featuregeometry|get_lat_lng:'lon' }}], {
                    icon: myIcon, title: '{{ site.samplingfeaturename }}'
                }).bindPopup( popup,{minWidth: 600, maxHeight: 500, autoPan: true, closeButton: true,offset: [0, 100]} );
            markerClusters.addLayer(m);
        {% endfor %}

        var legend = L.control({position: 'bottomright'});
        legend.onAdd = function (myMap) {

        var div = L.DomUtil.create('div', 'info legend');
        div.innerHTML += '<h2>Sample Feature Types</h2>';
        // loop through our density intervals and generate a label with a colored square for each interval
        for (var i = 0; i < feature_list.length; i++) {
            div.innerHTML +=
                    '<div class="legend-item">' +
                    '      <div class="legend-icon ' + feature_list[i].styleclass + '">' +
                    '           <i class="fa ' + feature_list[i].icon + '" aria-hidden="true"></i>' +
                    '      </div>' +
                    '      <div class="legend-text">' + feature_list[i].name + '</div>' +
                    '</div>'
        }

            return div;
        };

        legend.addTo(myMap);


        // Basemaps Choices
        basemaps = {
            'OSM': osm<commit_msg>Added text below icons<commit_after><!--check this for options https://docs.djangoproject.com/en/1.4/obsolete/admin-css/




-->

{% extends "admin/base_site.html" %}
{% load admin_extras %}
{% load staticfiles %}
{% load static %}



{% load i18n admin_static admin_shortcuts_tags %}

{# django-admin-shortcuts changes these blocks #}

{% block breadcrumbs %}
    {% if authenticated %}
        <div class="admin_shortcuts">
            {% admin_shortcuts %}
        </div>
    {% endif %}
{% endblock %}

{% block extrastyle %}
    <style type="text/css">{% admin_shortcuts_css %}</style>
	{{ block.super }}
    <link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}"/>

	{% endblock %}


{% block extrahead %}<script src="https://use.fontawesome.com/57b6c04fb7.js"></script>
    {{ block.super }}<title>
    {% block title %}{% endblock %}
</title>
    <script src="https://use.fontawesome.com/eb9894ac79.js"></script>
    <link rel="stylesheet" href="https://npmcdn.com/leaflet@1.0.0-rc.2/dist/leaflet.css"/>
    <script src="https://npmcdn.com/leaflet@1.0.0-rc.2/dist/leaflet.js"></script>

    <link rel="stylesheet" href="http://leaflet.github.io/Leaflet.markercluster/dist/MarkerCluster.Default.css" />
	<link rel="stylesheet" href="http://leaflet.github.io/Leaflet.markercluster/dist/MarkerCluster.css" />
	<script src="http://leaflet.github.io/Leaflet.markercluster/dist/leaflet.markercluster-src.js"></script>
    <link rel="stylesheet" href="http://code.ionicframework.com/ionicons/1.5.2/css/ionicons.min.css">

    <link rel="stylesheet"
          href="https://dl.dropboxusercontent.com/u/64841654/leaflet-awesome-marker/css/leaflet.awesome-markers.css">
    <script src="https://dl.dropboxusercontent.com/u/64841654/leaflet-awesome-marker/js/leaflet.awesome-markers.js"></script>
	
	<style type="text/css">
        .leaflet-google-layer {
            z-index: 0;
        }

        .leaflet-map-pane {
            z-index: 100;
        }

        .legend {
            line-height: 18px;
            color: #555;
            background-color: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: -1px 3px 10px -1px rgba(0, 0, 0, 0.4);
            opacity: 0.9;
        }

        .legend-icon {
            background-image: url(https://dl.dropboxusercontent.com/u/64841654/leaflet-awesome-marker/img/markers-soft.png);
            background-repeat: no-repeat;
            width: 35px;
            height: 46px;
            text-align: center;
            float: left;
        }

        .legend-icon > i {
            color: #fff;
            margin-top: 10px;
            display: inline-block;
            font-size: 14px;
        }

        .legend-item {
            clear: both;
        }

        .legend-text {
            float: left;
            padding-top: 10px;
        }

        .awesome-marker {
            background-image: url("https://dl.dropboxusercontent.com/u/64841654/leaflet-awesome-marker/img/markers-soft.png") !important;
            background-repeat: no-repeat !important;
            height: 46px !important;
            width: 35px !important;
        }

        html, body {
            width: 100%;
            height: 100%;
        }
    </style>
    {% admin_shortcuts_js %}{% endblock %}

{# end changes #}

{% block coltype %}colM{% endblock %}

{% block bodyclass %}{{ block.super }} dashboard{% endblock %}




{% block content %}

    <div id='content-main'> {% csrf_token %}</div>
    <div style="width:100%; height:900px;" id="map"></div>
    <script type='text/javascript'>
        var feature_list = [];
        {% for feats in legends %}
            feature_list.push(
                    {
                        "name": "{{ feats.feature_type }}",
                        "styleclass": "{{ feats.style_class }}",
                        "icon": "{{ feats.icon }}",
                        "color": "{{ feats.color }}"
                    }
            );
        {% endfor %}

        // Create Map and set view to LatLong: 18.28263, -65.77458 with zoom level 14
        var myMap = L.map('map').setView([ 18.28263, -65.77458], 14);
		//var results = {{ results | safe }};
        var osm = L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=<KEY>', {
            maxZoom: 22,
            attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
            '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
            'Imagery &copy; <a href="http://mapbox.com">Mapbox</a>', id: 'mapbox.streets'
        }).addTo(myMap);

        var markerClusters = L.markerClusterGroup(singleMarkerMode=true);
        {% for site in features|filter_coords %}
            var feat_obj = feature_list.filter(
                    function( obj ){
                        return obj.name == '{{ site.sampling_feature_type.name }}'
                    });
            var popup = '';
            {% if  site.sampling_feature_type.name == "Site" or site.sampling_feature_type.name == "Observation well" %}
                popup = '<br><h2>Sampling Feature: {{ site.samplingfeaturename }}</h2>'
                        + '<hr />'
                        + '<p>Sampling Feature Code: {{ site.samplingfeaturecode }}'
                        + '<br>Sampling Feature Type: {{ site.sampling_feature_type.name }}'
                        + '<br>Coordinates: [{{ site.featuregeometry|get_lat_lng:'lat' }},{{ site.featuregeometry|get_lat_lng:'lon' }}]'
                        + '<br> {{ site.sampling_feature_type.name}}'
                        + '<br> <a  target="_blank" href="{{prefixpath}}../graphfa/samplingfeature&#61;{{site.samplingfeatureid}}/startdate=2016-03-01/enddate=2016-03-10">view times series data in new page</a></p><iframe  width=600, height=600, src="{{prefixpath}}../graphfa/samplingfeature&#61;{{site.samplingfeatureid}}/startdate=2016-03-01/enddate=2016-03-10/popup=true" name="iframe_A"></iframe></p>';
            {% elif  site.sampling_feature_type.name == "Excavation" %}
                popup = '<br><h2>Sampling Feature: {{ site.samplingfeaturename }}</h2>'
                        + '<hr />'
                        + '<p>Sampling Feature Code: {{ site.samplingfeaturecode }}'
                        + '<br>Sampling Feature Type: {{ site.sampling_feature_type.name }}'
                        + '<br>Coordinates: [{{ site.featuregeometry|get_lat_lng:'lat' }},{{ site.featuregeometry|get_lat_lng:'lon' }}]'
                        + '<br> {{ site.sampling_feature_type.name}}'
                        + '<br><a  target="_blank" href="{{prefixpath}}../profilegraph/samplingfeature&#61;{{site.samplingfeatureid}}/popup=true">view times series data in new page</a></p><iframe  width=600, height=600, src="{{prefixpath}}../profilegraph/samplingfeature&#61;{{site.samplingfeatureid}}/popup=true" name="iframe_A"></iframe></p>';
            {% else %}
                popup = '<br><h2>Sampling Feature: {{ site.samplingfeaturename }}</h2>'
                        + '<hr />'
                        + '<p>Sampling Feature Code: {{ site.samplingfeaturecode }}'
                        + '<br>Sampling Feature Type: {{ site.sampling_feature_type.name }}'
                        + '<br>Coordinates: [{{ site.featuregeometry|get_lat_lng:'lat' }},{{ site.featuregeometry|get_lat_lng:'lon' }}]</p>';

            {% endif %}

            //new L.DivIcon({className: 'awesome-marker-icon-orange awesome-marker leaflet-zoom-animated leaflet-interactive', html: '<i class=" fa fa-eye  icon-white" aria-hidden="true"></i><p style="margin-top:20px;">{{ site.samplingfeaturecode }}</p>'
            var iconDiv = new L.DivIcon({
                className: feat_obj[0].styleclass + ' awesome-marker leaflet-zoom-animated leaflet-interactive',
                html: '<i class="fa '+  feat_obj[0].icon +' icon-white" aria-hidden="true"></i><p style="margin-top:20px;font-weight:bold;">{{ site.samplingfeaturecode }}</p>'
            });

            // For use of AwesomeMarkers only
            /*var myIcon = L.AwesomeMarkers.icon({
                    icon: feat_obj[0].icon,
                    prefix: 'fa',
                    markerColor: feat_obj[0].color
                });*/

            var m = L.marker([{{ site.featuregeometry|get_lat_lng:'lat' }}, {{ site.featuregeometry|get_lat_lng:'lon' }}], {
                icon: iconDiv,
                title: '{{ site.samplingfeaturecode }}'
                }).bindPopup( popup,{minWidth: 600, maxHeight: 500, autoPan: true, closeButton: true,offset: [0, 100]} );
            markerClusters.addLayer(m);
        {% endfor %}

        var legend = L.control({position: 'bottomright'});
        legend.onAdd = function (myMap) {

        var div = L.DomUtil.create('div', 'info legend');
        div.innerHTML += '<h2>Sample Feature Types</h2>';
        // loop through our density intervals and generate a label with a colored square for each interval
        for (var i = 0; i < feature_list.length; i++) {
            div.innerHTML +=
                    '<div class="legend-item">' +
                    '      <div class="legend-icon ' + feature_list[i].styleclass + '">' +
                    '           <i class="fa ' + feature_list[i].icon + '" aria-hidden="true"></i>' +
                    '      </div>' +
                    '      <div class="legend-text">' + feature_list[i].name + '</div>' +
                    '</div>'
        }

            return div;
        };

        legend.addTo(myMap);


        // Basemaps Choices
        basemaps = {
            'OSM': osm
{'fraction_non_alphanumeric': 0.16693935427574172, 'fraction_numerical': 0.023669284467713787, 'mean_word_length': 2.050066533599468, 'pattern_counts': {'":': 8, '<': 183, '<?xml version=': 0, '>': 183, 'https://': 19, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4253693', 'n_tokens_mistral': 6139, 'n_tokens_neox': 5474, 'n_words': 928}