diff --git a/templates/blog_post/index.html.twig b/templates/blog_post/index.html.twig index 8929093..5b6ed8a 100644 --- a/templates/blog_post/index.html.twig +++ b/templates/blog_post/index.html.twig @@ -1,3 +1,5 @@ + + {% extends 'base.html.twig' %} {% block title %}BlogPost index{% endblock %} @@ -10,44 +12,64 @@ {% endif %} - - {% for blog_post in pager %} -
-
- -

{{ blog_post.title }}

-
- {% if is_granted('IS_AUTHENTICATED_FULLY') %} - - Edit - - {% endif %} -
- - - {% if blog_post.banner %} -
- - {{ blog_post.title }} - -
- {% endif %} - -

Posted on by Author

- - {% if blog_post.content|length > 200 %} - {% set truncated = blog_post.content|slice(0, 200)|join(' ') ~ '...' %} + {% set isFirstItem = true %} +
+ {% for blog_post in pager %} + {% if isFirstItem %} +
+ {% set isFirstItem = false %} + {% if blog_post.banner %} +
+ {{ blog_post.title }} +
+
+ {% endif %} + +
+ +

{{ blog_post.title }}

+
+ {% if is_granted('IS_AUTHENTICATED_FULLY') %} + + Edit + + {% endif %} +

+ {{ blog_post.content|slice(0, 300) ~ '...' }} +

+
+
{% else %} - {% set truncated = blog_post.content %} +
+
+ +

{{ blog_post.title }}

+
+ {% if is_granted('IS_AUTHENTICATED_FULLY') %} + + Edit + + {% endif %} +
+ + {% if blog_post.banner %} +
+ + {{ blog_post.title }} +
+ {% endif %} + +

+ {{ blog_post.content|length > 300 ? blog_post.content|slice(0, 300) ~ '...' : blog_post.content }} +

+
{% endif %} - - {{ truncated }} -
- {% else %} -
-
No Articles found 😞
-
- {% endfor %} + {% else %} +
+
No Articles found 😞
+
+ {% endfor %} + {% endblock %}