source: trunk/grails-app/views/inventoryItemDetailed/search.gsp @ 405

Last change on this file since 405 was 405, checked in by gav, 14 years ago

Add estimatedUnitPrice to InventoryItem.
Change InventoryItem to use serviced controller and shared messages.

File size: 8.1 KB
Line 
1
2
3<html>
4    <head>
5        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
6        <meta name="layout" content="main" />
7        <title>InventoryItem Search</title>
8        <nav:resources override="true"/>
9        <g:render template="/shared/pictureHead" />
10        <filterpane:includes />
11        <export:resource />
12    </head>
13    <body>
14        <div class="nav">
15            <nav:renderSubItems group="nav"/>
16        </div>
17        <div class="body">
18            <g:render template="/shared/messages" />
19            <filterpane:currentCriteria domainBean="InventoryItem"
20                                    action="search"
21                                    dateFormat="${'EEE, dd-MMM-yyyy'}"
22                                    removeImgDir="images"
23                                    removeImgFile="bullet_delete.png"
24                                    title="Search"/>
25
26            <div class="paginateButtons">
27                Results: ${inventoryItemInstanceList.size()} / ${inventoryItemInstanceTotal}
28                <span class="searchButtons">
29                    <filterpane:filterButton text="Search" appliedText="Change Search" />
30                </span>
31            </div>
32
33            <jsUtil:toggleControl toggleId="options"
34                                                    imageId="optionsImg"
35                                                    closedImgUrl="${resource(dir:'images/skin',file:'bullet_arrow_right.png')}"
36                                                    openImgUrl="${resource(dir:'images/skin',file:'bullet_arrow_down.png')}"
37                                                    text="${g.message(code: 'default.options.text')}"
38                                                    />
39
40            <div id="options" style="display:none;">
41                <g:form method="post" >
42                    <g:hiddenField name="params" value="${filterParams}" />
43                    <div class="dialog">
44                        <table>
45                            <tbody>
46
47                                <tr class="prop">
48                                    <td valign="top" class="name">
49                                        <label for="max">Results per page:</label>
50                                    </td>
51                                    <td valign="top" class="value">
52                                        <input type="text" maxlength="4" id="description" name="newMax" value="${params.max}"/>
53
54                                        <span class="buttons">
55                                            <g:actionSubmit action="setSearchParamsMax" class="go" value="Update" />
56                                        </span>
57                                    </td>
58                                </tr>
59
60                            </tbody>
61                        </table>
62                    </div>
63                </g:form>
64                <export:formats  params="${filterParams}" formats="['csv', 'excel', 'pdf', 'rtf']"/>
65            </div>
66
67            <br />
68
69            <g:if test="${inventoryItemInstanceList.size() > 10}">
70                <g:if test="${inventoryItemInstanceTotal > inventoryItemInstanceList.size()}">
71                    <div class="paginateButtons">
72                        <g:paginate total="${inventoryItemInstanceTotal}" params="${filterParams}" />
73                    </div>
74                </g:if>
75            </g:if>
76
77            <div class="list">
78                <table>
79                    <thead>
80                        <tr>
81
82                            <th>Picture</th>
83                       
84                                <g:sortableColumn property="name" title="Name" params="${filterParams}" />
85                       
86                                <g:sortableColumn property="description" title="Description" params="${filterParams}" />
87                       
88                            <g:sortableColumn property="unitsInStock" title="Units In Stock" params="${filterParams}" />
89                           
90                            <th>Unit Of Measure</th>
91
92                            <th></th>
93                       
94                        </tr>
95                    </thead>
96                    <tbody>
97                    <g:each in="${inventoryItemInstanceList}" status="i" var="inventoryItemInstance">
98                        <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" />
99
100                            <td class='gallery'>
101                                <g:if test="${inventoryItemInstance.picture}" >
102                                    <wa:pictureLightboxAnchor picture="${inventoryItemInstance.picture}"
103                                                                                        size="${Image.Small}"
104                                                                                        lightboxSize="${Image.Large}"
105                                                                                        target="_blank"
106                                                                                        title="Show Original" />
107                                </g:if>
108                            </td>
109                       
110                            <td onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"' >
111                                ${fieldValue(bean:inventoryItemInstance, field:'name')}
112                            </td>
113                       
114                            <td onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"' >
115                                ${fieldValue(bean:inventoryItemInstance, field:'description')}
116                            </td>
117                       
118                            <td onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"' >
119                                ${fieldValue(bean:inventoryItemInstance, field:'unitsInStock')}
120                            </td>
121                       
122                            <td onclick='window.location = "${request.getContextPath()}/inventoryItemDetailed/show/${inventoryItemInstance.id}"' >
123                                ${fieldValue(bean:inventoryItemInstance, field:'unitOfMeasure')}
124                            </td>
125
126                            <td>
127                                <g:link action="show" id="${inventoryItemInstance.id}">
128                                    <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" />
129                                </g:link>
130                            </td>
131                       
132                        </tr>
133                    </g:each>
134                    </tbody>
135                </table>
136            </div>
137            <div class="paginateButtons">
138                <g:paginate total="${inventoryItemInstanceTotal}" params="${filterParams}" />
139            </div>
140
141            <filterpane:filterPane domainBean="InventoryItem"
142                                    title="Search"
143                                    action="search"
144                                    class="overlayPane"
145                                    excludeProperties=""
146                                    associatedProperties="inventoryLocation.name,
147                                                                            spareFor.name,
148                                                                            manufacturers.name,
149                                                                            suppliers.name"
150                                    filterPropertyValues="${['inventoryLocation.name':[values:InventoryLocation.list()],
151                                                                                'spareFor.name':[values:Asset.list()],
152                                                                                'manufacturers.name':[values:Manufacturer.list()],
153                                                                                'suppliers.name':[values:Supplier.list()],
154                                                                                ]}"/>
155        </div> <!-- end body div -->
156    </body>
157</html>
Note: See TracBrowser for help on using the repository browser.