Changeset 163


Ignore:
Timestamp:
Oct 22, 2009, 8:41:21 PM (15 years ago)
Author:
gav
Message:

Add costCode attribute to Site and regen non-detailed controller and views.

Location:
trunk/grails-app
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/SiteController.groovy

    r116 r163  
    2727        if(siteInstance) {
    2828            try {
    29                 siteInstance.delete()
     29                siteInstance.delete(flush:true)
    3030                flash.message = "Site ${params.id} deleted"
    3131                redirect(action:list)
     
    7777        else {
    7878            flash.message = "Site not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
  • trunk/grails-app/domain/Site.groovy

    r121 r163  
    33    String name
    44    String description = ""
     5    String costCode = ""
    56    Boolean isActive = true
    67
  • trunk/grails-app/views/site/create.gsp

    r151 r163  
    4747                            <tr class="prop">
    4848                                <td valign="top" class="name">
     49                                    <label for="costCode">Cost Code:</label>
     50                                </td>
     51                                <td valign="top" class="value ${hasErrors(bean:siteInstance,field:'costCode','errors')}">
     52                                    <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:siteInstance,field:'costCode')}"/>
     53                                </td>
     54                            </tr>
     55                       
     56                            <tr class="prop">
     57                                <td valign="top" class="name">
    4958                                    <label for="isActive">Is Active:</label>
    5059                                </td>
  • trunk/grails-app/views/site/edit.gsp

    r151 r163  
    4545                                <td valign="top" class="value ${hasErrors(bean:siteInstance,field:'description','errors')}">
    4646                                    <input type="text" maxlength="100" id="description" name="description" value="${fieldValue(bean:siteInstance,field:'description')}"/>
     47                                </td>
     48                            </tr>
     49                       
     50                            <tr class="prop">
     51                                <td valign="top" class="name">
     52                                    <label for="costCode">Cost Code:</label>
     53                                </td>
     54                                <td valign="top" class="value ${hasErrors(bean:siteInstance,field:'costCode','errors')}">
     55                                    <input type="text" id="costCode" name="costCode" value="${fieldValue(bean:siteInstance,field:'costCode')}"/>
    4756                                </td>
    4857                            </tr>
  • trunk/grails-app/views/site/list.gsp

    r151 r163  
    2828                                <g:sortableColumn property="description" title="Description" />
    2929                       
     30                                <g:sortableColumn property="costCode" title="Cost Code" />
     31                       
    3032                                <g:sortableColumn property="isActive" title="Is Active" />
    3133                       
     
    4244                            <td>${fieldValue(bean:siteInstance, field:'description')}</td>
    4345                       
     46                            <td>${fieldValue(bean:siteInstance, field:'costCode')}</td>
     47                       
    4448                            <td>${fieldValue(bean:siteInstance, field:'isActive')}</td>
    4549                       
  • trunk/grails-app/views/site/show.gsp

    r151 r163  
    4141                           
    4242                            <td valign="top" class="value">${fieldValue(bean:siteInstance, field:'description')}</td>
     43                           
     44                        </tr>
     45                   
     46                        <tr class="prop">
     47                            <td valign="top" class="name">Cost Code:</td>
     48                           
     49                            <td valign="top" class="value">${fieldValue(bean:siteInstance, field:'costCode')}</td>
    4350                           
    4451                        </tr>
Note: See TracChangeset for help on using the changeset viewer.