{# F.X.fix #9 — capability-badge partial, HTMX-swappable. Rendered both (a) inline by manage.html on first page load and (b) as the response body of GET /api/sites/{id}/capabilities/badge when the Re-check button is clicked. Swapping this element with hx-swap= "outerHTML" avoids the full-page reload the legacy button triggered. F.X.fix-pass2 — wording corrected for WordPress: application passwords inherit ALL capabilities from the user account, so the "credential tier" framing is misleading. WP-specific branches reference the WP user's role instead. AI-provider availability is surfaced here too so removing a provider key gives visible feedback on Re-check. Required context: capability_probe — probe payload (with .fit, .granted, .reason, .ai_providers_configured, optionally .install_hint) site — site dict (for .plugin_type, .tool_scope) lang — "fa" | "en" companion_download_url — string, may be empty #} {% set fit_status = capability_probe.fit.status %} {% set is_wp = site.plugin_type == 'wordpress' %} {% set is_wc = site.plugin_type == 'woocommerce' %} {% set is_wp_like = is_wp or is_wc %} {% set ai_providers = capability_probe.ai_providers_configured or [] %} {% set ai_provider_missing = is_wp_like and (ai_providers | length == 0) %}
{{ capability_probe.granted | join(', ') }}
{{ capability_probe.fit.missing | join(', ') }}
{{ capability_probe.granted | join(', ') }}
permissions با مقادیر
read یا read_write است. گزینهها:
(۱) سطح پایینتر انتخاب کنید؛
(۲) در WP Admin → WooCommerce → Settings → Advanced → REST API یک کلید جدید با Permission مناسب (Read / Write یا Read/Write) بسازید و در Connection Settings ذخیره کنید؛
(۳) ادامه — ابزارهای نیازمند این دسترسی هنگام فراخوانی ۴۰۳ میدهند.
{% else %}
WooCommerce REST API keys carry a permissions field
(read / read_write). Options:
(1) pick a lower access level;
(2) regenerate the REST key with Read/Write permission in WP Admin → WooCommerce → Settings → Advanced → REST API and re-paste it in Connection Settings;
(3) continue — tools needing missing caps will return 403 at call time.
{% endif %}
{% elif is_wp %}
{% if lang == 'fa' %}
application password در وردپرس همیشه تمام دسترسیهای کاربر صاحب آن را میگیرد و قابل محدودکردن نیست. گزینهها:
(۱) سطح دسترسی پایینتری انتخاب کنید؛
(۲) application password را از کاربری با نقش بالاتر (مثلاً Administrator یا Editor) بسازید؛
(۳) ادامه — ابزارهای نیازمند این دسترسی هنگام فراخوانی ۴۰۳ میدهند.
{% else %}
WordPress application passwords inherit ALL capabilities of the user account and cannot be scoped down.
Options: (1) pick a lower access level;
(2) create the application password from a higher-role user (e.g. Administrator or Editor);
(3) continue — tools needing missing caps will return 403 at call time.
{% endif %}
{% else %}
{% if lang == 'fa' %}
گزینهها: (۱) انتخاب سطح پایینتر؛ (۲) استفاده از credential با دسترسی بالاتر؛ (۳) ادامه — ابزارهای نیازمند این دسترسی هنگام فراخوانی ۴۰۳ میدهند.
{% else %}
Options: (1) pick a lower tier; (2) use a higher-privileged credential; (3) continue — tools needing missing caps will return 403 at call time.
{% endif %}
{% endif %}
wordpress_generate_and_upload_image غیرفعال است. کلید را در بخش «تولید تصویر با هوش مصنوعی» بالا ذخیره کنید.
{% else %}
— wordpress_generate_and_upload_image is disabled. Add a key in the "AI Image Generation" section above.
{% endif %}
{{ ai_providers | join(', ') }}