Revision 43bcf835
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/Template/Plugin/L.pm | ||
---|---|---|
468 | 468 |
} |
469 | 469 |
|
470 | 470 |
sub paginate_controls { |
471 |
my ($self) = @_;
|
|
471 |
my ($self, %params) = _hashify(1, @_);
|
|
472 | 472 |
|
473 | 473 |
my $controller = $self->{CONTEXT}->stash->get('SELF'); |
474 | 474 |
my $paginate_spec = $controller->get_paginate_spec; |
... | ... | |
483 | 483 |
|
484 | 484 |
return $controller->get_callback(%url_params); |
485 | 485 |
}, |
486 |
%params, |
|
486 | 487 |
); |
487 | 488 |
|
488 | 489 |
return SL::Presenter->get->render('common/paginate', %template_params); |
templates/webpages/common/paginate.html | ||
---|---|---|
8 | 8 |
[%- END %] |
9 | 9 |
[%- IF pages.max > 1 %] |
10 | 10 |
<div class='paginate'> |
11 |
[%- IF pages.page > 1 %]<a class='paginate-prev' href='[% build_url(page=pages.page - 1) %]'>« [% 'prev' | $T8 %]</a> [% ELSE %]<b>«</b> [% END %] |
|
11 |
[%- IF pages.page > 1 %]<a class='paginate-link paginate-prev' href='[% build_url(page=pages.page - 1) %]'>« [% 'prev' | $T8 %]</a> [% ELSE %]<b>«</b> [% END %]
|
|
12 | 12 |
[%- FOR p = pages.common %] |
13 | 13 |
[%- NEXT UNLESS p.visible %] |
14 |
[%- IF p.active %]<a class='paginate-page' href="[% build_url(page=p.page) %]">[% p.page %]</a> [% ELSE %]<b>[% p.page %]</b> [%- END %] |
|
14 |
[%- IF p.active %]<a class='paginate-link paginate-page' href="[% build_url(page=p.page) %]">[% p.page %]</a> [% ELSE %]<b>[% p.page %]</b> [%- END %]
|
|
15 | 15 |
[%- END %] |
16 |
[%- IF pages.page < pages.max %]<a class='paginate-next' href='[% build_url(page=pages.page + 1) %]'>[% 'next' | $T8 %] »</a>[% ELSE %]<b>»</b>[%- END %] |
|
16 |
[%- 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 %]
|
|
17 | 17 |
</div> |
18 | 18 |
[%- END %] |
19 |
[%- IF target %] |
|
20 |
<script type='text/javascript'> |
|
21 |
var target = '[% target %]'; |
|
22 |
$(function(){ |
|
23 |
$('.paginate-link').click(function(event){ |
|
24 |
event.preventDefault(); |
|
25 |
var e = this; |
|
26 |
var url = $(this).attr('href') |
|
27 |
$.ajax({ |
|
28 |
url: url, |
|
29 |
success: function(data){ |
|
30 |
$(target).html(data) |
|
31 |
}, |
|
32 |
}) |
|
33 |
}); |
|
34 |
}); |
|
35 |
</script> |
|
36 |
[%- END %] |
Auch abrufbar als: Unified diff
Möglichkeit die Paginating Links auf ein DOM Element zu senden