Changeset 379


Ignore:
Timestamp:
Apr 26, 2010, 2:31:00 PM (7 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
Files:
15 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>
  • trunk/web-app/css/default_style.css

    r367 r379  
    122122    height: 120px;
    123123}
     124
     125#content .message {
     126    border: 1px solid #ccc; /* #006dba; */
     127    margin-bottom: 10px;
     128    margin-top: 10px;
     129
     130    background: #f7f7f7 url(../images/icons/famfamfam/information.png) 10px 10px no-repeat;
     131    padding: 10px 10px 10px 33px;
     132
     133}
     134
    124135/** END :: content **/
    125136/** START :: footer **/
     
    200211
    201212/** START :: buttons **/
     213.buttons {
     214    margin-top: 10px;
     215    font-size: 10px;
     216    clear: both;
     217}
     218
     219/* Hides the default navigation bar that is added by the Grails scaffolding */
     220/* .nav { display: none; } */
     221
     222/* Links in the buttons section should look just like buttons in the
     223   same section */
     224#content .button a {
     225    color: #333;
     226}
     227.button a {
     228    font-size: 10px;
     229    font-weight: bold;
     230    margin-left: 3px;
     231    margin-right: 3px;
     232    padding-top: 2px;
     233    padding-bottom: 2px;
     234}
    202235.buttons input {
    203236    background: #fff;
     
    208241    font-weight: bold;
    209242    margin-left: 3px;
     243    margin-right: 3px;
    210244    overflow: visible;
    211245    padding: 2px 6px;
    212 }
    213 .buttons input.delete {
    214     background: transparent url(../images/obsolete/default_style/database_delete.png) 5px 50% no-repeat;
    215     padding-left: 28px;
    216 }
    217 .buttons input.edit {
    218     background: transparent url(../images/obsolete/default_style/database_edit.png) 5px 50% no-repeat;
    219     padding-left: 28px;
    220 }
    221 .buttons input.save {
    222     background: transparent url(../images/obsolete/default_style/database_save.png) 5px 50% no-repeat;
    223     padding-left: 28px;
    224 }
    225 .buttons input.delete {
     246    font-family: Verdana, Arial, Helvetica, sans-serif;
     247}
     248
     249.buttons input.delete, .buttons a.delete {
    226250        background: transparent url(../images/icons/famfamfam/delete.png) 5px 50% no-repeat;
    227251        padding-left: 28px;
    228252}
    229 .buttons input.edit {
     253.buttons input.edit, .buttons a.edit {
    230254        background: transparent url(../images/icons/famfamfam/application_edit.png) 5px 50% no-repeat;
    231255        padding-left: 28px;
    232256}
    233 .buttons input.save {
     257.buttons input.save, .buttons a.save {
    234258        background: transparent url(../images/icons/famfamfam/accept.png) 5px 50% no-repeat;
    235259        padding-left: 28px;
    236260}
     261.buttons input.create, .buttons a.create {
     262        background: transparent url(../images/icons/famfamfam/add.png) 5px 50% no-repeat;
     263        padding-left: 28px;
     264}
     265.buttons input.backToList, .buttons a.backToList {
     266        background: transparent url(../images/icons/famfamfam/application.png) 5px 50% no-repeat;
     267        padding-left: 28px;
     268}
     269.buttons input.cancel, .buttons a.cancel {
     270        background: transparent url(../images/icons/famfamfam/delete.png) 5px 50% no-repeat;
     271        padding-left: 28px;
     272        font-weight: normal;
     273}
     274
     275/* Reset the font weight for buttons occurring within the table */
     276td.buttons input { font-weight: normal; }
     277
    237278/** END :: buttons **/
     279
     280/** START :: pagination buttons **/
     281.paginateButtons {
     282    margin-top: 10px;
     283    overflow: auto;
     284    width: 100%;
     285}
     286
     287.paginateButtons a,
     288.paginateButtons span.currentStep {
     289    border:solid 1px #ccc;
     290    margin-right:2px;
     291    display:block;
     292    float:left;
     293    padding:1px 6px;
     294    text-decoration:none;
     295}
     296
     297.paginateButtons a {
     298    color:#0e509e;
     299}
     300
     301.paginateButtons span.currentStep {
     302    background:#2e6ab1;
     303    color:#FFFFFF;
     304}
     305
     306/** END :: pagination buttons **/
    238307
    239308/* START :: ontology autocomplete */
Note: See TracChangeset for help on using the changeset viewer.