{% extends 'base.html' %} {% block title %}{{ code }} — Workspace · BackTestingMarket{% endblock %} {% block extra_head %} {% endblock %} {% block content %}
← BTM Hub
{{ code }} Workspace
{{ posts | map(attribute='user_id') | list | unique | list | length }} {{ _('participante(s)') }}

# {{ _('Publicaciones y Mensajes') }} {{ posts | length }} {{ _('mensajes') }}

{% set pinned = posts | selectattr('is_pinned') | list %} {% if pinned %}
📌 {{ _('Mensajes fijados') }}
{% for p in pinned %}
{{ p.user.username[0] }}
@{{ p.user.username }} {{ p.created_at.strftime('%H:%M · %d %b') }} 📌 {{ _('fijado') }}
{{ p.content }}
{% for f in p.files %}
📎 {{ f.original_name }}
{% endfor %}
{% set IMG_EXTS = ['png','jpg','jpeg','gif','webp','svg'] %} {% for f in p.files %} {% set fext = f.original_name.rsplit('.',1)[-1].lower() %} {% if fext in IMG_EXTS %}
{{ f.original_name }}
{% else %} 📎 {{ f.original_name }} ({{ (f.file_size/1024)|round(1) }} KB) {% endif %} {% endfor %}
{% if p.user_id == current_user.id or is_admin %}
{% if p.user_id == current_user.id %}{% endif %}
{% endif %}
{% endfor %}
{{ _('Todos los mensajes') }}
{% endif %} {% if not posts %}
💬

{{ _('Sé el primero en escribir en este canal') }}

{% else %} {% set current_date = namespace(val=None) %} {% for p in posts %} {% set msg_date = p.created_at.strftime('%d %b %Y') %} {% if msg_date != current_date.val %}
{{ msg_date }}
{% set current_date.val = msg_date %} {% endif %} {# ── Wrapper post + thread ── #} {% if p.parent_id is none %}
{{ p.user.username[0] }}
@{{ p.user.username }} {{ p.created_at.strftime('%H:%M') }} {% if p.updated_at and (p.updated_at - p.created_at).total_seconds() > 2 %}({{ _('editado') }}){% endif %}
{{ p.content }}
{% for f in p.files %}
📎 {{ f.original_name }}
{% endfor %}
{% set IMG_EXTS = ['png','jpg','jpeg','gif','webp','svg'] %} {% for f in p.files %} {% set fext = f.original_name.rsplit('.',1)[-1].lower() %} {% if fext in IMG_EXTS %}
{{ f.original_name }}
{% else %} 📎 {{ f.original_name }} ({{ (f.file_size/1024)|round(1) }} KB) {% endif %} {% endfor %}
{% if p.user_id == current_user.id or is_admin %}
{% if p.user_id == current_user.id %}{% endif %}
{% endif %}
{# ── Thread: replies + composer ── #} {% set post_replies = p.replies.order_by('created_at').all() %}
{# Replies existentes #} {% set post_replies = p.replies.order_by('created_at').all() %} {# Botón + composer #}
{% endif %} {% endfor %} {% endif %}
{{ _('Subiendo archivo…') }} {{ _('Esto puede tardar unos segundos') }}
{{ _('archivo') }}

{{ _('¿Estás seguro?') }}

{% endblock %} {% block scripts %} {{ super() }} {% endblock %}