diff --git a/_layouts/community.html b/_layouts/community.html
index e1d03b301be6e6..b79108c6014435 100644
--- a/_layouts/community.html
+++ b/_layouts/community.html
@@ -38,7 +38,7 @@
{{ topic.title }} — Community Home
@@ -118,6 +118,9 @@
Cumulative Data as CSV
padding: 0.5em;
background: var(--stat-box-color);
}
+.col-md-8 .row .col-md-12 h3:first-child {
+ margin-top: 0;
+}
body[data-brightness="dark"] .stat-box {
background: none;
@@ -250,32 +253,32 @@ Cumulative Data as CSV
datasets: [
{
data: totals.news,
- label: 'news',
+ label: 'News',
borderColor: getStyleDarker("news", true, true),
backgroundColor: getStyleDarker("news", true, false),
backgroundColor: getStyleDarker("news", false),
},
{
data: totals.events,
- label: 'events',
+ label: 'Events',
borderColor: getStyleDarker("events", true),
backgroundColor: getStyleDarker("events", false),
},
{
data: totals['learning-pathways'],
- label: 'learning-pathways',
+ label: 'Learning Pathways',
borderColor: getStyleDarker("learning-pathways", true),
backgroundColor: getStyleDarker("learning-pathways", false),
},
{
data: totals.recordings,
- label: 'recordings',
+ label: 'Recordings',
borderColor: getStyleDarker("recordings", true),
backgroundColor: getStyleDarker("recordings", false),
},
{
data: totals.faqs,
- label: 'faqs',
+ label: 'Faqs',
borderColor: getStyleDarker("faqs", true),
backgroundColor: getStyleDarker("faqs", false),
},
diff --git a/_plugins/jekyll-topic-filter.rb b/_plugins/jekyll-topic-filter.rb
index b588d4d2cdd54e..04565bdb70bcc1 100644
--- a/_plugins/jekyll-topic-filter.rb
+++ b/_plugins/jekyll-topic-filter.rb
@@ -1552,10 +1552,12 @@ def list_materials_flat(site, topic_name)
def list_topic_materials_yearly(site, topic_name)
flat_mats = list_materials_flat(site, topic_name)
years = flat_mats.map{|x| x['pub_date'].year} + flat_mats.map{|x| x['mod_date'].year}
- topic_contribs = identify_contributors({'topic' => {'materials' => flat_mats}}, site)
+ # doesn't use identify_contributors because that excludes grants/orgs.
+ topic_contribs = flat_mats.map{|x| x['contributions'] || {"all" => x['contributors']}}.map{|x| x.values.flatten}.flatten.uniq.sort
+ pfo = ['contributors', 'grants', 'organisations']
Gtn::TopicFilter.all_date_sorted_resources(site)
- .select{|x| (x[3].include? topic_name) || (x[1] == 'contributors' && topic_contribs.include?(x[2].title[1..]))}
+ .select{|x| (x[3].include? topic_name) || (pfo.include?(x[1]) && topic_contribs.include?(x[2].title[1..]))}
.group_by{|x| x[0].year}
.map{|k, v| [k, v.group_by{|z| z[1]}]}
.to_h
@@ -1564,10 +1566,12 @@ def list_topic_materials_yearly(site, topic_name)
def count_topic_materials_yearly(site, topic_name)
flat_mats = list_materials_flat(site, topic_name)
years = flat_mats.map{|x| x['pub_date'].year} + flat_mats.map{|x| x['mod_date'].year}
- topic_contribs = identify_contributors({'topic' => {'materials' => flat_mats}}, site)
+ # doesn't use identify_contributors because that excludes grants/orgs.
+ topic_contribs = flat_mats.map{|x| x['contributions'] || {"all" => x['contributors']}}.map{|x| x.values.flatten}.flatten.uniq.sort
+ pfo = ['contributors', 'grants', 'organisations']
r = Gtn::TopicFilter.all_date_sorted_resources(site)
- .select{|x| (x[3].include? topic_name) || (x[1] == 'contributors' && topic_contribs.include?(x[2].title[1..]))}
+ .select{|x| (x[3].include? topic_name) || (pfo.include?(x[1]) && topic_contribs.include?(x[2].title[1..]))}
.map{|x| [x[0].year, x[1]]} # Only need year + type
.group_by{|x| x[1]} # Group by type.
.map{|k, v| [k, v.map{|vv| vv[0]}.tally]}