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