Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

paises conflictivos en 2009

  • Loading branch information...
commit 7a479e38ecb4f82f7ba154f2a769e554aafa6a5e 1 parent e75293a
@danilat authored
View
31 grails-app/services/de/eldisparate/CountriesService.groovy
@@ -0,0 +1,31 @@
+package de.eldisparate
+
+class CountriesService {
+
+ static transactional = false
+
+ def conflictives(){
+ def countries = [
+ [name: "ANGOLA", realName:"Angola", code:"AO"],
+ [name: "ARABIA SAUDI", realName:"Arabia Saudí", code:"SA"],
+ [name: "BOLIVIA", realName:"Bolivia", code:"BO"],
+ [name: "COLOMBIA", realName:"Colombia", code:"CO"],
+ [name: "ESTADOS UNIDOS DE AMERICA", realName:"Estados Unidos", code:"US"],
+ [name: "GEORGIA", realName:"Georgia", code:"GE"],
+ [name: "GHANA", realName:"Ghana", code:"GH"],
+ [name: "GUINEA", realName:"Guinea", code:"GN"],
+ [name: "INDONESIA", realName:"Indonesia", code:"ID"],
+ [name: "IRAN", realName:"Irán", code:"IR"],
+ [name: "ISRAEL", realName:"Israel", code:"IL"],
+ [name: "LIBANO", realName:"Líbano", code:"LB"],
+ [name: "MALASIA", realName:"Malasia", code:"MY"],
+ [name: "MARRUECOS", realName:"Marruecos", code:"MA"],
+ [name: "PAKISTAN", realName:"Pakistán", code:"PK"],
+ [name: "SRI LANKA", realName:"Sri Lanka", code:"LK"],
+ [name: "SUDAFRICA", realName:"Sudáfrica", code:"ZA"],
+ [name: "TAILANDIA", realName:"Tailandia", code:"TH"],
+ [name: "TURQUIA", realName:"Turquía", code:"TR"],
+ [name: "VENEZUELA", realName:"Venezuela", code:"VE"]
+ ]
+ }
+}
View
16 grails-app/taglib/de/eldisparate/GoogleChartsTagLib.groovy
@@ -1,6 +1,8 @@
package de.eldisparate
class GoogleChartsTagLib {
+ def countriesService
+
def barChart = { attrs, body ->
//def autonomy = attrs.autonomy
//def countries = autonomy.exportCountries
@@ -17,10 +19,20 @@ class GoogleChartsTagLib {
def worldMap = { attrs, body ->
//def autonomy = attrs.autonomy
//def countries = autonomy.exportCountries
- def countrycCodes = "ESAO"
+
+ def conflictiveCountries = countriesService.conflictives()
+
+ def countryCodes = conflictiveCountries.collect{it.code}.join()
def background = "FFEBBE"
def countryColor = "B8002D"
- String imageSrc = "http://chart.apis.google.com/chart?chf=bg,s,${background}&chs=440x220&cht=t&chco=${background}|${countryColor}&chld=${countrycCodes}&chd=s:____&chtm=world"
+ String imageSrc = "http://chart.apis.google.com/chart?chf=bg,s,${background}&chs=440x220&cht=t&chco=${background}|${countryColor}&chld=${countryCodes}&chd=s:____&chtm=world"
out << imageSrc
}
+
+ def conflictiveCountries = { attrs, body ->
+ def conflictiveCountries = countriesService.conflictives()
+ conflictiveCountries.each{
+ out << "<span class=\"text_paises\">${it.realName}: 23.000</span><br /> "
+ }
+ }
}
View
17 test/unit/de/eldisparate/CountriesServiceTests.groovy
@@ -0,0 +1,17 @@
+package de.eldisparate
+
+import grails.test.*
+
+class CountriesServiceTests extends GrailsUnitTestCase {
+ protected void setUp() {
+ super.setUp()
+ }
+
+ protected void tearDown() {
+ super.tearDown()
+ }
+
+ void testSomething() {
+
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.