frontpage: "Complete" needs to mean truly "complete"
all "missing/changed" fields need to be 0 for something to be complete.
"Same as english" is the only field that doesn't count.
diff --git a/index.php b/index.php
index 9abaedd..ede83b0 100644
--- a/index.php
+++ b/index.php
@@ -31,22 +31,22 @@
$an = $a['name'];
$bn = $b['name'];
// Sort by last update revision
- $au = $a['last_update_rev'];
- $bu = $b['last_update_rev'];
+// $au = $a['last_update_rev'];
+// $bu = $b['last_update_rev'];
// Sort by status
$ap = $a['percentage'];
$bp = $b['percentage'];
+ // Sort by missing
+ $ac = $a['source'] + $a['desc'] + $a['dest'] + $a['voice'];
+ $bc = $b['source'] + $b['desc'] + $b['dest'] + $b['voice'];
- $ac = $a['desc'] + $a['source'];
- $bc = $b['desc'] + $b['source'];
- if ($ap == $bp) {
- if ($ac != $bc) {
- return $ac > $bc ? -1 : 1;
- } else {
- return $an > $bn ? -1 : 1;
- }
- }
- return $ap < $bp ? 1 : -1;
+ if ($ap != $bp) {
+ return $ap < $bp ? 1 : -1;
+ }
+ if ($ac != $bc) {
+ return $ac < $bc ? -1 : 1;
+ }
+ return $an < $bn ? -1 : 1;
}
function get_stats() {
@@ -73,7 +73,9 @@
switch(true) {
case $info['percentage'] == 100
&& $info['source'] == 0
- && $info['desc'] == 0:
+ && $info['desc'] == 0
+ && $info['dest'] == 0
+ && $info['voice'] == 0:
$stats['summary']['complete']++;
break;
case $info['percentage'] > 90;
diff --git a/templates/frontpage.tpl b/templates/frontpage.tpl
index 5fd1685..4b90878 100644
--- a/templates/frontpage.tpl
+++ b/templates/frontpage.tpl
@@ -43,7 +43,7 @@
</tr>
</thead>
{foreach from=$langstats key=langfile item=language}
- {if $language.percentage == 100 && $language.source == 0}
+ {if $language.percentage == 100 && $language.source == 0 && $language.dest == 0 && $language.desc == 0 && $language.voice == 0}
{assign var='rowclass' value='good'}
{elseif $language.percentage < 50}
{assign var='rowclass' value='poor'}