{% extends "base.html" %} {% from "icons.html" import icon, sep, file_icon %} {% from "ui.html" import action, secret_confirm, file_input with context %} {% from "deposit-form.html" import deposit_form with context %} {% from "tidy-run-now.html" import run_now_button with context %} {% set tab = 'inbox' %} {% block title %}{{ _("Inbox") }} · {{ space.name }} · Synaptane{% endblock %} {% block crumbs %}{{ sep() }}{{ org.name }}{{ sep() }}{{ space.name }}{{ sep() }}{% if item %}{{ _("Inbox") }}{{ sep() }}{{ item.title|tr }}{% else %}{{ _("Inbox") }}{% endif %}{% endblock %} {% block content %} {% set space_tab = "inbox" %}{% include "space-tabs.html" %} {% if item %}

{{ item.title|tr }}

{{ _("Change", context="noun") if item.type == 'change' else _("Note") }} {{ item.deposited_by|names }} · {% if item.via %} · {{ item.via }}{% elif item.source %} · {{ item.source }}{% endif %}

{% if item.origin %}

{{ _("Origin") }} : {% if item.origin.startswith(('https://', 'http://')) %}{{ item.origin }}{% else %}{{ item.origin }}{% endif %}

{% endif %} {% if item.hint %}

{{ _("Suggested location: {hint}", hint=item.hint) }}

{% endif %} {% if item.status == 'left' %}
{{ _("Left by the tidy-up run: {reason}", reason=item.reason) }}
{% endif %} {% if form_error %}{% endif %} {% if contribute and not (editing and item.type == 'note') %}
{% if item.type == 'note' %} {{ _("Edit") }} {% if targets %} {% endif %} {{ action("/o/" ~ org.slug ~ "/" ~ space.slug ~ "/-/inbox/" ~ item.name ~ "/delete", _("Delete"), confirm=_("Delete the note “{title}” and its attachments? They will remain in the Git history.", title=item.title), kind="danger") }} {% else %} {{ action("/o/" ~ org.slug ~ "/" ~ space.slug ~ "/-/inbox/" ~ item.name ~ "/dismiss", _("Mark as seen")) }} {{ _("The tidy-up will not review it, unless the page changes again.") }} {% endif %}
{% endif %} {% if editing and contribute and item.type == 'note' %}
{{ secret_confirm(form_error) }}
{{ _("Cancel") }}
{% else %}
{{ body }}
{% endif %} {% if item.attachments %}

{{ _("Attachments") }}

{% endif %}
{% else %} {# Header: the title and, on the right, "Tidy now" (same rules as the log). #}

{{ _("Inbox") }}

{% if run_now %}{{ run_now_button("/o/" ~ org.slug ~ "/" ~ space.slug ~ "/-/tidy", run_now.caution, run_now.paid, run_now.average_cost, small=true) }}{% endif %}

{{ _("What is dropped here is filed into the wiki by the tidy-up agent. Changes made directly (web, assistants, Git) are flagged here too, to be integrated.") }}{% set upcoming = tidy_next_label(space) %}{% if upcoming and tidy_ready %} {{ upcoming }}.{% endif %}

{# Information, not an error: the inbox works, its notes wait for an AI to be set up. #} {% if not tidy_ready %}

{{ _("Notes wait here until an AI provider is configured for the organization: the tidy-up needs one to file them.") }} {% if actor.access.is_org_admin(space.org_id) %}{{ _("Configure AI") }}{% else %}{{ _("Ask an organization administrator.") }}{% endif %}

{% endif %} {% if total %}

{{ _(pl(counts.note, "{n} note", "{n} notes"), n=counts.note) }}, {{ _(pl(counts.change, "{n} changed page", "{n} changed pages"), n=counts.change) }}{% if counts.left %}, {{ _("{n} of them left by the tidy-up", n=counts.left) }}{% endif %}.

{% endif %} {% if total > 5 or query or kind %} {% endif %} {% if items is none %}

{{ _("No content yet: the space's Git repository is not linked or not synchronized yet.") }} {{ _("See the repository status") }}

{% elif items %}
    {% for entry in items %} {% set fresh = new and entry.name == new %} {{ icon('file') }}{{ entry.title|tr }}{% if fresh %}{{ _("Just arrived") }}{% endif %}{{ _("Change", context="noun") if entry.type == 'change' else _("Note") }} · {% if entry.status == 'left' %} · {{ _("left: {reason}", reason=entry.reason) if entry.reason else _("left") }}{% endif %} {% endfor %}
{% if matched > page_size %} {% set params = ('&q=' ~ query|urlencode if query else '') ~ ('&kind=' ~ kind if kind else '') %} {% endif %} {% elif query or kind %}

{{ _("No item matches this filter.") }}

{% else %}

{{ _("The inbox is empty. Drop some information here, or ask your assistant: “Note in Synaptane that…”.") }}

{% endif %}
{% if contribute and items is not none %} {{ deposit_form("/o/" ~ org.slug ~ "/" ~ space.slug ~ "/-/inbox", form, form_error) }} {% endif %}
{% endif %} {% endblock %}