Commit 1a902824 authored by Dmitry Shelepnev's avatar Dmitry Shelepnev
Browse files

Fix pagination error (error in calculating num_pages)

parent bb0f2530
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ class Paginator:
        self.d2_last_pos =  d2_MAXITEMS*self.page_num - 1;
        self.d2_last_pos = self.d2_last_pos if self.d2_last_pos<self.d2_count else (self.d2_count-1 if self.d2_count else 0)
        
        self.num_pages = self.count//self.MAXITEMS + 1 if self.count%self.MAXITEMS else 0
        self.num_pages = self.count//self.MAXITEMS + 1
        self.firstpage = self.page_num - self.HALF_PAGES_LINK
        self.lastpage = self.page_num + self.HALF_PAGES_LINK
        if self.firstpage<1:
+0 −2
Original line number Diff line number Diff line
@@ -192,8 +192,6 @@ class opdsScanner:
                zip_process_error = 1
            self.bad_archives+=zip_process_error



    def processfile(self,name,full_path,file,cat,archive=0,file_size=0):
        (n,e)=os.path.splitext(name)
        if e.lower() in config.SOPDS_BOOK_EXTENSIONS.split():
+0 −2
Original line number Diff line number Diff line
@@ -136,8 +136,6 @@ AUTH_PASSWORD_VALIDATORS = [
#LANGUAGE_CODE = 'en-US'
LANGUAGE_CODE = 'ru-RU'
    
3
    
LOCALE_PATHS = (
    os.path.join(BASE_DIR, 'sopds/locale'),
)
+2 −0
Original line number Diff line number Diff line
@@ -364,6 +364,8 @@ def CatalogsView(request):
    breadcrumbs_list.insert(0, (_('Catalogs'),-1))    
    args['breadcrumbs_cat'] =  breadcrumbs_list  
    
    print(args['paginator'], catalogs_count, books_count, page_num, config.SOPDS_MAXITEMS, HALF_PAGES_LINKS)
      
    return render(request,'sopds_catalogs.html', args)  

@sopds_login(url='web:login')