<commit_before>{% from "security/_macros.html" import render_field_with_errors, render_field %}

{% macro meeting(form, world) %}

<link rel="stylesheet" href="/static/content/bootstrap-datetimepicker.min.css" />

<ul class="nav nav-tabs">
    <li class="active"><a href="#world-tab" data-toggle="tab">Velg verden</a></li>
    <li><a href="#meeting-tab" data-toggle="tab">Møtedetaljer</a></li>
</ul>

<div class="tab-content" style="padding-top: 15px">
    <div class="tab-pane fade in active" id="world-tab" style="opacity: 0;">
        <div class="row" id="gen-choise">
            <div class="col-md-4">
                <a href="{{ url_for('from_map') }}" class="btn btn-default thumbnail" id="kartverket-btn">
                    <span class="glyphicon glyphicon-globe" aria-hidden="true" style="font-size: 8em"></span>

                    <div class="caption">
                        <h2>Norgeskart</h2>
                        <p>
                            Lag en ny verden basert på et utsnitt av et kart over Norge.
                        </p>
                    </div>
                </a>
            </div>

            <div class="col-md-4">
                <a class="btn btn-default thumbnail" id="upload-btn">
                    <span class="glyphicon glyphicon-cloud-upload" aria-hidden="true" style="font-size: 8em"></span>

                    <div class="caption">
                        <h2>Last opp</h2>
                        <p>
                            Last opp en verden fra din datamaskin.
                        </p>
                    </div>
                </a>
            </div>

            <div class="col-md-4">
                <a class="btn btn-default thumbnail" id="template-btn">
                    <span class="glyphicon glyphicon-list" aria-hidden="true" style="font-size: 8em"></span>

                    <div class="caption">
                        <h2>Dine verdener</h2>
                        <p>
                            Lag et nytt møte basert på en lagret Minecraft verden.
                        </p>
                    </div>
                </a>
            </div>
        </div>

        <div class="row body-content">
            <p><span class="btn btn-default glyphicon glyphicon-arrow-left" id="back-btn" style="display: none"></span></p>

            <div id="template" style="display: none">

                <!-- Placeholder -->
                <div style="background-color: red; width: 100%; height: 400px;"></div>

            </div>

            <div id="upload" style="display: none">

                <!-- Placeholder -->
                <div style="background-color: yellow; width: 100%; height: 400px;"></div>

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

    <div class="tab-pane fade" id="meeting-tab">

        <form role="form" method="POST" action=" {{ action }}">
            {{ form.hidden_tag() }}
            <div class="row">
                <div class="col-md-6">
                    {{ render_field_with_errors(form.title, class="form-control") }}
                    {{ render_field_with_errors(form.participant_count, class="form-control") }}
                </div>

                <div class="col-md-6">
                    {{ render_field_with_errors(form.start_time, class="form-control", id="start_time") }}
                    {{ render_field_with_errors(form.end_time, class="form-control", id="end_time") }}
                </div>
            </div>

            {% if world %}
                <a href="{{ url_for('get_world', file_name=world.file_ref) }}">Last ned verden</a><br><br>
            {% endif %}

            <input type="submit" class="btn btn-default" value="Lagre">
        </form>
    </div>
</div>

{% endmacro %}

{% macro meeting_scripts(set_tab) %}

<script type="text/javascript" src="/static/scripts/moment.js"></script>
<script type="text/javascript" src="/static/scripts/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="/static/scripts/nb.js"></script>

<script type=text/javascript>
var obj_load={% if set_tab==1 %} 1 {% else %} 0 {% endif %};
tab_load=(obj_load ? "#meeting-tab" : "#");

$(document).ready(function () {
    $('#start_time').datetimepicker({
        locale: 'nb'
    });
    $('#end_time').datetimepicker({
        locale: 'nb'
    });
});

$(document).ready(function() {
    if (location.hash || obj_load) {
        $('a[href=' + (location.hash || tab_load) + ']').tab('show');
    } else {
        document.getElementById("world-tab").style.opacity = "1";
    }
});

$(document).ready(function(){
    $(".nav-tabs a").click(function(){
        $(this).tab('show');
        document.getElementById("world-tab").style.opacity = "1";
    });
});

$(document).ready(function(){
    $("#template-btn").click(function(){<commit_msg>set a few settings in dateTimePicker<commit_after>{% from "security/_macros.html" import render_field_with_errors, render_field %}

{% macro meeting(form, world) %}

<link rel="stylesheet" href="/static/content/bootstrap-datetimepicker.min.css" />

<ul class="nav nav-tabs">
    <li class="active"><a href="#world-tab" data-toggle="tab">Velg verden</a></li>
    <li><a href="#meeting-tab" data-toggle="tab">Møtedetaljer</a></li>
</ul>

<div class="tab-content" style="padding-top: 15px">
    <div class="tab-pane fade in active" id="world-tab" style="opacity: 0;">
        <div class="row" id="gen-choise">
            <div class="col-md-4">
                <a href="{{ url_for('from_map') }}" class="btn btn-default thumbnail" id="kartverket-btn">
                    <span class="glyphicon glyphicon-globe" aria-hidden="true" style="font-size: 8em"></span>

                    <div class="caption">
                        <h2>Norgeskart</h2>
                        <p>
                            Lag en ny verden basert på et utsnitt av et kart over Norge.
                        </p>
                    </div>
                </a>
            </div>

            <div class="col-md-4">
                <a class="btn btn-default thumbnail" id="upload-btn">
                    <span class="glyphicon glyphicon-cloud-upload" aria-hidden="true" style="font-size: 8em"></span>

                    <div class="caption">
                        <h2>Last opp</h2>
                        <p>
                            Last opp en verden fra din datamaskin.
                        </p>
                    </div>
                </a>
            </div>

            <div class="col-md-4">
                <a class="btn btn-default thumbnail" id="template-btn">
                    <span class="glyphicon glyphicon-list" aria-hidden="true" style="font-size: 8em"></span>

                    <div class="caption">
                        <h2>Dine verdener</h2>
                        <p>
                            Lag et nytt møte basert på en lagret Minecraft verden.
                        </p>
                    </div>
                </a>
            </div>
        </div>

        <div class="row body-content">
            <p><span class="btn btn-default glyphicon glyphicon-arrow-left" id="back-btn" style="display: none"></span></p>

            <div id="template" style="display: none">

                <!-- Placeholder -->
                <div style="background-color: red; width: 100%; height: 400px;"></div>

            </div>

            <div id="upload" style="display: none">

                <!-- Placeholder -->
                <div style="background-color: yellow; width: 100%; height: 400px;"></div>

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

    <div class="tab-pane fade" id="meeting-tab">

        <form role="form" method="POST" action=" {{ action }}">
            {{ form.hidden_tag() }}
            <div class="row">
                <div class="col-md-6">
                    {{ render_field_with_errors(form.title, class="form-control") }}
                    {{ render_field_with_errors(form.participant_count, class="form-control") }}
                </div>

                <div class="col-md-6">
                    {{ render_field_with_errors(form.start_time, class="form-control", id="start_time") }}
                    {{ render_field_with_errors(form.end_time, class="form-control", id="end_time") }}
                </div>
            </div>

            {% if world %}
                <a href="{{ url_for('get_world', file_name=world.file_ref) }}">Last ned verden</a><br><br>
            {% endif %}

            <input type="submit" class="btn btn-default" value="Lagre">
        </form>
    </div>
</div>

{% endmacro %}

{% macro meeting_scripts(set_tab) %}

<script type="text/javascript" src="/static/scripts/moment.js"></script>
<script type="text/javascript" src="/static/scripts/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="/static/scripts/nb.js"></script>

<script type=text/javascript>
var obj_load={% if set_tab==1 %} 1 {% else %} 0 {% endif %};
tab_load=(obj_load ? "#meeting-tab" : "#");

$(document).ready(function () {
    $('#start_time').datetimepicker({
        locale: 'nb',
        showClose: true,
        toolbarPlacement: 'top',
        minDate: moment()
    });
    $('#end_time').datetimepicker({
        locale: 'nb',
        showClose: true,
        toolbarPlacement: 'top',
        minDate: moment(),
        useCurrent: true,
    });
    $("#start_time").on("dp.change", function (e) {
        $('#end_time').data("DateTimePicker").minDate(e.date);
    });
});

$(document).ready(function() {
    if (location.hash || obj_load) {
        $('a[href=' + (location.hash || tab_load) + ']').tab('show');
    } else {
        document.getElementById("world-tab").style.opacity = "1";
    }
});

$(document).ready(function(){
    $(".nav-tabs a").click(function(){
        $(this).tab('show');
        document.getElementById("world-tab").style.opacity = "1";
    });
});

$(document).ready(function(){
    $("#template-btn").click(function(){
{'fraction_non_alphanumeric': 0.17511289513296538, 'fraction_numerical': 0.006823883592574009, 'mean_word_length': 1.8761904761904762, 'pattern_counts': {'":': 0, '<': 185, '<?xml version=': 0, '>': 185, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2255385', 'n_tokens_mistral': 3079, 'n_tokens_neox': 2876, 'n_words': 568}