Permalink
Browse files

Implemened password reset feature, fixed title image, disabled commen…

…ts, various tweaks etc.
  • Loading branch information...
1 parent 6de21e2 commit fca91077bfcd166b91a230194e07d8b36775e3eb @graemerocher graemerocher committed Jul 27, 2009
Showing with 117 additions and 79 deletions.
  1. +1 −0 grails-samples/grails.org/grails-app/conf/UrlMappings.groovy
  2. +30 −1 grails-samples/grails.org/grails-app/controllers/org/grails/auth/UserController.groovy
  3. +1 −2 grails-samples/grails.org/grails-app/controllers/org/grails/plugin/PluginController.groovy
  4. +1 −1 grails-samples/grails.org/grails-app/jobs/MasterPluginTranslationJob.groovy
  5. +1 −17 grails-samples/grails.org/grails-app/views/content/homePage.gsp
  6. +3 −14 grails-samples/grails.org/grails-app/views/layouts/homepage.gsp
  7. +7 −3 grails-samples/grails.org/grails-app/views/layouts/pluginDetails.gsp
  8. +1 −1 grails-samples/grails.org/grails-app/views/layouts/pluginInfoLayout.gsp
  9. +2 −23 grails-samples/grails.org/grails-app/views/layouts/pluginLayout.gsp
  10. +2 −1 grails-samples/grails.org/grails-app/views/layouts/pluginNav.gsp
  11. +2 −8 grails-samples/grails.org/grails-app/views/layouts/subpage.gsp
  12. +0 −5 grails-samples/grails.org/grails-app/views/plugin/_pluginPreview.gsp
  13. +1 −1 grails-samples/grails.org/grails-app/views/user/_loginForm.gsp
  14. +3 −0 grails-samples/grails.org/grails-app/views/user/_profileBox.gsp
  15. +26 −0 grails-samples/grails.org/grails-app/views/user/passwordReminder.gsp
  16. +6 −0 grails-samples/grails.org/grails-app/views/user/profile.gsp
  17. +16 −0 grails-samples/grails.org/web-app/css/new/master.css
  18. +7 −1 grails-samples/grails.org/web-app/css/new/pluginInfo.css
  19. +7 −1 grails-samples/grails.org/web-app/css/new/plugins.css
  20. BIN grails-samples/grails.org/web-app/images/favicon16.png
  21. BIN grails-samples/grails.org/web-app/images/favicon32.png
  22. BIN grails-samples/grails.org/web-app/images/favicon48.png
  23. BIN grails-samples/grails.org/web-app/images/new/content/title_bg.png
