Subversion Repositories SmartDukaan

Rev

Rev 2838 | Rev 4755 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
162 naveen 1
<!DOCTYPE html PUBLIC 
2
    "-//W3C//DTD XHTML 1.1 Transitional//EN"
3
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
 
5
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
<head>
7
<title>List of Entities</title>
4129 mandeep.dh 8
<link rel="stylesheet" href="css/colorbox.css" type="text/css" />
242 naveen 9
<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.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.autocomplete.js"></script>
14
<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
 
17
<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>
19
<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>
21
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.effects.blind.js"></script>
22
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.effects.drop.js"></script>
516 rajveer 23
<script type="text/javascript" src="jquery/jquery.chained.js"></script>
579 rajveer 24
<script type="text/javascript" src="jquery/jquery.tablesorter.js"></script>
4129 mandeep.dh 25
<script type="text/javascript" src="jquery/thirdparty/jquery.colorbox-min.js"></script>
26
<script type="text/javascript" src="js/common.js"></script>
27
<script type="text/javascript" src="js/events.js"></script>
242 naveen 28
<script>
29
// increase the default animation speed to exaggerate the effect
30
jQuery.fx.speeds._default = 1000;
31
$(function() {
579 rajveer 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');
725 chandransh 45
        $('#dialog').dialog({
579 rajveer 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
            }
55
         });
56
 
57
		$('#dialog').dialog('open');
58
 
59
		return false;
60
	});
1051 rajveer 61
 
62
	$('.complete').click(function() {
63
		var entityid = $(this).attr('id');
64
        $('#dialog').dialog({
65
                    autoOpen: false,
66
    				width: 470,
67
            	    height: 100,
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;
79
	});
80
 
579 rajveer 81
 
725 chandransh 82
    $('.ready').click(function() {
83
		var entityid = $(this).attr('id');
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: {
1152 rajveer 91
                    "OK":function() { window.location.href = "/content/item-update/" + entityid + "?_method=put&action=ready" },
725 chandransh 92
                    "Cancel": function() { $(this).dialog("close"); }
93
            }
94
         });
95
 
96
		$('#dialog').dialog('open');
97
 
98
		return false;
99
	});
1051 rajveer 100
 
101
 
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
 
242 naveen 126
});
516 rajveer 127
 
579 rajveer 128
$(document).ready(function() 
129
    { 
130
        $("#myTable").tablesorter(); 
131
    } 
132
); 
133
 
516 rajveer 134
</script>
135
 
579 rajveer 136
 
198 naveen 137
<link type="text/css" href="jquery/jqueryui/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
162 naveen 138
<style type="text/css">
212 naveen 139
 
140
* { font-family: Verdana; font-size: 96%; }
141
label { width: 10em; float: left; }
142
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
143
p { clear: both; }
144
.submit { margin-left: 12em; }
145
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
146
 
162 naveen 147
table {
148
    border-width: 1px 1px 1px 1px;
149
    border-spacing: 2px;
150
    border-style: outset outset outset outset;
151
    border-color: gray gray gray gray;
152
    border-collapse: separate;
153
    background-color: white;
154
}
155
th {
156
    border-width: 1px 1px 1px 1px;
157
    padding: 1px 1px 1px 1px;
158
    border-style: inset inset inset inset;
159
    border-color: gray gray gray gray;
160
    background-color: white;
161
    -moz-border-radius: 0px 0px 0px 0px;
162
}
163
td {
164
    border-width: 1px 1px 1px 1px;
165
    padding: 1px 1px 1px 1px;
166
    border-style: inset inset inset inset;
167
    border-color: gray gray gray gray;
168
    background-color: white;
169
    -moz-border-radius: 0px 0px 0px 0px;
170
}
242 naveen 171
div.dialog {
172
    padding:12px;
173
    font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif";
174
}
162 naveen 175
</style>
242 naveen 176
 
162 naveen 177
</head>
178
<body>
208 naveen 179
<div>
1051 rajveer 180
	<span align="right"> Welcome $action.getUsername()   <a href="$request.contextPath/logout">logout</a></span>
181
</div>
182
<div>
2768 mandeep.dh 183
    <p/>
2838 mandeep.dh 184
    <span align="right"> <a href="$request.contextPath/special-page">Go to special pages</a></span>
2768 mandeep.dh 185
    <p/>
2276 rajveer 186
 
187
	<p/>
188
	<span align="right"> <a href="$request.contextPath/helpdoc">Go to helpdoc</a></span>
