Lines 109-121
sub pagination_bar {
Link Here
|
109 |
|
109 |
|
110 |
# navigation bar useful only if more than one page to display ! |
110 |
# navigation bar useful only if more than one page to display ! |
111 |
if ( $nb_pages > 1 ) { |
111 |
if ( $nb_pages > 1 ) { |
|
|
112 |
$pagination_bar = '<ul class="pagination">'; |
112 |
|
113 |
|
113 |
# link to first page? |
114 |
# link to first page? |
114 |
if ( $current_page > 1 ) { |
115 |
if ( $current_page > 1 ) { |
115 |
$pagination_bar .= |
116 |
$pagination_bar .= |
116 |
"\n" . ' ' . '<a href="' . $url . '1' . $url_suffix . '"rel="start">' . '<<' . '</a>'; |
117 |
"\n" |
117 |
} else { |
118 |
. '' |
118 |
$pagination_bar .= "\n" . ' <span class="inactive"><<</span>'; |
119 |
. '<li class="page-item"><a class="page-link output first" href="' |
|
|
120 |
. $url . '1' |
121 |
. $url_suffix |
122 |
. '"rel="start">' |
123 |
. '<i class="fa fa-fw fa-angle-double-left"></i> First' |
124 |
. '</a></li>'; |
119 |
} |
125 |
} |
120 |
|
126 |
|
121 |
# link on previous page ? |
127 |
# link on previous page ? |
Lines 123-131
sub pagination_bar {
Link Here
|
123 |
my $previous = $current_page - 1; |
129 |
my $previous = $current_page - 1; |
124 |
|
130 |
|
125 |
$pagination_bar .= |
131 |
$pagination_bar .= |
126 |
"\n" . ' ' . '<a href="' . $url . $previous . $url_suffix . '" rel="prev">' . '<' . '</a>'; |
132 |
"\n" |
127 |
} else { |
133 |
. '' |
128 |
$pagination_bar .= "\n" . ' <span class="inactive"><</span>'; |
134 |
. '<li class="page-item"><a class="page-link output previous" href="' |
|
|
135 |
. $url |
136 |
. $previous |
137 |
. $url_suffix |
138 |
. '" rel="prev">' |
139 |
. '<i class="fa fa-fw fa-angle-left"></i> Previous' |
140 |
. '</a></li>'; |
129 |
} |
141 |
} |
130 |
|
142 |
|
131 |
my $min_to_display = $current_page - $pages_around; |
143 |
my $min_to_display = $current_page - $pages_around; |
Lines 143-162
sub pagination_bar {
Link Here
|
143 |
if ( defined $last_displayed_page |
155 |
if ( defined $last_displayed_page |
144 |
and $last_displayed_page != $page_number - 1 ) |
156 |
and $last_displayed_page != $page_number - 1 ) |
145 |
{ |
157 |
{ |
146 |
$pagination_bar .= "\n" . ' <span class="inactive">...</span>'; |
158 |
$pagination_bar .= "\n" . '<li class="page-item disabled"><a class="page-link">...</a></li>'; |
147 |
} |
159 |
} |
148 |
|
160 |
|
149 |
if ( $page_number == $current_page ) { |
161 |
if ( $page_number == $current_page ) { |
150 |
$pagination_bar .= "\n" . ' ' . '<span class="currentPage">' . $page_number . '</span>'; |
162 |
$pagination_bar .= |
|
|
163 |
"\n" |
164 |
. '' |
165 |
. '<li class="page-item active" aria-current="page"><a class="page-link" href="#">' |
166 |
. $page_number |
167 |
. '</a></li>'; |
151 |
} else { |
168 |
} else { |
152 |
$pagination_bar .= |
169 |
$pagination_bar .= |
153 |
"\n" |
170 |
"\n" |
154 |
. ' ' |
171 |
. '' |
155 |
. '<a href="' |
172 |
. '<li class="page-item"><a class="page-link" href="' |
156 |
. $url |
173 |
. $url |
157 |
. $page_number |
174 |
. $page_number |
158 |
. $url_suffix . '">' |
175 |
. $url_suffix . '">' |
159 |
. $page_number . '</a>'; |
176 |
. $page_number |
|
|
177 |
. '</a></li>'; |
160 |
} |
178 |
} |
161 |
$last_displayed_page = $page_number; |
179 |
$last_displayed_page = $page_number; |
162 |
} |
180 |
} |
Lines 166-184
sub pagination_bar {
Link Here
|
166 |
if ( $current_page < $nb_pages ) { |
184 |
if ( $current_page < $nb_pages ) { |
167 |
my $next = $current_page + 1; |
185 |
my $next = $current_page + 1; |
168 |
|
186 |
|
169 |
$pagination_bar .= |
187 |
$pagination_bar .= "\n" |
170 |
"\n" . ' <a href="' . $url . $next . $url_suffix . '" rel="next">' . '>' . '</a>'; |
188 |
. '<li class="page-item"><a class="page-link output next" href="' |
171 |
} else { |
189 |
. $url |
172 |
$pagination_bar .= "\n" . ' <span class="inactive">></span>'; |
190 |
. $next |
|
|
191 |
. $url_suffix |
192 |
. '" rel="next">' |
193 |
. 'Next <i class="fa fa-fw fa-angle-right"></i>' |
194 |
. '</a></li>'; |
173 |
} |
195 |
} |
174 |
|
196 |
|
175 |
# link to last page? |
197 |
# link to last page? |
176 |
if ( $current_page != $nb_pages ) { |
198 |
if ( $current_page != $nb_pages ) { |
177 |
$pagination_bar .= |
199 |
$pagination_bar .= "\n" |
178 |
"\n" . ' <a href="' . $url . $nb_pages . $url_suffix . '" rel="last">' . '>>' . '</a>'; |
200 |
. '<li class="page-item"><a class="page-link output last" href="' |
179 |
} else { |
201 |
. $url |
180 |
$pagination_bar .= "\n" . ' <span class="inactive">>></span>'; |
202 |
. $nb_pages |
|
|
203 |
. $url_suffix |
204 |
. '" rel="last">' |
205 |
. 'Last <i class="fa fa-fw fa-angle-double-right"></i>' |
206 |
. '</a></li>'; |
181 |
} |
207 |
} |
|
|
208 |
|
209 |
$pagination_bar .= "\n" . '</ul>'; |
182 |
} |
210 |
} |
183 |
|
211 |
|
184 |
return $pagination_bar; |
212 |
return $pagination_bar; |