From 985cf255dcffeabe505660765f47a4c8babd0bc4 Mon Sep 17 00:00:00 2001 From: Alvaro Date: Sun, 27 Jul 2014 16:47:09 -0300 Subject: [PATCH] =?UTF-8?q?adicionando=20a=20parte=20de=20solu=C3=A7=C3=A3?= =?UTF-8?q?o=20da=20issue=20levantada,=20melhoramento=20da=20lista=20de=20?= =?UTF-8?q?newMembers=20first=20e=20melhorando=20a=20main=20page=20onde=20?= =?UTF-8?q?se=20tem=20um=20link=20para=20fazer=20logout=20#312=20#313=20#3?= =?UTF-8?q?14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rgms/authentication/AuthController.groovy | 3 +- .../rgms/home/HomeController.groovy | 8 +++ .../rgms/member/MemberController.groovy | 17 +++++- grails-app/i18n/messages.properties | 4 ++ grails-app/i18n/messages_pt_BR.properties | 4 ++ grails-app/views/layouts/main.gsp | 3 ++ grails-app/views/member/list.gsp | 53 +++++++++++++++++++ 7 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 grails-app/controllers/rgms/home/HomeController.groovy diff --git a/grails-app/controllers/rgms/authentication/AuthController.groovy b/grails-app/controllers/rgms/authentication/AuthController.groovy index 0219ef8b..6b76c6ee 100644 --- a/grails-app/controllers/rgms/authentication/AuthController.groovy +++ b/grails-app/controllers/rgms/authentication/AuthController.groovy @@ -75,7 +75,8 @@ class AuthController { if (user.passwordChangeRequiredOnNextLogon) { redirect(action: newPassword) } else { - render(view: "/initial") + redirect(uri: "/home/index") + // render(view: "/initial") // redirect(uri: targetUri) } } diff --git a/grails-app/controllers/rgms/home/HomeController.groovy b/grails-app/controllers/rgms/home/HomeController.groovy new file mode 100644 index 00000000..dbed1c98 --- /dev/null +++ b/grails-app/controllers/rgms/home/HomeController.groovy @@ -0,0 +1,8 @@ +package rgms.home + +class HomeController { + + def index() { + render(view: "/initial") + } +} diff --git a/grails-app/controllers/rgms/member/MemberController.groovy b/grails-app/controllers/rgms/member/MemberController.groovy index bc7b3f87..9a3e0f43 100644 --- a/grails-app/controllers/rgms/member/MemberController.groovy +++ b/grails-app/controllers/rgms/member/MemberController.groovy @@ -18,6 +18,10 @@ class MemberController { def list = { params.max = Math.min(params.max ? params.int('max') : 10, 100) def userMemberList = [] + //#if(memberNotApproved) + + def userMemberListNotApproved = [] + //#end def members = []; if (params.get("sort").equals("username")||params.get("sort").equals("enabled")){ params.put("sort","name"); @@ -28,6 +32,11 @@ class MemberController { } for (i in members) { def user = User.findByAuthor(i) + //#if(memberNotApproved) + if(!user.enabled){ + userMemberListNotApproved.add([user:user,member:i]) + } + //#end if (user) userMemberList.add([user: user, member: i]) else @@ -36,7 +45,9 @@ class MemberController { // userMemberList.sort() } - [userMemberInstanceList: userMemberList, memberInstanceTotal: Member.count()] + //#if(memberNotApproved) + [userMemberInstanceList: userMemberList, memberInstanceTotal: Member.count(),userMemberNotApprovedList:userMemberListNotApproved] + //#end } def create = { @@ -94,8 +105,10 @@ class MemberController { def content = message(code: 'mail.body.create.account', args: [memberInstance.name, params.username, password, createLink(absolute: true, uri: '/')]) EmailService emailService = new EmailService(); - emailService.sendEmail(email, mailSender, title, content) + //#if($Email) + //emailService.sendEmail(email, mailSender, title, content) + //#end flash.message = message(code: 'default.created.message', args: [message(code: 'member.label', default: 'Member'), memberInstance.id]) redirect(action: "show", id: memberInstance.id) } diff --git a/grails-app/i18n/messages.properties b/grails-app/i18n/messages.properties index a050fb1a..7d8a29cd 100644 --- a/grails-app/i18n/messages.properties +++ b/grails-app/i18n/messages.properties @@ -31,6 +31,10 @@ default.optimistic.locking.failure=Another user has updated this {0} while you w default.home.label=Home default.list.label={0} List +#{if feature de listagem de novos membros não aprovados} +default.list.label.notApproved={0} not approved List +member.toApprove.label = To Approve +#{/if} default.add.label=Add {0} default.new.label=New {0} default.create.label=Create {0} diff --git a/grails-app/i18n/messages_pt_BR.properties b/grails-app/i18n/messages_pt_BR.properties index 4a0b0d27..6d002906 100644 --- a/grails-app/i18n/messages_pt_BR.properties +++ b/grails-app/i18n/messages_pt_BR.properties @@ -32,6 +32,10 @@ default.optimistic.locking.failure=Outro usuário atualizou este [{0}] enquanto default.home.label=Principal default.list.label={0} Listagem +#{if feature de listagem de novos membros não aprovados} +default.list.label.notApproved={0} não aprovados Listagem +member.toApprove.label = Aprovar +#{/if} default.add.label=Adicionar {0} default.new.label=Novo {0} default.create.label=Criar {0} diff --git a/grails-app/views/layouts/main.gsp b/grails-app/views/layouts/main.gsp index 6a1d024a..6bbc0915 100644 --- a/grails-app/views/layouts/main.gsp +++ b/grails-app/views/layouts/main.gsp @@ -67,6 +67,9 @@ + + +
+ +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
${message(code: 'member.roles.label', default: 'Roles')}${message(code: 'member.toApprove.label', default: 'To Approve')}
${fieldValue(bean: userMemberInstance.member, field: "id")}${fieldValue(bean: userMemberInstance.member, field: "name")}${fieldValue(bean: userMemberInstance.user, field: "username")}${fieldValue(bean: userMemberInstance?.user, field: "enabled")}${fieldValue(bean: userMemberInstance.member, field: "email")}${fieldValue(bean: userMemberInstance?.user, field: "roles")}
+
+ +

${flash.message}