189
	<p/>
162 naveen 190
    <h1>Entities</h1>
242 naveen 191
 
1051 rajveer 192
	<div style="color:green;">
242 naveen 193
    #sactionmessage()
1051 rajveer 194
	</div>
195
	<div style="color:red;">
196
	#sactionerror()
197
	</div>
2095 rajveer 198
 
199
	#set($inconsistententities = $action.getInconsistentEntities())
2097 rajveer 200
 
201
	#if($inconsistententities && !$inconsistententities.isEmpty())
202
		<div style="color:red;">
2095 rajveer 203
		Following entities are not yet complete.
204
		<ul>
205
		#foreach($inconsistententity in $inconsistententities)
206
			<li>$inconsistententity</li>
207
		#end
208
		</ul>
209
		Please complete them before 2.45 PM. Otherwise these entities will be removed from www.saholic.com. 
210
	</div>
211
	#end
1152 rajveer 212
    <!--
1051 rajveer 213
    <a href="$request.contextPath/entity/new">Create New</a>
1152 rajveer 214
	-->
162 naveen 215
    <p></p>
1152 rajveer 216
    #set ( $entitiesState = $action.getEntitiesState() )
1051 rajveer 217
	#set ( $users = $action.getAllUserNames() )
250 naveen 218
 
219
    <div>
1152 rajveer 220
	#drawAllEntities($entitiesState)
250 naveen 221
    </div>
1051 rajveer 222
</div>
250 naveen 223
 
1051 rajveer 224
<div id="dialog" title="">
225
</div>
579 rajveer 226
 
1051 rajveer 227
<div style="display:none;">
228
<div id="dialog-form" title="Select an user to assign">
229
    <p class="validateTips">All form fields are required.</p> 
230
 	<form> 
231
	<fieldset> 
232
		<label for="user">Username</label> 
233
		<select id="username" name="username">
234
		#foreach($user in $users)
235
			<option value="$user" class="text ui-widget-content ui-corner-all">$user</option>
579 rajveer 236
		#end
1051 rajveer 237
        </select>
579 rajveer 238
 
1051 rajveer 239
	</fieldset> 
240
	</form>
241
</div> 
250 naveen 242
</div>
4129 mandeep.dh 243
<div id="items">
244
</div>
250 naveen 245
</body>
246
</html>
247
 
1152 rajveer 248
#macro (drawAllEntities $entitiesState)
579 rajveer 249
	    <table id="myTable">
250
	        <thead>
251
            <tr style="border: 1px">
252
                <th>#</th>
253
                <th>Entity ID</th>
254
                <th>Category</th>
255
                <th>Brand</th>
2605 rajveer 256
                <th>Model Name</th>
579 rajveer 257
                <th>Model Number</th>
4129 mandeep.dh 258
                <th>Item details</th>
1051 rajveer 259
				<th>Current Status</th>
260
				<th>Created By</th>
261
				<th>Assigned To</th>
262
				<th>Completed By</th>
263
                <th colspan="5">Actions</th>
579 rajveer 264
            </tr>
265
        </thead>
266
        <tbody>
1152 rajveer 267
 
268
 
269
    #foreach ( $entityid in $entitiesState.keySet() )
270
			#set($entityState = $entitiesState.get($entityid))
579 rajveer 271
            <tr style="border: 1px">
272
                <td>$velocityCount</td>
273
                <td><a href="/content/entity/$entityid/edit">$entityid</a></td>
1152 rajveer 274
                <td>$action.getCategoryName($entityState.getCategoryID())</td>
275
                <td>$entityState.getBrand()</td>
2605 rajveer 276
                <td>$entityState.getModelName()</td>
1152 rajveer 277
                <td>$entityState.getModelNumber()</td>
4129 mandeep.dh 278
				<td>
279
                    <a class="details-from-catalog" entityId="$entityid" href="#">
280
                        see items
281
                    </a>
282
                </td>
1051 rajveer 283
				<td>$entityState.getStatus()</td>
284
                <td>$entityState.getCreatedBy()</td>
285
				<td>#if($entityState.getAssignedTo())$entityState.getAssignedTo()#end</td>
286
				<td>#if($entityState.getCompletedBy())$entityState.getCompletedBy()#end</td>
287
 
579 rajveer 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>
1051 rajveer 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>
579 rajveer 295
            </tr>
296
    #end
297
        </tbody>
298
    </table>
299
 
300
#end