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