<commit_before>{% extends "base.html.twig" %}

{% block title %}
    {{ 'about.title'|trans }}
{% endblock %}

{% block body %}
    <div class="jumbotron">
        <h1>{{ 'about.version.title'|trans({'%version%': version}) }}</h1>
        <p>{{ 'about.version.subtitle'|trans }}</p>
        <p>
            <button id="btn-checkversion" class="btn btn-secondary btn-lg" role="button" onclick="return App.checkVersion();">
                <i class="fa fa-refresh"></i>
                {{ 'about.version.check_new'|trans }}
            </button>
            <a id="btn-downloader" href="#" class="btn btn-success btn-lg" role="button" style="display:none">
                <i class="fa fa-download"></i>
                {{ 'about.version.download'|trans }} <span class="version"></span>
            </a>
            <span id="update-alert" class="label label-success" style="display:none">
                <i class="fa fa-check"></i>
                {{ 'about.version.newest'|trans }}
            </span>
        </p>
    </div>
    <h2>{{ 'about.community.title'|trans }}</h2>
    <p>{{ 'about.community.subtitle'|trans }}</p>
    <div class="row">
        <div class="col-lg-4">
            <div class="card">
                <div class="card-header">
                    {{ 'about.community.blog.title'|trans }}
                </div>
                <div class="card-body">
                    <p>{{ 'about.community.blog.description'|trans }}</p>
                    <p>
                        <a href="https://medium.com/novosga" class="btn btn-primary" target="_blank">
                            <i class="fa fa-eye"></i>&nbsp;
                            {{ 'about.community.blog.button'|trans }}
                        </a>
                    </p>
                </div>
           </div>
        </div>
        <div class="col-lg-4">
            <div class="card">
                <div class="card-header">
                    {{ 'about.community.forum.title'|trans }}
                </div>
                <div class="card-body">
                    <p>{{ 'about.community.forum.description'|trans }}</p>
                    <p>
                        <a href="https://discuss.novosga.org" class="btn btn-primary" target="_blank">
                            <i class="fa fa-eye"></i>&nbsp;
                            {{ 'about.community.forum.button'|trans }}
                        </a>
                    </p>
                </div>
           </div>
        </div>
        <div class="col-lg-4">
            <div class="card">
                <div class="card-header">
                    {{ 'about.community.github.title'|trans }}
                </div>
                <div class="card-body">
                    <p>{{ 'about.community.github.description'|trans }}</p>
                    <p>
                        <a href="https://github.com/novosga" class="btn btn-primary" target="_blank">
                            <i class="fa fa-eye"></i>&nbsp;
                            {{ 'about.community.github.button'|trans }}
                        </a>
                    </p>
                </div>
           </div>
        </div>
    </div>
{% endblock %}

{% block stylesheets %}
    {{ parent() }}
    <style>
        body>section {
            padding: 20px 0;
        }
    </style>
{% endblock %}<commit_msg>moved version detection to about page<commit_after>{% extends "base.html.twig" %}

{% block title %}
    {{ 'about.title'|trans }}
{% endblock %}

{% block body %}
    <div class="jumbotron">
        <h1>{{ 'about.version.title'|trans({'%version%': version}) }}</h1>
        <p>{{ 'about.version.subtitle'|trans }}</p>
        <p>
            <button id="btn-checkversion" class="btn btn-secondary btn-lg" role="button">
                <i class="fa fa-refresh"></i>
                {{ 'about.version.check_new'|trans }}
            </button>
            <a id="btn-downloader" href="#" class="btn btn-success btn-lg" role="button" target="_blank" style="display:none">
                <i class="fa fa-download"></i>
                {{ 'about.version.download'|trans }} <span class="version"></span>
            </a>
            <span id="update-alert" class="label label-success" style="display:none">
                <i class="fa fa-check"></i>
                {{ 'about.version.newest'|trans }}
            </span>
        </p>
    </div>
    <h2>{{ 'about.community.title'|trans }}</h2>
    <p>{{ 'about.community.subtitle'|trans }}</p>
    <div class="row">
        <div class="col-lg-4">
            <div class="card">
                <div class="card-header">
                    {{ 'about.community.blog.title'|trans }}
                </div>
                <div class="card-body">
                    <p>{{ 'about.community.blog.description'|trans }}</p>
                    <p>
                        <a href="https://medium.com/novosga" class="btn btn-primary" target="_blank">
                            <i class="fa fa-eye"></i>&nbsp;
                            {{ 'about.community.blog.button'|trans }}
                        </a>
                    </p>
                </div>
           </div>
        </div>
        <div class="col-lg-4">
            <div class="card">
                <div class="card-header">
                    {{ 'about.community.forum.title'|trans }}
                </div>
                <div class="card-body">
                    <p>{{ 'about.community.forum.description'|trans }}</p>
                    <p>
                        <a href="https://discuss.novosga.org" class="btn btn-primary" target="_blank">
                            <i class="fa fa-eye"></i>&nbsp;
                            {{ 'about.community.forum.button'|trans }}
                        </a>
                    </p>
                </div>
           </div>
        </div>
        <div class="col-lg-4">
            <div class="card">
                <div class="card-header">
                    {{ 'about.community.github.title'|trans }}
                </div>
                <div class="card-body">
                    <p>{{ 'about.community.github.description'|trans }}</p>
                    <p>
                        <a href="https://github.com/novosga" class="btn btn-primary" target="_blank">
                            <i class="fa fa-eye"></i>&nbsp;
                            {{ 'about.community.github.button'|trans }}
                        </a>
                    </p>
                </div>
           </div>
        </div>
    </div>
{% endblock %}

{% block stylesheets %}
    {{ parent() }}
    <style>
        body>section {
            padding: 20px 0;
        }
    </style>
{% endblock %}

{% block javascripts %}
    {{ parent() }}
    <script>
        (function () {
            'use strict'
            
            $('#btn-checkversion').on('click', function () {
                var $elem = $(this);
                var icon = $elem.prop('disabled', true).find('span');
                icon.addClass('fa-spin');
                $.ajax({
                    url: 'https://api.github.com/repos/novosga/novosga/tags',
                    success: function(response) {
                        $('#btn-checkversion').hide();
                        var latest = response[0];
                        if (App.version !== latest.name.replace('v', '')) {
                            $('#btn-downloader')
                                .show()
                                .prop('href', 'https://github.com/novosga/novosga/releases/' + latest.name)
                                .find('.version')
                                .text(latest.name);
                        } else {
                            $('#update-alert').show();
                        }
                    },
                    complete: function () {
                        icon.removeClass('fa-spin');
                    }
                });
                return false;
            });
        })();
    </script>
{% endblock %}
{'fraction_non_alphanumeric': 0.1723406908592094, 'fraction_numerical': 0.002618780396558174, 'mean_word_length': 1.2087579179289452, 'pattern_counts': {'":': 0, '<': 161, '<?xml version=': 0, '>': 163, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2994775', 'n_tokens_mistral': 2326, 'n_tokens_neox': 2144, 'n_words': 375}