123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- {% extends theme("message/message_layout.html") %}
- {% block message_content %}
- {# quick check if the conversation is a draft #}
- {% if conversation.draft %}
- {% set messages = [conversation.first_message] %}
- {% else %}
- {% set messages = conversation.messages %}
- {% endif %}
- <div class="panel conversation-panel">
- <div class="panel-heading conversation-head">
- Subject: <strong>{{ conversation.subject }}</strong>
- </div>
- <div class="panel-body conversation-body">
- <div class="conversation-box">
- {% for message in messages %}
- <!-- First Comment -->
- <div class="row conversation-row" id="mid{{message.id}}">
- {% if current_user.id == message.user_id %}
- <div class="col-md-2 col-sm-3 col-xs-12">
- <div class="conversation-author author">
- <!-- Registered User -->
- <div class="author-name"><h4><a href="{{ message.user.url }}">{{ message.user.username }}</a></h4></div>
- <!-- check if user is online or not -->
- {% if message.user|is_online %}
- <div class="author-online" data-toggle="tooltip" data-placement="top" title="online"></div>
- {% else %}
- <div class="author-offline" data-toggle="tooltip" data-placement="top" title="offline"></div>
- {% endif %}
- <div class="author-title"><h5>{{ message.user.primary_group.name }}</h5></div>
- {% if message.user.avatar %}
- <div class="author-avatar"><img src="{{ message.user.avatar }}" alt="avatar"></div>
- {% endif %}
- <div class="author-registered">{% trans %}Joined{% endtrans %}: {{ message.user.date_joined|format_date('%b %d %Y') }}</div>
- <div class="author-posts">{% trans %}Posts{% endtrans %}: {{ message.user.post_count }}</div>
- {% if message.user.website %}
- <div class="author-website"><a href="{{ message.user.website }}" rel="nofollow">{% trans %}Website{% endtrans %}</a></div>
- {% endif %}
- </div>
- </div>
- {% endif %}
- <div class="col-md-10 col-sm-9 col-xs-12">
- <div class="conversation-message arrow {% if current_user.id == message.user_id %}left{% else %}right{% endif %}">
- <div class="message-box">
- <div class="text-left message-header">
- <time class="conversation-date" datetime="{{ message.date_created }}"><i class="fa fa-clock-o"></i> {{ message.date_created|format_date("%d %B %Y - %H:%M") }}</time>
- </div>
- <div class="message-content">
- {{ message.message|markup }}
- </div>
- <div class="message-footer">
- {% if conversation.draft %}
- <p class="text-right"><a href="{{ url_for('message.edit_conversation', conversation_id=conversation.id) }}" class="btn btn-default btn-sm"><i class="fa fa-pencil"></i> edit</a></p>
- {% else %}
- <p class="{% if current_user.id == message.user_id %}left{% else %}right{% endif %}"><a href="#" class="btn btn-default btn-sm reply-btn" data-message-id="{{ message.id }}"><i class="fa fa-reply"></i> reply</a></p>
- {% endif %}
- </div>
- </div>
- </div>
- </div>
- {% if current_user.id != message.user_id %}
- <div class="col-md-2 col-sm-3 col-xs-12">
- <div class="conversation-author author">
- {% if message.user_id and message.user %}
- <!-- Registered User -->
- <div class="author-name"><h4><a href="{{ message.user.url }}">{{ message.user.username }}</a></h4></div>
- <!-- check if user is online or not -->
- {% if message.user|is_online %}
- <div class="author-online" data-toggle="tooltip" data-placement="top" title="online"></div>
- {% else %}
- <div class="author-offline" data-toggle="tooltip" data-placement="top" title="offline"></div>
- {% endif %}
- <div class="author-title"><h5>{{ message.user.primary_group.name }}</h5></div>
- {% if message.user.avatar %}
- <div class="author-avatar"><img src="{{ message.user.avatar }}" alt="avatar"></div>
- {% endif %}
- <div class="author-registered">{% trans %}Joined{% endtrans %}: {{ message.user.date_joined|format_date('%b %d %Y') }}</div>
- <div class="author-posts">{% trans %}Posts{% endtrans %}: {{ message.user.post_count }}</div>
- <div class="author-pm">
- <a href="{{ url_for('message.new_conversation') }}?to_user={{ message.user.username }}">{% trans %}Message{% endtrans %}</a>
- </div>
- {% if message.user.website %}
- <div class="author-website"><a href="{{ message.user.website }}" rel="nofollow">{% trans %}Website{% endtrans %}</a></div>
- {% endif %}
- {% else %}
- <div class="author-name"><h4>{% trans %}Deleted{% endtrans %}</h4></div>
- <div class="author-title"><h5>{% trans %}Guest{% endtrans %}</h5></div>
- {% endif %}
- </div>
- </div>
- {% endif %}
- </div>
- {% endfor %}
- </div>
- </div>
- </div>
- {% if not conversation.draft %}
- {% from "macros.html" import render_quickreply, render_submit_field %}
- <form class="form" action="#" method="post">
- {{ form.hidden_tag() }}
- <div class="row conversation-reply">
- <div class="col-md-12 col-sm-12 col-xs-12">
- <div class="editor-box">
- <div class="editor">
- {{ render_quickreply(form.message, div_class="new-message", rows=7, cols=75, placeholder="", **{'data-provide': 'markdown', 'data-autofocus': 'false', 'class': 'flaskbb-editor'}) }}
- </div>
- <div class="editor-submit">
- {{ render_submit_field(form.submit, input_class="btn btn-success pull-right") }}
- </div>
- </div>
- </div>
- </div>
- {% include theme('editor_help.html') %}
- </form>
- {% endif %}
- {% endblock %}
- {% block scripts %}
- <script>
- $(function () {
- $('[data-toggle="tooltip"]').tooltip()
- })
- </script>
- {% endblock %}
|