github.com/kotovmak/go-admin@v1.1.1/template/components/paninator.go (about)

     1  package components
     2  
     3  import (
     4  	"html/template"
     5  
     6  	"github.com/kotovmak/go-admin/template/types"
     7  )
     8  
     9  type PaginatorAttribute struct {
    10  	Name              string
    11  	CurPageStartIndex string
    12  	CurPageEndIndex   string
    13  	Total             string
    14  	PreviousClass     string
    15  	PreviousUrl       string
    16  	Pages             []map[string]string
    17  	NextClass         string
    18  	NextUrl           string
    19  	PageSizeList      []string
    20  	Option            map[string]template.HTML
    21  	Url               string
    22  	ExtraInfo         template.HTML
    23  	EntriesInfo       template.HTML
    24  	types.Attribute
    25  }
    26  
    27  func (compo *PaginatorAttribute) SetCurPageStartIndex(value string) types.PaginatorAttribute {
    28  	compo.CurPageStartIndex = value
    29  	return compo
    30  }
    31  
    32  func (compo *PaginatorAttribute) SetCurPageEndIndex(value string) types.PaginatorAttribute {
    33  	compo.CurPageEndIndex = value
    34  	return compo
    35  }
    36  
    37  func (compo *PaginatorAttribute) SetTotal(value string) types.PaginatorAttribute {
    38  	compo.Total = value
    39  	return compo
    40  }
    41  
    42  func (compo *PaginatorAttribute) SetExtraInfo(value template.HTML) types.PaginatorAttribute {
    43  	compo.ExtraInfo = value
    44  	return compo
    45  }
    46  
    47  func (compo *PaginatorAttribute) SetEntriesInfo(value template.HTML) types.PaginatorAttribute {
    48  	compo.EntriesInfo = value
    49  	return compo
    50  }
    51  
    52  func (compo *PaginatorAttribute) SetPreviousClass(value string) types.PaginatorAttribute {
    53  	compo.PreviousClass = value
    54  	return compo
    55  }
    56  
    57  func (compo *PaginatorAttribute) SetPreviousUrl(value string) types.PaginatorAttribute {
    58  	compo.PreviousUrl = value
    59  	return compo
    60  }
    61  
    62  func (compo *PaginatorAttribute) SetPages(value []map[string]string) types.PaginatorAttribute {
    63  	compo.Pages = value
    64  	return compo
    65  }
    66  
    67  func (compo *PaginatorAttribute) SetPageSizeList(value []string) types.PaginatorAttribute {
    68  	compo.PageSizeList = value
    69  	return compo
    70  }
    71  
    72  func (compo *PaginatorAttribute) SetNextClass(value string) types.PaginatorAttribute {
    73  	compo.NextClass = value
    74  	return compo
    75  }
    76  
    77  func (compo *PaginatorAttribute) SetNextUrl(value string) types.PaginatorAttribute {
    78  	compo.NextUrl = value
    79  	return compo
    80  }
    81  
    82  func (compo *PaginatorAttribute) SetOption(value map[string]template.HTML) types.PaginatorAttribute {
    83  	compo.Option = value
    84  	return compo
    85  }
    86  
    87  func (compo *PaginatorAttribute) SetUrl(value string) types.PaginatorAttribute {
    88  	compo.Url = value
    89  	return compo
    90  }
    91  
    92  func (compo *PaginatorAttribute) GetContent() template.HTML {
    93  	return ComposeHtml(compo.TemplateList, compo.Separation, *compo, "paginator")
    94  }