Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project collections #17

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
87e7e06
Syncing the latest models from test.
chrisala Nov 24, 2014
4c8ef2a
Syncing the latest models from test.
chrisala Nov 24, 2014
2e87e87
Fixed an indexing issue, now both active and completed status are ind…
sat01a Nov 26, 2014
02123f1
Merge pull request #2 from sat01a/master
sat01a Nov 26, 2014
9e31fc6
Synced activity model from test.
chrisala Nov 27, 2014
14961a8
Homepage carousel functionality
sat01a Dec 2, 2014
a0ed4fc
Addressed review comments
sat01a Dec 2, 2014
2a5eb4f
Added an explicit mapping for the MERI plan budget field.
chrisala Dec 2, 2014
9ba99f5
Merge branch 'master' of https://github.com/AtlasOfLivingAustralia/ec…
sat01a Dec 2, 2014
f15bf70
Merge pull request #4 from sat01a/master
sat01a Dec 2, 2014
476a538
Allow promoteOnHomepage to be nullable to support existing data.
chrisala Dec 3, 2014
2e5cfbe
Updated data models for small grants
Oct 8, 2014
4a90373
Updated data models for small grants
Oct 8, 2014
c1a4487
Updated data models for small grants
Dec 4, 2014
209d0e5
Added custom mapping to ES.
sat01a Dec 4, 2014
bb0ac5a
Merge pull request #5 from sat01a/master
chrisala Dec 4, 2014
c48ba50
Updated data models for small grants
Dec 5, 2014
3cfdd59
Descriptions added to attributes
Dec 5, 2014
086d58c
maven repo update: maven.ala.org.au => nexus.ala.org.au
mbohun Dec 8, 2014
1eaccad
Made numberPlanted field mandatory
Jan 5, 2015
aee8430
New green army data models.
Jan 15, 2015
93843d8
Remove unnecessary fields
Jan 15, 2015
b4c5ba7
sync with ala-web-theme:1.1.0 and ala-auth:1.0.0
Jan 29, 2015
c42dfbe
use bootstrap resource defs from ala-web-theme plugin
Feb 2, 2015
26dd465
use nci-auth instead of auth for CAS
Feb 3, 2015
131ecc6
Merge branch 'project_collections' of https://github.com/AtlasOfLivin…
Feb 4, 2015
a2678d5
use config from ala-auth-plugin
Feb 4, 2015
9e28522
use ala-auth
jamirali Feb 4, 2015
8037241
Merge branch 'project_collections' of https://github.com/jamirali/eco…
jamirali Feb 4, 2015
500539f
use ala-bootstrap2 plugin
jamirali Feb 5, 2015
1346886
define app_bootstrap et alia
jamirali Feb 5, 2015
1cfac15
use 1.0-SNAPSHOT of ala-auth
jamirali Feb 6, 2015
8bca871
Merge branch 'project_collections'
chrisala Feb 9, 2015
46c44bf
Merge branch 'project_collections'
chrisala Feb 9, 2015
4395d46
Switched the build over to the ALA nexus repository.
chrisala Feb 10, 2015
9c32414
Merge https://github.com/AtlasOfLivingAustralia/ecodata into project_…
jamirali Feb 10, 2015
b5ae756
Model sync.
chrisala Feb 11, 2015
6181581
Merged branch to master.
chrisala Feb 11, 2015
5a50c59
Merge pull request #20 from chrisala/master
chrisala Feb 11, 2015
fb83739
Removed the auth call that returns the full user list.
chrisala Feb 11, 2015
c8c88c5
Merge pull request #21 from chrisala/master
chrisala Feb 11, 2015
e630ffa
Syncing fieldcapture-dev models with git.
sat01a Feb 11, 2015
3ef6780
Merge pull request #22 from sat01a/master
sat01a Feb 11, 2015
43078c1
Updated the ehcache plugin to allow a cache name to be specified.
chrisala Feb 12, 2015
86e64ac
Merge pull request #23 from chrisala/master
chrisala Feb 12, 2015
dcefc85
Removed a println.
chrisala Feb 12, 2015
348b551
Merge pull request #24 from chrisala/master
sat01a Feb 12, 2015
f9a402f
Dealing with the pain of a case change.
chrisala Feb 12, 2015
f475698
Merge remote-tracking branch 'upstream/master'
chrisala Feb 12, 2015
ff53018
Organisation reporting bulk download and upload functionality
sat01a Feb 12, 2015
bf58005
Including abandoned state.
sat01a Feb 12, 2015
74896c0
Merge pull request #25 from sat01a/master
chrisala Feb 12, 2015
518241f
Merge remote-tracking branch 'upstream/master'
chrisala Feb 13, 2015
2e80c94
fix auth link; add attrs to Project
jamirali Feb 13, 2015
e6cac37
use ala-auth/ala-bootstrap2 instead of ala-web-theme
jamirali Feb 13, 2015
48f8eb4
Merge https://github.com/AtlasOfLivingAustralia/ecodata into project_…
jamirali Feb 16, 2015
4320f9d
Added service provider fields to the project entity.
chrisala Feb 16, 2015
bedac89
fixed security.apikey.serviceUrl
jamirali Feb 16, 2015
d948dc7
Allow the view type to be passed to the project search.
chrisala Feb 17, 2015
7a821ec
Merge pull request #26 from chrisala/master
sat01a Feb 17, 2015
d42dae4
Merge https://github.com/AtlasOfLivingAustralia/ecodata into project_…
jamirali Feb 17, 2015
97a01bf
use ala-auth:1.0
jamirali Feb 18, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Homepage carousel functionality
  • Loading branch information
sat01a committed Dec 2, 2014
commit 14961a8bfce94b87b80fe7dbd0fcd6dbabcfe6a1
4 changes: 4 additions & 0 deletions grails-app/conf/UrlMappings.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class UrlMappings {
controller = 'activity'
action = 'activitiesForProject'
}
"/ws/listPromotionalProjects" {
controller = 'project'
action = 'listPromotionalProjects'
}

"/ws/assessment/$id?" {
controller = 'activity'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ProjectController {
model
}

static ignore = ['action','controller','id']
static ignore = ['action','controller','id']

def index() {
render "${Project.count()} sites"
Expand All @@ -31,7 +31,13 @@ class ProjectController {
list.sort {it.name}
render list as JSON
}


def listPromotionalProjects() {
def list = projectService.listPromotionalProjects()
list.sort {it.name}
render list as JSON
}

def get(String id) {
def includeDeleted = params.boolean('includeDeleted', false)
def levelOfDetail = []
Expand Down
2 changes: 2 additions & 0 deletions grails-app/domain/au/org/ala/ecodata/Project.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Project {
static mapping = {
name index: true
projectId index: true
promoteOnHomepage index: true
version false
}

Expand Down Expand Up @@ -40,6 +41,7 @@ class Project {
Map risks
Date dateCreated
Date lastUpdated
String promoteOnHomepage = 'no'

static constraints = {
externalId nullable:true
Expand Down
12 changes: 11 additions & 1 deletion grails-app/services/au/org/ala/ecodata/ProjectService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ProjectService {
static final BRIEF = 'brief'
static final FLAT = 'flat'
static final ALL = 'all'
static final PROMO = 'promo'
static final OUTPUT_SUMMARY = 'outputs'

def grailsApplication
Expand Down Expand Up @@ -40,7 +41,12 @@ class ProjectService {
def list = includeDeleted ? Project.list() : Project.findAllByStatus(ACTIVE)
list.collect { toMap(it, levelOfDetail) }
}


def listPromotionalProjects(){
def list = Project.findAllByPromoteOnHomepage("yes")
list.collect { toMap(it, PROMO) }
}

/**
* Converts the domain object into a map of properties, including
* dynamic properties.
Expand All @@ -54,6 +60,10 @@ class ProjectService {
if (levelOfDetail == BRIEF) {
return [projectId: prj.projectId, name: prj.name]
}
if (levelOfDetail == PROMO) {
return [projectId: prj.projectId, name: prj.name, organisationName: prj.organisationName, file:"${(int)10 + Math.random() * 3}.jpg",
description: prj.description?.take(200), documents:documentService.findAllForProjectId(prj.projectId, ALL)]
}
def id = mapOfProperties["_id"].toString()
mapOfProperties["id"] = id
mapOfProperties["status"] = mapOfProperties["status"]?.capitalize();
Expand Down