From 38b0d407481f3be5e132e395d466c94a78156ab4 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Sat, 7 Jan 2017 00:05:17 +0100 Subject: [PATCH] Timeline date range and prev/next buttons in title bar The original layout with the yellow background for the timeline date range did not look good. The new layout is similar to the other My View boxes', with the date range as well as the Prev/Next buttons moved to the widget's title bar; this also saves screen real estate. Unlike other boxes' 'View Issues' button, the Prev/Next buttons are not hidden on xs width. This also removes 2 seemingly unnecessary divs, previously under widget body. Fixes #22031 --- core/timeline_inc.php | 57 ++++++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/core/timeline_inc.php b/core/timeline_inc.php index 46e18b3..107fd24 100644 --- a/core/timeline_inc.php +++ b/core/timeline_inc.php @@ -37,41 +37,46 @@ $t_block_icon = $t_collapse_block ? 'fa-chevron-down' : 'fa-chevron-up';

- + ' + . date( $t_short_date_format, $t_start_time ) + . ' .. ' + . date( $t_short_date_format, $t_end_time ) + . ' '; + ?>

-
- -
-
-
+
+
' . date( $t_short_date_format, $t_start_time ) . ' '; - echo ' .. '; - echo ' ' . date( $t_short_date_format, $t_end_time ) . ' '; - echo '  '; - - echo '
'; - echo ' ' . lang_get( 'prev' ) . ''; + # Display Prev/Next buttons + print_small_button( + 'my_view_page.php?days=' . ( $f_days + 7 ), + lang_get( 'prev' ) + ); - $t_next_days = ( $f_days - 7 ) > 0 ? $f_days - 7 : 0; - - if( $t_next_days != $f_days ) { - echo ' ' . lang_get( 'next' ) . ''; - } - - echo '
'; - - echo '
'; + $t_next_days = max( $f_days - 7, 0 ); + if( $t_next_days != $f_days ) { + print_small_button( + 'my_view_page.php?days=' . $t_next_days, + lang_get( 'next' ) + ); + } + ?> +
+
+
+
+ MAX_EVENTS ) { $t_events = array_slice( $t_events, 0, MAX_EVENTS ); timeline_print_events( $t_events ); -- 1.9.1