Skip to content
Snippets Groups Projects
Commit b652eebf authored by Dmitry Shelepnev's avatar Dmitry Shelepnev
Browse files

Use strip_tags for annotation show

parent 08fe5892
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ from django.contrib.syndication.views import Feed ...@@ -5,6 +5,7 @@ from django.contrib.syndication.views import Feed
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.shortcuts import render from django.shortcuts import render
from django.db.models import Count, Min from django.db.models import Count, Min
from django.utils.html import strip_tags
from opds_catalog.models import Book, Catalog, Author, Genre, Series, bookshelf, Counter, lang_menu from opds_catalog.models import Book, Catalog, Author, Genre, Series, bookshelf, Counter, lang_menu
from opds_catalog import models from opds_catalog import models
...@@ -235,7 +236,7 @@ class CatalogsFeed(AuthFeed): ...@@ -235,7 +236,7 @@ class CatalogsFeed(AuthFeed):
for row in books_list[op.d2_first_pos:op.d2_last_pos+1]: for row in books_list[op.d2_first_pos:op.d2_last_pos+1]:
p = {'is_catalog':0, 'lang_code': row.lang_code, 'filename': row.filename, 'path': row.path, \ p = {'is_catalog':0, 'lang_code': row.lang_code, 'filename': row.filename, 'path': row.path, \
'registerdate': row.registerdate, 'id': row.id, 'annotation': row.annotation, \ 'registerdate': row.registerdate, 'id': row.id, 'annotation': strip_tags(row.annotation), \
'docdate': row.docdate, 'format': row.format, 'title': row.title, 'filesize': row.filesize//1000, 'docdate': row.docdate, 'format': row.format, 'title': row.title, 'filesize': row.filesize//1000,
'authors':row.authors.values(), 'genres':row.genres.values(), 'series':row.series.values()} 'authors':row.authors.values(), 'genres':row.genres.values(), 'series':row.series.values()}
items.append(p) items.append(p)
...@@ -465,7 +466,7 @@ class SearchBooksFeed(AuthFeed): ...@@ -465,7 +466,7 @@ class SearchBooksFeed(AuthFeed):
for row in books[start:finish+1]: for row in books[start:finish+1]:
p = {'doubles':0, 'lang_code': row.lang_code, 'filename': row.filename, 'path': row.path, \ p = {'doubles':0, 'lang_code': row.lang_code, 'filename': row.filename, 'path': row.path, \
'registerdate': row.registerdate, 'id': row.id, 'annotation': row.annotation, \ 'registerdate': row.registerdate, 'id': row.id, 'annotation': strip_tags(row.annotation), \
'docdate': row.docdate, 'format': row.format, 'title': row.title, 'filesize': row.filesize//1000, 'docdate': row.docdate, 'format': row.format, 'title': row.title, 'filesize': row.filesize//1000,
'authors':row.authors.values(), 'genres':row.genres.values(), 'series':row.series.values()} 'authors':row.authors.values(), 'genres':row.genres.values(), 'series':row.series.values()}
if summary_DOUBLES_HIDE: if summary_DOUBLES_HIDE:
......
...@@ -7,6 +7,7 @@ from django.utils.translation import ugettext as _ ...@@ -7,6 +7,7 @@ from django.utils.translation import ugettext as _
from django.contrib.auth import authenticate, login, logout, REDIRECT_FIELD_NAME from django.contrib.auth import authenticate, login, logout, REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.decorators import user_passes_test
from django.core.urlresolvers import reverse, reverse_lazy from django.core.urlresolvers import reverse, reverse_lazy
from django.utils.html import strip_tags
from opds_catalog import models from opds_catalog import models
from opds_catalog.models import Book, Author, Series, bookshelf, Counter, Catalog, Genre, lang_menu from opds_catalog.models import Book, Author, Series, bookshelf, Counter, Catalog, Genre, lang_menu
...@@ -191,7 +192,7 @@ def SearchBooksView(request): ...@@ -191,7 +192,7 @@ def SearchBooksView(request):
for row in books[start:finish+1]: for row in books[start:finish+1]:
p = {'doubles':0, 'lang_code': row.lang_code, 'filename': row.filename, 'path': row.path, \ p = {'doubles':0, 'lang_code': row.lang_code, 'filename': row.filename, 'path': row.path, \
'registerdate': row.registerdate, 'id': row.id, 'annotation': row.annotation, \ 'registerdate': row.registerdate, 'id': row.id, 'annotation': strip_tags(row.annotation), \
'docdate': row.docdate, 'format': row.format, 'title': row.title, 'filesize': row.filesize//1000, 'docdate': row.docdate, 'format': row.format, 'title': row.title, 'filesize': row.filesize//1000,
'authors':row.authors.values(), 'genres':row.genres.values(), 'series':row.series.values()} 'authors':row.authors.values(), 'genres':row.genres.values(), 'series':row.series.values()}
if summary_DOUBLES_HIDE: if summary_DOUBLES_HIDE:
...@@ -345,7 +346,7 @@ def CatalogsView(request): ...@@ -345,7 +346,7 @@ def CatalogsView(request):
for row in books_list[op.d2_first_pos:op.d2_last_pos+1]: for row in books_list[op.d2_first_pos:op.d2_last_pos+1]:
p = {'is_catalog':0, 'lang_code': row.lang_code, 'filename': row.filename, 'path': row.path, \ p = {'is_catalog':0, 'lang_code': row.lang_code, 'filename': row.filename, 'path': row.path, \
'registerdate': row.registerdate, 'id': row.id, 'annotation': row.annotation, \ 'registerdate': row.registerdate, 'id': row.id, 'annotation': strip_tags(row.annotation), \
'docdate': row.docdate, 'format': row.format, 'title': row.title, 'filesize': row.filesize//1000, 'docdate': row.docdate, 'format': row.format, 'title': row.title, 'filesize': row.filesize//1000,
'authors':row.authors.values(), 'genres':row.genres.values(), 'series':row.series.values()} 'authors':row.authors.values(), 'genres':row.genres.values(), 'series':row.series.values()}
items.append(p) items.append(p)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment