fixed tags appearing in the footer; added number of times tags are used on our website

svn path=/trunk/; revision=19392
This commit is contained in:
nicoulas 2011-01-21 16:25:48 +00:00
parent 2f085e88a8
commit f6373a3ba1
33 ha cambiato i file con 84 aggiunte e 106 eliminazioni

Vedi File

@ -58,7 +58,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -147,7 +147,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -147,7 +147,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -16,7 +16,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -44,7 +44,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -19,7 +19,7 @@
</xsl:template>
<!-- Do not copy <set> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -85,7 +85,7 @@
</xsl:template>
<!-- Do not copy <set> and <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -56,7 +56,7 @@
</xsl:template>
<!-- Do not copy <set> and <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -37,7 +37,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -37,7 +37,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -37,7 +37,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -37,7 +37,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -37,7 +37,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -37,7 +37,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -37,7 +37,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -37,7 +37,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -37,7 +37,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -37,7 +37,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -49,7 +49,7 @@
</xsl:template>
<!-- Do not copy <set> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -123,7 +123,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -39,7 +39,7 @@
</xsl:copy>
</xsl:template>
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
</xsl:stylesheet>

Vedi File

@ -94,7 +94,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -94,7 +94,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -35,7 +35,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -27,7 +27,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -27,7 +27,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -14,7 +14,7 @@
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -27,7 +27,7 @@
</xsl:template>
<!-- Do not copy <set> to output at all -->
<xsl:template match="set"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -10,7 +10,9 @@
<div id="intro">
<p>
Here after is a list of tags that are currently being used.
Here after is a list of tags that are currently being used. The
number in parenthesis is the number of time this tag is used in
our pages.
</p>
</div>

Vedi File

@ -35,8 +35,7 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="textset-content"/>
<xsl:template match="set | tags"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">

Vedi File

@ -32,6 +32,9 @@ use IO::Select;
use Socket;
use Fcntl ':flock';
require "/home/nicolas/FSFE/outdated trad check/comptree.pl";
our $nbout = 0;
# This defines the focuses and their respective preferred / original
# language. For example, it says that we should have a focus called
# "se" (Sweden) which has the preferred language "sv" (Swedish).
@ -310,6 +313,11 @@ while (wait() != -1) {
sub process {
my ($file, $langs) = @_;
if (not $file eq "tags/tags") {
return;
}
print "$file\n";
print STDERR "Building $file.. \n" unless $opts{q};
# Create the root note for the above mentioned XML file (used to feed the XSL
@ -523,6 +531,15 @@ sub process {
# TODO: optimise getting texts-content-xx.xml and texts-content-en.xml,
# since it does not depend on the xsl file being treated, we should do it only once!
if ( $lang eq "cs" ) {
print "--->outputting test.xml\n";
open (TEST, '>', "/home/nicolas/FSFE/fsfe-web-out/test.xml");
print TEST $sourcedoc->toString();
close (TEST);
}
#
# Transform the document using the XSL file and then push the
# result into the <document> element of the document we're building.
@ -573,17 +590,27 @@ sub process {
# with the original (but maybe a second earlier) isn't marked outdated.
#
my $originalsource = "$file.".$root->getAttribute("original").".xhtml";
if ((stat("$opts{i}/$originalsource"))[9] > (stat($source))[9] + 7200) {
$root->setAttribute("outdated", "yes");
if ($dir eq "global") {
lock(*TRANSLATIONS);
print TRANSLATIONS "$lang $source $originalsource\n";
unlock(*TRANSLATIONS);
}
} else {
$root->setAttribute("outdated", "no");
}
if ((stat("$opts{i}/$originalsource"))[9] > (stat($source))[9] + 7200) {
$root->setAttribute("outdated", "yes");
if ($dir eq "global") {
lock(*TRANSLATIONS);
print TRANSLATIONS "$lang $source $originalsource\n";
unlock(*TRANSLATIONS);
}
} else {
$root->setAttribute("outdated", "no");
}
if ( not -e "$opts{i}/$originalsource" ) {
# do something
} else {
my ($bool, $err) = areEqual( "$opts{i}/$originalsource", $source );
if ( not $bool ) {
print "$err\n";
$nbout += 1;
}
}
#
# Get the appropriate textset for this language. If one can't be
# found, use the English. (I hope this never happens)
@ -771,3 +798,6 @@ sub unlock {
my ($fh) = @_;
flock($fh, LOCK_UN);
}
print "$nbout pages are out of date\n";

Vedi File

@ -7,14 +7,14 @@
# however, is done by the Perl script build.pl.
# -----------------------------------------------------------------------------
SOURCE=/home/www/fsfe
DEST=/home/www/html
TMP=/home/www/tmp.$$
STATUS=/var/www/web
SOURCE=.
DEST=../fsfe-web-out/home/www/html
TMP=../fsfe-web-out/home/www/tmp.$$
STATUS=../fsfe-web-out/var/www/web
ALARM_LOCKFILE=alarm_lockfile
MAKEFILE_PL=${SOURCE}/Makefile.PL
SVNUPOUTFILE=/tmp/fsfe-svnup-out
SVNUPERRFILE=/tmp/fsfe-svnup-err
SVNUPOUTFILE=../fsfe-web-out/tmp/fsfe-svnup-out
SVNUPERRFILE=../fsfe-web-out/tmp/fsfe-svnup-err
# Since we must grep for svn output messages,
# let's ensure we get English messages
@ -41,7 +41,7 @@ if [[ -n "$BUILD_STARTED" && "10#${BUILD_STARTED}" -gt 30 && ! -f ${STATUS}/${AL
fi
# Redirect output
exec 1> ${STATUS}/status.txt 2>&1
#exec 1> ${STATUS}/status.txt 2>&1
# If some build script is already running, don't run it.
if ps -C "build-df.sh,build-test.sh,build.sh" -o pid= | grep -q -v "$$"; then
@ -65,7 +65,7 @@ echo "$(date) Updating source files from SVN."
# Since the "svn update" exit status cannot be trusted, and "svn update -q" is
# always quiet, we have to test the output of "svn update" (ignoring the final
# "At revision" line) and check for any output lines
svn --non-interactive update 2>${SVNUPERRFILE} | grep -v 'At revision' >${SVNUPOUTFILE}
#svn --non-interactive update 2>${SVNUPERRFILE} | grep -v 'At revision' >${SVNUPOUTFILE}
cat ${SVNUPOUTFILE}
# If "svn update" wrote anything to standard error, exit

Vedi File

@ -117,29 +117,18 @@
<xsl:for-each select="/html/set/news/tags/tag">
<xsl:sort select="." order="ascending" />
<xsl:variable name="thistag" select="node()" />
<xsl:if test="generate-id() = generate-id(key('news-tags-by-value', normalize-space(.)))">
<xsl:element name="li">
<xsl:value-of select="."/>
<xsl:text> (</xsl:text><xsl:value-of select="count( /html/set/news/tags/tag[text() = $thistag]) " /><xsl:text>)</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:element>
<!-- <xsl:element name="ul">
<xsl:for-each select="/html/set/news">
<xsl:sort select="@date" order="descending" />
<xsl:call-template name="output-tags">
<xsl:with-param name="list" select="@tags" />
<xsl:with-param name="delimiter" select="', '" />
</xsl:call-template>
</xsl:for-each>
</xsl:element> -->
</xsl:template>
@ -163,49 +152,7 @@
</xsl:for-each>
</xsl:element>
<!-- <xsl:element name="ul">
<xsl:for-each select="/html/set/event">
<xsl:sort select="@start" order="descending" />
<xsl:call-template name="output-tags">
<xsl:with-param name="list" select="@tags" />
<xsl:with-param name="delimiter" select="', '" />
</xsl:call-template>
</xsl:for-each>
</xsl:element> -->
</xsl:template>
<xsl:template name="output-tags">
<xsl:param name="list" />
<xsl:param name="delimiter" />
<xsl:variable name="newlist">
<xsl:choose>
<xsl:when test="contains($list, $delimiter)"><xsl:value-of select="normalize-space($list)" /></xsl:when>
<xsl:otherwise><xsl:value-of select="concat(normalize-space($list), $delimiter)"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="first" select="substring-before($newlist, $delimiter)" />
<xsl:variable name="remaining" select="substring-after($newlist, $delimiter)" />
<xsl:if test="$first != ''">
<xsl:element name="li">
<xsl:value-of select="$first" />
</xsl:element>
</xsl:if>
<xsl:if test="$remaining">
<xsl:call-template name="output-tags">
<xsl:with-param name="list" select="$remaining" />
<xsl:with-param name="delimiter"><xsl:value-of select="$delimiter"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>