{% extends 'base.html' %} {% block title %}Forums{% endblock %} {% block content %} <div class="container"> <div class="row"> <div class="col-md-12"> <h1>Welcome to the Forums!</h1> {% for category in categories %} <div class="card mt-4"> <div class="card-header">{{ category.category_name }}</div> <div class="card-body"> <div class="list-group"> {% set count = 0 %} {% for post in posts %} {% if post.category_id == category.id %} {% if count < 10 %} <a href="{{ url_for('new_post', post_id=post.id) }}" class="list-group-item list-group-item-action"> <h5 class="mb-1">{{ post.post_name }}</h5> <p class="mb-1">{{ post.text }}</p> <small>Created by {{ post.created_by }} - {{ post.creation_date }}</small> </a> {% set count = count + 1 %} {% endif %} {% endif %} {% endfor %} </div> </div> </div> {% endfor %} </div> </div> </div> {% endblock %}