@@ -42,6 +42,7 @@ class UrlMappings {
"/upload/$id?"(controller: "content", action: "uploadImage")
"/register"(controller: "user", action: "register")
"/login"(controller: "user", action: "login")
+ "/reminder"(controller: "user", action: "passwordReminder")
"/profile"(controller: "user", action: "profile")
"/logout"(controller: "user", action: "logout")
"/edit/$id"(controller: "content", action: "editWikiPage")
@@ -18,14 +18,43 @@ class UserController {
def scaffold = User
def jsecSecurityManager
+ def mailService
+
+ String randomPass() {
+ UUID uuid = UUID.randomUUID()
+ uuid.toString()[0..7]
+ }
+
+ def passwordReminder = {
+ if(request.method == 'POST') {
+ def user = User.findByLogin(params.login)
+ if(user && user.login!='admin') {
+ def newPassword = randomPass()
+ user.password = DigestUtils.shaHex(newPassword)
+ user.save()
+ mailService.sendMail {
+ from "wiki@grails.org"
+ to user.email
+ title "Grails.org password reset"
+ body "Your password has been reset. Please login with the following password: ${newPassword}"
+ }
+ }
+ else {
+ flash.message = "Username not found"
+ }
+ }
+ }
def profile = {
def userInfo = UserInfo.findByUser(request.user)
if(request.method == 'POST') {
if(!userInfo) userInfo = new UserInfo(user:request.user)
userInfo.properties = params
userInfo.save()
-
+ if(params.password) {
+ request.user.password = DigestUtils.shaHex(params.password)
+ request.user.save()
+ }
}
return [user:request.user, userInfo:userInfo]
@@ -74,8 +74,7 @@ class PluginController extends BaseWikiController {
break
}
- def latestComments = commentService.getLatestComments('plugin', PORTAL_MAX_RESULTS)
- [currentPlugins:currentPlugins, category:category,latestComments:latestComments, totalPlugins:totalPlugins]
+ [currentPlugins:currentPlugins, category:category,totalPlugins:totalPlugins]
}
@@ -3,7 +3,7 @@ class MasterPluginTranslationJob {
def pluginService
def startDelay = 120000 // 120 second start-up
- def timeout = 3600000 // execute job every hour
+ def timeout = 7200000 // execute job 2 hours
def execute() {
log.info "Starting master plugin translation..."
@@ -6,23 +6,7 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta content="homepage" name="layout" />
</head
-<body>
-
-%{--
- <div id="feedLink" >
- <g:link controller="blog" action="feed" params="[format:'rss']"><img border="0" src="${createLinkTo(dir:'images', file:'feed.gif')}" alt="RSS Feed" /></g:link>
- </div>
- <div class="newsItems">
- <div style="float:right; margin-right:10px">
- <g:link controller="blog" action="createEntry">Click here</g:link> to add news
- </div>
-
- <blog:renderEntries number="3" />
- </div>
- <div id="trainingEvents">
- <wiki:text page="Training Events" />
- </div>
---}%
+<body
</body>
</html>
@@ -6,8 +6,8 @@
<g:javascript src="common/application.js"/>
<g:javascript src="common/tracking.js"/>
- <link rel="stylesheet" href="${createLinkTo(dir: 'css/new', file: 'master.css')}" type="text/css" />
- <link rel="stylesheet" href="${createLinkTo(dir: 'css/new', file: 'homepage.css')}" type="text/css" />
+ <link rel="stylesheet" href="${resource(dir: 'css/new', file: 'master.css')}" type="text/css" />
+ <link rel="stylesheet" href="${resource(dir: 'css/new', file: 'homepage.css')}" type="text/css" />
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" />
<link rel="icon" href="/images/favicon.ico" type="image/x-icon">
@@ -67,18 +67,7 @@
<div class="eventDownloadWrapper">
<div id="events">
<h3>Training Events</h3>
- <h4>June 17-19, 2009</h4>
- <p>Groovy and Grails - Belgium, Brussels</p>
- <h4>June 17-19, 2009</h4>
- <p>Groovy and Grails - Belgium, Brussels</p>
- <h4>June 17-19, 2009</h4>
- <p>Groovy and Grails - Belgium, Brussels</p>
- <h4>June 17-19, 2009</h4>
- <p>Groovy and Grails - Belgium, Brussels</p>
- <h4>June 17-19, 2009</h4>
- <p>Groovy and Grails - Belgium, Brussels</p>
- <h4>June 17-19, 2009</h4>
- <p>Groovy and Grails - Belgium, Brussels</p>
+ <wiki:text page="Training Events" />
</div><!-- events -->
<div id="globeGraphic"></div>
@@ -32,7 +32,7 @@
<div id="contentPane">
<div id="pluginBigBox">
-
+ <g:render template="/user/profileBox" />
<div id="pluginBgTop"></div>
<div id="pluginBox">
<div id="pluginDetailWrapper">
@@ -43,8 +43,12 @@
</div>
- <g:render template="/content/commentsFooter" model="[commentType:'plugin', commentObject:plugin, comments:plugin?.comments]"></g:render>
-
+ <div id="btmSectionGraphicsWrapper">
+ <div id="mountainLeft"></div>
+ <div id="knight"></div>
+ <div id="mountainRight"></div>
+ <div id="castle"></div>
+ </div><!-- btmSectionGraphicsWrapper-->
<g:render template="/content/footer"></g:render>
<g:render template="../content/previewPane"/>
@@ -47,7 +47,7 @@
<div id="contentWrapper">
<div id="contentCenter" >
-
+
<g:layoutBody/>
</div><!-- contentCenter -->
</div><!-- contentWrapper -->
@@ -47,32 +47,11 @@
<div id="contentWrapper">
<div id="contentCenter" align="center">
+ <g:render template="/user/profileBox" />
<g:layoutBody/>
</div><!-- contentCenter -->
</div><!-- contentWrapper -->
-<g:if test="${latestComments}">
- <div id="latestComments">
- <h2><img src="${resource(dir:'images/new/plugins/icons', file:'comments.png')}" border="0" /> Most Recent Comments</h2>
- <div id='commentList'>
- <g:each var='comment' status='i' in="${latestComments}">
- <g:set var='oddEven' value="${(i%2==0) ? 'even' : 'odd'}"/>
- <div class='comment ${oddEven}'>
- <g:render template="comment" var="comment" bean="${comment}"/>
- </div>
- </g:each>
- </div>
- </div>
-</g:if>
-
-<div id="footer">
- <div align="center">
- <div class="innerFooter">
- <a href="http://twitter.com/grailsframework"><div class="twitter"></div></a>
- <a href="http://www.springsource.com"><div class="springSource"></div></a>
- <p>&copy; Copyright 2009 SpringSource.<br/>All Rights Reserved.</p>
- </div><!-- innerFooter -->
- </div><!-- center -->
-</div><!-- footer -->
+ <g:render template="/content/footer" />
</body>
</html>
@@ -31,7 +31,8 @@
<ul>
<li><a href="http://grails.org/Creating+Plugins">Creating a plugin</a></li>
<li><a href="http://svn.grails-plugins.codehaus.org">Plugins Fisheye</a></li>
- <li><a href="http://jira.codehaus.org/browse/GRAILSPLUGINS">Plugins JIRA</a></li>
+ <li><a href="http://jira.codehaus.org/browse/GRAILSPLUGINS">JIRA Issue Tracker</a></li>
+ <li><a href="http://grails.org/Mailing+lists">Mailing List Help</a></li>
</ul>
</div>
</div>
@@ -47,9 +47,11 @@
</div><!-- center -->
<div id="contentWrapper" align="center">
+
<div id="contentInnerWrapper">
<div id="contentCenter" >
+ <g:render template="/user/profileBox" />
<div id="contentLogo">
<a href="http://grails.org"><img src="${resource(dir:'images/new', file:'grailslogo_topNav.png')}" border="0"></a>
</div>
@@ -79,20 +81,12 @@
</div>
</div><!-- contentWrapper -->
-<g:if test="${content}">
- <div id="contentComments">
- <g:render template="/content/commentsFooter" model="[commentType:'content', commentObject:content, comments:content?.comments]"></g:render>
-
- </div>
-</g:if>
-<g:else>
<div id="btmSectionGraphicsWrapper">
<div id="mountainLeft"></div>
<div id="knight"></div>
<div id="mountainRight"></div>
<div id="castle"></div>
</div><!-- btmSectionGraphicsWrapper-->
-</g:else>
<g:render template="/content/footer" />
</body>
@@ -42,11 +42,6 @@
</g:link>
</div>
- <div class="comments">
- <g:link fragment="comments" action="show" params="${[name:plugin.name]}">${plugin.comments.size()} Comments
- <img src="${resource(dir:'images/new/plugins/icons', file:'comments.png')}" border="0" />
- </g:link>
- </div>
<div class="download">
<a href="${plugin.downloadUrl}">Download</a>
</div>
@@ -44,7 +44,7 @@
<g:if test="${true == async}"><a href="#" onclick="new Ajax.Updater('${updateElement}','${createLink(controller:'user', action:'register')}',{method:'GET',asynchronous:true,evalScripts:true,parameters:Form.serialize('login')});return false;">click here</a></g:if>
<g:else><g:link controller="user" action="register">click here</g:link></g:else>
</g:set>
- If you do not have an account ${registerLink} to register.
+ If you do not have an account ${registerLink} to register. If you have forgotten your password visit the <g:link controller="user" action="passwordReminder">password</g:link> reminder page.
</div>
</div>
@@ -0,0 +1,3 @@
+<jsec:isLoggedIn>
+ <div id="statusbox">Welcome <strong><jsec:principal /></strong> | <g:link controller="user" action="profile">Profile</g:link> | <g:link controller="user" action="logout">Logout</g:link></div>
+ </jsec:isLoggedIn>
@@ -0,0 +1,26 @@
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <meta name="layout" content="subpage">
+ <title>Password Reminder</title>
+
+ </head>
+
+ <body id="passwordreminder">
+ <p>Enter the username you registered with and your password will be emailed to you:</p>
+ <g:if test="${flash.message}">
+ <div class="error">
+ ${flash.message}
+ </div>
+
+ </g:if>
+ <g:form action="passwordReminder" class="userForm">
+
+ <p>
+ <span class="label"><label for="login">Username:</label></span> <g:textField class="textInput" name="login" value="${formData?.login}"/>
+ </p>
+ <g:submitButton name="Send Password"></g:submitButton>
+
+ </g:form>
+ </body>
+</html>
@@ -19,6 +19,12 @@
<h1>${user?.login}'s Profile</h1>
<div id="profileForm" class="userForm">
<g:form name="register" url="[controller:'user',action:'profile']">
+ <div class="inputForm">
+ <p> <span class="label"><label for="password">Change Password:</label></span>
+ <g:passwordField name="password"></g:passwordField>
+ </p>
+
+ </div>
<div class="inputForm">
<p>
<span class="label"><label for="email">Receive E-mail Updates for Content Changes?:</label></span> <g:checkBox name="emailSubscribed" value="${userInfo?.emailSubscribed}"/>
@@ -22,6 +22,22 @@ h1, h2, h3, h4, h5, h6 {
padding-top:30px;
background: url(/images/new/content/title_bg.png) no-repeat left top;
}
+#statusbox a {
+ color:#48802C;
+ text-decoration:none;
+}
+#statusbox {
+ background-color:white;
+ font-size:10pt;
+ padding:5px;
+ position:absolute;
+ margin-left:730px;
+ float:right;
+ border: 2px solid #e6e6e6;
+}
+#message {
+ margin-bottom:10px;
+}
#contentArea {
width: 910px;
text-align: left;
@@ -61,12 +61,16 @@ body {
#pluginContent {
background: url(../../images/new/plugins/fullpagePlugin_mid.png) repeat-y center top;
background-position: center;
+ margin-top:22px;
+}
+#statusbox {
+ margin-left:950px;
}
.yui-content {
text-align:left;
width:1008px;
min-height:200px;
- padding-top:15px;
+ padding-top:0px;
padding-left:50px;
padding-bottom:15px;
}
@@ -155,6 +159,8 @@ body {
}
.tabOuter {
+ position:relative;
+ top:-20px;
padding-left:30px;
text-align:left;
width:1008px;
@@ -211,7 +211,7 @@ body {
bottom:80px;
padding-right:55px;
- padding-top:20px;
+ padding-top:40px;
padding-bottom:10px;
background: url(../../images/new/plugins/Buttons/download_btn.png) no-repeat right bottom;
}
@@ -286,7 +286,13 @@ body {
color:#767676;
}
+#statusbox {
+ margin-left:950px;
+}
+#paginationPlugins {
+ margin-top:30px;
+}
#paginationPlugins .currentStep {
font-size:0.8em;
padding:5px;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fca9107

Please sign in to comment.