appdb/include version.php

WineHQ wineowner at wine.codeweavers.com
Fri Dec 8 22:28:20 CST 2006


ChangeSet ID:	30433
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2006/12/08 22:28:20

Modified files:
	include        : version.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Colourize the maintainer's rating and version fields with the appropriate
	rating colours, both in the application and version view.
	This should make it easier for users to identify working versions, and it also
	prevents the maintainer's rating from being 'overshadowed' by the test
	results.

Patch: http://cvs.winehq.org/patch.py?id=30433

Old revision  New revision  Changes     Path
 1.86          1.87          +12 -4      appdb/include/version.php

Index: appdb/include/version.php
diff -u -p appdb/include/version.php:1.86 appdb/include/version.php:1.87
--- appdb/include/version.php:1.86	9 Dec 2006  4:28:20 -0000
+++ appdb/include/version.php	9 Dec 2006  4:28:20 -0000
@@ -662,9 +662,14 @@ class Version {
             echo "        </td></tr>\n";
         }    
 
+        if($this->sTestedRating != "/" && $this->sTestedRating)
+            $sMaintainerColor = $this->sTestedRating;
+        else
+            $sMaintainerColor = "color0";
+
         // rating Area
-        echo "<tr class=\"color1\" valign=\"top\"><td><b>Maintainer Rating</b></td><td>".$this->sTestedRating."</td></tr>\n";
-        echo "<tr class=\"color0\" valign=\"top\"><td><b>Maintainers Version</b></td><td>".$this->sTestedRelease."</td></tr>\n";
+        echo "<tr class=\"$sMaintainerColor\" valign=\"top\"><td><b>Maintainer&#8217;s Rating</b></td><td>".$this->sTestedRating."</td></tr>\n";
+        echo "<tr class=\"$sMaintainerColor\" valign=\"top\"><td><b>Maintainer&#8217;s Version</b></td><td>".$this->sTestedRelease."</td></tr>\n";
 
         // image
         $img = Screenshot::get_random_screenshot_img($oApp->iAppId, $this->iVersionId, false);
@@ -923,12 +928,15 @@ class Version {
                     // set row color
                     $bgcolor = ($c % 2 == 0) ? "color0" : "color1";
 
+                    if($oVersion->sTestedRating && $oVersion->sTestedRating != "/")
+                        $sRatingColor = "class=\"$oVersion->sTestedRating\"";
+
                     //display row
                     echo "<tr class=$bgcolor>\n";
                     echo "    <td><a href=\"".BASE."appview.php?iVersionId=".$iVersionId."\">".$oVersion->sName."</a></td>\n";
                     echo "    <td>".util_trim_description($oVersion->sDescription)."</td>\n";
-                    echo "    <td align=center>".$oVersion->sTestedRating."</td>\n";
-                    echo "    <td align=center>".$oVersion->sTestedRelease."</td>\n";
+                    echo "    <td $sRatingColor align=center>".$oVersion->sTestedRating."</td>\n";
+                    echo "    <td $sRatingColor align=center>".$oVersion->sTestedRelease."</td>\n";
                     echo "    <td align=center>".Comment::get_comment_count_for_versionid($oVersion->iVersionId)."</td>\n";
                     echo "</tr>\n\n";
 



More information about the wine-cvs mailing list