{% extends "admin/layout.html" %} {% block title %}Blog Posts – Admin{% endblock %} {% block body %}

{% trans %}Blog Posts{% endtrans %}

{% trans %}Manage all blog posts — admin-created and user submissions.{% endtrans %}

{% trans %}Create Blog{% endtrans %}
{% with messages = get_flashed_messages(with_categories=true) %}{% for cat, msg in messages %}{% endfor %}{% endwith %} {% set pending_blogs = blogs | selectattr('status', 'eq', 'pending_review') | list %} {% if pending_blogs %}
{{ pending_blogs|length }} {% trans %}Post(s) Pending Review{% endtrans %}
{% for blog in pending_blogs %}

{{ blog.title or 'Untitled' }}

{% trans %}User Submission{% endtrans %}
{% if blog.summary %}

{{ blog.summary }}

{% endif %}
{% trans %}Submitted{% endtrans %} {{ blog.created_at[:10] if blog.created_at else '' }}
{% trans %}Approve{% endtrans %}
$
{% trans %}fee{% endtrans %}
{% trans %}Reject{% endtrans %}
{% endfor %}
{% endif %} {% set pay_pending_blogs = blogs | selectattr('status', 'in', ['pending_payment']) | list %} {% set manual_pending_blogs = blogs | selectattr('payment_status', 'eq', 'pending_manual') | list %} {% if pay_pending_blogs or manual_pending_blogs %}
{{ (pay_pending_blogs|length + manual_pending_blogs|length) }} {% trans %}Post(s) Awaiting Payment{% endtrans %}
{% for blog in pay_pending_blogs %}
{{ blog.title }}
{% trans %}Fee:{% endtrans %} ${{ '%.2f'|format(blog.publish_fee) }} {% if blog.payment_status == 'pending_manual' %} · {% trans %}Manual payment requested by user{% endtrans %} {% else %} · {% trans %}Awaiting online payment{% endtrans %} {% endif %}
{% trans %}Edit{% endtrans %}
{% endfor %}
{% endif %}
{% for label, val in [(_('All'), 'all'), (_('Published'), 'published'), (_('Rejected'), 'rejected'), (_('Draft'), 'draft')] %} {{ label }} {% endfor %}
{% set filter_val = request.args.get('filter', 'all') %} {% set visible_blogs = blogs | rejectattr('status', 'eq', 'pending_review') | list %} {% if filter_val != 'all' %} {% set visible_blogs = visible_blogs | selectattr('status', 'eq', filter_val) | list %} {% endif %}
{% for blog in visible_blogs %}
{% if blog.image %}
{% else %}
{% endif %}

{{ blog.title or 'Untitled' }}

{{ blog.status|title|replace('_', ' ') }} {% if blog.author_user_id %} {% trans %}User Post{% endtrans %} {% endif %}
{% if blog.summary %}
{{ blog.summary }}
{% endif %} {% if blog.status == 'published' %} /blogs/{{ blog.slug }} {% endif %}
{% endfor %} {% if not visible_blogs %}

{% trans %}No blog posts found.{% endtrans %}

{% endif %}
{% endblock %}