Changeset 379 for trunk/grails-app


Ignore:
Timestamp:
Apr 26, 2010, 2:31:00 PM (11 years ago)
Author:
roberth
Message:

Updated the person, personrole and personaffiliation view templates in order to create a consistent example for simple tables.
Also updated bootstrap.groovy to contain several persons and roles

Location:
trunk/grails-app
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrap.groovy

    r375 r379  
    6262                            name: "Statician"
    6363                        ).save();
     64
     65                        // Create 30 roles to test pagination
     66                        def roleCounter = 1;
     67                        30.times { new PersonRole( name: "Rol #${roleCounter++}" ).save() }
     68
     69                        // Create persons
    6470                        def person1 = new Person(
    6571                            lastName: "Scientist",
     
    8591                        .save();
    8692
     93                        // Create 30 persons to test pagination
     94                        def personCounter = 1;
     95                        30.times { new Person( firstName: "Person #${roleCounter}", lastName: "Testperson", email: "email${roleCounter++}@testdomain.com" ).save() }
     96
    8797 /*   COMMENTED OUT BECAUSE IT BREAKS EVERYTHING AFTER REFACTORING THE DATAMODEL
    8898
  • trunk/grails-app/controllers/dbnp/studycapturing/PersonRoleController.groovy

    r361 r379  
    2424        if (personRoleInstance.save(flush: true)) {
    2525            flash.message = "${message(code: 'default.created.message', args: [message(code: 'personRole.label', default: 'Role'), personRoleInstance.name])}"
    26             redirect(action: "show", id: personRoleInstance.id)
     26            //redirect(action: "show", id: personRoleInstance.id)
     27            redirect(action: "list")
    2728        }
    2829        else {
     
    6869            if (!personRoleInstance.hasErrors() && personRoleInstance.save(flush: true)) {
    6970                flash.message = "${message(code: 'default.updated.message', args: [message(code: 'personRole.label', default: 'Role'), personRoleInstance.name])}"
    70                 redirect(action: "show", id: personRoleInstance.id)
     71                //redirect(action: "show", id: personRoleInstance.id)
     72                redirect(action: "list")
     73
    7174            }
    7275            else {
     
    9295            catch (org.springframework.dao.DataIntegrityViolationException e) {
    9396                flash.message = "${message(code: 'default.not.deleted.message', args: [message(code: 'personRole.label', default: 'Role'), roleName])}"
    94                 redirect(action: "show", id: params.id)
     97                // redirect(action: "show", id: params.id)
     98                redirect(action: "list")
    9599            }
    96100        }
  • trunk/grails-app/views/person/create.gsp

    r361 r379  
    99    </head>
    1010    <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
    14         </div>
    1511        <div class="body">
    1612            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
     
    9692                </div>
    9793                <div class="buttons">
    98                     <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
     94                   <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
     95                   <span class="button"><g:link class="cancel" action="list">Cancel</g:link></span>
    9996                </div>
    10097            </g:form>
  • trunk/grails-app/views/person/edit.gsp

    r361 r379  
    99    </head>
    1010    <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
    14             <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
    15         </div>
    1611        <div class="body">
    1712            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
     
    109104                <div class="buttons">
    110105                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
    111                     <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
     106                    <span class="button"><g:actionSubmit class="cancel" action="show" value="Cancel" /></span>
    112107                </div>
    113108            </g:form>
  • trunk/grails-app/views/person/list.gsp

    r361 r379  
    99    </head>
    1010    <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
    14         </div>
    1511        <div class="body">
    16             <h1><g:message code="default.list.label" args="[entityName]" /></h1>
     12            <h1>Persons</h1>
    1713            <g:if test="${flash.message}">
    1814            <div class="message">${flash.message}</div>
     
    6561                <g:paginate total="${personInstanceTotal}" />
    6662            </div>
     63            <div class="buttons">
     64                <span class="button"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
     65            </div>
     66
    6767        </div>
    6868    </body>
  • trunk/grails-app/views/person/show.gsp

    r361 r379  
    99    </head>
    1010    <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
    14             <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
    15         </div>
    1611        <div class="body">
    1712            <h1><g:message code="default.show.label" args="[entityName]" /></h1>
     
    9489                    <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
    9590                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
     91                    <span class="button"><g:link class="backToList" action="list">Back to list</g:link></span>
    9692                </g:form>
    9793            </div>
  • trunk/grails-app/views/personAffiliation/create.gsp

    r361 r379  
    99    </head>
    1010    <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="['Affiliation']" /></g:link></span>
    14         </div>
    1511        <div class="body">
    1612            <h1><g:message code="default.create.label" args="['Affiliation']" /></h1>
     
    4137                </div>
    4238                <div class="buttons">
    43                     <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
     39                   <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
     40                   <span class="button"><g:link class="cancel" action="list">Cancel</g:link></span>
    4441                </div>
    4542            </g:form>
  • trunk/grails-app/views/personAffiliation/edit.gsp

    r361 r379  
    99    </head>
    1010    <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="['Affiliation']" /></g:link></span>
    14             <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="['Affiliation']" /></g:link></span>
    15         </div>
    1611        <div class="body">
    1712            <h1><g:message code="default.edit.label" args="['Affiliation']" /></h1>
     
    4540                <div class="buttons">
    4641                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
    47                     <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
     42                    <span class="button"><g:actionSubmit class="cancel" action="show" value="Cancel" /></span>
    4843                </div>
    4944            </g:form>
  • trunk/grails-app/views/personAffiliation/list.gsp

    r361 r379  
    99    </head>
    1010    <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="['Affiliation']" /></g:link></span>
    14         </div>
    1511        <div class="body">
    1612            <h1><g:message code="default.list.label" args="['Affiliation']" /></h1>
     
    4137                <g:paginate total="${personAffiliationInstanceTotal}" />
    4238            </div>
     39            <br clear="all" />
     40            <div class="buttons">
     41                <span class="button"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
     42            </div>
    4343        </div>
    4444    </body>
  • trunk/grails-app/views/personAffiliation/show.gsp

    r361 r379  
    99    </head>
    1010    <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="['Affiliation']" /></g:link></span>
    14             <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="['Affiliation']" /></g:link></span>
    15         </div>
    1611        <div class="body">
    1712            <h1><g:message code="default.show.label" args="['Affiliation']" /></h1>
     
    3833                    <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
    3934                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
     35                    <span class="button"><g:link class="backToList" action="list">Back to list</g:link></span>
    4036                </g:form>
    4137            </div>
  • trunk/grails-app/views/personRole/create.gsp

    r361 r379  
    99    </head>
    1010    <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="['Role']" /></g:link></span>
    14         </div>
     11
    1512        <div class="body">
    1613            <h1><g:message code="default.create.label" args="['Role']" /></h1>
     
    4138                </div>
    4239                <div class="buttons">
    43                     <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
     40                   <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
     41                   <span class="button"><g:link class="cancel" action="list">Cancel</g:link></span>
    4442                </div>
    4543            </g:form>
  • trunk/grails-app/views/personRole/edit.gsp

    r361 r379  
    99    </head>
    1010    <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="['Role']" /></g:link></span>
    14             <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="['Role']" /></g:link></span>
    15         </div>
     11
    1612        <div class="body">
    1713            <h1><g:message code="default.edit.label" args="['Role']" /></h1>
     
    4541                <div class="buttons">
    4642                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
    47                     <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
     43                    <span class="button"><g:actionSubmit class="cancel" action="list" value="Cancel" /></span>
    4844                </div>
    4945            </g:form>
  • trunk/grails-app/views/personRole/list.gsp

    r361 r379  
    99    </head>
    1010    <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="['Role']" /></g:link></span>
    14         </div>
     11
    1512        <div class="body">
    1613            <h1><g:message code="default.list.label" args="['Role']" /></h1>
     
    2219                    <thead>
    2320                        <tr>
    24                        
    2521                            <g:sortableColumn property="name" title="${message(code: 'personRole.name.label', default: 'Name')}" />
    26                        
     22                            <th></th>
    2723                        </tr>
    2824                    </thead>
     
    3127                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
    3228                       
    33                             <td><g:link action="show" id="${personRoleInstance.id}">${fieldValue(bean: personRoleInstance, field: "name")}</g:link></td>
    34                        
     29                            <td>${fieldValue(bean: personRoleInstance, field: "name")}</td>
     30                            <td class="buttons">
     31                              <g:form>
     32                                  <g:hiddenField name="id" value="${personRoleInstance?.id}" />
     33                                  <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
     34                                  <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
     35                              </g:form>
     36                            </td>
    3537                        </tr>
    3638                    </g:each>
     
    4143                <g:paginate total="${personRoleInstanceTotal}" />
    4244            </div>
     45            <div class="buttons">
     46                <span class="button"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
     47            </div>
    4348        </div>
    4449    </body>
  • trunk/grails-app/views/personRole/show.gsp

    r361 r379  
    99    </head>
    1010    <body>
    11         <div class="nav">
    12             <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    13             <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="['Role']" /></g:link></span>
    14             <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="['Role']" /></g:link></span>
    15         </div>
     11   
    1612        <div class="body">
    1713            <h1><g:message code="default.show.label" args="['Role']" /></h1>
     
    3834                    <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
    3935                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
     36                    <span class="button"><g:link class="backToList" action="list">Back to list</g:link></span>
    4037                </g:form>
    4138            </div>
Note: See TracChangeset for help on using the changeset viewer.