Correct the ISO country codes of UK and Mongolia and add a world map

with countries colored in according to the number of usergroups there
using the Google Chart API.
This commit is contained in:
Murray Stokely 2008-04-20 22:49:26 +00:00
parent 9583f1582f
commit 1fa321d5ba
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=31882
3 changed files with 45 additions and 5 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE xsl:stylesheet PUBLIC "-//FreeBSD//DTD FreeBSD XSLT 1.0 DTD//EN"
"http://www.FreeBSD.org/XML/www/share/sgml/xslt10-freebsd.dtd">
<!-- $FreeBSD: www/share/sgml/libcommon.xsl,v 1.18 2008/04/20 22:14:54 murray Exp $ -->
<!-- $FreeBSD: www/share/sgml/libcommon.xsl,v 1.19 2008/04/20 22:22:34 murray Exp $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
@ -29,6 +29,7 @@
<!--
template name used in
html-usergroups-map templates.usergroups.xsl
html-usergroups-list-regions templates.usergroups.xsl
html-usergroups-list-entries templates.usergroups.xsl
html-usergroups-list-header templates.usergroups.xsl (for l10n)
@ -44,6 +45,7 @@
html-news-list-press-preface templates.press.xsl (for l10n)
html-news-list-press templates.press.xsl
html-events-map templates.events.xsl (for l10n)
html-events-list-preface templates.events.xsl (for l10n)
html-events-list-upcoming-heading templates.events.xsl (for l10n)
html-events-list-past-heading templates.events.xsl (for l10n)
@ -86,6 +88,16 @@
<xsl:key name="html-usergroups-regions-key" match="entry" use="../../@name" />
<xsl:key name="html-usergroups-id-key" match="entry" use="@id" />
<xsl:template name="html-usergroups-map">
<xsl:param name="mapurl" select="'none'" />
<img>
<xsl:attribute name="src">
<xsl:value-of select="$mapurl" />
</xsl:attribute>
</img>
</xsl:template>
<xsl:template name="html-usergroups-list-regions">
<xsl:param name="usergroups.xml" select="'usergroups.xml'" />

View file

@ -6,7 +6,7 @@
<!ENTITY % navinclude.community "INCLUDE">
]>
<!-- $FreeBSD: www/share/sgml/templates.usergroups.xsl,v 1.9 2008/04/20 22:14:54 murray Exp $ -->
<!-- $FreeBSD: www/share/sgml/templates.usergroups.xsl,v 1.10 2008/04/20 22:22:34 murray Exp $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:cvs="http://www.FreeBSD.org/XML/CVS"
@ -21,6 +21,11 @@
<xsl:value-of select="//cvs:keyword[@name='freebsd']"/>
</xsl:variable>
<xsl:key name="usergroup-by-country" match="entry"
use="../@code" />
<xsl:variable name="charturl" select="'http://chart.apis.google.com/chart?cht=t&amp;chs=400x200&amp;chtm=world&amp;chco=ffffff,ffbe38,600000&amp;chf=bg,s,4D89F9'" />
<xsl:template match="/">
<html>
&header1;
@ -38,6 +43,25 @@
<div id="CONTENTWRAP">
&header3;
<xsl:variable name="chart-countries">
<xsl:for-each select="//entry[
generate-id() =
generate-id(key('usergroup-by-country', ../@code)[1])]">
<!-- <xsl:sort select="format-number(count(key('event-by-country', location/country)), '000')" order="descending"/>
-->
<xsl:value-of select="../@code" />
</xsl:for-each>
</xsl:variable>
<xsl:variable name="chart-country-counts">
<xsl:for-each select="//entry[
generate-id() =
generate-id(key('usergroup-by-country', ../@code)[1])]">
<xsl:value-of select="count(key('usergroup-by-country', ../@code))" />.0<xsl:if test="position()!=last()">,</xsl:if></xsl:for-each>
</xsl:variable>
<xsl:variable name="imageurl"><xsl:value-of select="$charturl"/>&amp;chd=t:<xsl:value-of select="$chart-country-counts"/>&amp;chld=<xsl:value-of select="$chart-countries"/></xsl:variable>
<xsl:call-template name="html-usergroups-list-header" />
<xsl:call-template name="html-usergroups-list-regions">
@ -45,6 +69,10 @@
<xsl:with-param name="usergroups-local.xml" select="$usergroups-local.xml" />
</xsl:call-template>
<xsl:call-template name="html-usergroups-map">
<xsl:with-param name="mapurl" select="$imageurl" />
</xsl:call-template>
<xsl:call-template name="html-usergroups-list-entries">
<xsl:with-param name="usergroups.xml" select="$usergroups.xml" />
<xsl:with-param name="usergroups-local.xml" select="$usergroups-local.xml" />

View file

@ -5,7 +5,7 @@
<usergroups>
<cvs:keywords xmlns:cvs="http://www.FreeBSD.org/XML/CVS" version="1.0">
<cvs:keyword name="freebsd">
$FreeBSD: www/share/sgml/usergroups.xml,v 1.66 2008/04/20 22:14:54 murray Exp $
$FreeBSD: www/share/sgml/usergroups.xml,v 1.67 2008/04/20 22:22:35 murray Exp $
</cvs:keyword>
</cvs:keywords>
@ -542,7 +542,7 @@ The country codes are precise ISO3166 codes from, e.g.
</entry>
</country>
<country code="UK" name="UK">
<country code="GB" name="UK">
<entry id="bsdgroups" >
<name>Manchester BSD Users Group</name>
<url>http://www.bsdgroups.org.uk/manchester</url>
@ -1148,7 +1148,7 @@ The country codes are precise ISO3166 codes from, e.g.
</entry>
</country>
<country code="MO" name="Mongolia">
<country code="MN" name="Mongolia">
<entry id="muug">
<name>Mongolian Unix User Group (MUUG)</name>