Commit 05b5915c authored by Mario Chirinos's avatar Mario Chirinos

websearch

parent f94f0733
......@@ -276,7 +276,11 @@ def newsDetails(request, newsId):
form = SearchForm(request.GET)
news = News.objects.get(id=newsId)
for i in request.GET['text'].split():
news.text = news.text.replace(i, "<b>"+i+"</b>")
txtlen = len(i)
index = news.text.lower().find(i.lower())
if index>0:
word = news.text[index:index+txtlen]
news.text = news.text.replace(word, "<b>"+word+"</b>")
return render(request,'new/newsDetails.html',{"form":form,"news":news})
#-------------------------------------------------------------------------------
def wsAudioList(request, publisher, start, end):
......
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