{% extends "base/base_naked.html" %}

{% load staticfiles %}

{% block body %}

    <script src="{% static 'world/3rd/three.min.js' %}?{{ git_rev }}"></script>
    <script src="{% static 'world/3rd/OrbitControls.js' %}?{{ git_rev }}"></script>
    <script src="{% static 'world/base_renderer.js' %}?{{ git_rev }}"></script>
    <script src="{% static 'world/battle_renderer.js' %}?{{ git_rev }}"></script>

    <script>
        function info_callback(contubernium, unit, character, organization) {
            $('#unit_name').text(contubernium === undefined ? '' : unit.name);
            $('#char_name').text(character === undefined ? '' : character.name);
            $('#org_name').text(organization === undefined ? '' : organization.name);
        }

        var map;
        $(function () {
            map = new BattleRenderer({{ battle_data|safe }});
            map.renderer.add_orbit_controls();
            map.hover_callback = info_callback;
        })
    </script>

    <div class="battlefield_turn_controls">
        <a href="#" onclick="map.prev_turn()" class="btn btn-default">PREV</a>
        <a href="#" onclick="map.fwd_turn()" class="btn btn-default">NEXT</a>
    </div>

    <div class="battlefield_unit_info text-right">
        <div id="org_name"></div>
        <div id="char_name"></div>
        <div id="unit_name"></div>
    </div>

{% endblock %}

{% extends "base/base_naked.html" %}

{% load staticfiles %}

{% block body %}

    <script src="{% static 'world/3rd/three.min.js' %}?{{ git_rev }}"></script>
    <script src="{% static 'world/3rd/OrbitControls.js' %}?{{ git_rev }}"></script>
    <script src="{% static 'world/base_renderer.js' %}?{{ git_rev }}"></script>
    <script src="{% static 'world/battle_renderer.js' %}?{{ git_rev }}"></script>

    <script>
        function info_callback(contubernium, unit, character, organization) {
            $('#unit_name').text(contubernium === undefined ? '' : unit.name);
            $('#char_name').text(character === undefined ? '' : character.name);
            $('#org_name').text(organization === undefined ? '' : organization.name);
        }

        var map;
        $(function () {
            map = new BattleRenderer({{ battle_data|safe }});
            map.renderer.add_orbit_controls();
            map.hover_callback = info_callback;
        })
    </script>

    <div class="battlefield_turn_controls">
        <button onclick="map.prev_turn()" class="btn btn-default">PREV</button>
        <button onclick="map.fwd_turn()" class="btn btn-default">NEXT</button>
    </div>

    <div class="battlefield_unit_info text-right">
        <div id="org_name"></div>
        <div id="char_name"></div>
        <div id="unit_name"></div>
    </div>

{% endblock %}

Use buttons instead of anchors in battle turn buttons
Use buttons instead of anchors in battle turn buttons
