82 lines
No EOL
3.4 KiB
HTML
82 lines
No EOL
3.4 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block js_media %}
|
|
{% include "comments/media-js.html" %}
|
|
{% include "blog/media-js.html" %}
|
|
{% endblock %}
|
|
|
|
{% block media %}
|
|
{% include "comments/media-css.html" %}
|
|
{% include "blog/media-css.html" %}
|
|
{% endblock %}
|
|
|
|
{% block title_row %}
|
|
{% endblock %}
|
|
|
|
{% block title_ruler %}
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
{% set logged_in = request.user.is_authenticated %}
|
|
{% set profile = request.profile if logged_in else None %}
|
|
<div class="post-full">
|
|
<div style="display: flex;">
|
|
<div class="blog-vote" style="margin-right: 5px;">
|
|
{% if logged_in %}
|
|
<a href="javascript:blog_upvote({{ post.id }})"
|
|
class="upvote-link fa fa-chevron-up fa-fw{% if post.vote_score(request.profile) == 1 %} voted{% endif %}"></a>
|
|
{% else %}
|
|
<a href="javascript:alert('{{ _('Please log in to vote')|escapejs }}')" title="{{ _('Please log in to vote') }}"
|
|
class="upvote-link fa fa-chevron-up fa-fw"></a>
|
|
{% endif %}
|
|
<br>
|
|
<div class="post-score"> {{ post.score }} </div>
|
|
{% if logged_in %}
|
|
<a href="javascript:blog_downvote({{ post.id }})"
|
|
class="downvote-link fa fa-chevron-down fa-fw{% if post.vote_score(request.profile) == -1 %} voted{% endif %}"></a>
|
|
{% else %}
|
|
<a href="javascript:alert('{{ _('Please log in to vote')|escapejs }}')" title="{{ _('Please log in to vote') }}"
|
|
class="downvote-link fa fa-chevron-down fa-fw"></a>
|
|
{% endif %}
|
|
</div>
|
|
<div class="post-title">{{ title }}</div>
|
|
</div>
|
|
<div class="time">
|
|
{% with authors=post.authors.all() %}
|
|
{% if authors %}
|
|
<span class="post-authors">{{ link_users(authors) }}</span>
|
|
{% endif %}
|
|
{% endwith %}
|
|
<span class="post-time">
|
|
{% trans time=post.publish_on|date(_("N j, Y, g:i a")) %} posted on {{ time }}{% endtrans %}
|
|
</span>
|
|
{% if post.is_editable_by(request.user) %}
|
|
<span> [<a href="{{ url('admin:judge_blogpost_change', post.id) }}">{{ _('Edit') }}</a>]</span>
|
|
{% elif valid_user_to_show_edit %}
|
|
{% for org in valid_org_to_show_edit %}
|
|
<span> [<a href="{{ url('edit_organization_blog', org.id , org.slug , post.id) }}">{{ _('Edit in') }} {{org.slug}}</a>]</span>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</div>
|
|
<div class="body content-description">
|
|
{% cache 86400 'post_content' post.id MATH_ENGINE %}
|
|
{{ post.content|markdown|reference|str|safe}}
|
|
{% endcache %}
|
|
</div>
|
|
</div>
|
|
<hr style="width: 60%; margin:4em auto;">
|
|
<span class="social">
|
|
{{ post_to_gplus(request, post, '<i class="fa fa-google-plus-square"></i>') }}
|
|
{{ post_to_facebook(request, post, '<i class="fa fa-facebook-official"></i>') }}
|
|
{{ post_to_twitter(request, SITE_NAME + ':', post, '<i class="fa fa-twitter"></i>') }}
|
|
</span>
|
|
{% include "comments/list.html" %}
|
|
{% endblock %}
|
|
|
|
{% block bodyend %}
|
|
{{ super() }}
|
|
{% if REQUIRE_JAX %}
|
|
{% include "mathjax-load.html" %}
|
|
{% endif %}
|
|
{% include "comments/math.html" %}
|
|
{% endblock %} |