Commit d5bd1a26 authored by Mario Chirinos's avatar Mario Chirinos

websearch

parent 7e1afa52
...@@ -275,7 +275,6 @@ def newsList(request, publisherShortName="all"): ...@@ -275,7 +275,6 @@ def newsList(request, publisherShortName="all"):
def newsDetails(request, newsId): def newsDetails(request, newsId):
form = SearchForm(request.GET) form = SearchForm(request.GET)
news = News.objects.get(id=newsId) news = News.objects.get(id=newsId)
from django.contrib.postgres.search import SearchHeadline, SearchQuery
for i in request.GET['text'].split(): for i in request.GET['text'].split():
news.text = news.text.replace(i, "<b>"+i+"</b>") news.text = news.text.replace(i, "<b>"+i+"</b>")
news.text = news.text.replace(new RegExp(i, "gi"), (match) => '<b>${match}</b>'); news.text = news.text.replace(new RegExp(i, "gi"), (match) => '<b>${match}</b>');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment