Commit e534fdfb authored by Laura Arjona Reina's avatar Laura Arjona Reina

Merge branch 'last-modified' into 'master'

Improve the Last Modified timestamps pn web page footers

See merge request !21
parents e42b74cd ddb44527
......@@ -185,18 +185,22 @@ msgid "Last Modified"
msgstr ""
#: ../../english/template/debian/footer.wml:113
msgid "Copyright"
msgid "Last Built"
msgstr ""
#: ../../english/template/debian/footer.wml:116
msgid "<a href=\"https://www.spi-inc.org/\">SPI</a> and others;"
msgid "Copyright"
msgstr ""
#: ../../english/template/debian/footer.wml:119
msgid "See <a href=\"m4_HOME/license\" rel=\"copyright\">license terms</a>"
msgid "<a href=\"https://www.spi-inc.org/\">SPI</a> and others;"
msgstr ""
#: ../../english/template/debian/footer.wml:122
msgid "See <a href=\"m4_HOME/license\" rel=\"copyright\">license terms</a>"
msgstr ""
#: ../../english/template/debian/footer.wml:125
msgid "Debian is a registered <a href=\"m4_HOME/trademark\">trademark</a> of Software in the Public Interest, Inc."
msgstr ""
......
......@@ -122,9 +122,8 @@ $rangeform_samemonth =~ s/\[%\]/%/g;
$rangeform_severalmonths = '<gettext domain="date">q{[%]d [%]s-[%]d [%]s}, $sday, $smon_str, $eday, $emon_str</gettext>';
$rangeform_severalmonths =~ s/\[%\]/%/g;
# This function creates a last modification time stamp for the web pages.
sub webwml_ctime {
# This function creates a last *built* time stamp for a web page.
sub webwml_built_time {
my ($time, $sec, $min, $hour, $mday, $monnr, $year, $wday, $yday, $isdst, $mon);
# The last modification time of inputfile in ISO dd-mm-yyyy hh:mm:ss format.
if (defined $(GEN_TIME)) {
......@@ -155,6 +154,25 @@ sub webwml_ctime {
return eval("sprintf($dateform)");
}
# This function creates a last *modified* time stamp for the source of a web page.
sub webwml_modified_time {
my ($time, $sec, $min, $hour, $mday, $monnr, $year, $wday, $yday, $isdst, $mon);
# The last modification time of inputfile in ISO dd-mm-yyyy hh:mm:ss format.
$WML_SRC_ISOTIME =~ /(\d+)-(..)-(\d+) (..):(..):(..)/;
if ($1 <= 31) { # for WML 1.x
$time = timelocal($6, $5, $4, $1, $2-1, $3);
} else { # for WML 2.x
$time = timelocal($6, $5, $4, $3, $2-1, $1);
}
# $lday=$1; $lmon=$2; $lyear=$3; $lhr=$4; $lmin=$5; $lsec=$6;
# if ($lyear > 19000) { $lyear = 1900+($lyear-19000); }
# $time = timelocal($lsec, $lmin, $lhr, $lday, $lmon-1, $lyear);
($sec, $min, $hour, $mday, $monnr, $year, $wday, $yday, $isdst) = gmtime($time);
$wday = $dow[$wday];
$mon = $moy[$monnr];
return eval("sprintf($dateform)");
}
# creates a timestamp in "W3C Date and Time Format"
# see http://www.w3.org/TR/NOTE-datetime
sub rdf_ctime {
......
......@@ -109,6 +109,9 @@
<define-tag lastmodified whitespace=delete>
<gettext>Last Modified</gettext>
</define-tag>
<define-tag lastbuilt whitespace=delete>
<gettext>Last Built</gettext>
</define-tag>
<define-tag copyright whitespace=delete>
<gettext>Copyright</gettext>
</define-tag>
......@@ -159,7 +162,9 @@ if ($first eq $second) {
<p><sendcomments/></p>
</when>
<p>
<lastmodified/>: <:= webwml_ctime () :>
<lastmodified/>: <:= webwml_modified_time () :>
<br />
<lastbuilt/>: <:= webwml_built_time () :>
<when <string-eq "$(NOCOPYRIGHT)" "" />>
<br />
<copyright/> &copy; <copyrightyears/> <holder/> <seelicense/><br />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment