diff --git a/.gitignore b/.gitignore
index 10229ae..6b0c0c9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,26 +1,29 @@
-
-grails-app/conf/NimbleBootStrap.groovy
-grails-app/domain/intient/test/*
-
-.DS_Store
-.sass-cache
-classes
-stacktrace.log
-docs.tar.gz
-
-*~
-*.ipr
-*.iml
-*.iws
-*.war
-web-app/plugins/*
-target/
-test/reports/*
-unzipped/*
-docs/*
-*.zip
-plugin.xml
-
-src/docs
-
-grails-app/i18n/shiro.properties
+
+grails-app/conf/NimbleBootStrap.groovy
+grails-app/domain/intient/test/*
+
+.DS_Store
+.sass-cache
+classes
+stacktrace.log
+docs.tar.gz
+
+*~
+*.ipr
+*.iml
+*.iws
+*.war
+web-app/plugins/*
+web-app/css/*
+web-app/images/*
+web-app/js/*
+target/
+test/reports/*
+unzipped/*
+docs/*
+*.zip
+plugin.xml
+
+src/docs
+
+grails-app/i18n/shiro.properties
diff --git a/NimbleGrailsPlugin.groovy b/NimbleGrailsPlugin.groovy
index 82ed0f0..aadb5e7 100644
--- a/NimbleGrailsPlugin.groovy
+++ b/NimbleGrailsPlugin.groovy
@@ -27,7 +27,7 @@ import grails.plugins.nimble.core.UserBase
class NimbleGrailsPlugin {
// the plugin version
- def version = "0.4-SNAPSHOT"
+ def version = "1.0-SNAPSHOT"
// the version or versions of Grails the plugin is designed for
def grailsVersion = "1.1 > *"
@@ -45,7 +45,7 @@ class NimbleGrailsPlugin {
'grails-app/conf/NimbleBootStrap.groovy',
]
- def author = "Bradley Beddoes and open source contributors"
+ def author = "Bradley Beddoes, Chris Doty, Mike Wille and open source contributors"
def authorEmail = "nimbleproject@googlegroups.com"
def title = "Nimble"
def description = '''\\
@@ -55,7 +55,7 @@ class NimbleGrailsPlugin {
// URL to the plugin's documentation
def documentation = "http://sites.google.com/site/nimbledoc/"
- def observe = ['controllers']
+ def observe = ['controllers', 'services', 'filters']
def doWithSpring = {
loadNimbleConfig(application)
@@ -119,14 +119,19 @@ class NimbleGrailsPlugin {
}
def onChange = { event ->
- doWithDynamicMethods()
+ if(event.source) {
+ injectAuthn(event.source, event.application)
+ }
}
def onConfigChange = { event ->
}
- private void injectAuthn(def clazz, def application) {
+ private void injectAuthn(def clazz, GrailsApplication grailsApplication) {
+ def config = grailsApplication.config
+ GroovyClassLoader classLoader = new GroovyClassLoader(getClass().classLoader)
+
clazz.metaClass.getAuthenticatedSubject = {
def subject = SecurityUtils.getSubject()
}
@@ -134,8 +139,8 @@ class NimbleGrailsPlugin {
def principal = SecurityUtils.getSubject()?.getPrincipal()
def authUser
- if(application.config?.nimble?.implementation?.user)
- authUser = grailsApplication.classLoader.loadClass(application.config.nimble.implementation.user).get(principal)
+ if(config.nimble?.implementation?.user)
+ authUser = classLoader.loadClass(config.nimble.implementation.user).get(principal)
else
authUser = UserBase.get(principal)
@@ -155,6 +160,13 @@ class NimbleGrailsPlugin {
// Merging default Nimble config into main application config
config.merge(new ConfigSlurper(GrailsUtil.environment).parse(classLoader.loadClass('DefaultNimbleConfig')))
+ // Merging default Nimble Social config into main application config if social is used.
+ try {
+ config.merge(new ConfigSlurper(GrailsUtil.environment).parse(classLoader.loadClass('DefaultNimbleSocialConfig')))
+ } catch (Exception ignored) {
+ // ignore, just use the defaults
+ }
+
// Merging user-defined Nimble config into main application config if provided
try {
config.merge(new ConfigSlurper(GrailsUtil.environment).parse(classLoader.loadClass('NimbleConfig')))
diff --git a/application.properties b/application.properties
index 48a09fa..5790f7a 100644
--- a/application.properties
+++ b/application.properties
@@ -1,10 +1,10 @@
-#Grails Metadata file
-#Thu Feb 11 07:30:26 EST 2010
-app.grails.version=1.2.1
-app.name=nimble
-app.servlet.version=2.4
-app.version=0.4
-plugins.hibernate=1.2.1
-plugins.mail=0.6
-plugins.shiro=1.0.1
-plugins.tomcat=1.2.1
+#Grails Metadata file
+#Wed Apr 21 20:59:53 CDT 2010
+app.grails.version=1.3.0.RC1
+app.name=nimble
+app.servlet.version=2.4
+app.version=0.4
+plugins.hibernate=1.3.0.RC1
+plugins.mail=0.6
+plugins.shiro=1.0.1
+plugins.tomcat=1.3.0.RC1
diff --git a/grails-app/conf/BuildConfig.groovy b/grails-app/conf/BuildConfig.groovy
new file mode 100644
index 0000000..f8ee2d7
--- /dev/null
+++ b/grails-app/conf/BuildConfig.groovy
@@ -0,0 +1,25 @@
+grails.project.class.dir = "target/classes"
+grails.project.test.class.dir = "target/test-classes"
+grails.project.test.reports.dir = "target/test-reports"
+grails.project.dependency.resolution = {
+ inherits "global" // inherit Grails' default dependencies
+ log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
+ repositories {
+ grailsHome()
+ // grailsCentral()
+ }
+ dependencies {
+ // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
+ // runtime 'com.mysql:mysql-connector-java:5.1.5'
+ }
+
+}
+
+nimble {
+ resources {
+ nomodcheck = false
+ nocompilesass = false
+ nocompress = false
+ noclean = false
+ }
+}
diff --git a/grails-app/conf/DefaultNimbleConfig.groovy b/grails-app/conf/DefaultNimbleConfig.groovy
index 885c0c6..3e4c56d 100644
--- a/grails-app/conf/DefaultNimbleConfig.groovy
+++ b/grails-app/conf/DefaultNimbleConfig.groovy
@@ -15,6 +15,10 @@
* limitations under the License.
*/
+// change the JavaScript library that grails & nimble use by adjusting this value
+// valid values: jquery, mootools prototype
+grails.views.javascript.library='jquery'
+
nimble {
tablenames {
@@ -28,6 +32,8 @@ nimble {
permission = "permission"
levelpermission = "level_permission"
url = "url"
+ socialmediaaccount = "social_media_account"
+ socialmediaservice = "social_media_service"
}
fieldnames {
@@ -41,6 +47,12 @@ nimble {
customcss = ''
}
+ resources {
+ jslibrary = grails.views.javascript.library
+ usejsdev = false
+ usecssdev = false
+ }
+
localusers {
usernames {
minlength = 4
@@ -51,15 +63,15 @@ nimble {
}
}
- fields {
- admin {
- user['username', 'external', 'federated']
- }
- enduser {
- user['username', 'pass', 'passConfirm']
- profile['fullName', 'email']
- }
- }
+ fields {
+ admin {
+ user = ['username', 'external', 'federated']
+ }
+ enduser {
+ user = ['username', 'pass', 'passConfirm']
+ profile = ['fullName', 'email']
+ }
+ }
passwords {
mustcontain {
diff --git a/grails-app/controllers/grails/plugins/nimble/core/AccountController.groovy b/grails-app/controllers/grails/plugins/nimble/core/AccountController.groovy
index c1b731a..8f4e438 100644
--- a/grails-app/controllers/grails/plugins/nimble/core/AccountController.groovy
+++ b/grails-app/controllers/grails/plugins/nimble/core/AccountController.groovy
@@ -103,6 +103,10 @@ class AccountController {
def user = InstanceGenerator.user()
user.profile = InstanceGenerator.profile()
+ def userFields = grailsApplication.config.nimble.fields.enduser.user
+ def profileFields = grailsApplication.config.nimble.fields.enduser.profile
+ user.properties[userFields] = params
+ user.profile.properties[profileFields] = params
log.debug("Starting new user creation")
[user: user]
@@ -117,9 +121,11 @@ class AccountController {
def user = InstanceGenerator.user()
user.profile = InstanceGenerator.profile()
+ def userFields = grailsApplication.config.nimble.fields.enduser.user
+ def profileFields = grailsApplication.config.nimble.fields.enduser.profile
+ user.properties[userFields] = params
+ user.profile.properties[profileFields] = params
user.profile.owner = user
- user.properties['username', 'pass', 'passConfirm'] = params
- user.profile.properties['fullName', 'email'] = params
user.enabled = grailsApplication.config.nimble.localusers.provision.active
user.external = false
@@ -137,6 +143,10 @@ class AccountController {
if (user.profile.email == null || user.profile.email.length() == 0)
user.profile.email = 'invalid'
+ // Allow host application to do some validation, etc.
+ if(userService.events['beforeregister']) {
+ userService.events['beforeregister'](user)
+ }
if (user.hasErrors()) {
log.debug("Submitted values for new user are invalid")
@@ -170,6 +180,10 @@ class AccountController {
return
}
+ if(userService.events['afterregister']) {
+ userService.events['afterregister'](user)
+ }
+
log.info("Sending account registration confirmation email to $user.profile.email with subject $grailsApplication.config.nimble.messaging.registration.subject")
if(grailsApplication.config.nimble.messaging.enabled) {
sendMail {
@@ -303,7 +317,7 @@ class AccountController {
userService.setRandomPassword(user)
log.info("Sending account password reset email to $user.profile.email with subject $grailsApplication.config.nimble.messaging.passwordreset.subject")
- if(grailsApplication.config.nimble.messaging.enabled) {
+ if(grailsApplication.config.nimble.messaging.enabled && !grailsApplication.config.nimble.provision.active) {
sendMail {
to user.profile.email
from grailsApplication.config.nimble.messaging.mail.from
diff --git a/grails-app/controllers/grails/plugins/nimble/core/AuthController.groovy b/grails-app/controllers/grails/plugins/nimble/core/AuthController.groovy
index 86166d0..ee98dce 100644
--- a/grails-app/controllers/grails/plugins/nimble/core/AuthController.groovy
+++ b/grails-app/controllers/grails/plugins/nimble/core/AuthController.groovy
@@ -36,7 +36,7 @@ import grails.plugins.nimble.auth.AccountCreatedException
class AuthController {
private static String TARGET = 'grails.plugins.nimble.controller.AuthController.TARGET'
-
+
def shiroSecurityManager
def facebookService
def openIDService
@@ -88,7 +88,7 @@ class AuthController {
catch (IncorrectCredentialsException e) {
log.info "Credentials failure for user '${params.username}'."
log.debug(e)
-
+
flash.type = 'error'
flash.message = message(code: "nimble.login.failed.credentials")
}
@@ -324,7 +324,7 @@ class AuthController {
response.sendError(403)
return
}
-
+
def discovered = session.getAttribute("discovered")
ParameterList openIDResponse = new ParameterList(request.getParameterMap());
@@ -356,7 +356,7 @@ class AuthController {
}
else {
log.debug ("OpenID authentication failure")
-
+
flash.type = 'error'
flash.message = message(code: "nimble.login.openid.${service}.internal.error.res")
redirect(action: 'login', params: [active: service])
diff --git a/grails-app/controllers/grails/plugins/nimble/core/UserController.groovy b/grails-app/controllers/grails/plugins/nimble/core/UserController.groovy
index bfac781..b6de222 100644
--- a/grails-app/controllers/grails/plugins/nimble/core/UserController.groovy
+++ b/grails-app/controllers/grails/plugins/nimble/core/UserController.groovy
@@ -84,13 +84,15 @@ class UserController {
redirect action: edit, id: params.id
}
else {
- def fields = grailsApplication.config.nimble.fields.admin.user
- user.properties[fields] = params
- if (!user.validate()) {
- log.debug("Updated details for user [$user.id]$user.username are invalid")
- render view: 'edit', model: [user: user]
- }
- else {
+ def fields = grailsApplication.config.nimble.fields.admin.user
+ def profileFields = grailsApplication.config.nimble.fields.enduser.profile
+ user.properties[fields] = params
+ user.profile.properties[profileFields] = params
+ if (!user.validate()) {
+ log.debug("Updated details for user [$user.id]$user.username are invalid")
+ render view: 'edit', model: [user: user]
+ }
+ else {
def updatedUser = userService.updateUser(user)
log.info("Successfully updated details for user [$user.id]$user.username")
flash.type = "success"
@@ -110,10 +112,10 @@ class UserController {
def save = {
def user = InstanceGenerator.user()
user.profile = InstanceGenerator.profile()
- def userFields = grailsApplication.config.nimble.fields.enduser.user
- def profileFields = grailsApplication.config.nimble.fields.enduser.profile
- user.properties[userFields] = params
- user.profile.properties[profileFields] = params
+ def userFields = grailsApplication.config.nimble.fields.enduser.user
+ def profileFields = grailsApplication.config.nimble.fields.enduser.profile
+ user.properties[userFields] = params
+ user.profile.properties[profileFields] = params
user.enabled = false
user.external = false
diff --git a/grails-app/i18n/messages-nimble.properties b/grails-app/i18n/messages-nimble.properties
index f473c20..d5d7700 100644
--- a/grails-app/i18n/messages-nimble.properties
+++ b/grails-app/i18n/messages-nimble.properties
@@ -132,6 +132,7 @@ nimble.view.account.registeraccount.complete.title=Successfully registered accou
nimble.view.account.registeraccount.complete.heading=Successfully registered account
nimble.view.account.registeraccount.complete.descriptive=You've successfully registered for a new account on this system.
nimble.view.account.registeraccount.complete.sentemail=To complete the process an email has been sent to your nominated email address. Please follow the instructions to login for the first time.
+nimble.view.account.registeraccount.complete.continue=Continue
nimble.view.account.forgottenpassword.initiate.title=Forgotten Password
nimble.view.account.forgottenpassword.initiate.heading=Forgotten Password
@@ -202,6 +203,7 @@ nimble.view.user.show.extendedinformation.heading=Extended account information
##########
# Templates
+nimble.template.sessionterminated.title=Session Terminated
nimble.template.sessionterminated.descriptive=Unfortunately your session has expired. This usually happens when a page is left open for long periods of time without performing any action. If you're experiencing this problem often contact your helpdesk for assistance.
nimble.template.logins.heading=Logins
@@ -246,7 +248,6 @@ nimble.template.passwordpolicy=
To ensure security passwords must meet the fol
Not previously used as a password on this account \
\
Ideally set a password that is considered to be in the category 'strongest' by the indicator bar.
-
nimble.template.accountcreationpolicy=This service integrates with all of the following account providers
\
\
- Google
\
@@ -442,4 +443,4 @@ nimble.levelpermission.invalid.second.sector=The second sector is invalid. It mu
nimble.levelpermission.invalid.third.sector=The third sector is invalid. It must not contain seperator (:) characters
nimble.levelpermission.invalid.fourth.sector=The fourth sector is invalid. It must not contain seperator (:) characters
nimble.levelpermission.invalid.fifth.sector=The fifth sector is invalid. It must not contain seperator (:) characters
-nimble.levelpermission.invalid.sixth.sector=The sixth sector is invalid. It must not contain seperator (:) characters
\ No newline at end of file
+nimble.levelpermission.invalid.sixth.sector=The sixth sector is invalid. It must not contain seperator (:) characters
diff --git a/grails-app/i18n/messages-nimble_de.properties b/grails-app/i18n/messages-nimble_de.properties
index db80c43..57823a4 100644
--- a/grails-app/i18n/messages-nimble_de.properties
+++ b/grails-app/i18n/messages-nimble_de.properties
@@ -132,6 +132,7 @@ nimble.view.account.registeraccount.complete.title = erfolgreich registriert Kon
nimble.view.account.registeraccount.complete.heading = erfolgreich registriert Konto
nimble.view.account.registeraccount.complete.descriptive = Sie haben sich erfolgreich für ein neues Konto auf diesem System registriert.
nimble.view.account.registeraccount.complete.sentemail = Um den Vorgang abzuschließen eine E-Mail wurde an Ihre angegebene E-Mailadresse geschickt. Bitte folgen Sie den Anweisungen, die zum ersten Mal neu anmelden.
+nimble.view.account.registeraccount.complete.continue=Fortsetzen
nimble.view.account.forgottenpassword.initiate.title = Passwort vergessen
nimble.view.account.forgottenpassword.initiate.heading = Passwort vergessen
@@ -201,7 +202,8 @@ nimble.view.user.show.federated.heading = Federated Kontoinformationen
nimble.view.user.show.extendedinformation.heading = Erweiterte Kontoinformationen
##########
-# Templates
+# Templates
+nimble.template.sessionterminated.title=Sitzung Beendet
nimble.template.sessionterminated.descriptive = Leider unterstützt Ihr Sitzung ist abgelaufen. Dies passiert meist, wenn eine Seite offen ist für längere Zeit verlassen ohne eine Aktion auszuführen. Wenn Sie dieses Problem auftritt, sind sie häufig an Ihr Helpdesk wenden.
nimble.template.logins.heading = Anmeldungs
diff --git a/grails-app/i18n/messages_pt_BR.properties b/grails-app/i18n/messages-nimble_pt.properties
similarity index 99%
rename from grails-app/i18n/messages_pt_BR.properties
rename to grails-app/i18n/messages-nimble_pt.properties
index 84a85da..30bf7de 100644
--- a/grails-app/i18n/messages_pt_BR.properties
+++ b/grails-app/i18n/messages-nimble_pt.properties
@@ -1,4 +1,4 @@
-# Nimble i18n Default (English) Messages
+# Nimble i18n Default (Portuguese) Messages
##########
# General
@@ -132,6 +132,7 @@ nimble.view.account.registeraccount.complete.title=Conta registrada com sucesso
nimble.view.account.registeraccount.complete.heading=Conta registrada com sucesso
nimble.view.account.registeraccount.complete.descriptive=Você registrou com sucesso para uma nova conta no sistema.
nimble.view.account.registeraccount.complete.sentemail=Para completar o processo um email foi enviado para o endereço de email digitado. Por favor siga as instruções para entrar pela primeira vez.
+nimble.view.account.registeraccount.complete.continue=Continuar
nimble.view.account.forgottenpassword.initiate.title=Perdeu Senha
nimble.view.account.forgottenpassword.initiate.heading=Perdeu Senha
@@ -201,6 +202,7 @@ nimble.view.user.show.extendedinformation.heading=Informações de conta estendi
##########
# Templates
+nimble.template.sessionterminated.title=Sessão Encerrada
nimble.template.sessionterminated.descriptive=Infelizmente sua sessão expirou. Isto geralmente acontece quando a página é mantida aberta por longos períodos de tempo sem executar nenhuma ação. Se você está passando por esse problema frequentemente entre em contato com o suporte para obter ajuda.
nimble.template.logins.heading=Logins
diff --git a/grails-app/i18n/messages.properties b/grails-app/i18n/messages.properties
new file mode 100644
index 0000000..e69de29
diff --git a/grails-app/services/grails/plugins/nimble/core/UserService.groovy b/grails-app/services/grails/plugins/nimble/core/UserService.groovy
index 30721e0..c32abb8 100644
--- a/grails-app/services/grails/plugins/nimble/core/UserService.groovy
+++ b/grails-app/services/grails/plugins/nimble/core/UserService.groovy
@@ -36,6 +36,12 @@ class UserService {
def grailsApplication
def permissionService
+ /**
+ * login - Called when a user logs in.
+ * logout - Called when a user logs out.
+ * beforeregister - Called immediately before a new user is created. Can be used for validation. (i.e., user.errors.rejectValue('customfield', 'user.customfield.invalid') )
+ * afterregister - Called immediately after a new user is created.
+ */
def events = [:]
/**
diff --git a/grails-app/taglib/NimbleAuthTagLib.groovy b/grails-app/taglib/NimbleAuthTagLib.groovy
index bb71013..2eb86cd 100644
--- a/grails-app/taglib/NimbleAuthTagLib.groovy
+++ b/grails-app/taglib/NimbleAuthTagLib.groovy
@@ -308,11 +308,12 @@ class NimbleAuthTagLib {
}
def facebookConnect = {attrs, body ->
+ def facebook = grailsApplication.config.nimble.facebook.federationprovider.enabled
if (attrs['secure']?.equals('true'))
- out << render(template: "/templates/auth/facebookjs", contextPath: pluginContextPath, model: [secure: true, apikey: facebookService.apiKey])
+ out << render(template: "/templates/auth/facebookjs", contextPath: pluginContextPath, model: [facebook:facebook, secure: true, apikey: facebookService.apiKey])
else
- out << render(template: "/templates/auth/facebookjs", contextPath: pluginContextPath, model: [secure: false, apikey: facebookService.apiKey])
+ out << render(template: "/templates/auth/facebookjs", contextPath: pluginContextPath, model: [facebook:facebook, secure: false, apikey: facebookService.apiKey])
}
}
diff --git a/grails-app/taglib/NimbleHeaderTagLib.groovy b/grails-app/taglib/NimbleHeaderTagLib.groovy
index 1967384..6cffa2a 100644
--- a/grails-app/taglib/NimbleHeaderTagLib.groovy
+++ b/grails-app/taglib/NimbleHeaderTagLib.groovy
@@ -28,22 +28,27 @@ class NimbleHeaderTagLib {
// Enables js for Nimble core UI features
def nimblecore = {attrs ->
- out << render(template: "/templates/header/nimblecore", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
+ out << render(template: "/templates/header/" + grailsApplication.config.nimble.resources.jslibrary + "/nimblecore", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
}
// Enables js for Nimble supplied UI features
def nimbleui = {attrs ->
- out << render(template: "/templates/header/nimbleui", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
+ out << render(template: "/templates/header/" + grailsApplication.config.nimble.resources.jslibrary + "/nimbleui", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
}
// Enables growl like message popup in the page
def growl = {attrs, body ->
- out << render(template: "/templates/header/growl", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
+ out << render(template: "/templates/header/" + grailsApplication.config.nimble.resources.jslibrary + "/growl", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
}
// Imports JQuery Javascript to make the JQuery library available to the current page
- def jquery = {attrs, body ->
- out << render(template: "/templates/header/jquerysetup", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
+ def jsetup = {attrs, body ->
+ out << render(template: "/templates/header/" + grailsApplication.config.nimble.resources.jslibrary + "/setup", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
+ }
+
+ // imports library to do password strength test
+ def pstrength = {attrs, body ->
+ out << render(template: "/templates/header/" + grailsApplication.config.nimble.resources.jslibrary + "/pstrength", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
}
// Imports css required to use FAM FAM FAM icons in buttons etc
@@ -53,7 +58,7 @@ class NimbleHeaderTagLib {
// Imports default Nimble login UI css
def login = {attrs, body ->
- out << render(template: "/templates/header/loginsetup", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
+ out << render(template: "/templates/header/" + grailsApplication.config.nimble.resources.jslibrary + "/loginsetup", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
}
// Imports layouts and javascript required for the administration layout
diff --git a/grails-app/taglib/NimbleInlineJSTagLib.groovy b/grails-app/taglib/NimbleInlineJSTagLib.groovy
index ad694dd..6825cf8 100644
--- a/grails-app/taglib/NimbleInlineJSTagLib.groovy
+++ b/grails-app/taglib/NimbleInlineJSTagLib.groovy
@@ -28,43 +28,48 @@ class NimbleInlineJSTagLib {
// Enables growl message popup when the Grails application stores a message in flash scope
def flashgrowl = {attrs, body ->
- out << render(template: "/templates/inlinejs/flashgrowl", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
+ out << render(template: "/templates/inlinejs/" + grailsApplication.config.nimble.resources.jslibrary + "/flashgrowl", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
+ }
+
+ // admin management
+ def admin = {attrs ->
+ out << render(template: "/templates/inlinejs/" + grailsApplication.config.nimble.resources.jslibrary + "/admin", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath])
}
// User management
def user = {attrs ->
if(attrs.user == null)
throwTagError("User management tag requires user attribute [njs]")
-
- out << render(template: "/templates/inlinejs/user", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath, user:attrs.user])
+
+ out << render(template: "/templates/inlinejs/" + grailsApplication.config.nimble.resources.jslibrary + "/user", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath, user:attrs.user])
}
-
+
def permission = {attrs ->
if(attrs.parent == null)
throwTagError("Permission management tag requires owner attribute [njs]")
-
- out << render(template: "/templates/inlinejs/permission", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath, parent:attrs.parent])
+
+ out << render(template: "/templates/inlinejs/" + grailsApplication.config.nimble.resources.jslibrary + "/permission", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath, parent:attrs.parent])
}
-
+
def role = {attrs ->
if(attrs.parent == null)
throwTagError("Role management tag requires user attribute [njs]")
-
- out << render(template: "/templates/inlinejs/role", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath, parent:attrs.parent])
+
+ out << render(template: "/templates/inlinejs/" + grailsApplication.config.nimble.resources.jslibrary + "/role", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath, parent:attrs.parent])
}
-
+
def group = {attrs ->
if(attrs.parent == null)
throwTagError("Group management tag requires user attribute [njs]")
-
- out << render(template: "/templates/inlinejs/group", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath, parent:attrs.parent])
+
+ out << render(template: "/templates/inlinejs/" + grailsApplication.config.nimble.resources.jslibrary + "/group", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath, parent:attrs.parent])
}
-
+
def member = {attrs ->
if(attrs.parent == null)
throwTagError("Member management tag requires user attribute [njs]")
-
- out << render(template: "/templates/inlinejs/member", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath, parent:attrs.parent])
+
+ out << render(template: "/templates/inlinejs/" + grailsApplication.config.nimble.resources.jslibrary + "/member", contextPath: pluginContextPath, model:[nimblePath:pluginContextPath, parent:attrs.parent])
}
}
\ No newline at end of file
diff --git a/grails-app/taglib/NimbleTagLib.groovy b/grails-app/taglib/NimbleTagLib.groovy
index d87f884..00e8ffa 100644
--- a/grails-app/taglib/NimbleTagLib.groovy
+++ b/grails-app/taglib/NimbleTagLib.groovy
@@ -16,6 +16,7 @@
*/
import grails.plugins.nimble.core.*
+import grails.util.GrailsUtil
/**
* Provides generic, mostly UI related tags to the Nimble application
@@ -28,6 +29,14 @@ class NimbleTagLib {
def recaptchaService
+ def baseJsResourcePath = {
+ out << (grailsApplication.config.nimble.resources.usejsdev ? "dev" : "")
+ }
+
+ def baseCssResourcePath = {
+ out << (grailsApplication.config.nimble.resources.usecssdev ? "dev" : "")
+ }
+
/**
* Provides an inline output of the Grails application message in flash scope
*/
@@ -42,13 +51,6 @@ class NimbleTagLib {
out << render(template: "/templates/sessionterminated", contextPath: pluginContextPath)
}
- /**
- * Provides markup to render confirmation
- */
- def confirm = {attrs, body ->
- out << render(template:"/templates/nimble/help/confirmation", contextPath: pluginContextPath)
- }
-
/**
* provides markup to render grails error messages for beans
*/
@@ -60,27 +62,6 @@ class NimbleTagLib {
out << render("Error: Details not supplied to generate error content")
}
- /**
- * Provides markup to render the default password policy
- */
- def passwordpolicy = {attrs, body ->
- out << render(template: "/templates/nimble/help/passwordpolicy", contextPath: pluginContextPath)
- }
-
- /**
- * Provides markup to render the default username policy
- */
- def usernamepolicy = {attrs, body ->
- out << render(template: "/templates/nimble/help/usernamepolicy")
- }
-
- /**
- * Provides markup to render the default account creation policy
- */
- def accountcreationpolicy = {attrs, body ->
- out << render(template: "/templates/nimble/help/accountcreationpolicy")
- }
-
/**
* Provides markup to render a ReCaptcha instance. Supports the following attributes:
*
@@ -137,7 +118,7 @@ class NimbleTagLib {
if(attrs.action == null || attrs.title == null || attrs.msg == null || attrs.accept == null || attrs.cancel == null)
throwTagError("Confirm action tag requires action, title, msg, accept and cancel attributes")
- out << "${body()}"
+ out << "${body()}"
}
// Allows UI developers to request verification of contents of a field using onBlur
@@ -147,6 +128,12 @@ class NimbleTagLib {
out << render(template: "/templates/tags/verifyfield", contextPath: pluginContextPath, model: [id:attrs.id, cssclass: attrs.class, required:attrs.required, controller:attrs.controller, action:attrs.action, name:attrs.name, value:attrs.value, validmsg:attrs.validmsg, invalidmsg:attrs.invalidmsg] )
}
+
+ def javascript = { attrs ->
+ out << ""
+ }
+ def css = { attrs ->
+ out << """"
+ }
}
-
diff --git a/grails-app/views/account/changepassword.gsp b/grails-app/views/account/changepassword.gsp
index f01aef0..511e5c9 100644
--- a/grails-app/views/account/changepassword.gsp
+++ b/grails-app/views/account/changepassword.gsp
@@ -1,9 +1,9 @@
-
-
+
+
@@ -65,7 +65,9 @@
-
+
diff --git a/grails-app/views/account/createduser.gsp b/grails-app/views/account/createduser.gsp
index d6768ac..e2b1e59 100644
--- a/grails-app/views/account/createduser.gsp
+++ b/grails-app/views/account/createduser.gsp
@@ -19,10 +19,9 @@
-
+
-
-
\ No newline at end of file
+