Classified ads templates
Classified ads templates (English fallback)
Aug. 16, 2025
Posted by admin
Nhom |
Notes |
|
Template Integration Patterns Common Design Elements:
Performance Optimizations:
User Experience Features:
This template system provides a complete, production-ready classified ads platform with modern web standards, comprehensive functionality, and excellent user experience patterns.
|
1 |
1. home.html - Landing Page Template Structure & Purpose
Key Sections: Hero Section <div class="jumbotron bg-primary text-white text-center py-5 mb-5 rounded"> <h1 class="display-4">Find What You Need</h1> <p class="lead">Browse thousands of classified ads or post your own</p> <a class="btn btn-light btn-lg" href="{% url 'classified_ads:create' %}"> <i class="fas fa-plus me-2"></i>Post an Ad </a> </div>
Statistics Dashboard <div class="row text-center mb-5"> <div class="col-md-3"> <h3 class="text-primary">{{ total_ads }}</h3> <p class="text-muted">Total Ads</p> </div> <!-- Additional stats... --> </div>
Category Grid {% for category in categories %} <div class="col-lg-3 col-md-4 col-sm-6 mb-3"> <a href="{% url 'classified_ads:category' category.slug %}"> <div class="card h-100 border-0 shadow-sm hover-shadow"> <i class="{{ category.icon }} fa-2x text-primary mb-3"></i> <h6>{{ category.name }}</h6> <small>{{ category.ad_count }} ads</small> </div> </a> </div> {% endfor %}
Popular Locations {% for location in popular_locations %} <div class="card h-100 border-0 shadow-sm hover-shadow"> <i class="fas fa-map-marker-alt fa-2x text-success mb-3"></i> <h6>{{ location.name }}</h6> <small>{{ location.ad_count }} ads</small> </div> {% endfor %}
|
1 |
This template (home.html) is the homepage for the classified ads section. Here’s what it does:
This homepage provides a visually appealing, easy-to-navigate entry point for users to browse, search, and post classified ads, highlighting key categories, locations, and featured/recent ads.
|
2 |
2. ad_list.html - Main Browse/Search Template Advanced Search Form <form method="GET" action="{% url 'classified_ads:ad_list' %}"> <div class="row g-3"> <!-- Search Query --> <input type="text" name="q" placeholder="Search ads..." value="{{ request.GET.q }}">
<!-- Category Filter --> <select name="category"> {% for category in categories %} <option value="{{ category.id }}">{{ category.name }} ({{ category.ad_count }})</option> {% endfor %} </select>
<!-- Location with Autocomplete --> <input type="text" name="location" list="popular-locations"> <datalist id="popular-locations"> {% for location in all_locations %} <option value="{{ location.name }}"> {% endfor %} </datalist> </div> </form> Key Features:
Results Display {% for ad in ads %} <div class="card mb-3"> <div class="row g-0"> <div class="col-md-3"> <!-- Image thumbnail --> </div> <div class="col-md-9"> <div class="card-body"> <h5>{{ ad.title }}</h5> <p class="text-success">${{ ad.price }}</p> <span class="badge bg-primary">{{ ad.get_ad_type_display }}</span> </div> </div> </div> </div> {% endfor %}
|
2 |
This template (ad_list.html) displays the main classified ads listing page. Here’s what it does:
This template provides a user-friendly, filterable, and visually appealing interface for browsing and searching classified ads.
|
3 |
3. ad_detail.html - Individual Ad View Template Image Gallery <div id="adImageCarousel" class="carousel slide"> <div class="carousel-inner"> {% for image in ad.images.all %} <div class="carousel-item {% if forloop.first %}active{% endif %}"> <img src="{{ image.image.url }}" style="height: 400px; object-fit: cover;"> {% if image.caption %} <div class="carousel-caption"> <p>{{ image.caption }}</p> </div> {% endif %} </div> {% endfor %} </div> </div>
Ad Information Panel <div class="card-header"> <div class="d-flex justify-content-between"> <div> <h1 class="h3">{{ ad.title }}</h1> <span class="badge bg-primary">{{ ad.get_ad_type_display }}</span> <span class="badge bg-secondary">{{ ad.category.name }}</span> {% if ad.featured %} <span class="badge bg-warning">Featured</span> {% endif %} </div> <div class="text-end"> {% if ad.price %} <div class="h3 text-success"> ${{ ad.price }} {% if ad.price_negotiable %}(Negotiable){% endif %} </div> {% endif %} <small>Posted {{ ad.created_at|timesince }} ago</small> </div> </div> </div>
User Interaction Features <!-- Favorite Button (AJAX) --> <button class="btn btn-outline-danger" onclick="toggleFavorite({{ ad.pk }})"> <i class="fas fa-heart"></i> {% if is_favorited %}Remove from{% else %}Add to{% endif %} Favorites </button> <!-- Contact Form --> <form method="post" action="{% url 'classified_ads:submit_inquiry' ad.pk %}"> {% csrf_token %} {{ inquiry_form|crispy }} <button type="submit" class="btn btn-primary">Send Inquiry</button> </form>
|
3 |
This template (ad_detail.html) displays the details of a single classified ad. Here’s what it does:
This page provides a comprehensive, user-friendly view of an ad, with all key info, seller contact, and user actions. |
4 |
4. ad_form.html - Create/Edit Ad Template Multilingual Form Structure <!-- Creation Guide --> <div class="creation-guide"> <h6><i class="fas fa-lightbulb"></i> Classified Ad Creation Guide</h6> <ul> <li><strong>Option 1:</strong> Create English ad first, add Vietnamese translation later</li> <li><strong>Option 2:</strong> Create both English and Vietnamese content simultaneously</li> <li><strong>Translation Status:</strong> Will be automatically set based on content completion</li> </ul> </div> <!-- Tab Navigation --> <ul class="nav nav-tabs" role="tablist"> <li class="nav-item"> <a class="nav-link active" data-bs-toggle="tab" href="#english-content"> English Content </a> </li> <li class="nav-item"> <a class="nav-link" data-bs-toggle="tab" href="#vietnamese-content"> Vietnamese Content (Tiếng Việt) </a> </li> </ul> Advanced Features:
Image Management <!-- Image Upload Formset --> {{ formset.management_form }} {% for form in formset %} <div class="image-form"> {{ form.image }} {{ form.caption }} {{ form.is_primary }} {{ form.order }} </div> {% endfor %}
|
4 |
This template (ad_form.html) is used for creating or editing a classified ad, supporting both English and Vietnamese content. Here’s what it does:
This template provides a clear, step-by-step, and visually appealing workflow for posting or editing classified ads, supporting both English and Vietnamese content, and managing images.
|
5 |
5. my_ads.html - User Dashboard Template Multilingual Support <h2> <i class="fas fa-list-alt"></i> {% if request.LANGUAGE_CODE == 'vi' %} Quảng cáo cá»§a tôi {% else %} My Ads {% endif %} </h2>
Ad Management Grid {% for ad in ads %} <div class="col-md-6 col-lg-4 mb-4"> <div class="card h-100"> <div class="card-header"> <div class="d-flex justify-content-between"> <span class="badge bg-{{ ad.status|status_color }}">{{ ad.get_status_display }}</span> <span class="text-muted">{{ ad.view_count }} views</span> </div> </div> <div class="card-body"> <h6>{{ ad.title|truncatechars:50 }}</h6> <p class="text-success">${{ ad.price }}</p> <div class="btn-group"> <a href="{% url 'classified_ads:edit' ad.pk %}" class="btn btn-sm btn-outline-primary">Edit</a> <a href="{% url 'classified_ads:delete' ad.pk %}" class="btn btn-sm btn-outline-danger">Delete</a> </div> </div> </div> </div> {% endfor %}
|
5 |
This template (my_ads.html) displays the current user's own classified ads, with support for both English and Vietnamese languages. Here’s what it does:
This template provides a user-friendly, bilingual dashboard for users to manage their own ads, see their account status, and quickly post, edit, or delete ads.
|
6 |
6. category_list.html - Category Browser Template Hierarchical Display {% for category in categories %} <div class="col-lg-4 col-md-6 mb-4"> <div class="card h-100 shadow-sm hover-shadow"> <div class="card-body"> <div class="d-flex align-items-start"> <div class="flex-shrink-0 me-3"> <i class="{{ category.icon }} fa-2x text-primary"></i> </div> <div class="flex-grow-1"> <h5><a href="{% url 'classified_ads:category' category.slug %}">{{ category.name }}</a></h5> <p class="text-muted">{{ category.description|truncatewords:15 }}</p> <div class="d-flex justify-content-between"> <span class="badge bg-primary">{{ category.ad_count }} ads</span> {% if category.children.exists %} <span class="text-muted">{{ category.children.count }} subcategories</span> {% endif %} </div> </div> </div> </div> </div> </div> {% endfor %}
|
6 |
This template (category_list.html) displays all main (parent) categories for classified ads. Here’s what it does:
This template provides a visually appealing and organized way for users to browse and select categories for classified ads, with easy navigation to subcategories and ad posting.
|
7 |
7. favorites.html - User Favorites Template Favorites Management {% for favorite in favorites %} {% with ad=favorite.ad %} <div class="col-md-6 col-lg-4 mb-4"> <div class="card h-100"> {% if ad.images.first %} <img src="{{ ad.images.first.image.url }}" class="card-img-top" style="height: 200px; object-fit: cover;"> {% endif %} <div class="card-body"> <h6>{{ ad.title|truncatechars:50 }}</h6> <p class="text-success">${{ ad.price }}</p> <p class="text-muted">Added: {{ favorite.created_at|date:"M d, Y" }}</p> <div class="d-flex justify-content-between"> <a href="{% url 'classified_ads:detail' ad.pk %}" class="btn btn-sm btn-primary">View</a> <button onclick="toggleFavorite({{ ad.pk }})" class="btn btn-sm btn-outline-danger">Remove</button> </div> </div> </div> </div> {% endwith %} {% endfor %}
|
7 |
This template (favorites.html) displays the user's list of favorite classified ads. Here’s what it does:
This template provides a user-friendly way for users to view, access, and manage their favorite ads.
|
8 |
8. ad_confirm_delete.html - Deletion Confirmation Safety Features <div class="card-header bg-danger text-white"> <h4><i class="fas fa-exclamation-triangle"></i> Confirm Deletion</h4> </div> <div class="card-body"> <div class="alert alert-warning"> <strong>Warning:</strong> This action cannot be undone! </div> <h5>Are you sure you want to delete this ad?</h5> <!-- Ad preview for confirmation --> <form method="post"> {% csrf_token %} <button type="submit" class="btn btn-danger">Yes, Delete</button> <a href="{% url 'classified_ads:my_ads' %}" class="btn btn-secondary">Cancel</a> </form> </div>
|
8 |
This template (ad_confirm_delete.html) is the confirmation page shown when a user tries to delete a classified ad. Here’s what it does:
This ensures users are clearly warned and can review the ad details before confirming deletion.
|
a |
This template (ad_form_clean.html) is for creating or editing a classified ad, with a focus on bilingual (English/Vietnamese) content and a modern, user-friendly UI. Here’s what it does:
This template provides a clear, step-by-step, and visually appealing workflow for posting or editing classified ads, supporting both English and Vietnamese content, and managing images.
|
a |
The file ad_form_vi.html is currently empty. There is no code or template content inside, so it does not provide any functionality or display anything at this time. If you intend to create a Vietnamese-only ad form or a special template for Vietnamese content, you would need to add the appropriate HTML and template logic to this file.
|
a |
This template (category_detail.html) displays all classified ads within a specific category. Here’s what it does:
This template provides a user-friendly, filterable, and visually appealing interface for browsing and searching ads within a specific category, with support for subcategories and easy ad posting.
|
a |
This template (location_detail.html) displays all classified ads for a specific location. Here’s what it does:
This template provides a user-friendly, filterable, and visually appealing interface for browsing and searching ads within a specific location, with easy navigation to related locations and quick actions.
|
Nhom |
Notes |
|
Template Integration Patterns Common Design Elements:
Performance Optimizations:
User Experience Features:
This template system provides a complete, production-ready classified ads platform with modern web standards, comprehensive functionality, and excellent user experience patterns.
|
1 |
1. home.html - Landing Page Template Structure & Purpose
Key Sections: Hero Section <div class="jumbotron bg-primary text-white text-center py-5 mb-5 rounded"> <h1 class="display-4">Find What You Need</h1> <p class="lead">Browse thousands of classified ads or post your own</p> <a class="btn btn-light btn-lg" href="{% url 'classified_ads:create' %}"> <i class="fas fa-plus me-2"></i>Post an Ad </a> </div>
Statistics Dashboard <div class="row text-center mb-5"> <div class="col-md-3"> <h3 class="text-primary">{{ total_ads }}</h3> <p class="text-muted">Total Ads</p> </div> <!-- Additional stats... --> </div>
Category Grid {% for category in categories %} <div class="col-lg-3 col-md-4 col-sm-6 mb-3"> <a href="{% url 'classified_ads:category' category.slug %}"> <div class="card h-100 border-0 shadow-sm hover-shadow"> <i class="{{ category.icon }} fa-2x text-primary mb-3"></i> <h6>{{ category.name }}</h6> <small>{{ category.ad_count }} ads</small> </div> </a> </div> {% endfor %}
Popular Locations {% for location in popular_locations %} <div class="card h-100 border-0 shadow-sm hover-shadow"> <i class="fas fa-map-marker-alt fa-2x text-success mb-3"></i> <h6>{{ location.name }}</h6> <small>{{ location.ad_count }} ads</small> </div> {% endfor %}
|
1 |
This template (home.html) is the homepage for the classified ads section. Here’s what it does:
This homepage provides a visually appealing, easy-to-navigate entry point for users to browse, search, and post classified ads, highlighting key categories, locations, and featured/recent ads.
|
2 |
2. ad_list.html - Main Browse/Search Template Advanced Search Form <form method="GET" action="{% url 'classified_ads:ad_list' %}"> <div class="row g-3"> <!-- Search Query --> <input type="text" name="q" placeholder="Search ads..." value="{{ request.GET.q }}">
<!-- Category Filter --> <select name="category"> {% for category in categories %} <option value="{{ category.id }}">{{ category.name }} ({{ category.ad_count }})</option> {% endfor %} </select>
<!-- Location with Autocomplete --> <input type="text" name="location" list="popular-locations"> <datalist id="popular-locations"> {% for location in all_locations %} <option value="{{ location.name }}"> {% endfor %} </datalist> </div> </form> Key Features:
Results Display {% for ad in ads %} <div class="card mb-3"> <div class="row g-0"> <div class="col-md-3"> <!-- Image thumbnail --> </div> <div class="col-md-9"> <div class="card-body"> <h5>{{ ad.title }}</h5> <p class="text-success">${{ ad.price }}</p> <span class="badge bg-primary">{{ ad.get_ad_type_display }}</span> </div> </div> </div> </div> {% endfor %}
|
2 |
This template (ad_list.html) displays the main classified ads listing page. Here’s what it does:
This template provides a user-friendly, filterable, and visually appealing interface for browsing and searching classified ads.
|
3 |
3. ad_detail.html - Individual Ad View Template Image Gallery <div id="adImageCarousel" class="carousel slide"> <div class="carousel-inner"> {% for image in ad.images.all %} <div class="carousel-item {% if forloop.first %}active{% endif %}"> <img src="{{ image.image.url }}" style="height: 400px; object-fit: cover;"> {% if image.caption %} <div class="carousel-caption"> <p>{{ image.caption }}</p> </div> {% endif %} </div> {% endfor %} </div> </div>
Ad Information Panel <div class="card-header"> <div class="d-flex justify-content-between"> <div> <h1 class="h3">{{ ad.title }}</h1> <span class="badge bg-primary">{{ ad.get_ad_type_display }}</span> <span class="badge bg-secondary">{{ ad.category.name }}</span> {% if ad.featured %} <span class="badge bg-warning">Featured</span> {% endif %} </div> <div class="text-end"> {% if ad.price %} <div class="h3 text-success"> ${{ ad.price }} {% if ad.price_negotiable %}(Negotiable){% endif %} </div> {% endif %} <small>Posted {{ ad.created_at|timesince }} ago</small> </div> </div> </div>
User Interaction Features <!-- Favorite Button (AJAX) --> <button class="btn btn-outline-danger" onclick="toggleFavorite({{ ad.pk }})"> <i class="fas fa-heart"></i> {% if is_favorited %}Remove from{% else %}Add to{% endif %} Favorites </button> <!-- Contact Form --> <form method="post" action="{% url 'classified_ads:submit_inquiry' ad.pk %}"> {% csrf_token %} {{ inquiry_form|crispy }} <button type="submit" class="btn btn-primary">Send Inquiry</button> </form>
|
3 |
This template (ad_detail.html) displays the details of a single classified ad. Here’s what it does:
This page provides a comprehensive, user-friendly view of an ad, with all key info, seller contact, and user actions. |
4 |
4. ad_form.html - Create/Edit Ad Template Multilingual Form Structure <!-- Creation Guide --> <div class="creation-guide"> <h6><i class="fas fa-lightbulb"></i> Classified Ad Creation Guide</h6> <ul> <li><strong>Option 1:</strong> Create English ad first, add Vietnamese translation later</li> <li><strong>Option 2:</strong> Create both English and Vietnamese content simultaneously</li> <li><strong>Translation Status:</strong> Will be automatically set based on content completion</li> </ul> </div> <!-- Tab Navigation --> <ul class="nav nav-tabs" role="tablist"> <li class="nav-item"> <a class="nav-link active" data-bs-toggle="tab" href="#english-content"> English Content </a> </li> <li class="nav-item"> <a class="nav-link" data-bs-toggle="tab" href="#vietnamese-content"> Vietnamese Content (Tiếng Việt) </a> </li> </ul> Advanced Features:
Image Management <!-- Image Upload Formset --> {{ formset.management_form }} {% for form in formset %} <div class="image-form"> {{ form.image }} {{ form.caption }} {{ form.is_primary }} {{ form.order }} </div> {% endfor %}
|
4 |
This template (ad_form.html) is used for creating or editing a classified ad, supporting both English and Vietnamese content. Here’s what it does:
This template provides a clear, step-by-step, and visually appealing workflow for posting or editing classified ads, supporting both English and Vietnamese content, and managing images.
|
5 |
5. my_ads.html - User Dashboard Template Multilingual Support <h2> <i class="fas fa-list-alt"></i> {% if request.LANGUAGE_CODE == 'vi' %} Quảng cáo cá»§a tôi {% else %} My Ads {% endif %} </h2>
Ad Management Grid {% for ad in ads %} <div class="col-md-6 col-lg-4 mb-4"> <div class="card h-100"> <div class="card-header"> <div class="d-flex justify-content-between"> <span class="badge bg-{{ ad.status|status_color }}">{{ ad.get_status_display }}</span> <span class="text-muted">{{ ad.view_count }} views</span> </div> </div> <div class="card-body"> <h6>{{ ad.title|truncatechars:50 }}</h6> <p class="text-success">${{ ad.price }}</p> <div class="btn-group"> <a href="{% url 'classified_ads:edit' ad.pk %}" class="btn btn-sm btn-outline-primary">Edit</a> <a href="{% url 'classified_ads:delete' ad.pk %}" class="btn btn-sm btn-outline-danger">Delete</a> </div> </div> </div> </div> {% endfor %}
|
5 |
This template (my_ads.html) displays the current user's own classified ads, with support for both English and Vietnamese languages. Here’s what it does:
This template provides a user-friendly, bilingual dashboard for users to manage their own ads, see their account status, and quickly post, edit, or delete ads.
|
6 |
6. category_list.html - Category Browser Template Hierarchical Display {% for category in categories %} <div class="col-lg-4 col-md-6 mb-4"> <div class="card h-100 shadow-sm hover-shadow"> <div class="card-body"> <div class="d-flex align-items-start"> <div class="flex-shrink-0 me-3"> <i class="{{ category.icon }} fa-2x text-primary"></i> </div> <div class="flex-grow-1"> <h5><a href="{% url 'classified_ads:category' category.slug %}">{{ category.name }}</a></h5> <p class="text-muted">{{ category.description|truncatewords:15 }}</p> <div class="d-flex justify-content-between"> <span class="badge bg-primary">{{ category.ad_count }} ads</span> {% if category.children.exists %} <span class="text-muted">{{ category.children.count }} subcategories</span> {% endif %} </div> </div> </div> </div> </div> </div> {% endfor %}
|
6 |
This template (category_list.html) displays all main (parent) categories for classified ads. Here’s what it does:
This template provides a visually appealing and organized way for users to browse and select categories for classified ads, with easy navigation to subcategories and ad posting.
|
7 |
7. favorites.html - User Favorites Template Favorites Management {% for favorite in favorites %} {% with ad=favorite.ad %} <div class="col-md-6 col-lg-4 mb-4"> <div class="card h-100"> {% if ad.images.first %} <img src="{{ ad.images.first.image.url }}" class="card-img-top" style="height: 200px; object-fit: cover;"> {% endif %} <div class="card-body"> <h6>{{ ad.title|truncatechars:50 }}</h6> <p class="text-success">${{ ad.price }}</p> <p class="text-muted">Added: {{ favorite.created_at|date:"M d, Y" }}</p> <div class="d-flex justify-content-between"> <a href="{% url 'classified_ads:detail' ad.pk %}" class="btn btn-sm btn-primary">View</a> <button onclick="toggleFavorite({{ ad.pk }})" class="btn btn-sm btn-outline-danger">Remove</button> </div> </div> </div> </div> {% endwith %} {% endfor %}
|
7 |
This template (favorites.html) displays the user's list of favorite classified ads. Here’s what it does:
This template provides a user-friendly way for users to view, access, and manage their favorite ads.
|
8 |
8. ad_confirm_delete.html - Deletion Confirmation Safety Features <div class="card-header bg-danger text-white"> <h4><i class="fas fa-exclamation-triangle"></i> Confirm Deletion</h4> </div> <div class="card-body"> <div class="alert alert-warning"> <strong>Warning:</strong> This action cannot be undone! </div> <h5>Are you sure you want to delete this ad?</h5> <!-- Ad preview for confirmation --> <form method="post"> {% csrf_token %} <button type="submit" class="btn btn-danger">Yes, Delete</button> <a href="{% url 'classified_ads:my_ads' %}" class="btn btn-secondary">Cancel</a> </form> </div>
|
8 |
This template (ad_confirm_delete.html) is the confirmation page shown when a user tries to delete a classified ad. Here’s what it does:
This ensures users are clearly warned and can review the ad details before confirming deletion.
|
a |
This template (ad_form_clean.html) is for creating or editing a classified ad, with a focus on bilingual (English/Vietnamese) content and a modern, user-friendly UI. Here’s what it does:
This template provides a clear, step-by-step, and visually appealing workflow for posting or editing classified ads, supporting both English and Vietnamese content, and managing images.
|
a |
The file ad_form_vi.html is currently empty. There is no code or template content inside, so it does not provide any functionality or display anything at this time. If you intend to create a Vietnamese-only ad form or a special template for Vietnamese content, you would need to add the appropriate HTML and template logic to this file.
|
a |
This template (category_detail.html) displays all classified ads within a specific category. Here’s what it does:
This template provides a user-friendly, filterable, and visually appealing interface for browsing and searching ads within a specific category, with support for subcategories and easy ad posting.
|
a |
This template (location_detail.html) displays all classified ads for a specific location. Here’s what it does:
This template provides a user-friendly, filterable, and visually appealing interface for browsing and searching ads within a specific location, with easy navigation to related locations and quick actions.
|
Attached Files
You are viewing this article in public mode. Some features may be limited.