Changeset 377


Ignore:
Timestamp:
Feb 18, 2010, 3:09:18 AM (14 years ago)
Author:
gav
Message:

Svn move InventoryLocation and InventoryStore controllers and views to detailed and complete detailing.

Location:
trunk/grails-app
Files:
10 edited
2 moved

Legend:

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

    r374 r377  
    223223            [order:91, controller:'manufacturerDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
    224224        ]
     225    ],
     226    [order:70, controller:'inventoryStoreDetailed', title:'inventoryStore', action:'list',
     227        subItems: [
     228            [order:10, controller:'inventoryStoreDetailed', title:'Inventory Store List', action:'list', isVisible: { true }],
     229            [order:20, controller:'inventoryStoreDetailed', title:'Create', action:'create', isVisible: { true }],
     230            [order:90, controller:'inventoryStoreDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
     231            [order:91, controller:'inventoryStoreDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
     232        ]
     233    ],
     234    [order:80, controller:'inventoryLocationDetailed', title:'inventoryLocation', action:'list',
     235        subItems: [
     236            [order:10, controller:'inventoryLocationDetailed', title:'Inventory Location List', action:'list', isVisible: { true }],
     237            [order:20, controller:'inventoryLocationDetailed', title:'Create', action:'create', isVisible: { true }],
     238            [order:90, controller:'inventoryLocationDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
     239            [order:91, controller:'inventoryLocationDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
     240        ]
    225241    ]
    226242]
  • trunk/grails-app/controllers/InventoryLocationDetailedController.groovy

    r298 r377  
    1818    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser'])
    1919    def show = {
     20
     21        // In the case of an actionSubmit button, rewrite action name from 'index'.
     22        if(params._action_Show)
     23            params.action='show'
     24
    2025        def inventoryLocationInstance = InventoryLocation.get( params.id )
    2126
     
    4752
    4853    def edit = {
     54
     55        // In the case of an actionSubmit button, rewrite action name from 'index'.
     56        if(params._action_Edit)
     57            params.action='edit'
     58
    4959        def inventoryLocationInstance = InventoryLocation.get( params.id )
    5060
  • trunk/grails-app/controllers/InventoryStoreDetailedController.groovy

    r361 r377  
    11import org.codehaus.groovy.grails.plugins.springsecurity.Secured
    22
    3 class InventoryStoreController extends BaseAppAdminController {
     3@Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager'])
     4class InventoryStoreDetailedController extends BaseController {
    45   
     6    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser'])
    57    def index = { redirect(action:list,params:params) }
    68
     
    1315    }
    1416
     17    @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_InventoryManager', 'ROLE_InventoryUser'])
    1518    def show = {
     19
     20        // In the case of an actionSubmit button, rewrite action name from 'index'.
     21        if(params._action_Show)
     22            params.action='show'
     23
    1624        def inventoryStoreInstance = InventoryStore.get( params.id )
    1725
     
    4351
    4452    def edit = {
     53
     54        // In the case of an actionSubmit button, rewrite action name from 'index'.
     55        if(params._action_Edit)
     56            params.action='edit'
     57
    4558        def inventoryStoreInstance = InventoryStore.get( params.id )
    4659
  • trunk/grails-app/views/inventoryLocationDetailed/create.gsp

    r178 r377  
    55        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    66        <meta name="layout" content="main" />
    7         <title>Create InventoryLocation</title>         
     7        <title>Create InventoryLocation</title>
     8        <nav:resources override="true"/>
    89    </head>
    910    <body>
    1011        <div class="nav">
    11             <span class="menuButton"><g:link class="list" action="list">InventoryLocation List</g:link></span>
     12            <nav:renderSubItems group="navAlt"/>
    1213        </div>
    1314        <div class="body">
    14             <h1>Create InventoryLocation</h1>
    1515            <g:if test="${flash.message}">
    1616            <div class="message">${flash.message}</div>
  • trunk/grails-app/views/inventoryLocationDetailed/edit.gsp

    r178 r377  
    66        <meta name="layout" content="main" />
    77        <title>Edit InventoryLocation</title>
     8        <nav:resources override="true"/>
    89    </head>
    910    <body>
    1011        <div class="nav">
    11             <span class="menuButton"><g:link class="list" action="list">InventoryLocation List</g:link></span>
    12             <span class="menuButton"><g:link class="create" action="create">New InventoryLocation</g:link></span>
     12            <nav:renderSubItems group="navAlt"/>
    1313        </div>
    1414        <div class="body">
    15             <h1>Edit InventoryLocation</h1>
    1615            <g:if test="${flash.message}">
    1716            <div class="message">${flash.message}</div>
     
    4039                            <tr class="prop">
    4140                                <td valign="top" class="name">
    42                                     <label for="inventoryItems">Inventory Items:</label>
    43                                 </td>
    44                                 <td valign="top" class="value ${hasErrors(bean:inventoryLocationInstance,field:'inventoryItems','errors')}">
    45                                    
    46 <ul>
    47 <g:each var="i" in="${inventoryLocationInstance?.inventoryItems?}">
    48     <li><g:link controller="inventoryItem" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
    49 </g:each>
    50 </ul>
    51 <g:link controller="inventoryItem" params="['inventoryLocation.id':inventoryLocationInstance?.id]" action="create">Add InventoryItem</g:link>
    52 
    53                                 </td>
    54                             </tr>
    55                        
    56                             <tr class="prop">
    57                                 <td valign="top" class="name">
    5841                                    <label for="inventoryStore">Inventory Store:</label>
    5942                                </td>
     
    7255                            </tr>
    7356                       
     57                            <tr class="prop">
     58                                <td valign="top" class="name">
     59                                    <label for="inventoryItems">Inventory Items:</label>
     60                                </td>
     61                                <td valign="top" class="value ${hasErrors(bean:inventoryLocationInstance,field:'inventoryItems','errors')}">
     62                                   
     63<ul>
     64<g:each var="i" in="${inventoryLocationInstance?.inventoryItems?}">
     65    <li><g:link controller="inventoryItemDetailed" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
     66</g:each>
     67</ul>
     68<g:link controller="inventoryItemDetailed" params="['inventoryLocation.id':inventoryLocationInstance?.id]" action="create">Add InventoryItem</g:link>
     69
     70                                </td>
     71                            </tr>
     72                       
    7473                        </tbody>
    7574                    </table>
     
    7776                <div class="buttons">
    7877                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
     78                    <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span>
    7979                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
    8080                </div>
  • trunk/grails-app/views/inventoryLocationDetailed/list.gsp

    r178 r377  
    66        <meta name="layout" content="main" />
    77        <title>InventoryLocation List</title>
     8        <nav:resources override="true"/>
    89    </head>
    910    <body>
    1011        <div class="nav">
    11             <span class="menuButton"><g:link class="create" action="create">New InventoryLocation</g:link></span>
     12            <nav:renderSubItems group="navAlt"/>
    1213        </div>
    1314        <div class="body">
    14             <h1>InventoryLocation List</h1>
    1515            <g:if test="${flash.message}">
    1616            <div class="message">${flash.message}</div>
     
    2121                        <tr>
    2222                       
    23                                 <g:sortableColumn property="id" title="Id" />
    24                        
    25                                 <g:sortableColumn property="name" title="Name" />
    26                        
    27                                 <th>Inventory Store</th>
    28                            
    29                                 <g:sortableColumn property="isActive" title="Is Active" />
     23                            <g:sortableColumn property="id" title="Id" />
     24
     25                            <g:sortableColumn property="name" title="Name" />
     26
     27                            <th>Inventory Store</th>
     28
     29                            <g:sortableColumn property="isActive" title="Is Active" />
     30
     31                            <th></th>
    3032                       
    3133                        </tr>
     
    3335                    <tbody>
    3436                    <g:each in="${inventoryLocationInstanceList}" status="i" var="inventoryLocationInstance">
    35                         <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
     37                        <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/inventoryLocationDetailed/show/${inventoryLocationInstance.id}"'/>
     38
    3639                       
    37                             <td><g:link action="show" id="${inventoryLocationInstance.id}">${fieldValue(bean:inventoryLocationInstance, field:'id')}</g:link></td>
     40                            <td>${fieldValue(bean:inventoryLocationInstance, field:'id')}</td>
    3841                       
    3942                            <td>${fieldValue(bean:inventoryLocationInstance, field:'name')}</td>
     
    4245                       
    4346                            <td>${fieldValue(bean:inventoryLocationInstance, field:'isActive')}</td>
     47
     48                            <td>
     49                                <g:link action="show" id="${inventoryLocationInstance.id}">
     50                                    <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" />
     51                                </g:link>
     52                            </td>
    4453                       
    4554                        </tr>
  • trunk/grails-app/views/inventoryLocationDetailed/show.gsp

    r178 r377  
    66        <meta name="layout" content="main" />
    77        <title>Show InventoryLocation</title>
     8        <nav:resources override="true"/>
    89    </head>
    910    <body>
    1011        <div class="nav">
    11             <span class="menuButton"><g:link class="list" action="list">InventoryLocation List</g:link></span>
    12             <span class="menuButton"><g:link class="create" action="create">New InventoryLocation</g:link></span>
     12            <nav:renderSubItems group="navAlt"/>
    1313        </div>
    1414        <div class="body">
    15             <h1>Show InventoryLocation</h1>
    1615            <g:if test="${flash.message}">
    1716            <div class="message">${flash.message}</div>
     
    3736                   
    3837                        <tr class="prop">
    39                             <td valign="top" class="name">Inventory Items:</td>
    40                            
    41                             <td  valign="top" style="text-align:left;" class="value">
    42                                 <ul>
    43                                 <g:each var="i" in="${inventoryLocationInstance.inventoryItems}">
    44                                     <li><g:link controller="inventoryItem" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
    45                                 </g:each>
    46                                 </ul>
    47                             </td>
    48                            
    49                         </tr>
    50                    
    51                         <tr class="prop">
    5238                            <td valign="top" class="name">Inventory Store:</td>
    5339                           
    54                             <td valign="top" class="value"><g:link controller="inventoryStore" action="show" id="${inventoryLocationInstance?.inventoryStore?.id}">${inventoryLocationInstance?.inventoryStore?.encodeAsHTML()}</g:link></td>
     40                            <td valign="top" class="value"><g:link controller="inventoryStoreDetailed" action="show" id="${inventoryLocationInstance?.inventoryStore?.id}">${inventoryLocationInstance?.inventoryStore?.encodeAsHTML()}</g:link></td>
    5541                           
    5642                        </tr>
     
    6046                           
    6147                            <td valign="top" class="value">${fieldValue(bean:inventoryLocationInstance, field:'isActive')}</td>
     48                           
     49                        </tr>
     50                   
     51                        <tr class="prop">
     52                            <td valign="top" class="name">Inventory Items:</td>
     53                           
     54                            <td  valign="top" style="text-align:left;" class="value">
     55                                <ul>
     56                                <g:each var="i" in="${inventoryLocationInstance.inventoryItems}">
     57                                    <li><g:link controller="inventoryItemDetailed" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
     58                                </g:each>
     59                                </ul>
     60                            </td>
    6261                           
    6362                        </tr>
  • trunk/grails-app/views/inventoryStoreDetailed/create.gsp

    r178 r377  
    66        <meta name="layout" content="main" />
    77        <title>Create InventoryStore</title>
     8        <nav:resources override="true"/>
    89    </head>
    910    <body>
    1011        <div class="nav">
    11             <span class="menuButton"><g:link class="list" action="list">InventoryStore List</g:link></span>
     12            <nav:renderSubItems group="navAlt"/>
    1213        </div>
    1314        <div class="body">
    14             <h1>Create InventoryStore</h1>
    1515            <g:if test="${flash.message}">
    1616            <div class="message">${flash.message}</div>
  • trunk/grails-app/views/inventoryStoreDetailed/edit.gsp

    r178 r377  
    66        <meta name="layout" content="main" />
    77        <title>Edit InventoryStore</title>
     8        <nav:resources override="true"/>
    89    </head>
    910    <body>
    1011        <div class="nav">
    11             <span class="menuButton"><g:link class="list" action="list">InventoryStore List</g:link></span>
    12             <span class="menuButton"><g:link class="create" action="create">New InventoryStore</g:link></span>
     12            <nav:renderSubItems group="navAlt"/>
    1313        </div>
    1414        <div class="body">
    15             <h1>Edit InventoryStore</h1>
    1615            <g:if test="${flash.message}">
    1716            <div class="message">${flash.message}</div>
     
    4948                            <tr class="prop">
    5049                                <td valign="top" class="name">
    51                                     <label for="inventoryLocations">Inventory Locations:</label>
    52                                 </td>
    53                                 <td valign="top" class="value ${hasErrors(bean:inventoryStoreInstance,field:'inventoryLocations','errors')}">
    54                                    
    55 <ul>
    56 <g:each var="i" in="${inventoryStoreInstance?.inventoryLocations?}">
    57     <li><g:link controller="inventoryLocation" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
    58 </g:each>
    59 </ul>
    60 <g:link controller="inventoryLocation" params="['inventoryStore.id':inventoryStoreInstance?.id]" action="create">Add InventoryLocation</g:link>
    61 
    62                                 </td>
    63                             </tr>
    64                        
    65                             <tr class="prop">
    66                                 <td valign="top" class="name">
    6750                                    <label for="isActive">Is Active:</label>
    6851                                </td>
     
    8164                            </tr>
    8265                       
     66                            <tr class="prop">
     67                                <td valign="top" class="name">
     68                                    <label for="inventoryLocations">Inventory Locations:</label>
     69                                </td>
     70                                <td valign="top" class="value ${hasErrors(bean:inventoryStoreInstance,field:'inventoryLocations','errors')}">
     71                                   
     72<ul>
     73<g:each var="i" in="${inventoryStoreInstance?.inventoryLocations?}">
     74    <li><g:link controller="inventoryLocationDetailed" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
     75</g:each>
     76</ul>
     77<g:link controller="inventoryLocationDetailed" params="['inventoryStore.id':inventoryStoreInstance?.id]" action="create">Add InventoryLocation</g:link>
     78
     79                                </td>
     80                            </tr>
     81                       
    8382                        </tbody>
    8483                    </table>
     
    8685                <div class="buttons">
    8786                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
     87                    <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span>
    8888                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
    8989                </div>
  • trunk/grails-app/views/inventoryStoreDetailed/list.gsp

    r178 r377  
    66        <meta name="layout" content="main" />
    77        <title>InventoryStore List</title>
     8        <nav:resources override="true"/>
    89    </head>
    910    <body>
    1011        <div class="nav">
    11             <span class="menuButton"><g:link class="create" action="create">New InventoryStore</g:link></span>
     12            <nav:renderSubItems group="navAlt"/>
    1213        </div>
    1314        <div class="body">
    14             <h1>InventoryStore List</h1>
    1515            <g:if test="${flash.message}">
    1616            <div class="message">${flash.message}</div>
     
    2121                        <tr>
    2222                       
    23                                 <g:sortableColumn property="id" title="Id" />
    24                        
    25                                 <g:sortableColumn property="name" title="Name" />
    26                        
    27                                 <g:sortableColumn property="description" title="Description" />
    28                        
    29                                 <g:sortableColumn property="isActive" title="Is Active" />
    30                        
    31                                 <th>Site</th>
     23                            <g:sortableColumn property="id" title="Id" />
     24
     25                            <g:sortableColumn property="name" title="Name" />
     26
     27                            <g:sortableColumn property="description" title="Description" />
     28
     29                            <g:sortableColumn property="isActive" title="Is Active" />
     30
     31                            <th>Site</th>
     32
     33                            <th></th>
    3234                           
    3335                        </tr>
     
    3537                    <tbody>
    3638                    <g:each in="${inventoryStoreInstanceList}" status="i" var="inventoryStoreInstance">
    37                         <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
     39                        <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/inventoryStoreDetailed/show/${inventoryStoreInstance.id}"'/>
    3840                       
    39                             <td><g:link action="show" id="${inventoryStoreInstance.id}">${fieldValue(bean:inventoryStoreInstance, field:'id')}</g:link></td>
     41                            <td>${fieldValue(bean:inventoryStoreInstance, field:'id')}</td>
    4042                       
    4143                            <td>${fieldValue(bean:inventoryStoreInstance, field:'name')}</td>
     
    4648                       
    4749                            <td>${fieldValue(bean:inventoryStoreInstance, field:'site')}</td>
     50
     51                            <td>
     52                                <g:link action="show" id="${inventoryStoreInstance.id}">
     53                                    <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" />
     54                                </g:link>
     55                            </td>
    4856                       
    4957                        </tr>
  • trunk/grails-app/views/inventoryStoreDetailed/show.gsp

    r178 r377  
    66        <meta name="layout" content="main" />
    77        <title>Show InventoryStore</title>
     8        <nav:resources override="true"/>
    89    </head>
    910    <body>
    1011        <div class="nav">
    11             <span class="menuButton"><g:link class="list" action="list">InventoryStore List</g:link></span>
    12             <span class="menuButton"><g:link class="create" action="create">New InventoryStore</g:link></span>
     12            <nav:renderSubItems group="navAlt"/>
    1313        </div>
    1414        <div class="body">
    15             <h1>Show InventoryStore</h1>
    1615            <g:if test="${flash.message}">
    1716            <div class="message">${flash.message}</div>
     
    4443                   
    4544                        <tr class="prop">
    46                             <td valign="top" class="name">Inventory Locations:</td>
    47                            
    48                             <td  valign="top" style="text-align:left;" class="value">
    49                                 <ul>
    50                                 <g:each var="i" in="${inventoryStoreInstance.inventoryLocations}">
    51                                     <li><g:link controller="inventoryLocation" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
    52                                 </g:each>
    53                                 </ul>
    54                             </td>
    55                            
    56                         </tr>
    57                    
    58                         <tr class="prop">
    5945                            <td valign="top" class="name">Is Active:</td>
    6046                           
     
    6652                            <td valign="top" class="name">Site:</td>
    6753                           
    68                             <td valign="top" class="value"><g:link controller="site" action="show" id="${inventoryStoreInstance?.site?.id}">${inventoryStoreInstance?.site?.encodeAsHTML()}</g:link></td>
     54                            <td valign="top" class="value"><g:link controller="siteDetailed" action="show" id="${inventoryStoreInstance?.site?.id}">${inventoryStoreInstance?.site?.encodeAsHTML()}</g:link></td>
     55                           
     56                        </tr>
     57                   
     58                        <tr class="prop">
     59                            <td valign="top" class="name">Inventory Locations:</td>
     60                           
     61                            <td  valign="top" style="text-align:left;" class="value">
     62                                <ul>
     63                                <g:each var="i" in="${inventoryStoreInstance.inventoryLocations}">
     64                                    <li><g:link controller="inventoryLocationDetailed" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
     65                                </g:each>
     66                                </ul>
     67                            </td>
    6968                           
    7069                        </tr>
Note: See TracChangeset for help on using the changeset viewer.