Closed sehmuzc closed 10 months ago
Label separation and label search is working.
I added the images for the badges from the admin page. Ceyda did this one: The annotation server should be running in cloud environment.
The second issue is fixed with 8d15d86 and 0626685
Annotation search is still going on. All others are solved.
The search functionality should be looking for annotations. @ceydaduzgec
Annotation search is done https://github.com/swe574-spring23/SWE574/pull/181 and https://github.com/swe574-spring23/SWE574/pull/180
<p class="labels">
Labels:
{% for label in post.get_labels_list %}
<a href="{% url 'search_posts_by_label' label %}" class="badge bg-secondary"
data-bs-toggle="tooltip" data-bs-placement="top"
data-bs-custom-class="custom-tooltip">
{{ label }}
</a>
{% endfor %}
</p>
from django.shortcuts import render
from django.db.models import Q
def search_posts_by_label(request, label):
posts_s = Post.objects.filter(labels__icontains=label).distinct()
# You can pass the 'posts_s' queryset to the template or perform further actions
return render(request, 'search_results.html', {'posts_s': posts_s})
from django.urls import path
from .views import search_posts_by_label
urlpatterns = [
# Other URL patterns
path('search/label/<str:label>/', search_posts_by_label, name='search_posts_by_label'),
]
The issues below should be corrected: