Changeset 59
- Timestamp:
- Feb 8, 2009, 11:28:04 PM (16 years ago)
- Location:
- branches/TaskRewrite/src
- Files:
-
- 35 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/TaskRewrite/src/grails-app/conf/BootStrap.groovy
r58 r59 46 46 // name:"gnuMims").save() 47 47 48 //Authority 49 def authInstance 50 51 authInstance = new Authority(description:"Application Admin", 52 authority:"ROLE_ADMIN") 53 BootStrapSaveAndTest(authInstance) 54 55 authInstance = new Authority(description:"Application Admin", 56 authority:"ROLE_USER") 57 BootStrapSaveAndTest(authInstance) 48 58 49 59 //Person 50 // def passwordEncoded = authenticateService.encodePassword("pass") 60 def passwordEncoded = authenticateService.encodePassword("pass") 61 def personInstance 51 62 52 defpersonInstance = new Person(loginName:"admin",63 personInstance = new Person(loginName:"admin", 53 64 firstName:"Admin", 54 65 lastName:"Powers", 55 password: authenticateService.encodePassword("pass"),66 password:passwordEncoded, 56 67 email:"admin@example.com") 57 68 BootStrapSaveAndTest(personInstance) 69 personInstance.addToAuthorities(Authority.get(1)) 70 personInstance.addToAuthorities(Authority.get(2)) 58 71 59 //Role 60 def authInstance = new Authority(description:"Application Admin", 61 authority:"ROLE_ADMIN") 62 authInstance.addToPersons(personInstance) 63 authInstance.save() 72 personInstance = new Person(loginName:"user", 73 firstName:"Demo", 74 lastName:"Danza", 75 password:passwordEncoded, 76 email:"user@example.com") 77 BootStrapSaveAndTest(personInstance) 78 personInstance.addToAuthorities(Authority.get(2)) 64 79 65 // new Person(username:"admin", 66 // userRealName:"Admin Powers", 67 // enabled:true, 68 // 69 // new Person(personGroup:PersonGroup.get(3), 70 // firstName:"Admin", 71 // lastName:"Powers", 72 // userId:"admin", 73 // password:"pass").save() 74 // new Person(personGroup:PersonGroup.get(1), 75 // firstName:"Demo", 76 // lastName:"Danza", 77 // userId:"user", 78 // password:"pass").save() 80 personInstance = new Person(loginName:"craig", 81 firstName:"Craig", 82 lastName:"SuperTech", 83 password:passwordEncoded, 84 email:"user@example.com") 85 BootStrapSaveAndTest(personInstance) 86 personInstance.addToAuthorities(Authority.get(2)) 79 87 88 personInstance = new Person(loginName:"joe", 89 firstName:"Joe", 90 lastName:"Samples", 91 password:passwordEncoded, 92 email:"user@example.com") 93 BootStrapSaveAndTest(personInstance) 94 personInstance.addToAuthorities(Authority.get(2)) 80 95 81 // new Person(personGroup:PersonGroup.get(1), 82 // firstName:"Craig", 83 // lastName:"SuperTech", 84 // userId:"craig", 85 // password:"pass").save() 86 // new Person(personGroup:PersonGroup.get(2), 87 // firstName:"Joe", 88 // lastName:"Samples", 89 // userId:"joe", 90 // password:"pass").save() 91 // new Person(personGroup:PersonGroup.get(1), 92 // firstName:"Production", 93 // lastName:"Mann", 94 // userId:"Mann", 95 // password:"pass").save() 96 personInstance = new Person(loginName:"mann", 97 firstName:"Production", 98 lastName:"Mann", 99 password:passwordEncoded, 100 email:"user@example.com") 101 BootStrapSaveAndTest(personInstance) 102 personInstance.addToAuthorities(Authority.get(2)) 103 96 104 97 105 //TaskGroup -
branches/TaskRewrite/src/grails-app/controllers/AuthorityController.groovy
r58 r59 1 2 3 4 /** 5 * Authority Controller. 6 */ 1 @Secured(['ROLE_ADMIN']) 7 2 class AuthorityController { 8 3 -
branches/TaskRewrite/src/grails-app/controllers/LoginController.groovy
r58 r59 38 38 } 39 39 } 40 41 def loggedOut = { 42 flash['message'] = 'Successfully logged out' 43 auth() 44 } 40 45 41 46 /** -
branches/TaskRewrite/src/grails-app/controllers/LogoutController.groovy
r58 r59 9 9 def index = { 10 10 // TODO put any pre-logout code here 11 redirect(uri: '/j_spring_security_logout') 11 12 redirect(uri: '/j_spring_security_logout?logoutSuccessUrl=/login/loggedOut') 12 13 } 13 14 } -
branches/TaskRewrite/src/grails-app/controllers/PersonController.groovy
r58 r59 5 5 * User controller. 6 6 */ 7 @Secured(['ROLE_ADMIN']) 7 8 class PersonController { 8 9 -
branches/TaskRewrite/src/grails-app/domain/Person.groovy
r58 r59 1 1 class Person { 2 2 static transients = ['pass'] 3 static hasMany = [authorities: Authority] 4 static belongsTo = Authority 3 static hasMany = [authorities: Authority, 4 personGroups: PersonGroup] 5 // modifications: Modification, 6 // entries: Entry, 7 // tasks: Task] 8 9 static belongsTo = [Authority, PersonGroup] 5 10 6 11 String loginName … … 25 30 26 31 static constraints = { 27 loginName(blank: false, unique: true) 32 loginName(blank: false, unique: true)//minSize:7 28 33 firstName(blank: false) 29 34 lastName(blank: false) 30 password(blank: false) 35 password(blank: false) //minSize:7 31 36 employeeID(blank: true, nullable:true) 32 37 } -
branches/TaskRewrite/src/grails-app/views/layouts/main.gsp
r56 r59 1 1 <html> 2 2 <head> 3 <title><g:layoutTitle default=" Grails" /></title>3 <title><g:layoutTitle default="gnuMims" /></title> 4 4 <link rel="stylesheet" href="${createLinkTo(dir:'css',file:'main.css')}" /> 5 <link rel="shortcut icon" href="${createLinkTo(dir:'images',file:' favicon.ico')}" type="image/x-icon" />5 <link rel="shortcut icon" href="${createLinkTo(dir:'images',file:'gnuMimsIcon.ico')}" type="image/x-icon" /> 6 6 <g:layoutHead /> 7 <g:javascript library="application" /> 7 <g:javascript library="application" /> 8 8 </head> 9 9 <body> 10 <div id="wrapper" style="height: 100%;"> 11 <div id="top"> 12 </div> 13 <div id="content" align="center"> 10 14 <div id="spinner" class="spinner" style="display:none;"> 11 <img src="${createLinkTo(dir:'images',file:'spinner. gif')}" alt="Spinner" />15 <img src="${createLinkTo(dir:'images',file:'spinner.png')}" alt="Spinner" /> 12 16 </div> 13 <div class="logo"><img src="${createLinkTo(dir:'images',file:'grails_logo.jpg')}" alt="Grails" /></div> 14 <g:layoutBody /> 17 <!-- <div class="logo" style="text-align: center; width: 980px; height: 220px"> 18 <img src="${createLinkTo(dir:'images',file:'logo.png')}" 19 alt="gnuMims" /> 20 <g:render template="/adminmenubar" /> 21 22 </div> --> 23 <div id="Header"> 24 </div> 25 <div class="appControl"> 26 <g:render template="/adminmenubar" /> 27 </div> 28 <!-- Body wrapper div for IE --> 29 <div style="text-align: center; width: 980px"> 30 <g:layoutBody /> 31 </div> 32 </div> 33 <div id="bottom"> 34 </div> 35 </div> 15 36 </body> 16 37 </html> -
branches/TaskRewrite/src/web-app/css/main.css
r55 r59 2 2 margin: 0; 3 3 /*padding: 0; SELECT NOT DISPLAYED CORRECTLY IN FIREFOX */ 4 4 5 } 5 6 … … 13 14 14 15 body { 16 text-align: center; 17 width: 980px 15 18 background: #fff; 16 19 color: #333; 17 20 font: 11px verdana, arial, helvetica, sans-serif; 21 background: transparent url("../images/brushed_metal.png") repeat fixed center; 22 } 23 24 #wrapper { 25 margin: 0 auto; 26 padding: 0; 27 width: 1024px; 28 } 29 30 #top { 31 background: url("../images/topBg.png") no-repeat scroll center; 32 width: 1020px; 33 height: 44px; 34 } 35 36 #content { 37 padding: 0px 20px 20px; 38 background: url("../images/Contentbg.png") repeat-y scroll center; 39 width: 980px; 40 } 41 42 #Header { 43 background: transparent url("../images/logo.png") no-repeat scroll center; 44 width: 980px; 45 height: 160px; 18 46 } 19 47 … … 22 50 font-weight: bold; 23 51 text-decoration: none; 24 } 52 } 25 53 26 54 h1 { … … 28 56 font-weight: normal; 29 57 font-size: 16px; 30 margin: .8em0 .3em 0;58 margin: 0 0 .3em 0; 31 59 } 32 60 33 61 ul { 34 padding-left: 15px; 62 padding-left: 15px; 35 63 } 36 64 … … 56 84 57 85 .body { 58 float: left; 59 margin: 0 15px 10px 15px; 86 padding: 0px 20px 20px; 87 background: url("../images/Contentbg.png") repeat-y scroll center; 88 height: 100%; 89 } 90 91 /* Login/out and Admin*/ 92 93 .appcontrol { 94 text-align: right; 95 padding: 5px 160px 5px 5px 96 } 97 98 .appcontrolButton { 99 font-size: 10px; 100 padding: 5px 5px; 60 101 } 61 102 … … 63 104 64 105 .nav { 65 background: #fff url(../images/skin/shadow.jpg) bottom repeat-x; 66 border: 1px solid #ccc; 67 border-style: solid none solid none; 68 margin-top: 5px; 69 padding: 7px 12px; 70 } 106 text-align: centre; 107 background: url("../images/linkPanel_long.png") top no-repeat; 108 /*border: 1px solid #ccc; 109 border-style: solid none solid none;*/ 110 padding: 15px 0px 0px 0px; 111 width: 980px; 112 height: 40px; 113 } 114 115 /*.nav a{ 116 background: url("../images/linkPanel.png") no-repeat top; 117 display: inline-block; 118 width: 140px; 119 height: 40px; 120 text-decoration: none; 121 }*/ 71 122 72 123 .menuButton { … … 76 127 .menuButton a { 77 128 color: #333; 78 padding: 4px 6px;129 padding: 14px 25px; 79 130 } 80 131 .menuButton a.home { 81 background: url(../images/skin/house.png) center left no-repeat;82 color: #333; 83 padding-left: 25px;132 /*background: url(../images/skin/house.png) center left no-repeat;*/ 133 color: #333; 134 /*padding: 25px;*/ 84 135 } 85 136 .menuButton a.list { 86 background: url(../images/skin/database_table.png) center left no-repeat;87 color: #333; 88 padding-left: 25px;137 /*background: url(../images/skin/database_table.png) center left no-repeat;*/ 138 color: #333; 139 /*padding-left: 25px;*/ 89 140 } 90 141 .menuButton a.create { 91 background: url(../images/skin/database_add.png) center left no-repeat;92 color: #333; 93 padding-left: 25px;142 /*background: url(../images/skin/database_add.png) center left no-repeat;*/ 143 color: #333; 144 /*padding-left: 25px;*/ 94 145 } 95 146 … … 101 152 color: #006dba; 102 153 margin: 10px 0 5px 0; 103 padding: 5px 5px 5px 30px154 padding: 5px 5px 5px 0px 104 155 } 105 156 … … 113 164 div.errors ul { 114 165 list-style: none; 115 padding: 0; 166 padding: 0; 116 167 } 117 168 div.errors li { … … 137 188 border: 0; 138 189 } 139 td, th { 190 td, th { 140 191 font: 11px verdana, arial, helvetica, sans-serif; 141 192 line-height: 12px; … … 266 317 padding-left: 28px; 267 318 } 319 320 #bottom { 321 background: url("../images/bottomBg.png") no-repeat scroll center; 322 width: 1020px; 323 height: 100px; 324 } -
branches/TaskRewrite/src/web-app/index.gsp
r54 r59 1 <html> 2 <head> 3 <title>Welcome to Grails</title> 4 <meta name="layout" content="main" /> 5 </head> 6 <body> 7 <h1 style="margin-left:20px;">Welcome to Grails</h1> 8 <p style="margin-left:20px;width:80%">Congratulations, you have successfully started your first Grails application! At the moment 9 this is the default page, feel free to modify it to either redirect to a controller or display whatever 10 content you may choose. Below is a list of controllers that are currently deployed in this application, 11 click on each to execute its default action:</p> 12 <div class="dialog" style="margin-left:20px;width:60%;"> 13 <ul> 14 <g:each var="c" in="${grailsApplication.controllerClasses}"> 15 <li class="controller"><g:link controller="${c.logicalPropertyName}">${c.fullName}</g:link></li> 16 </g:each> 17 </ul> 18 </div> 19 </body> 20 </html> 1 <%response.sendRedirect(request.getContextPath()+'/appCore/home')%>
Note: See TracChangeset
for help on using the changeset viewer.