{% extends "layouts/base.html" %} {% load i18n %} {% block title %}{{ platform_name }} - {% trans "Comment Detail" %} - PX360{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{% trans "Back to Comments" %}

{{ platform_name }}

{% trans "Comment Detail & AI Analysis" %}

{% trans "Original Comment" %}

{{ comment.author_name|first|upper|default:"?" }}

{{ comment.author_name }}

{% if comment.rating %} {{ comment.rating }}/5 {% endif %}

{{ comment.created_at|date:"M d, Y H:i" }}

{{ comment.text|linebreaksbr }}

{% if comment.like_count > 0 %}
{{ comment.like_count }} {% trans "likes" %}
{% endif %} {% if comment.reply_count > 0 %}
{{ comment.reply_count }} {% trans "replies" %}
{% endif %} {% if comment.synced_via_webhook %}
{% trans "Real-time" %}
{% endif %}
{% if comment.is_analyzed %}

{% trans "AI Analysis" %}

{% with sentiment=comment.ai_analysis.sentiment %} {% if sentiment %}

{% trans "Sentiment" %}

{% with classification=sentiment.classification.en %} {% if classification == 'positive' %} {% trans "Positive" %} {% elif classification == 'negative' %} {% trans "Negative" %} {% elif classification == 'neutral' %} {% trans "Neutral" %} {% endif %} {% endwith %} {% if sentiment.score is not None %} {% trans "Score:" %} {{ sentiment.score|floatformat:2 }} {% endif %} {% if sentiment.confidence is not None %} {% trans "Confidence:" %} {{ sentiment.confidence|floatformat:2 }} {% endif %} {% if sentiment.urgency_level and sentiment.urgency_level.en %} {% trans "Urgency:" %} {{ sentiment.urgency_level.en|title }} {% endif %}
{% endif %} {% endwith %} {% with summaries=comment.ai_analysis.summaries %} {% if summaries.en or summaries.ar %}

{% trans "Summary" %}

{% if summaries.en %}

{{ summaries.en }}

{% endif %} {% if summaries.ar %}

{{ summaries.ar }}

{% endif %}
{% endif %} {% endwith %} {% with keywords=comment.ai_analysis.keywords %} {% if keywords.en or keywords.ar %}

{% trans "Keywords" %}

{% for kw in keywords.en %} {{ kw }} {% endfor %}
{% endif %} {% endwith %} {% with topics=comment.ai_analysis.topics %} {% if topics.en or topics.ar %}

{% trans "Topics" %}

{% for topic in topics.en %} {{ topic }} {% endfor %}
{% endif %} {% endwith %} {% with emotions=comment.ai_analysis.emotions %} {% if emotions %}

{% trans "Emotions" %}

{% for emotion, score in emotions.items %} {{ emotion }} {{ score|floatformat:2 }} {% endfor %}
{% endif %} {% endwith %} {% with insights=comment.ai_analysis.actionable_insights %} {% if insights.primary_concern or insights.affected_department %}

{% trans "Actionable Insights" %}

{% if insights.primary_concern and insights.primary_concern.en %}

{% trans "Primary Concern" %}

{{ insights.primary_concern.en }}

{% endif %} {% if insights.affected_department and insights.affected_department.en %}

{% trans "Affected Department" %}

{{ insights.affected_department.en }}

{% endif %} {% if insights.requires_followup %}

{% trans "Requires Follow-up" %}

{% if insights.followup_priority and insights.followup_priority.en %} {{ insights.followup_priority.en|title }} {% else %} {% trans "Yes" %} {% endif %}

{% endif %} {% if insights.recommended_actions and insights.recommended_actions.en %}

{% trans "Recommended Actions" %}

    {% for action in insights.recommended_actions.en %}
  • {{ action }}
  • {% endfor %}
{% endif %}
{% endif %} {% endwith %}
{% else %}

{% trans "AI Analysis Pending" %}

{% trans "This comment has not been analyzed yet" %}

{% endif %} {% if replies %}

{% trans "Replies" %} ({{ replies|length }})

{% for reply in replies %}
{{ reply.author_name|first|upper|default:"?" }}
{{ reply.author_name }} {{ reply.created_at|date:"M d, Y H:i" }}

{{ reply.text }}

{% endfor %}
{% endif %}

{% trans "Post Reply" %}

{% csrf_token %}
{% if messages %}
{% for message in messages %}
{{ message }}
{% endfor %}
{% endif %}

{% trans "Details" %}

{% trans "Platform" %} {{ platform_name }}
{% trans "Comment ID" %} {{ comment.comment_id|truncatechars:20 }}
{% if comment.source_platform %}
{% trans "Source" %} {{ comment.source_platform }}
{% endif %}
{% trans "Posted" %} {{ comment.created_at|date:"M d, Y" }}
{% trans "Collected" %} {{ comment.added_at|date:"M d, Y" }}
{% if comment.media_url %} {% endif %}
{% endblock %} {% block extra_js %} {% endblock %}