From 0e32f27e70668fb568724da9e5c0267ad03e9e74 Mon Sep 17 00:00:00 2001 From: Shawn Kwang Date: Tue, 21 Mar 2017 16:05:11 -0500 Subject: [PATCH 1/2] Drupal: Fixed bug where font-awesome icons were not appearing correctly on some translated pages. Changed template for team forum topic to use different variables. Now template uses $results, not topics/rows variable. The former has numerical values, which won't be translated into another language. https://dev.gridrepublic.org/browse/DBOINCP-360 --- ...iew-table--boinc-team-forum-topics.tpl.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drupal/sites/default/boinc/themes/boinc/templates/views-view-table--boinc-team-forum-topics.tpl.php b/drupal/sites/default/boinc/themes/boinc/templates/views-view-table--boinc-team-forum-topics.tpl.php index 7ef3abd41a..093a5c4bf2 100644 --- a/drupal/sites/default/boinc/themes/boinc/templates/views-view-table--boinc-team-forum-topics.tpl.php +++ b/drupal/sites/default/boinc/themes/boinc/templates/views-view-table--boinc-team-forum-topics.tpl.php @@ -27,7 +27,6 @@ $topic_count = count($topics); $topic_index = 0; $first_non_sticky = FALSE; - ?> @@ -42,7 +41,7 @@ - + $topic): ?> uid); @@ -51,29 +50,29 @@ if ($topic_index == 1) { $row_class .= ' first'; } - if ($topic->sticky=="True") { + if ($result[$id]->node_boincteam_forum_node_sticky) { $row_class .= ' sticky'; } - elseif (!$first_non_sticky AND !($topic->sticky=="True")) { + elseif (!$first_non_sticky AND !($result[$id]->node_boincteam_forum_node_sticky)) { $row_class .= ' first-non-sticky'; $first_non_sticky = TRUE; } if ($topic_index == $topic_count) { $row_class .= ' last'; } - if ($topic->timestamp=="new" OR $topic->new_comments) { + if ($topic->timestamp OR $topic->new_comments) { $row_class .= ' updated'; } ?>
icon; ?> - sticky=="True"): ?> + node_boincteam_forum_node_sticky): ?> - comment != "Read/Write"): ?> + node_boincteam_forum_node_comment != COMMENT_NODE_READ_WRITE): ?> - timestamp=="new"): ?> + timestamp): ?> new_comments): ?> @@ -87,8 +86,8 @@ new_comments): ?> - ]+href=([\'"])(.+?)\1[^>]*>/i', $topic->new_comments, $result); ?> - + ]+href=([\'"])(.+?)\1[^>]*>/i', $topic->new_comments, $myresult); ?> + comment_count; ?> new_comments): ?> From 64f4a3954c74aaeacf3d34bd19c5b697ab65e8aa Mon Sep 17 00:00:00 2001 From: Shawn Kwang Date: Wed, 22 Mar 2017 14:57:58 -0500 Subject: [PATCH 2/2] Drupal: Added !empty() function to check if timestamp does/does not exist. --- .../views-view-table--boinc-team-forum-topics.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drupal/sites/default/boinc/themes/boinc/templates/views-view-table--boinc-team-forum-topics.tpl.php b/drupal/sites/default/boinc/themes/boinc/templates/views-view-table--boinc-team-forum-topics.tpl.php index 093a5c4bf2..e81430f300 100644 --- a/drupal/sites/default/boinc/themes/boinc/templates/views-view-table--boinc-team-forum-topics.tpl.php +++ b/drupal/sites/default/boinc/themes/boinc/templates/views-view-table--boinc-team-forum-topics.tpl.php @@ -60,7 +60,7 @@ if ($topic_index == $topic_count) { $row_class .= ' last'; } - if ($topic->timestamp OR $topic->new_comments) { + if (!empty($topic->timestamp) OR $topic->new_comments) { $row_class .= ' updated'; } ?> @@ -72,7 +72,7 @@ node_boincteam_forum_node_comment != COMMENT_NODE_READ_WRITE): ?> - timestamp): ?> + timestamp)): ?> new_comments): ?>