<header>
    <h2>
        <div class="pull-right">
            <a href="?action=config">
                {% if inMaintenanceMode %}
                <span class="label label-important">{{ PMF_LANG['msgMaintenanceMode'] }}</span>
                {% else %}
                <span class="label label-success">{{ PMF_LANG['msgOnlineMode'] }}</span>
                {% endif %}
            </a>
        </div>
        <i class="icon-dashboard"></i> {{ PMF_LANG['ad_pmf_info'] }}
    </h2>
</header>

<section class="row-fluid">
    <div class="dashboard-stat span2">
        <span><a href="?action=viewsessions">{{ PMF_LANG['ad_start_visits'] }}</a></span>
        {{ dashboardVisits }}
    </div>
    <div class="dashboard-stat span2">
        <span><a href="?action=view">{{ PMF_LANG['ad_start_articles'] }}</a></span>
        {{ dashboardArticles }}
    </div>
    <div class="dashboard-stat span2">
        <span><a href="?action=comments">{{ PMF_LANG['ad_start_comments'] }}</a></span>
        {{ dashboardComments }}
    </div>
    <div class="dashboard-stat span2">
        <span><a href="?action=question">{{ PMF_LANG['msgOpenQuestions'] }}</a></span>
        {{ dashboardOpenQuestions }}
    </div>
    <div class="dashboard-stat span2">
        <span><a href="?action=news">{{ PMF_LANG['msgNews'] }}</a></span>
        {{ dashboardNews }}
    </div>
    <div class="dashboard-stat span2">
        <span><a href="?action=user&user_action=listallusers">{{ PMF_LANG['admin_mainmenu_users'] }}</a></span>
        {{ dashboardUsers }}
    </div>
</section>

{% if enableUserTracking %}

<section class="row-fluid">
    <div class="span12">
        <header>
            <h3>{{ PMF_LANG['ad_stat_report_visits'] }}</h3>
        </header>
        <script type="text/javascript" src="../assets/js/plugins/jquery.sparkline.min.js"></script>
        <script type="text/javascript">
            $(function() {
                var visits = [{{ visitsData }}];
                $('.visits').sparkline(
                        visits, {
                            type: 'bar',
                            barColor: '#fbc372',
                            barWidth: window.innerWidth / 42,
                            height: 200,
                            tooltipSuffix: ' {{ PMF_LANG['ad_visits_per_day'] }}'
                        });
            });
        </script>
        <span class="visits">Loading...</span>
    </div>
</section>

{% endif %}

<section class="row-fluid">
    <div class="span6">
        <header>
            <h3>{{ PMF_LANG['ad_online_info'] }}</h3>
        </header>
        {% if updateCheckActive %}
        <p class="alert alert-{% if updateAvailable %}danger{% else %}info{% endif %}">
            {{ PMF_LANG['ad_xmlrpc_latest'] }}
            <a href="http://www.phpmyfaq.de" target="_blank">phpmyfaq.de</a>:<br/>
            <strong>phpMyFAQ {{ lastestVersion }}</strong>
            {% if updateAvailable %}{{ PMF_LANG['ad_you_should_update'] }}{% endif %}
        </p>
        {% else %}
        <p>
        <form action="index.php" method="post">
            <input type="hidden" name="param" value="version" />
            <button class="btn btn-primary" type="submit">
                <i class="icon-check icon-white"></i> {{ PMF_LANG['ad_xmlrpc_button'] }}
            </button>
        </form>
        </p>
        {% endif %}
    </div>
    <div class="span6">
        <header>
            <h3>{{ PMF_LANG['ad_online_verification'] }}</h3>
        </header>
        {% if onlineVerificationActive %}
        {% if onlineVerificationError %}
        <p class="alert alert-danger">phpMyFAQ version mismatch - no verification possible.</p>
        {% elseif not onlineVerificationSuccessful %}
        <p class="alert alert-danger">{{ PMF_LANG['ad_verification_notokay'] }}</p>
        <ul>
            {% for hash, file in onlineVerificationDiff %}
            <li><span class="pmf-popover" data-original-title="SHA-1" data-content="{{ hash }}">{{ file }}</span></li>
            {% endfor %}
        </ul>
        {% else %}
        <p class="alert alert-success">{{ PMF_LANG['ad_verification_okay'] }}</p>
        {% endif %}
        {% else %}
        <p>
        <form action="index.php" method="post">
            <input type="hidden" name="getJson" value="verify" />
            <button class="btn btn-primary" type="submit">
                <i class="icon-certificate icon-white"></i> {{ PMF_LANG['ad_verification_button'] }}
            </button>
        </form>
        </p>
        {% endif %}
        <script>$(function(){ $('span[class="pmf-popover"]').popover();});</script>
    </div>

    <div style="font-size: 5px; text-align: right; color: #f5f5f5">NOTE: Art is resistance.</div>
</section>