<commit_before>{% extends 'dataloaderinterface/base.html' %}
{% load staticfiles %}

{% block content %}
    <div class="container">
        <div class="row">
            <section class="sites-list col-xs-5">
                <div class="page-title">Registered Sites</div>
            </section>
            <div class="col-xs-7">
                <a href="{% url 'site_registration' %}" id="btn-new-site"
                   class="button-link pull-right mdl-button mdl-js-button mdl-button--raised mdl-button--accent mdl-js-ripple-effect">
                    <i class="material-icons center-icon">add_circle_outline</i> Register A New Site
                </a>
                <br>
            </div>
        </div>
    </div>

    <div class="container">
        <div class="row">
            <div class="full-width-map-container my-sites">
                <div id="map"></div>
            </div>
        </div>
    </div>

    <div class="container main-content">
        <div class="row">
            <div class="col-xs-12">
                <h4>My sites</h4>
            </div>
            {% for site in sites %}
                <div class="col-xs-12 col-sm-4 col-md-3 site" data-site="{{ site.sampling_feature_id }}">
                    <div class="mdl-card mdl-shadow--2dp site-card">
                        <div class="mdl-card__title">
                            <h2 class="mdl-card__title-text"><a href="{% url 'site_detail' site.sampling_feature_code %}">{{ site.sampling_feature_name }}</a></h2>
                        </div>

                        <div class="mdl-card__supporting-text">
                            <table>
                                <tbody>
                                <tr>
                                    <td><i class="material-icons site-card-icon">settings_remote</i></td>
                                    <td>
                                        <span> Sampling Feature</span>
                                    </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td><strong>{{ site.sampling_feature_name }}</strong></td>
                                </tr>
                                </tbody>
                            </table>
                            <br>
                            <table>
                                <tbody>
                                <tr>
                                    <td><i class="material-icons site-card-icon">today</i></td>
                                    <td>
                                        <span> Registration Date</span>
                                    </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td><strong>{{ site.registration_date }}</strong></td>
                                </tr>
                                </tbody>
                            </table>
                            <br>
                            {% with latest_result=site.sampling_feature.latest_updated_result %}
                                {% if latest_result %}
                                <table>
                                    <tbody>
                                    <tr>
                                        <td><i class="material-icons site-card-icon">query_builder</i></td>
                                        <td>
                                            <span> Latest Measurement</span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td><strong>{{ latest_result.result_datetime }}</strong></td>
                                    </tr>
                                    </tbody>
                                </table>
                                {% endif %}
                            {% endwith %}
                        </div>

                            <div class="mdl-card__menu">
                                <!-- Right aligned menu below button -->
                                <button id="site-card-menu-{{ forloop.counter0 }}"
                                        class="mdl-button mdl-js-button mdl-button--icon view-on-map">
                                    <i class="material-icons">map</i>
                                </button>
                                <div class="mdl-tooltip" data-mdl-for="site-card-menu-{{ forloop.counter0 }}">
                                    View on map
                                </div>
                            </div>
                        </div>
                    </div>
            {% endfor %}
        </div>

        <script id="sites-data" type="application/json">
            [
            {% for site in sites %}
                 {
                    "id": "{{ site.sampling_feature_id }}",
                    "code": "{{ site.sampling_feature_code }}",
                    "name": "{{ site.sampling_feature_name }}",
                    "latitude": {{ site.latitude|default_if_none:0 }},
                    "longitude": {{ site.longitude|default_if_none:0 }},
                    "elevation": {{ site.elevation_m|default_if_none:'""' }},
                    "latest-measurement": "{% if site.latest_measurement.value_datetime %}{{ site.latest_measurement.value_datetime }} ({{ site.latest_measurement.value_datetime|timesince }} ago){% else %}-{% endif %}",<commit_msg>Minor style changes<commit_after>{% extends 'dataloaderinterface/base.html' %}
{% load staticfiles %}

{% block content %}
    <div class="container">
        <div class="row">
            <section class="sites-list col-xs-5">
                <div class="page-title">Registered Sites</div>
            </section>
            <div class="col-xs-7">
                <a href="{% url 'site_registration' %}" id="btn-new-site"
                   class="button-link pull-right mdl-button mdl-js-button mdl-button--raised mdl-button--accent mdl-js-ripple-effect">
                    <i class="material-icons center-icon">add_circle_outline</i> Register A New Site
                </a>
                <br>
            </div>
        </div>
    </div>

    <div class="container">
        <div class="row">
            <div class="full-width-map-container my-sites">
                <div id="map"></div>
            </div>
        </div>
    </div>

    <div class="container main-content">
        <div class="row">
            <div class="col-xs-12">
                <h4>My sites</h4>
            </div>
            {% if sites %}
                {% for site in sites %}
                    <div class="col-xs-12 col-sm-4 col-md-3 site" data-site="{{ site.sampling_feature_id }}">
                        <div class="mdl-card mdl-shadow--2dp site-card">
                            <div class="mdl-card__title">
                                <h2 class="mdl-card__title-text"><a href="{% url 'site_detail' site.sampling_feature_code %}">{{ site.sampling_feature_name }}</a></h2>
                            </div>

                            <div class="mdl-card__supporting-text">
                                <table>
                                    <tbody>
                                    <tr>
                                        <td><i class="material-icons site-card-icon">settings_remote</i></td>
                                        <td>
                                            <span style="color:#92d050;"> Sampling Feature</span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td>{{ site.sampling_feature_name }}</td>
                                    </tr>
                                    </tbody>
                                </table>
                                <br>
                                <table>
                                    <tbody>
                                    <tr>
                                        <td><i class="material-icons site-card-icon">today</i></td>
                                        <td>
                                            <span style="color:#92d050;"> Registration Date</span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td>{{ site.registration_date }}</td>
                                    </tr>
                                    </tbody>
                                </table>
                                <br>
                                {% with latest_result=site.sampling_feature.latest_updated_result %}
                                    {% if latest_result %}
                                    <table>
                                        <tbody>
                                        <tr>
                                            <td><i class="material-icons site-card-icon">query_builder</i></td>
                                            <td>
                                                <span style="color:#92d050;"> Latest Measurement</span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td></td>
                                            <td>{{ latest_result.result_datetime }} ({{ latest_result.result_datetime|timesince }} ago)</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                    {% endif %}
                                {% endwith %}
                            </div>

                                <div class="mdl-card__menu">
                                    <!-- Right aligned menu below button -->
                                    <button id="site-card-menu-{{ forloop.counter0 }}"
                                            class="mdl-button mdl-js-button mdl-button--icon view-on-map">
                                        <i class="material-icons">map</i>
                                    </button>
                                    <div class="mdl-tooltip" data-mdl-for="site-card-menu-{{ forloop.counter0 }}">
                                        View on map
                                    </div>
                                </div>
                            </div>
                        </div>
                {% endfor %}
            {% else %}
                <div class="col-xs-12">
                    <p>No sites to display</p>
                </div>
            {% endif %}
        </div>

        <script id="sites-data" type="application/json">
            [
            {% for site in sites %}
                 {
                    "id": "{{ site.sampling_feature_id }}",
                    "code": "{{ site.sampling_feature_code }}",
                    "name": "{{ site.sampling_feature_name }}",
                    "latitude": {{ site.latitude|default_if_none:0 }},
                    "longitude": {{ site.longitude|default_if_none:0 }},
                    "elevation": {{ site.elevation_m|default_if_none:'""' }},
                    "latest-measurement": "{% if site.latest_measurement.value_datetime %}{{ site.latest_measurement.value_datetime }} ({{ site.latest_measurement.value_datetime|timesince }} ago){% else %}-{% endif %}",
{'fraction_non_alphanumeric': 0.12004069175991862, 'fraction_numerical': 0.0043234994913530014, 'mean_word_length': 0.7801418439716312, 'pattern_counts': {'":': 14, '<': 241, '<?xml version=': 0, '>': 241, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 95, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5044728', 'n_tokens_mistral': 2813, 'n_tokens_neox': 2558, 'n_words': 457}