Skip to content

Instantly share code, notes, and snippets.

@nucleartux
Created May 4, 2012 15:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nucleartux/2595483 to your computer and use it in GitHub Desktop.
Save nucleartux/2595483 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
(function() {
var fos_comment_script = document.createElement('script');
fos_comment_script.async = true;
fos_comment_script.src = '/app_dev.php/js/35a8e64_comments_1.js';
fos_comment_script.type = 'text/javascript';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(fos_comment_script);
})();
</script>
{% extends '::base.html.twig' %}
{% block body %}
{% javascripts '@FOSCommentBundle/Resources/assets/js/comments.js' %}
<script type="text/javascript">
(function() {
var fos_comment_script = document.createElement('script');
fos_comment_script.async = true;
fos_comment_script.src = '{{ asset_url }}';
fos_comment_script.type = 'text/javascript';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(fos_comment_script);
})();
</script>
{% endjavascripts %}
{% for entity in entities %}
<div class="post">
<div class="leftbar">
<div class="meta">Date: {{ entity.createdat|date('n M Y') }}</div>
<div class="meta">Author: <a href="#">{{ entity.user.username }}</a></div>
<div class="meta">Tags: <a href="#">boston</a>, <a href="#">photography</a></div>
<div class="meta"><a href="{{ path('post_show', { 'slug': entity.slug }) }}#fos_comment_thread"><span class="fos-comment-count" data-fos-comment-thread-id="post_{{ entity.id }}">#</span></a></div>
</div>
<div class="post-header">
<a href="{{ path('post_show', { 'slug': entity.slug }) }}">{{ entity.title }}</a>
{% if app.user == entity.user %}
<a href="{{ path('post_edit', { 'id': entity.id }) }}"><img class="icon" src="{{ asset('/images/edit.png') }}" alt="редактировать" title="редактировать"/></a>
{% endif %}
</div>
<div class="post-content">
{{ entity.content | truncate(400) | markdown }}
</div>
<div class="more">
<a href="{{ path('post_show', { 'slug': entity.slug }) }}">Read More...</a>
</div>
</div>
{% endfor %}
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment