Improve Group Statistics UI, a=chris

Chris Pollett [2020-06-21 18:Jun:st]
Improve Group Statistics UI, a=chris
Filename
src/locale/ar/configure.ini
src/locale/bn/configure.ini
src/locale/de/configure.ini
src/locale/en_US/configure.ini
src/locale/es/configure.ini
src/locale/fa/configure.ini
src/locale/fr_FR/configure.ini
src/locale/he/configure.ini
src/locale/hi/configure.ini
src/locale/id/configure.ini
src/locale/it/configure.ini
src/locale/ja/configure.ini
src/locale/kn/configure.ini
src/locale/ko/configure.ini
src/locale/nl/configure.ini
src/locale/pl/configure.ini
src/locale/pt/configure.ini
src/locale/ru/configure.ini
src/locale/te/configure.ini
src/locale/th/configure.ini
src/locale/tl/configure.ini
src/locale/tr/configure.ini
src/locale/vi_VN/configure.ini
src/locale/zh_CN/configure.ini
src/views/elements/ManagegroupsElement.php
src/views/elements/QuerystatsElement.php
src/views/elements/TrendingElement.php
diff --git a/src/locale/ar/configure.ini b/src/locale/ar/configure.ini
index 22cecf25c..282b2e055 100755
--- a/src/locale/ar/configure.ini
+++ b/src/locale/ar/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "آخر يوم"
 managegroups_element_last_month = "الشهر الماضي"
 managegroups_element_last_year = "العام الماضي"
 managegroups_element_all_time = "كل الوقت"
+managegroups_element_views = ""
 managegroups_element_no_activity = "أي نشاط"
 managegroups_element_search_joinable = "البحث Joinable المجموعات"
 managegroups_element_search_subscribed = "البحث المكتتب المجموعات"
diff --git a/src/locale/bn/configure.ini b/src/locale/bn/configure.ini
index 236905d19..4c9e41255 100755
--- a/src/locale/bn/configure.ini
+++ b/src/locale/bn/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "শেষ দিন"
 managegroups_element_last_month = "গত মাসে"
 managegroups_element_last_year = "গত বছর"
 managegroups_element_all_time = "সব সময়"
+managegroups_element_views = ""
 managegroups_element_no_activity = "কোন কার্যকলাপ"
 managegroups_element_search_joinable = "অনুসন্ধান Joinable গ্রুপ"
 managegroups_element_search_subscribed = "অনুসন্ধান সাবস্ক্রাইব গ্রুপ"
diff --git a/src/locale/de/configure.ini b/src/locale/de/configure.ini
index e7571d911..492b2c576 100755
--- a/src/locale/de/configure.ini
+++ b/src/locale/de/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Letzter Tag"
 managegroups_element_last_month = "Letzten Monat"
 managegroups_element_last_year = "Im Letzten Jahr"
 managegroups_element_all_time = "Alle Zeit"
+managegroups_element_views = ""
 managegroups_element_no_activity = "Keine Aktivität"
 managegroups_element_search_joinable = "Suche Je Gruppen"
 managegroups_element_search_subscribed = "Suche Abonnierten Gruppen"
diff --git a/src/locale/en_US/configure.ini b/src/locale/en_US/configure.ini
index 2e8dab5ce..12245780b 100644
--- a/src/locale/en_US/configure.ini
+++ b/src/locale/en_US/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Last Day"
 managegroups_element_last_month = "Last Month"
 managegroups_element_last_year = "Last Year"
 managegroups_element_all_time = "All Time"
+managegroups_element_views = "Views"
 managegroups_element_no_activity = "No Activity"
 managegroups_element_search_joinable = "Search Joinable Groups"
 managegroups_element_search_subscribed = "Search Subscribed Groups"
diff --git a/src/locale/es/configure.ini b/src/locale/es/configure.ini
index eebd05d6e..bb48716ad 100755
--- a/src/locale/es/configure.ini
+++ b/src/locale/es/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Último Día"
 managegroups_element_last_month = "El Mes Pasado"
 managegroups_element_last_year = "El Año Pasado"
 managegroups_element_all_time = "Todo El Tiempo"
+managegroups_element_views = ""
 managegroups_element_no_activity = "No Hay Actividad"
 managegroups_element_search_joinable = "Búsqueda Acoplable Grupos"
 managegroups_element_search_subscribed = "Búsqueda Suscrito Grupos"
diff --git a/src/locale/fa/configure.ini b/src/locale/fa/configure.ini
index 1c4f96773..9d6b92874 100755
--- a/src/locale/fa/configure.ini
+++ b/src/locale/fa/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "آخرین روز"
 managegroups_element_last_month = "ماه گذشته"
 managegroups_element_last_year = "در سال گذشته"
 managegroups_element_all_time = "تمام وقت"
+managegroups_element_views = ""
 managegroups_element_no_activity = "هیچ فعالیت"
 managegroups_element_search_joinable = "جستجو Joinable گروه"
 managegroups_element_search_subscribed = "جستجو مشترک گروه"
diff --git a/src/locale/fr_FR/configure.ini b/src/locale/fr_FR/configure.ini
index f34aa5473..7e8f3044e 100755
--- a/src/locale/fr_FR/configure.ini
+++ b/src/locale/fr_FR/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Dernier jour"
 managegroups_element_last_month = "Le mois dernier"
 managegroups_element_last_year = "L'année dernière"
 managegroups_element_all_time = "Tous les temps"
+managegroups_element_views = ""
 managegroups_element_no_activity = "Aucune activité"
 managegroups_element_search_joinable = "Recherche recrutables groupes"
 managegroups_element_search_subscribed = "Recherche groupes abonnés"
diff --git a/src/locale/he/configure.ini b/src/locale/he/configure.ini
index 5ee7fd02e..7cefd2503 100755
--- a/src/locale/he/configure.ini
+++ b/src/locale/he/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "היום האחרון"
 managegroups_element_last_month = "בחודש שעבר"
 managegroups_element_last_year = "בשנה שעברה"
 managegroups_element_all_time = "כל הזמן"
+managegroups_element_views = ""
 managegroups_element_no_activity = "אין פעילות"
 managegroups_element_search_joinable = "חיפוש Joinable קבוצות"
 managegroups_element_search_subscribed = "חיפוש המנויים קבוצות"
diff --git a/src/locale/hi/configure.ini b/src/locale/hi/configure.ini
index 9a7036e52..3e429c6c2 100755
--- a/src/locale/hi/configure.ini
+++ b/src/locale/hi/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "अंतिम दिन"
 managegroups_element_last_month = "पिछले महीने"
 managegroups_element_last_year = "पिछले वर्ष"
 managegroups_element_all_time = "सभी समय"
+managegroups_element_views = ""
 managegroups_element_no_activity = "कोई गतिविधि"
 managegroups_element_search_joinable = "खोज Joinable समूहों"
 managegroups_element_search_subscribed = "खोज सदस्यता समूहों"
diff --git a/src/locale/id/configure.ini b/src/locale/id/configure.ini
index 3873f0025..5a7028a40 100755
--- a/src/locale/id/configure.ini
+++ b/src/locale/id/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Hari Terakhir"
 managegroups_element_last_month = "Bulan Lalu"
 managegroups_element_last_year = "Tahun Lalu"
 managegroups_element_all_time = "Semua Waktu"
+managegroups_element_views = ""
 managegroups_element_no_activity = "Tidak Ada Kegiatan"
 managegroups_element_search_joinable = "Pencarian Joinable Kelompok"
 managegroups_element_search_subscribed = "Pencarian Berlangganan Grup"
diff --git a/src/locale/it/configure.ini b/src/locale/it/configure.ini
index 4978b7369..6b8724f5b 100755
--- a/src/locale/it/configure.ini
+++ b/src/locale/it/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Ultimo Giorno"
 managegroups_element_last_month = "Il Mese Scorso"
 managegroups_element_last_year = "L'Anno Scorso"
 managegroups_element_all_time = "Tutti I Tempi"
+managegroups_element_views = ""
 managegroups_element_no_activity = "Nessuna Attività"
 managegroups_element_search_joinable = "Ricerca Unibili, Gruppi"
 managegroups_element_search_subscribed = "Ricerca Sottoscritto Gruppi"
diff --git a/src/locale/ja/configure.ini b/src/locale/ja/configure.ini
index 712540835..e7cdce1ce 100755
--- a/src/locale/ja/configure.ini
+++ b/src/locale/ja/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "最終日"
 managegroups_element_last_month = "前月"
 managegroups_element_last_year = "昨年"
 managegroups_element_all_time = "すべての時間"
+managegroups_element_views = ""
 managegroups_element_no_activity = "活動なし"
 managegroups_element_search_joinable = "検索Joinableグ"
 managegroups_element_search_subscribed = "検索加入団体"
diff --git a/src/locale/kn/configure.ini b/src/locale/kn/configure.ini
index e08cd123d..d04cd51fc 100755
--- a/src/locale/kn/configure.ini
+++ b/src/locale/kn/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "ಕೊನೆಯ ದಿನ"
 managegroups_element_last_month = "ಕಳೆದ ತಿಂಗಳು"
 managegroups_element_last_year = "ಕಳೆದ ವರ್ಷ"
 managegroups_element_all_time = "ಎಲ್ಲಾ ಸಮಯ"
+managegroups_element_views = ""
 managegroups_element_no_activity = "ಯಾವುದೇ ಚಟುವಟಿಕೆ"
 managegroups_element_search_joinable = "ಹುಡುಕಾಟ Joinable ಗುಂಪುಗಳು"
 managegroups_element_search_subscribed = "ಹುಡುಕಾಟ ಚಂದಾದಾರರಾಗಿದ್ದಾರೆ ಗುಂಪುಗಳು"
diff --git a/src/locale/ko/configure.ini b/src/locale/ko/configure.ini
index eb1a595b1..70fa37e9a 100755
--- a/src/locale/ko/configure.ini
+++ b/src/locale/ko/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "마지막 날"
 managegroups_element_last_month = "지난 달"
 managegroups_element_last_year = "지난해"
 managegroups_element_all_time = "모든 시간"
+managegroups_element_views = ""
 managegroups_element_no_activity = "활동이 없"
 managegroups_element_search_joinable = "검색 결합 가능한 그룹"
 managegroups_element_search_subscribed = "검색 구독 그룹"
diff --git a/src/locale/nl/configure.ini b/src/locale/nl/configure.ini
index 41905c983..997f8ae0a 100644
--- a/src/locale/nl/configure.ini
+++ b/src/locale/nl/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Laatste Dag"
 managegroups_element_last_month = "Laatste Maand"
 managegroups_element_last_year = "Vorig Jaar"
 managegroups_element_all_time = "Alle Tijd"
+managegroups_element_views = ""
 managegroups_element_no_activity = "Geen Activiteit"
 managegroups_element_search_joinable = "Zoeken Joinable Groepen"
 managegroups_element_search_subscribed = "Zoeken Geplaatste Groepen"
diff --git a/src/locale/pl/configure.ini b/src/locale/pl/configure.ini
index a61767f80..e2e7f1fca 100755
--- a/src/locale/pl/configure.ini
+++ b/src/locale/pl/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Ostatni Dzień"
 managegroups_element_last_month = "W Zeszłym Miesiącu"
 managegroups_element_last_year = "W Zeszłym Roku"
 managegroups_element_all_time = "Cały Czas"
+managegroups_element_views = ""
 managegroups_element_no_activity = "Żadnej Aktywności"
 managegroups_element_search_joinable = "Powiązane Grupy Wyszukiwanie "
 managegroups_element_search_subscribed = "Wyszukaj Podpisane Grupy"
diff --git a/src/locale/pt/configure.ini b/src/locale/pt/configure.ini
index b98bad4d4..4f4c360c7 100755
--- a/src/locale/pt/configure.ini
+++ b/src/locale/pt/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Último Dia"
 managegroups_element_last_month = "Último Mês"
 managegroups_element_last_year = "No Ano Passado"
 managegroups_element_all_time = "Todos Os Tempos"
+managegroups_element_views = ""
 managegroups_element_no_activity = "Nenhuma Atividade"
 managegroups_element_search_joinable = "Pesquisa Acopláveis Grupos"
 managegroups_element_search_subscribed = "Pesquisa Subscrito Grupos"
diff --git a/src/locale/ru/configure.ini b/src/locale/ru/configure.ini
index ba8a708cf..680a8dbbb 100755
--- a/src/locale/ru/configure.ini
+++ b/src/locale/ru/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Последний День"
 managegroups_element_last_month = "В Прошлом Месяце"
 managegroups_element_last_year = "В Прошлом Году"
 managegroups_element_all_time = "Все Время"
+managegroups_element_views = ""
 managegroups_element_no_activity = "Никакой Активности"
 managegroups_element_search_joinable = "Присоединяемые Группы Поиск "
 managegroups_element_search_subscribed = "Поиск Подписанные Группы"
diff --git a/src/locale/te/configure.ini b/src/locale/te/configure.ini
index a7adda730..d85ae95d8 100644
--- a/src/locale/te/configure.ini
+++ b/src/locale/te/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "చివరి రోజు"
 managegroups_element_last_month = "గత నెల"
 managegroups_element_last_year = "గత సంవత్సరం"
 managegroups_element_all_time = "అన్ని సమయం"
+managegroups_element_views = ""
 managegroups_element_no_activity = "ఏ కార్యాచరణ"
 managegroups_element_search_joinable = "శోధన Joinable సమూహాలు"
 managegroups_element_search_subscribed = "శోధన సభ్యత్వాన్ని సమూహాలు"
diff --git a/src/locale/th/configure.ini b/src/locale/th/configure.ini
index be49f9e57..0a1466bee 100755
--- a/src/locale/th/configure.ini
+++ b/src/locale/th/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "วันสุดท้าย"
 managegroups_element_last_month = "เมื่อเดือนก่อน"
 managegroups_element_last_year = "เมื่อปีที่แล้ว"
 managegroups_element_all_time = "ทุกเวลา"
+managegroups_element_views = ""
 managegroups_element_no_activity = "ไม่มีกิจกรรม"
 managegroups_element_search_joinable = "การค้นหา Joinable กลุ่ม"
 managegroups_element_search_subscribed = "การค้นหากลุ่มข่าวบอกรับ"
diff --git a/src/locale/tl/configure.ini b/src/locale/tl/configure.ini
index be7b77447..2b3033aeb 100644
--- a/src/locale/tl/configure.ini
+++ b/src/locale/tl/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Huling Araw"
 managegroups_element_last_month = "Noong Nakaraang Buwan"
 managegroups_element_last_year = "Noong Nakaraang Taon"
 managegroups_element_all_time = "Sa Lahat Ng Oras"
+managegroups_element_views = ""
 managegroups_element_no_activity = "Walang Aktibidad"
 managegroups_element_search_joinable = "Maghanap Ng Joinable Grupo"
 managegroups_element_search_subscribed = "Maghanap Ng Mga Naka-Subscribe Na Mga Grupo"
diff --git a/src/locale/tr/configure.ini b/src/locale/tr/configure.ini
index 8b4ed4542..4226e2c0f 100755
--- a/src/locale/tr/configure.ini
+++ b/src/locale/tr/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Son Gün"
 managegroups_element_last_month = "Geçen Ay"
 managegroups_element_last_year = "Geçen Yıl"
 managegroups_element_all_time = "Her Zaman"
+managegroups_element_views = ""
 managegroups_element_no_activity = "Hiçbir Faaliyet"
 managegroups_element_search_joinable = "Arama Joinable Grupları"
 managegroups_element_search_subscribed = "Arama Abone Grupları"
diff --git a/src/locale/vi_VN/configure.ini b/src/locale/vi_VN/configure.ini
index e701d010a..ea8b69258 100755
--- a/src/locale/vi_VN/configure.ini
+++ b/src/locale/vi_VN/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "Ngày Cuối Cùng"
 managegroups_element_last_month = "Tháng Cuối Cùng"
 managegroups_element_last_year = "Năm Ngoái"
 managegroups_element_all_time = "Tất Cả Thời Gian"
+managegroups_element_views = ""
 managegroups_element_no_activity = "Không Có Hoạt Động"
 managegroups_element_search_joinable = "Tìm Kiếm Phun Nhóm"
 managegroups_element_search_subscribed = "Tìm Kiếm Đăng Ký Nhóm"
diff --git a/src/locale/zh_CN/configure.ini b/src/locale/zh_CN/configure.ini
index cbfb5ad12..81485084d 100755
--- a/src/locale/zh_CN/configure.ini
+++ b/src/locale/zh_CN/configure.ini
@@ -1063,6 +1063,7 @@ managegroups_element_last_day = "最后一天"
 managegroups_element_last_month = "上个月"
 managegroups_element_last_year = "去年"
 managegroups_element_all_time = "所有时间"
+managegroups_element_views = ""
 managegroups_element_no_activity = "没有任何活动,"
 managegroups_element_search_joinable = "搜索可连接组"
 managegroups_element_search_subscribed = "搜索组预订了"
diff --git a/src/views/elements/ManagegroupsElement.php b/src/views/elements/ManagegroupsElement.php
index e6e43406f..1666c038b 100755
--- a/src/views/elements/ManagegroupsElement.php
+++ b/src/views/elements/ManagegroupsElement.php
@@ -940,62 +940,89 @@ class ManagegroupsElement extends Element
            C\ONE_YEAR => tl('managegroups_element_last_year'),
            C\FOREVER => tl('managegroups_element_all_time'),
         ];
-        foreach ($stat_types as $field => $heading) {
-            ?><h3><?=$heading ?></h3><?php
+        foreach ($stat_types as $field => $heading) {?>
+            <h3><?=$heading ?></h3>
+            <div class="trending-container">
+            <?php
+            if ($field == C\GROUP_IMPRESSION) {?>
+                <div class="trending-float">
+                <table class="trending-table">
+                <?php
+            }
             foreach ($time_periods as  $time_period => $period_heading) {
-                if ($field == C\GROUP_IMPRESSION) {
+                if ($field == C\GROUP_IMPRESSION) { ?>
+                    <tr><th><?=$period_heading?></th><?php
                     if (empty($data['STATISTICS'][$field][
-                        $time_period][0]['NUM_VIEWS'])) {
-                        e("<p><b>$period_heading</b>: ".
-                            tl('managegroups_element_no_activity').
-                            "</p>");
+                        $time_period][0]['NUM_VIEWS'])) {?>
+                        <td><?=
+                            tl('managegroups_element_no_activity')
+                        ?></td><?php
                     } else {
                         if ($time_period == C\ONE_HOUR ||
-                           $time_period == C\FOREVER ||
-                           C\DIFFERENTIAL_PRIVACY) {
-                            e("<p><b>$period_heading</b>: ".
-                                $data['STATISTICS'][$field]
-                                [$time_period][0]['NUM_VIEWS'].
-                                "</p>");
-                        } else {
-                            e("<p><b>$period_heading</b>:
-                                <a href='" . $graph_stats_url .
-                                "&amp;impression=" . $field .
-                                "&amp;time=" . $time_period .
-                                "&amp;item=" . $data['STATISTICS'][$field]
-                                [$time_period][0]['ID']."'> ".
-                                $data['STATISTICS'][$field]
-                                [$time_period][0]['NUM_VIEWS'].
-                                "</a></p>");
+                            $time_period == C\FOREVER ||
+                            C\DIFFERENTIAL_PRIVACY) { ?>
+                            <td><?=
+                            $data['STATISTICS'][$field]
+                            [$time_period][0]['NUM_VIEWS']?>
+                            </td><?php
+                        } else {?>
+                            <td><a href='<?=$graph_stats_url .
+                            "&amp;impression=" . $field .
+                            "&amp;time=" . $time_period .
+                            "&amp;item=" . $data['STATISTICS'][$field]
+                            [$time_period][0]['ID']?>'><?=
+                            $data['STATISTICS'][$field]
+                            [$time_period][0]['NUM_VIEWS']?>
+                            </a></td><?php
                         }
-                    }
-                } else {
+                    }?>
+                    </tr><?php
+                } else {?>
+                    <div class="trending-float">
+                    <table class="trending-table">
+                    <tr class="trending-tr">
+                    <th class="trending-th" ><?=$period_heading ?></th>
+                    <th class="trend-score trending-th"><?=
+                        tl('managegroups_element_views');
+                    ?></th></tr><?php
                     if (!empty($data['STATISTICS'][$field][
                         $time_period])) {
-                        ?><h4><?=$period_heading ?>:</h4><?php
+                        $background = "";
                         foreach ($data['STATISTICS'][$field][
                             $time_period] as $item_name => $item_data) {
+                            $background = empty($background) ?
+                                " class='back-gray' " : "";?>
+                            <tr <?=$background ?>>
+                            <td class="trending-td"><?=$item_name
+                            ?></td><td class="trend-score trending-td"><?php
                             if ($time_period == C\ONE_HOUR ||
                                 $time_period == C\FOREVER ||
                                 C\DIFFERENTIAL_PRIVACY) {
-                                e("<p>$item_name: ". $item_data[0]['NUM_VIEWS'].
-                                "</p>");
-                            } else {
-                                e("<p>$item_name: <a href='" . $graph_stats_url.
+                                e($item_data[0]['NUM_VIEWS']);
+                            } else {?>
+                                <a href='<?=$graph_stats_url.
                                     "&amp;impression=".$field.
                                     "&amp;time=".$time_period.
-                                    "&amp;item=".$item_data[0]['ID']."'> ".
-                                    $item_data[0]['NUM_VIEWS'].
-                                    "</a></p>");
-                            }
+                                    "&amp;item=".$item_data[0]['ID']?>'><?=
+                                    $item_data[0]['NUM_VIEWS'] ?>
+                                    </a><?php
+                            }?></td></tr><?php
                         }
-                    } else {
-                        e("<p><b>$period_heading</b>: ".
-                            tl('managegroups_element_no_activity').
-                            "</p>");
-                    }
+                    } else {?>
+                        <tr class='back-gray'><td colspan="2"><?=
+                            tl('managegroups_element_no_activity') ?>
+                        </td>
+                        </tr><?php
+                    }?>
+                    </table>
+                    </div><?php
                 }
             }
+            if ($field == C\GROUP_IMPRESSION) {?>
+                </table>
+                </div><?php
+            }?>
+            </div><?php
         }
     }
     /**
diff --git a/src/views/elements/QuerystatsElement.php b/src/views/elements/QuerystatsElement.php
index ea288a271..133afa82d 100644
--- a/src/views/elements/QuerystatsElement.php
+++ b/src/views/elements/QuerystatsElement.php
@@ -90,8 +90,7 @@ class QuerystatsElement extends Element
                 <th class="trending-th" ><?=$period_heading ?></th>
                 <th class="trend-score trending-th"><?=
                     tl('querystats_element_views');
-                ?></th>
-                <?php
+                ?></th></tr><?php
             if (!empty($data['STATISTICS'][
                 $time_period])) {
                 $background = "";
@@ -117,8 +116,8 @@ class QuerystatsElement extends Element
                 </td>
                 </tr><?php
             }?>
-        </table>
-        </div><?php
+            </table>
+            </div><?php
         }
         ?>
         </div>
diff --git a/src/views/elements/TrendingElement.php b/src/views/elements/TrendingElement.php
index efaaf9f7e..0ffac34be 100644
--- a/src/views/elements/TrendingElement.php
+++ b/src/views/elements/TrendingElement.php
@@ -113,8 +113,7 @@ class TrendingElement extends Element
                         <th class="trending-th"><?=
                             tl('trending_element_term')?></th>
                         <th class="trend-score trending-th"><?=
-                            tl('trending_element_score'); ?></th>
-                        </tr><?php
+                            tl('trending_element_score'); ?></th></tr><?php
                     $background = "";
                     foreach($occurrences as $item) {
                         $background = empty($background) ?
ViewGit