Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | 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>
242 naveen 8
<script type="text/javascript" src="jquery/jquery-1.4.2.js"></script>
9
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.core.js"></script>
10
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.widget.js"></script>
11
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.position.js"></script>
12
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.autocomplete.js"></script>
13
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.dialog.js"></script>
14
<script type="text/javascript" src="jquery/validation/jquery.validate.js"></script>
15
 
16
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.mouse.js"></script>
17
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.draggable.js"></script>
18
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.ui.resizable.js"></script>
19
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.effects.core.js"></script>
20
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.effects.blind.js"></script>
21
<script type="text/javascript" src="jquery/jqueryui/ui/jquery.effects.drop.js"></script>
516 rajveer 22
<script type="text/javascript" src="jquery/jquery.chained.js"></script>
579 rajveer 23
<script type="text/javascript" src="jquery/jquery.tablesorter.js"></script>
242 naveen 24
<script>
25
// increase the default animation speed to exaggerate the effect
26
jQuery.fx.speeds._default = 1000;
27
$(function() {
579 rajveer 28
 
29
 
30
 
31
	$('.category').click(function() {
32
	    var categoryid = $(this).attr('id') + "-table";
33
		alert("Toggle style for category" + categoryid);
34
		$('.category-table').hide();
35
		$('#'+categoryid).show();
36
		return false;
37
	});
38
 
39
	$('.delete').click(function() {
40
		var entityid = $(this).attr('id');
725 chandransh 41
        $('#dialog').dialog({
579 rajveer 42
                    autoOpen: false,
43
    				width: 470,
44
            	    height: 100,
45
                    modal: true,
46
    				title: 'Are you sure ? It will be permanently deleted. Continue ?',
47
                    buttons: {
48
                    "OK":function() { window.location.href = "/content/entity/" + entityid + "?_method=delete" },
49
                    "Cancel": function() { $(this).dialog("close"); }
50
            }
51
         });
52
 
53
		$('#dialog').dialog('open');
54
 
55
		return false;
56
	});
57
 
725 chandransh 58
    $('.ready').click(function() {
59
		var entityid = $(this).attr('id');
60
        $('#dialog').dialog({
61
                    autoOpen: false,
62
    				width: 470,
63
            	    height: 100,
64
                    modal: true,
65
    				title: 'The item will become available for consumers to place orders for. Continue?',
66
                    buttons: {
67
                    "OK":function() { window.location.href = "/content/item-update/" + entityid + "?_method=put" },
68
                    "Cancel": function() { $(this).dialog("close"); }
69
            }
70
         });
71
 
72
		$('#dialog').dialog('open');
73
 
74
		return false;
75
	});
242 naveen 76
});
516 rajveer 77
 
579 rajveer 78
$(document).ready(function() 
79
    { 
80
        $("#myTable").tablesorter(); 
81
    } 
82
); 
83
 
516 rajveer 84
</script>
85
 
579 rajveer 86
 
198 naveen 87
<link type="text/css" href="jquery/jqueryui/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
162 naveen 88
<style type="text/css">
212 naveen 89
 
90
* { font-family: Verdana; font-size: 96%; }
91
label { width: 10em; float: left; }
92
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
93
p { clear: both; }
94
.submit { margin-left: 12em; }
95
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
96
 
162 naveen 97
table {
98
    border-width: 1px 1px 1px 1px;
99
    border-spacing: 2px;
100
    border-style: outset outset outset outset;
101
    border-color: gray gray gray gray;
102
    border-collapse: separate;
103
    background-color: white;
104
}
105
th {
106
    border-width: 1px 1px 1px 1px;
107
    padding: 1px 1px 1px 1px;
108
    border-style: inset inset inset inset;
109
    border-color: gray gray gray gray;
110
    background-color: white;
111
    -moz-border-radius: 0px 0px 0px 0px;
112
}
113
td {
114
    border-width: 1px 1px 1px 1px;
115
    padding: 1px 1px 1px 1px;
116
    border-style: inset inset inset inset;
117
    border-color: gray gray gray gray;
118
    background-color: white;
119
    -moz-border-radius: 0px 0px 0px 0px;
120
}
242 naveen 121
div.dialog {
122
    padding:12px;
123
    font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif";
124
}
162 naveen 125
</style>
242 naveen 126
 
162 naveen 127
</head>
128
<body>
208 naveen 129
<div>
162 naveen 130
    <h1>Entities</h1>
242 naveen 131
 
132
    #sactionmessage()
133
 
162 naveen 134
    <a href="/content/entity/new">Create New</a>
135
    <p></p>
250 naveen 136
    #set ( $entities = $action.getEntities() )
137
    #set ( $incompleteentities = $action.getIncompleteEntities() )
516 rajveer 138
    #set ( $catEntities = $action.getEntitiesByCategory())
250 naveen 139
    <!-- Incomplete -->
140
    <h3>Incomplete</h3>
141
 
142
    <div>
516 rajveer 143
        #drawEntities($incompleteentities 1)
250 naveen 144
    </div>
145
    <p/>
146
    <!-- Completes -->
147
    <h3>Complete</h3>
148
 
579 rajveer 149
 
250 naveen 150
    <div>
579 rajveer 151
	#drawAllEntities($entities)
152
	<!--
153
		<ul>
154
		#*	
516 rajveer 155
		#foreach( $catid in $catEntities.keySet())
579 rajveer 156
			#if($catEntities.get($catid))
157
				#set ( $entities = $catEntities.get($catid))
158
			<li><a href="" class="category" id="$catid">$catid - ($action.getCategoryName($entities.get(0).getCategoryID()) )</a></li>
159
			#end
160
		#end
161
		</ul>	
162
 
163
		#foreach( $catid in $catEntities.keySet())
516 rajveer 164
			#set ( $entities = $catEntities.get($catid))
165
			#drawEntities($entities $catid)
579 rajveer 166
		#end
167
	*#	
168
     -->
250 naveen 169
    </div>
170
</div>
171
 
172
<div id="dialog" title="">
173
    <iframe src="" id="dialog-iframe" width="430px" height="360px">
174
    </iframe>
175
</div>
176
</body>
177
</html>
178
 
579 rajveer 179
#macro (drawAllEntities $entities)
180
	    <table id="myTable">
181
	        <thead>
182
            <tr style="border: 1px">
183
                <th>#</th>
184
                <th>Entity ID</th>
185
                <th>Category</th>
186
                <th>Brand</th>
187
                <th>Model Number</th>
188
                <th>Model Name</th>
725 chandransh 189
                <th colspan="3">Actions</th>
579 rajveer 190
            </tr>
191
        </thead>
192
        <tbody>
193
    #foreach ( $entity in $entities )
194
            <tr style="border: 1px">
195
                <td>$velocityCount</td>
196
                #set ( $entityid = $entity.getID() )
197
                <td><a href="/content/entity/$entityid/edit">$entityid</a></td>
198
                <td>$action.getCategoryName($entity.getCategoryID())</td>
199
                <td>$entity.getBrand()</td>
200
                <td>$entity.getModelNumber()</td>
201
                <td>$entity.getModelName()</td>
202
                <td><a href="/content/entity/$entityid" target="_blank">View</a></td>
203
                <!-- <td><a href="" id="$entityid" class="opener">Media</a></td> -->
204
                <td><a href=""  id="$entityid" class="delete">Delete</a></td>
725 chandransh 205
				<td><a href=""  id="$entityid" class="ready">Ready</a></td>				
579 rajveer 206
            </tr>
207
    #end
208
        </tbody>
209
    </table>
210
 
211
#end	
212
 
516 rajveer 213
#macro (drawEntities $entities $catid)
214
	<!-- style= "display: none; z-index: 1000; outline: 0px none; position: relative;" -->
579 rajveer 215
    <table id="${catid}-table"; class="category-table" >
162 naveen 216
        <thead>
217
            <tr style="border: 1px">
218
                <th>#</th>
219
                <th>Entity ID</th>
220
                <th>Category</th>
221
                <th>Brand</th>
222
                <th>Model Number</th>
223
                <th>Model Name</th>
242 naveen 224
                <th></th>
225
                <th></th>
162 naveen 226
            </tr>
227
        </thead>
228
        <tbody>
229
    #foreach ( $entity in $entities )
230
            <tr style="border: 1px">
231
                <td>$velocityCount</td>
232
                #set ( $entityid = $entity.getID() )
233
                <td><a href="/content/entity/$entityid/edit">$entityid</a></td>
242 naveen 234
                <td>$action.getCategoryName($entity.getCategoryID())</td>
162 naveen 235
                <td>$entity.getBrand()</td>
236
                <td>$entity.getModelNumber()</td>
237
                <td>$entity.getModelName()</td>
242 naveen 238
                <td><a href="/content/entity/$entityid" target="_blank">View</a></td>
455 rajveer 239
                <!-- <td><a href="" id="$entityid" class="opener">Media</a></td> -->
579 rajveer 240
                <td><a href=""  id="$entityid" class="delete">Delete</a></td>
162 naveen 241
            </tr>
242
    #end
243
        </tbody>
244
    </table>
250 naveen 245
#end