[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Nouveau changement aux pages de stats: diff preliminaire



Hello,

Ce coup ci, j'aimerais autant eviter de me prendre les pieds dans le tapis,
alors je file ici mon differenciel avant d'agir.

Aujourd'hui, on ne joue que dans templates/

Le but du jeu est de placer un ptit '!' devant le nom des paquets contenant
des erreurs detectees par le systeme. Ce signe est un lien vers la page
listant les erreurs par paquet. Et y'a aussi un lien supplementaire sur
cette page depuis le nom du mainteneur vers la page listant les erreurs par
mainteneur.

Le plus gros du diff consiste a remonter le traitement des erreurs avant
l'affichage dans ok.inc ou todo.inc, mais c'est un changement sans
importance sur la semantique.

Au passage, j'ai aussi sorti les '[' et ']' du lien quand il y a plusieurs
templates non traduites, histoire qu'on voit bien qu'il y a plusieurs liens.


Dans mes tests locaux, c'est amusant, car ca montre bien que quasi tous les
paquets utilisant debconf sans po-debconf contiennent des erreurs...

Peut etre que la mise en forme n'est pas optimale. On pourrait vouloir
ajouter une colonne "Extra informations" et mettre dedans un lien nomme
"(errors)", et quand ca sera fait un autre lien "(comments)", qui pointera
vers les commentaires des equipes de trad. Mais ca me semble suffisant dans
un premier temps, non?

C'est ok, je peux commiter ?

Mt.

-- 
Je préfère glisser ma peau sous les draps pour le plaisir des sens
que la risquer sous les drapeaux pour le prix de l'essence.
Index: scripts/gen-files.pl
===================================================================
RCS file: /cvs/webwml/webwml/english/international/l10n/scripts/gen-files.pl,v
retrieving revision 1.31
diff -u -r1.31 gen-files.pl
--- scripts/gen-files.pl	10 Sep 2003 07:39:18 -0000	1.31
+++ scripts/gen-files.pl	10 Sep 2003 09:01:18 -0000
@@ -232,6 +232,27 @@
                         $none .= "<li>".$pkg."</li>\n";
                         next;
                 }
+                if ($data->has_errors($pkg)) {
+                        $tmpl_errors->{$pkg} = { noorig => [], master => [], fuzzy => [], mismatch => [], };
+                        my $found = 0;
+                        foreach (@{$data->errors($pkg)}) {
+                                next unless s/debconf: //;
+                                if (m/([^:]+):(\d+): original-fields-removed-in-translated-templates/) {
+                                        push(@{$tmpl_errors->{$pkg}->{noorig}}, "$1:$2");
+                                        $found = 1;
+                                } elsif (m/([^:]+):(\d+): translated-fields-in-master-templates/) {
+                                        push(@{$tmpl_errors->{$pkg}->{master}}, "$1:$2");
+                                        $found = 1;
+                                } elsif (m/([^:]+):(\d+): fuzzy-fields-in-templates/) {
+                                        push(@{$tmpl_errors->{$pkg}->{fuzzy}}, "$1:$2");
+                                        $found = 1;
+                                } elsif (m/([^:]+):(\d+): lang-mismatch-in-translated-templates/) {
+                                        push(@{$tmpl_errors->{$pkg}->{mismatch}}, "$1:$2");
+                                        $found = 1;
+                                }
+                        }
+                        delete $tmpl_errors->{$pkg} unless $found;
+                }
                 my $list = {};
                 foreach (@td_langs) {
                         $list{uc $_} = 0;
@@ -256,8 +277,15 @@
 		        my $str = '';
                         $str .= "<tr bgcolor=\"".
                               get_color(percent_stat($stat)).
-                              "\"><td>".$pkg."</td>".
-                              "<td>".show_stat($stat)."</td><td><a href=\"";
+                              "\"><td>";
+		        if (defined $tmpl_errors->{$pkg}) {
+			    $str .= "<a href=errors-by-pkg#P$pkg>!</a>&nbsp;";
+			} else {
+			    $str .= "&nbsp;&nbsp;";
+			}
+		        $str .= $pkg."</td>".
+                              "<td>".show_stat($stat);
+		        $str .= "</td><td><a href=\"";
                         $str .= ($data->section($pkg) =~ m/non-US/ ? $rootnonus : $root) . "templates/unstable/";
                         $str .= $data->pooldir($pkg)."/$link_trans.gz\">$template</a></td><td>";
                         if ($link_orig ne '') {
@@ -287,31 +315,13 @@
                         my $count = 1;
                         foreach (@untranslated) {
                                 $count ++;
-                                $excl{$l} .= "<a href=\"".($data->section($pkg) =~ m/non-US/ ? $rootnonus : $root)."templates/unstable/".$data->pooldir($pkg)."/".$_.".gz\">[".$count."]</a>";
+                                $excl{$l} .= "[<a href=\"".($data->section($pkg) =~ m/non-US/ ? $rootnonus : $root)."templates/unstable/".$data->pooldir($pkg)."/".$_.".gz\">".$count."</a>]";
                         }
+		        if (defined $tmpl_errors->{$pkg}) {
+			    $excl{$l} .= " (<a href=errors-by-pkg#P$pkg>!</a>)";
+			}
                         $excl{$l} .= ", ";
                 }
-                if ($data->has_errors($pkg)) {
-                        $tmpl_errors->{$pkg} = { noorig => [], master => [], fuzzy => [], mismatch => [], };
-                        my $found = 0;
-                        foreach (@{$data->errors($pkg)}) {
-                                next unless s/debconf: //;
-                                if (m/([^:]+):(\d+): original-fields-removed-in-translated-templates/) {
-                                        push(@{$tmpl_errors->{$pkg}->{noorig}}, "$1:$2");
-                                        $found = 1;
-                                } elsif (m/([^:]+):(\d+): translated-fields-in-master-templates/) {
-                                        push(@{$tmpl_errors->{$pkg}->{master}}, "$1:$2");
-                                        $found = 1;
-                                } elsif (m/([^:]+):(\d+): fuzzy-fields-in-templates/) {
-                                        push(@{$tmpl_errors->{$pkg}->{fuzzy}}, "$1:$2");
-                                        $found = 1;
-                                } elsif (m/([^:]+):(\d+): lang-mismatch-in-translated-templates/) {
-                                        push(@{$tmpl_errors->{$pkg}->{mismatch}}, "$1:$2");
-                                        $found = 1;
-                                }
-                        }
-                        delete $tmpl_errors->{$pkg} unless $found;
-                }
         }
         foreach $lang (@td_langs) {
                 next unless defined $done{uc $lang};
@@ -344,7 +354,10 @@
                 $maint = $data->maintainer($pkg);
                 $maint =~ s/\s*<.*>//;
                 $maint =~ s/&/&amp;/g;
-                print GEN "<li><a name=\"P$pkg\">$pkg</a> ".$data->version($pkg)." [$maint]\n";
+	        my $anchor_maint = lc $maint;
+                $anchor_maint =~ s/[^a-z0-9]/_/g;
+
+                print GEN "<li><a name=\"P$pkg\">$pkg</a> ".$data->version($pkg)." [<a href=errors-by-maint#M$anchor_maint>$maint</a>]\n";
                 my $errors_pkg = "<ul>\n";
                 if (@{$tmpl_errors->{$pkg}->{master}}) {
                         $errors_pkg .= "<li><a href=\"errors#master\">translated-fields-in-master-templates</a><br>\n".${$tmpl_errors->{$pkg}->{master}}[0]."</li>\n";

Reply to: