[bknr-cvs] ksprotte changed trunk/projects/bos/

BKNR Commits bknr at bknr.net
Thu Sep 4 12:18:43 UTC 2008


Revision: 3789
Author: ksprotte
URL: http://bknr.net/trac/changeset/3789

fixed country-stats
U   trunk/projects/bos/m2/m2.lisp
U   trunk/projects/bos/web/kml-handlers.lisp

Modified: trunk/projects/bos/m2/m2.lisp
===================================================================
--- trunk/projects/bos/m2/m2.lisp	2008-09-04 10:52:31 UTC (rev 3788)
+++ trunk/projects/bos/m2/m2.lisp	2008-09-04 12:18:43 UTC (rev 3789)
@@ -624,8 +624,7 @@
 (defun add-to-contract-stats (contract)
   (let* ((area (contract-area contract))
          (sponsor (contract-sponsor contract))
-         (new-sponsor-p (alexandria:length= 1 (sponsor-contracts sponsor)))
-         (country (sponsor-country sponsor)))
+         (new-sponsor-p (alexandria:length= 1 (sponsor-contracts sponsor))))
     (with-slots (sold-m2s paying-sponsors country-sponsors last-contracts)
         *contract-stats*
       ;; sold-m2s
@@ -634,8 +633,9 @@
       (when new-sponsor-p
         (incf paying-sponsors))
       ;; country-sponsors
-      (when country
-        (let ((country-stat (gethash country country-sponsors)))
+      (when (sponsor-country sponsor)
+        (let* ((country (make-keyword-from-string (sponsor-country sponsor)))
+               (country-stat (gethash country country-sponsors)))
           (unless country-stat
             (setq country-stat (setf (gethash country country-sponsors) (make-country-stat))))
           (when new-sponsor-p

Modified: trunk/projects/bos/web/kml-handlers.lisp
===================================================================
--- trunk/projects/bos/web/kml-handlers.lisp	2008-09-04 10:52:31 UTC (rev 3788)
+++ trunk/projects/bos/web/kml-handlers.lisp	2008-09-04 12:18:43 UTC (rev 3789)
@@ -286,9 +286,9 @@
             (attribute "id" "countryStatsStyle")
             (with-element "IconStyle"
               (with-element "Icon"
-                ;; (with-element "href" (text "http://maps.google.com/mapfiles/kml/pal3/icon23.png"))
                 (with-element "href" (text (format nil "http://~a/static/Orang_weiss.png" (website-host)))))))
           (do-sponsor-countries (country)
+            (assert (keywordp country))
             (let ((coords (cdr (assoc country *country-coords*))))
               (when coords
                 (destructuring-bind (lon lat)
@@ -296,7 +296,6 @@
                   (multiple-value-bind (number-of-paying-sponsors number-of-sold-m2s)
                       (contract-stats-for-country country)
                     (with-element "Placemark"
-                      ;; (with-element "name" (text (format nil "~a ~a" (car country-contracts) (length (cdr country-contracts)))))
                       (with-element "styleUrl" (text "#countryStatsStyle"))
                       (with-element "description"
                         (text (format nil "<p>~A</p><table><tbody><tr><td>~A:</td><td>~D ~A</td></tr>




More information about the Bknr-cvs mailing list