-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
1,125 additions
and
32 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import kuorum.PoliticalGroup | ||
|
||
fixture { | ||
// build{ | ||
grupoMixto (PoliticalGroup,name: 'Grupo Mixto') | ||
izquierdaPlural (PoliticalGroup,name: 'Grupo de la Izquierda Plural') | ||
grupoVasco (PoliticalGroup,name: 'Grupo Vasco') | ||
upyd (PoliticalGroup,name: 'Grupo UPyD') | ||
grupoCatalan (PoliticalGroup,name: 'Grupo Catalán') | ||
grupoSocialista (PoliticalGroup,name: 'Grupo Socialista') | ||
grupoPopular (PoliticalGroup,name: 'Grupo Popular') | ||
|
||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import kuorum.Region | ||
|
||
fixture { | ||
|
||
europe(Region){ | ||
name ="Europa" | ||
iso3166_2 = "EU" | ||
} | ||
|
||
spain(Region){ | ||
name ="España" | ||
iso3166_2 = "EU-SP" | ||
superRegion = europe | ||
} | ||
|
||
madrid(Region){ | ||
name ="Madrid" | ||
iso3166_2 = "EU-SP-MD" | ||
superRegion = spain | ||
} | ||
|
||
catalonia(Region){ | ||
name ="Cataluña" | ||
iso3166_2 = "EU-SP-CT" | ||
superRegion = spain | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
//include "region" | ||
include "regions" | ||
//include "politicalGroups" | ||
include "authoritiesData" | ||
include "users/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package kuorum | ||
|
||
class LawController { | ||
|
||
static scaffold = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package kuorum | ||
|
||
import grails.converters.JSON | ||
|
||
class SearchController { | ||
def searchSolrService | ||
def indexSolrService | ||
|
||
def search(String word) { | ||
|
||
def docs = searchSolrService.search(word) | ||
render docs as JSON | ||
|
||
} | ||
|
||
def index(){ | ||
indexSolrService.fullIndex() | ||
render "Ok" | ||
} | ||
|
||
def suggest(String word){ | ||
def res = searchSolrService.suggest(word) | ||
render res as JSON | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
grails-app/controllers/kuorum/users/KuorumUserController.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package kuorum.users | ||
|
||
class KuorumUserController { | ||
|
||
static scaffold = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package kuorum | ||
|
||
import org.bson.types.ObjectId | ||
|
||
/** | ||
* Represents the different places where the politician celebrate meetings | ||
* to make decisions -Parlament, Senate - | ||
* | ||
* Parlament of Catalonia, Parlament of Spain, Senate of spain | ||
* | ||
*/ | ||
class Institution { | ||
|
||
ObjectId id | ||
String name | ||
Region region | ||
|
||
static embedded = [ 'region' ] | ||
|
||
static constraints = { | ||
name blank: false, nullable:false | ||
} | ||
|
||
String toString(){ | ||
name | ||
} | ||
|
||
boolean equals(Object object){ | ||
object && ( | ||
id && id.equals(object?.id) || | ||
name && name.equals(object.name) && region && region.equals(object.region) | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package kuorum | ||
|
||
import org.bson.types.ObjectId | ||
|
||
class ParliamentaryGroup { | ||
|
||
ObjectId id | ||
String name | ||
Institution institution | ||
|
||
//Desnorm from institution: is for make easier searchs | ||
Region region | ||
|
||
static embedded = [ 'institution', 'region' ] | ||
|
||
static constraints = { | ||
name blank: false | ||
institution nullable:false | ||
region validator: { val, obj -> | ||
if (val != obj.institution.region) { | ||
return ['notSameRegionAsInstitution'] | ||
} | ||
} | ||
} | ||
|
||
String toString(){ | ||
name | ||
} | ||
|
||
boolean equals(Object object){ | ||
id.equals(object?.id) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package kuorum | ||
|
||
import org.bson.types.ObjectId | ||
|
||
class Region { | ||
|
||
ObjectId id | ||
String name | ||
Region superRegion | ||
String iso3166_2 | ||
|
||
static constraints = { | ||
iso3166_2 blank: false, | ||
matches: '([A-Z]{2}-)*[A-Z]{2}', // ES-PV España - Pais Vasco | ||
validator: { val, obj -> | ||
if (obj.superRegion && !val.startsWith("${obj.superRegion.iso3166_2}-")) { | ||
return ['incorrectMaterializedPath'] | ||
} | ||
} | ||
superRegion nullable:true | ||
} | ||
|
||
String toString(){ | ||
name | ||
} | ||
|
||
boolean equals(Object object){ | ||
iso3166_2.equals(object?.iso3166_2) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package kuorum.law | ||
|
||
import kuorum.Institution | ||
import kuorum.Region | ||
import kuorum.core.model.CommissionType | ||
|
||
class Law { | ||
|
||
String hashtag | ||
String shortName | ||
String realName | ||
String description | ||
String introduction | ||
List<CommissionType> commissions = [] | ||
Region region | ||
|
||
static embedded = ['region' ] | ||
|
||
static constraints = { | ||
hashtag matches: '#[a-zA-Z0-9]+', nullable: false | ||
shortName nullable: false | ||
commissions nullable: false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package kuorum.post | ||
|
||
import kuorum.users.KuorumUser | ||
|
||
class Cluck { | ||
|
||
/** | ||
* The user who has created the cluck | ||
*/ | ||
KuorumUser owner | ||
/** | ||
* The user who has created the post clucked | ||
*/ | ||
KuorumUser postOwner | ||
|
||
Post post | ||
|
||
static constraints = { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package kuorum.post | ||
|
||
import kuorum.law.Law | ||
import kuorum.users.KuorumUser | ||
|
||
class Post { | ||
|
||
KuorumUser owner | ||
Law law | ||
String title | ||
String text | ||
String photo | ||
Integer numVotes | ||
|
||
static constraints = { | ||
numVotes min:0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package kuorum.post | ||
|
||
import kuorum.users.PersonalData | ||
import kuorum.users.KuorumUser | ||
|
||
/** | ||
* Storage the person vote of each post | ||
*/ | ||
class PostVote { | ||
|
||
Post post | ||
KuorumUser user | ||
PersonalData personalData | ||
|
||
static embedded = ['personalData'] | ||
|
||
static constraints = { | ||
} | ||
} |
Oops, something went wrong.