<commit_before>{% extends 'NumaDOADMSBundle::layout.html.twig' %}
{% import "NumaDOASiteBundle::components.html.twig" as component %}
{% block content %}
    <div class="box">
        <div class="box-header">
            <h3 class="box-title">Theme chooser</h3>

        </div>
    </div>

    {% if app.session.get('dms_dealer_id') is null %}
        <div class="alert alert-danger" role="alert">
            <strong>Attention:</strong> You must be logged in like dealer to change theme.
        </div>
    {% else %}
        <div class="alert">
            <span id="alert-message"></span>
        </div>
        <script>
            $(document).ready(function () {
                var name = "";
                $(".theme").click(function () {
                    console.log(this);
                    $(".theme").removeClass("themeactive");
                    $(this).addClass("themeactive");
                    $(".theme > .glyphicon").addClass("hidden");
                    $(".themeactive > .glyphicon").removeClass("hidden");

                    name = $(this).data("name");
                    console.log(name);

                });

                $("#change").click(function () {
                    $.ajax(
                        {
                            url: "{{ path('dms_change_themes') }}",
                            type: "POST",
                            data: {"theme": name},
                            success: function (data, textStatus, jqXHR) {
                                //alert(theme);
                                //console.log (theme);
                                //location.reload();
                                $(".alert").addClass('alert-success');
                                $(".alert").removeClass('alert-error');
                                $("#alert-message").html("Theme successfully changed for {{ dealer.name }}. Current theme is " + name);
                            },
                            error: function (jqXHR, textStatus, errorThrown) {
                                //alert("Error");
                                $(".alert").addClass('alert-error');
                                $(".alert").removeClass('alert-success');
                                $("#alert-message").html("Theme successfully changed");
                            }
                        });
                })
            });

        </script>
    {% endif %}
    <div>
        <div class="col-md-3 theme {% if theme == "Default" %}themeactive{% endif %}" id="theme1" data-name="Default">

            {{ component.image('images/themes/theme1.jpg', 'theme1', '', 'themes_image','400px') }}
            <h4>Default Theme</h4>
            <span class="{% if theme != "Default" %}hidden{% endif %} glyphicon glyphicon-ok"></span>
        </div>
        <div class="col-md-3 theme {% if theme == "Sea" %}themeactive{% endif %}" id="theme2" data-name="Sea">
            {{ component.image('images/themes/theme2.jpg', 'theme1', '', 'themes_image','400px') }}
            <h4>Sea Theme</h4>
            <span class="{% if theme != "Sea" %}hidden{% endif %} glyphicon glyphicon-ok"></span>
        </div>
        <div class="col-md-3 theme {% if theme == "Mountain" %}themeactive{% endif %}" id="theme3" data-name="Mountain">
            {{ component.image('images/themes/theme3.jpg', 'theme1', '', 'themes_image','400px') }}
            <h4>Mountain Theme</h4><commit_msg>DMS Themes if deleted<commit_after>{% extends 'NumaDOADMSBundle::layout.html.twig' %}
{% import "NumaDOASiteBundle::components.html.twig" as component %}
{% block content %}
    <div class="box">
        <div class="box-header">
            <h3 class="box-title">Theme chooser</h3>

        </div>
    </div>
        <div class="alert">
            <span id="alert-message"></span>
        </div>
        <script>
            $(document).ready(function () {
                var name = "";
                $(".theme").click(function () {
                    console.log(this);
                    $(".theme").removeClass("themeactive");
                    $(this).addClass("themeactive");
                    $(".theme > .glyphicon").addClass("hidden");
                    $(".themeactive > .glyphicon").removeClass("hidden");

                    name = $(this).data("name");
                    console.log(name);

                });

                $("#change").click(function () {
                    $.ajax(
                        {
                            url: "{{ path('dms_change_themes') }}",
                            type: "POST",
                            data: {"theme": name},
                            success: function (data, textStatus, jqXHR) {
                                //alert(theme);
                                //console.log (theme);
                                //location.reload();
                                $(".alert").addClass('alert-success');
                                $(".alert").removeClass('alert-error');
                                $("#alert-message").html("Theme successfully changed for {{ dealer.name }}. Current theme is " + name);
                            },
                            error: function (jqXHR, textStatus, errorThrown) {
                                //alert("Error");
                                $(".alert").addClass('alert-error');
                                $(".alert").removeClass('alert-success');
                                $("#alert-message").html("Theme successfully changed");
                            }
                        });
                })
            });

        </script>
    <div>
        <div class="col-md-3 theme {% if theme == "Default" %}themeactive{% endif %}" id="theme1" data-name="Default">

            {{ component.image('images/themes/theme1.jpg', 'theme1', '', 'themes_image','400px') }}
            <h4>Default Theme</h4>
            <span class="{% if theme != "Default" %}hidden{% endif %} glyphicon glyphicon-ok"></span>
        </div>
        <div class="col-md-3 theme {% if theme == "Sea" %}themeactive{% endif %}" id="theme2" data-name="Sea">
            {{ component.image('images/themes/theme2.jpg', 'theme1', '', 'themes_image','400px') }}
            <h4>Sea Theme</h4>
            <span class="{% if theme != "Sea" %}hidden{% endif %} glyphicon glyphicon-ok"></span>
        </div>
        <div class="col-md-3 theme {% if theme == "Mountain" %}themeactive{% endif %}" id="theme3" data-name="Mountain">
            {{ component.image('images/themes/theme3.jpg', 'theme1', '', 'themes_image','400px') }}
            <h4>Mountain Theme</h4>
{'fraction_non_alphanumeric': 0.17177637511271415, 'fraction_numerical': 0.008716561466786895, 'mean_word_length': 1.4138556401886109, 'pattern_counts': {'":': 2, '<': 63, '<?xml version=': 0, '>': 67, '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': '4440068', 'n_tokens_mistral': 1818, 'n_tokens_neox': 1658, 'n_words': 314}