Loading sopds_web_backend/__pycache__/views.cpython-35.pyc +464 B (6.79 KiB) File changed.No diff preview for this file type. View original file View changed file sopds_web_backend/templates/sopds_footer.html +7 −9 Original line number Diff line number Diff line <div class="row expanded callout secondary" style="margin:0"> <div class="large-4 columns"> <h5>LATESTS BOOKS</h5> <h5><a href="{% url "web:searchbooks" %}?searchtype=u">BOOKSHELF</a></h5> <div class="row small-up-4"> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> {% for b in bookshelf %} <div class="column"> <span data-tooltip aria-haspopup="true" class="has-tip" data-disable-hover="false" tabindex="1" title="{{b.title}}"> <img class="thumbnail" src="{% url 'opds_catalog:cover' b.book_id %}" type="image/jpeg" alt="{{b.title}}"> </span></div> {% endfor %} </div> </div> <div class="large-4 columns"> Loading sopds_web_backend/templates/sopds_main.html +9 −1 Original line number Diff line number Diff line Loading @@ -60,8 +60,16 @@ return false; return true; }; function logout(to_url) { var out = window.location.href.replace(/:\/\//, '://log:out@'); jQuery.get(out).error(function() { window.location = to_url; }); } </script> {% block block-js %}{% endblock %} </body> </html> No newline at end of file sopds_web_backend/templates/sopds_top.html +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ {% if sopds_auth %} <ul class="menu" style="font-size:90%;"> {% if user.username %} <li><a href="/logout/"><i class="fi-torsos"></i>Logout ({{ user.username }})</a></li> <li><a href="#" onClick="logout('/logout/')"><i class="fi-torsos"></i>Logout ({{ user.username }})</a></li> {% else %} <li><a href="#"><i class="fi-torsos"></i>Login</a></li> {% endif %} Loading sopds_web_backend/views.py +16 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ from django.template import Context, RequestContext from django.template.context_processors import csrf from django.core.paginator import Paginator, InvalidPage from opds_catalog.models import Book, Author, Series from opds_catalog.models import Book, Author, Series, bookshelf from opds_catalog.settings import SPLITITEMS, MAXITEMS, DOUBLES_HIDE, AUTH, VERSION from sopds_web_backend.settings import HALF_PAGES_LINKS Loading @@ -15,7 +15,14 @@ def sopds_processor(request): args['sopds_version']=VERSION user=request.user if user.is_authenticated(): pass result=[] for i,row in enumerate(bookshelf.objects.filter(user=user).order_by('-readtime')): book = Book.objects.get(id=row.book_id) p = {'id':row.id, 'readtime': row.readtime, 'book_id': row.book_id, 'title': book.title, 'authors':book.authors.values()} result.append(p) if (i>=7): break; args['bookshelf']=result return args # Create your views here. Loading Loading @@ -49,6 +56,12 @@ def SearchBooksView(request): except: ser_id = 0 books = Book.objects.filter(series=ser_id) # Поиск книг на книжной полке elif searchtype == 'u': if AUTH: books = Book.objects.filter(bookshelf__user=request.user) else: books={} # Поиск дубликатов для книги elif searchtype == 'd': #try: Loading Loading
sopds_web_backend/__pycache__/views.cpython-35.pyc +464 B (6.79 KiB) File changed.No diff preview for this file type. View original file View changed file
sopds_web_backend/templates/sopds_footer.html +7 −9 Original line number Diff line number Diff line <div class="row expanded callout secondary" style="margin:0"> <div class="large-4 columns"> <h5>LATESTS BOOKS</h5> <h5><a href="{% url "web:searchbooks" %}?searchtype=u">BOOKSHELF</a></h5> <div class="row small-up-4"> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> <div class="column"><img class="thumbnail" src="http://placehold.it/75" alt="image of space dog"></div> {% for b in bookshelf %} <div class="column"> <span data-tooltip aria-haspopup="true" class="has-tip" data-disable-hover="false" tabindex="1" title="{{b.title}}"> <img class="thumbnail" src="{% url 'opds_catalog:cover' b.book_id %}" type="image/jpeg" alt="{{b.title}}"> </span></div> {% endfor %} </div> </div> <div class="large-4 columns"> Loading
sopds_web_backend/templates/sopds_main.html +9 −1 Original line number Diff line number Diff line Loading @@ -60,8 +60,16 @@ return false; return true; }; function logout(to_url) { var out = window.location.href.replace(/:\/\//, '://log:out@'); jQuery.get(out).error(function() { window.location = to_url; }); } </script> {% block block-js %}{% endblock %} </body> </html> No newline at end of file
sopds_web_backend/templates/sopds_top.html +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ {% if sopds_auth %} <ul class="menu" style="font-size:90%;"> {% if user.username %} <li><a href="/logout/"><i class="fi-torsos"></i>Logout ({{ user.username }})</a></li> <li><a href="#" onClick="logout('/logout/')"><i class="fi-torsos"></i>Logout ({{ user.username }})</a></li> {% else %} <li><a href="#"><i class="fi-torsos"></i>Login</a></li> {% endif %} Loading
sopds_web_backend/views.py +16 −3 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ from django.template import Context, RequestContext from django.template.context_processors import csrf from django.core.paginator import Paginator, InvalidPage from opds_catalog.models import Book, Author, Series from opds_catalog.models import Book, Author, Series, bookshelf from opds_catalog.settings import SPLITITEMS, MAXITEMS, DOUBLES_HIDE, AUTH, VERSION from sopds_web_backend.settings import HALF_PAGES_LINKS Loading @@ -15,7 +15,14 @@ def sopds_processor(request): args['sopds_version']=VERSION user=request.user if user.is_authenticated(): pass result=[] for i,row in enumerate(bookshelf.objects.filter(user=user).order_by('-readtime')): book = Book.objects.get(id=row.book_id) p = {'id':row.id, 'readtime': row.readtime, 'book_id': row.book_id, 'title': book.title, 'authors':book.authors.values()} result.append(p) if (i>=7): break; args['bookshelf']=result return args # Create your views here. Loading Loading @@ -49,6 +56,12 @@ def SearchBooksView(request): except: ser_id = 0 books = Book.objects.filter(series=ser_id) # Поиск книг на книжной полке elif searchtype == 'u': if AUTH: books = Book.objects.filter(bookshelf__user=request.user) else: books={} # Поиск дубликатов для книги elif searchtype == 'd': #try: Loading