Skip to content

Commit

Permalink
adicionando a parte de solução da issue levantada, melhoramento da li…
Browse files Browse the repository at this point in the history
…sta de newMembers first e melhorando a main page onde se tem um link para fazer logout spgroup#312 spgroup#313 spgroup#314
  • Loading branch information
Alvaro committed Jul 27, 2014
1 parent e913f21 commit 985cf25
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ class AuthController {
if (user.passwordChangeRequiredOnNextLogon) {

This comment has been minimized.

Copy link
@pauloborba

pauloborba Jul 30, 2014

não implementa os cenários especificados

This comment has been minimized.

Copy link
@asilvino

asilvino via email Aug 2, 2014

Owner
redirect(action: newPassword)
} else {
render(view: "/initial")
redirect(uri: "/home/index")
// render(view: "/initial")
// redirect(uri: targetUri)
}
}
Expand Down
8 changes: 8 additions & 0 deletions grails-app/controllers/rgms/home/HomeController.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package rgms.home

class HomeController {

def index() {
render(view: "/initial")
}
}
17 changes: 15 additions & 2 deletions grails-app/controllers/rgms/member/MemberController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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
Expand All @@ -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 = {
Expand Down Expand Up @@ -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)

This comment has been minimized.

Copy link
@asilvino

asilvino Jul 30, 2014

Owner

resolver essa situação


//#if($Email)

This comment has been minimized.

Copy link
@pauloborba

pauloborba Jul 30, 2014

não faz sentido. removendo funcionalidade que funcionava!

//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)
}
Expand Down
4 changes: 4 additions & 0 deletions grails-app/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions grails-app/i18n/messages_pt_BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
3 changes: 3 additions & 0 deletions grails-app/views/layouts/main.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
</head>
<body>
<div id="grailsLogo" role="banner"><a href="http://grails.org"><img src="${resource(dir: 'images', file: 'icon.png')}" alt="Grails"/></a></div><!-- grails_logo.png -->
<g:if test="${(params.controller!='auth')}">
<label><g:link controller="auth" action="signOut">Logout</g:link></label>
</g:if>
<g:layoutBody/>
<div class="footer" role="contentinfo">
<p>©2012 Research Group Management System</p>
Expand Down
53 changes: 53 additions & 0 deletions grails-app/views/member/list.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,59 @@
<span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
</div>
<div class="body">

<h1><g:message code="default.list.label.notApproved" args="[entityName]" /></h1>

<div class="list">
<table>
<thead>
<tr>

<g:sortableColumn property="id" title="${message(code: 'member.id.label', default: 'Id')}" />

<g:sortableColumn property="name" title="${message(code: 'member.name.label', default: 'Name')}" />

<g:sortableColumn property="username" title="${message(code: 'member.username.label', default: 'Username')}" />

<g:sortableColumn property="enabled" title="${message(code: 'member.enabled.label', default: 'Enabled')}" />

<g:sortableColumn property="email" title="${message(code: 'member.email.label', default: 'Email')}" />

<th>${message(code: 'member.roles.label', default: 'Roles')}</th>

<th>${message(code: 'member.toApprove.label', default: 'To Approve')}</th>

</tr>
</thead>
<tbody>
<g:each in="${userMemberNotApprovedList}" status="i" var="userMemberInstance">
<tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

<td><g:link action="show" id="${userMemberInstance.member.id}">${fieldValue(bean: userMemberInstance.member, field: "id")}</g:link></td>

<td>${fieldValue(bean: userMemberInstance.member, field: "name")}</td>

<!-- <td>{fieldValue(bean: memberInstance, field: "lastName")}</td>-->

<td>${fieldValue(bean: userMemberInstance.user, field: "username")}</td>

<td>${fieldValue(bean: userMemberInstance?.user, field: "enabled")}</td>

<td><a href="mailto:${fieldValue(bean: userMemberInstance.member, field: "email")}">${fieldValue(bean: userMemberInstance.member, field: "email")}</a></td>

<td>${fieldValue(bean: userMemberInstance?.user, field: "roles")}</td>

<!--
<td>${fieldValue(bean: userMemberInstance?.user, field: "permissions")}</td>
-->
<td><input type="checkbox" name="vehicle" value="Bike"></td>
</tr>
</g:each>
</tbody>
</table>
</div>


<h1><g:message code="default.list.label" args="[entityName]" /></h1>
<g:if test="${flash.message}">
<div class="message">${flash.message}</div>
Expand Down

0 comments on commit 985cf25

Please sign in to comment.