}
sub paginate_controls {
- my ($self) = @_;
+ my ($self, %params) = _hashify(1, @_);
my $controller = $self->{CONTEXT}->stash->get('SELF');
my $paginate_spec = $controller->get_paginate_spec;
return $controller->get_callback(%url_params);
},
+ %params,
);
return SL::Presenter->get->render('common/paginate', %template_params);
[%- END %]
[%- IF pages.max > 1 %]
<div class='paginate'>
-[%- IF pages.page > 1 %]<a class='paginate-prev' href='[% build_url(page=pages.page - 1) %]'>« [% 'prev' | $T8 %]</a> [% ELSE %]<b>«</b> [% END %]
+[%- IF pages.page > 1 %]<a class='paginate-link paginate-prev' href='[% build_url(page=pages.page - 1) %]'>« [% 'prev' | $T8 %]</a> [% ELSE %]<b>«</b> [% END %]
[%- FOR p = pages.common %]
[%- NEXT UNLESS p.visible %]
- [%- IF p.active %]<a class='paginate-page' href="[% build_url(page=p.page) %]">[% p.page %]</a> [% ELSE %]<b>[% p.page %]</b> [%- END %]
+ [%- IF p.active %]<a class='paginate-link paginate-page' href="[% build_url(page=p.page) %]">[% p.page %]</a> [% ELSE %]<b>[% p.page %]</b> [%- END %]
[%- END %]
-[%- IF pages.page < pages.max %]<a class='paginate-next' href='[% build_url(page=pages.page + 1) %]'>[% 'next' | $T8 %] »</a>[% ELSE %]<b>»</b>[%- END %]
+[%- IF pages.page < pages.max %]<a class='paginate-link paginate-next' href='[% build_url(page=pages.page + 1) %]'>[% 'next' | $T8 %] »</a>[% ELSE %]<b>»</b>[%- END %]
</div>
[%- END %]
+[%- IF target %]
+<script type='text/javascript'>
+ var target = '[% target %]';
+ $(function(){
+ $('.paginate-link').click(function(event){
+ event.preventDefault();
+ var e = this;
+ var url = $(this).attr('href')
+ $.ajax({
+ url: url,
+ success: function(data){
+ $(target).html(data)
+ },
+ })
+ });
+ });
+</script>
+[%- END %]