From b2b8c9a9486bda1f7e60a08378e624d58ae2f7d2 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 24 Jan 2015 16:43:51 +0100 Subject: [PATCH] [ticket/418] Correctly assign pagination in compact news and announcements The repsonsiveness of those two blocks has also been improved. B3P-418 --- modules/announcements.php | 2 +- modules/news.php | 5 +++-- .../modules/announcements_center_compact.html | 15 ++++++++++++++- .../portal/modules/news_compact_center.html | 9 +++++---- styles/prosilver/theme/portal_responsive.css | 3 ++- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/modules/announcements.php b/modules/announcements.php index 88399a29..aaab4541 100644 --- a/modules/announcements.php +++ b/modules/announcements.php @@ -350,7 +350,7 @@ class announcements extends module_base 'S_HAS_ATTACHMENTS' => (!empty($fetch_news[$i]['attachments'])) ? true : false, )); - $this->pagination->generate_template_pagination($view_topic_url, 'announcements.center_row.pagination', 'ap_' . $module_id, $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1, true, true); + $this->pagination->generate_template_pagination($view_topic_url, 'announcements.center_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1, true, true); if(!empty($fetch_news[$i]['attachments'])) { diff --git a/modules/news.php b/modules/news.php index 3d31e9e5..e3e430e3 100644 --- a/modules/news.php +++ b/modules/news.php @@ -309,8 +309,6 @@ class news extends module_base // Grab icons $icons = $this->cache->obtain_icons(); - $this->pagination->generate_template_pagination($view_topic_url, 'pagination', 'np_' . $module_id, $fetch_news[$i]['topic_replies'], $this->config['board3_number_of_news_' . $module_id], $start); - $this->template->assign_block_vars('news.news_row', array( 'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment'] && $this->config['allow_attachments']) ? $this->user->img('icon_topic_attach', $this->user->lang['TOTAL_ATTACHMENTS']) : '', 'FORUM_NAME' => ($forum_id) ? $fetch_news[$i]['forum_name'] : '', @@ -348,6 +346,9 @@ class news extends module_base 'S_HAS_ATTACHMENTS' => (!empty($fetch_news[$i]['attachments'])) ? true : false, )); + // Assign pagination + $this->pagination->generate_template_pagination($view_topic_url, 'news.news_row.pagination', 'start', $fetch_news[$i]['topic_replies'] + 1, $this->config['posts_per_page'], 1); + if(!empty($fetch_news[$i]['attachments'])) { foreach ($fetch_news[$i]['attachments'] as $attachment) diff --git a/styles/prosilver/template/portal/modules/announcements_center_compact.html b/styles/prosilver/template/portal/modules/announcements_center_compact.html index 24a2d9b8..90136c8d 100644 --- a/styles/prosilver/template/portal/modules/announcements_center_compact.html +++ b/styles/prosilver/template/portal/modules/announcements_center_compact.html @@ -32,7 +32,20 @@ {L_VIEW_TOPIC_POLL} {announcements.center_row.TITLE} {L_VIEW_UNREAD_POST} - {announcements.center_row.PAGINATION} + + +
{L_POSTED} {L_POST_BY_AUTHOR} {announcements.center_row.POSTER_FULL} » {announcements.center_row.TIME}
{L_FORUM}{L_COLON} {announcements.center_row.FORUM_NAME} diff --git a/styles/prosilver/template/portal/modules/news_compact_center.html b/styles/prosilver/template/portal/modules/news_compact_center.html index c36a65fb..3af2d504 100644 --- a/styles/prosilver/template/portal/modules/news_compact_center.html +++ b/styles/prosilver/template/portal/modules/news_compact_center.html @@ -30,16 +30,17 @@
{news.news_row.ATTACH_ICON_IMG} {news.news_row.TITLE}{L_VIEW_UNREAD_POST} - + diff --git a/styles/prosilver/theme/portal_responsive.css b/styles/prosilver/theme/portal_responsive.css index b12f0b3f..6520a2c8 100644 --- a/styles/prosilver/theme/portal_responsive.css +++ b/styles/prosilver/theme/portal_responsive.css @@ -8,7 +8,7 @@ } dt#a { width: 125% !important; } - .responsive-portal-announcements dt { width: 125% !important; } + .responsive-portal-announcements dt { width: 130% !important; } dd.responsive-portal-news { display: none !important; } .responsive-portal-news dd.posts, .responsive-portal-news dd.views { @@ -32,6 +32,7 @@ padding-left: 0 !important; } .responsive-portal-news dt { width: 100% !important; } + .responsive-portal-announcements dt { width: 100% !important; } } @media only screen and (max-width: 700px), only screen and (max-device-width: 700px)