Changeset 49
- Timestamp:
- Feb 3, 2009, 6:06:01 PM (16 years ago)
- Location:
- trunk/src/grails-app
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/grails-app/controllers/EntryController.groovy
r40 r49 74 74 def save = { 75 75 def entryInstance = new Entry(params) 76 entryInstance.person = Person.findByUserId(session.userId) 77 76 78 if(!entryInstance.hasErrors() && entryInstance.save()) { 77 79 flash.message = "Entry ${entryInstance.id} created" -
trunk/src/grails-app/views/entry/create.gsp
r39 r49 23 23 </g:hasErrors> 24 24 <g:form action="save" method="post" > 25 <g:hiddenField name="task.id" value="${entryInstance.task.id}" /> 25 26 <div class="dialog"> 26 27 <table> … … 31 32 <label for="task">Task:</label> 32 33 </td> 33 <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'task','errors')}"> 34 <g:select optionKey="id" from="${Task.list()}" name="task.id" value="${entryInstance?.task?.id}" ></g:select> 34 <td valign="top" class="name"> 35 ${entryInstance?.task?.name} 36 </td> 37 </tr> 38 39 <tr class="prop"> 40 <td valign="top" class="name"> 41 <label for="date">Date:</label> 42 </td> 43 <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'date','errors')}"> 44 <g:datePicker name="date" precision='day' value="${entryInstance?.date}" ></g:datePicker> 35 45 </td> 36 46 </tr> … … 45 55 </tr> 46 56 47 <tr class="prop"> 48 <td valign="top" class="name"> 49 <label for="date">Date:</label> 50 </td> 51 <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'date','errors')}"> 52 <g:datePicker name="date" value="${entryInstance?.date}" ></g:datePicker> 53 </td> 54 </tr> 57 55 58 56 59 <tr class="prop"> … … 81 84 </tr> 82 85 83 <tr class="prop">84 <td valign="top" class="name">85 <label for="person">Person:</label>86 </td>87 <td valign="top" class="value ${hasErrors(bean:entryInstance,field:'person','errors')}">88 <g:select optionKey="id" from="${Person.list()}" name="person.id" value="${entryInstance?.person?.id}" ></g:select>89 </td>90 </tr>91 92 86 </tbody> 93 87 </table> -
trunk/src/grails-app/views/entry/show.gsp
r39 r49 11 11 <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span> 12 12 <span class="menuButton"><g:link class="list" action="list">Entry List</g:link></span> 13 <span class="menuButton"><g:link class="create" action="create">New Entry</g:link></span>14 13 </div> 15 14 <div class="body"> -
trunk/src/grails-app/views/task/edit.gsp
r47 r49 34 34 </td> 35 35 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'name','errors')}"> 36 <input type="text" id="name" name="name" value="${fieldValue(bean:taskInstance,field:'name')}"/>36 <input type="text" style="width:200px" id="name" name="name" value="${fieldValue(bean:taskInstance,field:'name')}"/> 37 37 </td> 38 38 </tr> … … 43 43 </td> 44 44 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'description','errors')}"> 45 <input type="text" id="description" name="description" value="${fieldValue(bean:taskInstance,field:'description')}"/> 45 ${hasErrors(bean:taskInstance,field:'description','errors')} 46 <input type="text" style="width:350px" id="description" name="description" value="${fieldValue(bean:taskInstance,field:'description')}"/> 46 47 </td> 47 </tr> 48 48 </tr> 49 49 50 <tr class="prop"> 50 51 <td valign="top" class="name"> 51 <label for="entries">Entries:</label> 52 </td> 53 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'entries','errors')}"> 54 55 <ul> 56 <g:each var="e" in="${taskInstance?.entries?}"> 57 <li><g:link controller="entry" action="show" id="${e.id}">${e?.encodeAsHTML()}</g:link></li> 58 </g:each> 59 </ul> 60 <g:link controller="entry" params="['task.id':taskInstance?.id]" action="create">Add Entry</g:link> 61 62 </td> 63 </tr> 64 65 <tr class="prop"> 66 <td valign="top" class="name"> 67 <label for="modifications">Modifications:</label> 68 </td> 69 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'modifications','errors')}"> 70 71 <ul> 72 <g:each var="m" in="${taskInstance?.modifications?}"> 73 <li><g:link controller="modification" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li> 74 </g:each> 75 </ul> 76 <g:link controller="modification" params="['task.id':taskInstance?.id]" action="create">Add Modification</g:link> 77 78 </td> 79 </tr> 80 81 <tr class="prop"> 82 <td valign="top" class="name"> 83 <label for="leadPerson">Person:</label> 52 <label for="leadPerson">Lead Person:</label> 84 53 </td> 85 54 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'leadPerson','errors')}"> 86 55 <g:select optionKey="id" from="${Person.list()}" name="leadPerson.id" value="${taskInstance?.leadPerson?.id}" ></g:select> 87 56 </td> 88 </tr> 89 57 </tr> 58 90 59 <tr class="prop"> 91 60 <td valign="top" class="name"> … … 93 62 </td> 94 63 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'scheduledDate','errors')}"> 95 <g:datePicker name="scheduledDate" value="${taskInstance?.scheduledDate}" ></g:datePicker>64 <g:datePicker name="scheduledDate" precision='day' value="${taskInstance?.scheduledDate}" ></g:datePicker> 96 65 </td> 97 66 </tr> … … 102 71 </td> 103 72 <td valign="top" class="value ${hasErrors(bean:taskInstance,field:'targetDate','errors')}"> 104 <g:datePicker name="targetDate" value="${taskInstance?.targetDate}" ></g:datePicker>73 <g:datePicker name="targetDate" precision='day' value="${taskInstance?.targetDate}" ></g:datePicker> 105 74 </td> 106 75 </tr> … … 114 83 </td> 115 84 </tr> 85 <tr class="prop"> 86 <td valign="top"> 87 <g:link controller="entry" params="['task.id':taskInstance.id]" action="create">Add Entry</g:link> 88 </td> 89 </tr> 116 90 91 <tr class="prop"> 92 <td valign="top"> 93 <!-- <g:link controller="modification" params="['task.id':taskInstance?.id]" action="showModifications">Show Modifications</g:link> --> 94 <g:link controller="modification" params="['task.id':taskInstance?.id]" action="list">Show Modifications</g:link> 95 </td> 96 </tr> 117 97 </tbody> 118 98 </table>
Note: See TracChangeset
for help on using the changeset viewer.