{% extends 'admin/base.html' %}
{% block title %}{{ plugin.name }}{% endblock %}
{% block content %}
<div class="page-header page-header--with-action">
    <div class="page-header__content">
        <h2>🔒 {{ plugin.name }}</h2>
    </div>
    <span class="btn header-spacer" aria-hidden="true">&nbsp;</span>
</div>
<div class="page-help">{{ t('plugins.locked_page_msg') }}</div>

<div class="settings-section">
    <p style="margin-top:0;"><span class="badge-pending">{{ t('plugins.status_needs_license') }}</span></p>
    {% if is_owner %}
    <form method="POST" action="{{ url_for('plugins_admin.admin_plugins_license', plugin_id=plugin_id) }}" style="display:flex; gap:8px; flex-wrap:wrap; align-items:center;">
        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
        <input type="text" name="license_key" class="form-control input-medium" placeholder="{{ t('plugins.license_key') }}" autocomplete="off">
        <button type="submit" class="btn btn-primary btn-sm">{{ t('plugins.activate_license') }}</button>
    </form>
    {% if has_stored_key %}
    <form method="POST" action="{{ url_for('plugins_admin.admin_plugins_license_recheck', plugin_id=plugin_id) }}" style="margin-top:10px;">
        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
        <button type="submit" class="btn btn-secondary btn-sm">🔄 {{ t('plugins.recheck_license') }}</button>
    </form>
    {% endif %}
    <div style="margin-top:16px;">
        <a href="{{ url_for('plugins_admin.admin_plugins') }}" class="btn btn-secondary btn-sm">🧩 {{ t('plugins.installed') }}</a>
    </div>
    {% endif %}
</div>
{% endblock %}
