Added more docs

This commit is contained in:
Antonio de la Rosa 2022-03-20 00:33:32 +01:00
parent 131e93c679
commit eb93be38ea
2 changed files with 88 additions and 3 deletions

View file

@ -5,11 +5,27 @@ from paramecio2.libraries.urls import add_get_parameters
from paramecio2.libraries.i18n import I18n
class Pages:
"""Simple class for create html pagination code"""
css_class='link_pages'
@staticmethod
def show( begin_page, total_elements, num_elements, link ,initial_num_pages=20, variable='begin_page', label='', func_jscript=''):
"""Static method for create the html pagination
With this method, you can create html pagination code with automated urls for load every page. You can use it also how base for ajax pagination
Args:
begin_page (int): The number where pagination begin
total_elements (int): The total items in pages
num_elements (int): The number of items for every page
link (str): The url of every page
initial_num_pages (int): Optional. Number of pages showed in pagination, if you have 50 pages, if this value is 20, an interval of 20 pages is showed, with first pages links, and after pages links for navigate between many pages.
variable (str): Optional. The name of GET url variable used for send the first element in the query for get the page.
label (str): Optional. In the future will be used for identify some html tags
func_jscript (str): Javascript function to be executed when page url is clicked.
"""
pages='';