Subversion Repositories SmartDukaan

Rev

Rev 4129 | Rev 5012 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4129 Rev 4755
Line 4... Line 4...
4
    
4
    
5
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
<head>
6
<head>
7
<title>List of Entities</title>
7
<title>List of Entities</title>
8
<link rel="stylesheet" href="css/colorbox.css" type="text/css" />
8
<link rel="stylesheet" href="css/colorbox.css" type="text/css" />
-
 
9
<link rel="stylesheet" href="css/datatable.css" type="text/css" />
9
<script type="text/javascript" src="jquery/jquery-1.4.2.js"></script>
10
<script type="text/javascript" src="jquery/jquery-1.4.2.js"></script>
10
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.core.js"></script>
11
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.core.js"></script>
11
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.widget.js"></script>
12
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.widget.js"></script>
12
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.position.js"></script>
13
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.position.js"></script>
13
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.autocomplete.js"></script>
14
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.autocomplete.js"></script>
14
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.dialog.js"></script>
15
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.dialog.js"></script>
15
<script type="text/javascript" src="jquery/validation/jquery.validate.js"></script>
16
<script type="text/javascript" src="jquery/validation/jquery.validate.js"></script>
-
 
17
<script type="text/javascript" src="jquery/jquery.dataTables.js"></script>
16
 
18
 
17
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.mouse.js"></script>
19
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.mouse.js"></script>
18
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.draggable.js"></script>
20
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.draggable.js"></script>
19
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.resizable.js"></script>
21
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.resizable.js"></script>
20
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.effects.core.js"></script>
22
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.effects.core.js"></script>
Line 23... Line 25...
23
<script type="text/javascript" src="jquery/jquery.chained.js"></script>
25
<script type="text/javascript" src="jquery/jquery.chained.js"></script>
24
<script type="text/javascript" src="jquery/jquery.tablesorter.js"></script>
26
<script type="text/javascript" src="jquery/jquery.tablesorter.js"></script>
25
<script type="text/javascript" src="jquery/thirdparty/jquery.colorbox-min.js"></script>
27
<script type="text/javascript" src="jquery/thirdparty/jquery.colorbox-min.js"></script>
26
<script type="text/javascript" src="js/common.js"></script>
28
<script type="text/javascript" src="js/common.js"></script>
27
<script type="text/javascript" src="js/events.js"></script>
29
<script type="text/javascript" src="js/events.js"></script>
28
<script>
-
 
29
// increase the default animation speed to exaggerate the effect
30
<script type="text/javascript" src="js/entity-index.js"></script>
30
jQuery.fx.speeds._default = 1000;
-
 
31
$(function() {
-
 
32
 
-
 
33
	
-
 
34
	
-
 
35
	$('.category').click(function() {
-
 
36
	    var categoryid = $(this).attr('id') + "-table";
-
 
37
		alert("Toggle style for category" + categoryid);
-
 
38
		$('.category-table').hide();
-
 
39
		$('#'+categoryid).show();
-
 
40
		return false;
-
 
41
	});
-
 
42
	 
-
 
43
	$('.delete').click(function() {
-
 
44
		var entityid = $(this).attr('id');
31
<script type="text/javascript">
45
        $('#dialog').dialog({
-
 
46
                    autoOpen: false,
-
 
47
    				width: 470,
-
 
48
            	    height: 100,
-
 
49
                    modal: true,
-
 
50
    				title: 'Are you sure ? It will be permanently deleted. Continue ?',
-
 
51
                    buttons: {
-
 
52
                    "OK":function() { window.location.href = "/content/entity/" + entityid + "?_method=delete" },
-
 
53
                    "Cancel": function() { $(this).dialog("close"); }
-
 
54
            }
32
    Entity = {};
55
         });
-
 
56
 
-
 
57
		$('#dialog').dialog('open');
-
 
58
 
-
 
59
		return false;
-
 
60
	});
-
 
61
 
-
 
62
	$('.complete').click(function() {
-
 
63
		var entityid = $(this).attr('id');
33
    Entity.arr = #generateEntities($entitiesState);
64
        $('#dialog').dialog({
-
 
65
                    autoOpen: false,
-
 
66
    				width: 470,
-
 
67
            	    height: 100,
34
    Entity.arr.splice(-1,1);
68
                    modal: true,
-
 
69
    				title: 'The item will be completed, you will not be able to make further changes.  Continue?',
-
 
70
                    buttons: {
-
 
71
                    "OK":function() { window.location.href = "/content/item-update/" + entityid + "?_method=put&action=complete" },
-
 
72
                    "Cancel": function() { $(this).dialog("close"); }
-
 
73
            }
-
 
74
         });
-
 
75
 
-
 
76
		$('#dialog').dialog('open');
-
 
77
 
-
 
78
		return false;
35
	Entity.arr.reverse();
79
	});
-
 
80
 
-
 
81
	
-
 
82
    $('.ready').click(function() {
-
 
83
		var entityid = $(this).attr('id');
36
	Entity.start = $entitiesState.size();
84
        $('#dialog').dialog({
-
 
85
                    autoOpen: false,
-
 
86
    				width: 470,
-
 
87
            	    height: 100,
-
 
88
                    modal: true,
-
 
89
    				title: 'The item will become available for consumers to place orders for. Continue?',
-
 
90
                    buttons: {
-
 
91
                    "OK":function() { window.location.href = "/content/item-update/" + entityid + "?_method=put&action=ready" },
-
 
92
                    "Cancel": function() { $(this).dialog("close"); }
-
 
93
            }
-
 
94
         });
-
 
95
 
-
 
96
		$('#dialog').dialog('open');
-
 
97
 
-
 
98
		return false;
-
 
99
	});
-
 
100
	
-
 
101
	
37
	
102
	$('.assign').click(function() {
-
 
103
		var entityid = $(this).attr('id');
-
 
104
		
-
 
105
        $('#dialog-form').dialog({
-
 
106
                    autoOpen: false,
-
 
107
    				width: 470,
-
 
108
            	    height: 400,
-
 
109
                    modal: true,
-
 
110
					title: 'The item will be assigned. Are you sure ?',
-
 
111
                    buttons: {
-
 
112
                    "OK":function() {
-
 
113
					var username = $('#username').val();
-
 
114
						window.location.href = "/content/item-update/" + entityid + "?_method=put&action=assign&username=" + username; 
-
 
115
					},
-
 
116
                    "Cancel": function() { $(this).dialog("close"); }
-
 
117
            }
-
 
118
         });
-
 
119
 
-
 
120
		$('#dialog-form').dialog('open');
-
 
121
 
-
 
122
		return false;
-
 
123
	});
-
 
124
 
-
 
125
	
-
 
126
});
-
 
127
 
-
 
128
$(document).ready(function() 
-
 
129
    { 
-
 
130
        $("#myTable").tablesorter(); 
-
 
131
    } 
-
 
132
); 
-
 
133
 
-
 
134
</script>
38
</script>
135
 
39
 
136
 
40
 
137
<link type="text/css" href="jquery/jqueryui/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
41
<link type="text/css" href="jquery/jqueryui/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
138
<style type="text/css">
42
<style type="text/css">
139
    
43
    
140
* { font-family: Verdana; font-size: 96%; }
44
* { font-family: Verdana; font-size: 96%; }
141
label { width: 10em; float: left; }
45
fieldset.label { width: 10em; float: left; }
142
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
46
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
143
p { clear: both; }
47
p { clear: both; }
144
.submit { margin-left: 12em; }
48
.submit { margin-left: 12em; }
145
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
49
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
146
 
50
 
Line 215... Line 119...
215
    <p></p>
119
    <p></p>
216
    #set ( $entitiesState = $action.getEntitiesState() )
120
    #set ( $entitiesState = $action.getEntitiesState() )
217
	#set ( $users = $action.getAllUserNames() )
121
	#set ( $users = $action.getAllUserNames() )
218
    
122
    
219
    <div>
123
    <div>
220
	#drawAllEntities($entitiesState)
124
        <table id="myTable" style="width:100%"></table>
221
    </div>
125
    </div>
222
</div>
126
</div>
223
 
127
 
224
<div id="dialog" title="">
128
<div id="dialog" title="">
225
</div>
129
</div>
Line 244... Line 148...
244
</div>
148
</div>
245
</body>
149
</body>
246
</html>
150
</html>
247
 
151
 
248
#macro (drawAllEntities $entitiesState)
152
#macro (drawAllEntities $entitiesState)
249
	    <table id="myTable">
153
	    <table id="myTable" style="display:none">
250
	        <thead>
154
	        <thead>
251
            <tr style="border: 1px">
155
            <tr style="border: 1px">
252
                <th>#</th>
156
                <th rowspan="2">#</th>
253
                <th>Entity ID</th>
157
                <th rowspan="2">Entity ID</th>
254
                <th>Category</th>
158
                <th rowspan="2">Category</th>
255
                <th>Brand</th>
159
                <th rowspan="2">Brand</th>
256
                <th>Model Name</th>
160
                <th rowspan="2">Model Name</th>
257
                <th>Model Number</th>
161
                <th rowspan="2">Model Number</th>
258
                <th>Item details</th>
162
                <th rowspan="2">Item details</th>
259
				<th>Current Status</th>
163
				<th rowspan="2">Current Status</th>
260
				<th>Created By</th>
164
				<th rowspan="2">Created By</th>
261
				<th>Assigned To</th>
165
				<th rowspan="2">Assigned To</th>
262
				<th>Completed By</th>
166
				<th rowspan="2">Completed By</th>
263
                <th colspan="5">Actions</th>
167
                <th rowspan="1" colspan="5">Actions</th>
-
 
168
            </tr>
-
 
169
            <tr style="display:none">
-
 
170
                <th rowspan="1" colspan="1"></th>
-
 
171
                <th rowspan="1" colspan="1"></th>
-
 
172
                <th rowspan="1" colspan="1"></th>
-
 
173
                <th rowspan="1" colspan="1"></th>
-
 
174
                <th rowspan="1" colspan="1"></th>
264
            </tr>
175
            </tr>
265
        </thead>
176
        </thead>
266
        <tbody>
177
        <tbody>
267
			
178
			
268
 
179
 
Line 282... Line 193...
282
                </td>
193
                </td>
283
				<td>$entityState.getStatus()</td>
194
				<td>$entityState.getStatus()</td>
284
                <td>$entityState.getCreatedBy()</td>
195
                <td>$entityState.getCreatedBy()</td>
285
				<td>#if($entityState.getAssignedTo())$entityState.getAssignedTo()#end</td>
196
				<td>#if($entityState.getAssignedTo())$entityState.getAssignedTo()#end</td>
286
				<td>#if($entityState.getCompletedBy())$entityState.getCompletedBy()#end</td>
197
				<td>#if($entityState.getCompletedBy())$entityState.getCompletedBy()#end</td>
287
					
-
 
288
                <td><a href="/content/entity/$entityid" target="_blank">View</a></td>
-
 
289
                <!-- <td><a href="" id="$entityid" class="opener">Media</a></td> -->
-
 
290
                <td><a href=""  id="$entityid" class="delete">Delete</a></td>
-
 
291
				<td><a href=""  id="$entityid" class="ready">Approve</a></td>
-
 
292
				
-
 
293
				<td><a href=""  id="$entityid" class="complete">Complete</a></td>
-
 
294
				<td><a href=""  id="$entityid" class="assign">Assign</a></td>
-
 
295
            </tr>
198
            </tr>
296
    #end
199
    #end
297
        </tbody>
200
        </tbody>
298
    </table>
201
    </table>
299
 
202
 
300
#end	
203
#end	
-
 
204
 
-
 
205
 
-
 
206
#macro (generateEntities $entitiesState)
-
 
207
	 [
-
 
208
	 #foreach ( $entityid in $entitiesState.keySet() )
-
 
209
			#set($entityState = $entitiesState.get($entityid))
-
 
210
            [$velocityCount,
-
 
211
            $entityid,
-
 
212
            "$action.getCategoryName($entityState.getCategoryID())",
-
 
213
            "$entityState.getBrand()",
-
 
214
            "$entityState.getModelName()",
-
 
215
            "$entityState.getModelNumber()",
-
 
216
			$entityid,
-
 
217
			"$entityState.getStatus()",
-
 
218
            "$entityState.getCreatedBy()",
-
 
219
			"#if($entityState.getAssignedTo())$entityState.getAssignedTo()#end",
-
 
220
			"#if($entityState.getCompletedBy())$entityState.getCompletedBy()#end",
-
 
221
			$entityid],
-
 
222
	 #end
-
 
223
	 0]
-
 
224
#end
301
225