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');
41
    	$('#dialog').dialog({
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
 
242 naveen 58
 
59
});
516 rajveer 60
 
579 rajveer 61
$(document).ready(function() 
62
    { 
63
        $("#myTable").tablesorter(); 
64
    } 
65
); 
66
 
516 rajveer 67
</script>
68
 
579 rajveer 69
 
198 naveen 70
<link type="text/css" href="jquery/jqueryui/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
162 naveen 71
<style type="text/css">
212 naveen 72
 
73
* { font-family: Verdana; font-size: 96%; }
74
label { width: 10em; float: left; }
75
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
76
p { clear: both; }
77
.submit { margin-left: 12em; }
78
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
79
 
162 naveen 80
table {
81
    border-width: 1px 1px 1px 1px;
82
    border-spacing: 2px;
83
    border-style: outset outset outset outset;
84
    border-color: gray gray gray gray;
85
    border-collapse: separate;
86
    background-color: white;
87
}
88
th {
89
    border-width: 1px 1px 1px 1px;
90
    padding: 1px 1px 1px 1px;
91
    border-style: inset inset inset inset;
92
    border-color: gray gray gray gray;
93
    background-color: white;
94
    -moz-border-radius: 0px 0px 0px 0px;
95
}
96
td {
97
    border-width: 1px 1px 1px 1px;
98
    padding: 1px 1px 1px 1px;
99
    border-style: inset inset inset inset;
100
    border-color: gray gray gray gray;
101
    background-color: white;
102
    -moz-border-radius: 0px 0px 0px 0px;
103
}
242 naveen 104
div.dialog {
105
    padding:12px;
106
    font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif";
107
}
162 naveen 108
</style>
242 naveen 109
 
162 naveen 110
</head>
111
<body>
208 naveen 112
<div>
162 naveen 113
    <h1>Entities</h1>
242 naveen 114
 
115
    #sactionmessage()
116
 
162 naveen 117
    <a href="/content/entity/new">Create New</a>
118
    <p></p>
250 naveen 119
    #set ( $entities = $action.getEntities() )
120
    #set ( $incompleteentities = $action.getIncompleteEntities() )
516 rajveer 121
    #set ( $catEntities = $action.getEntitiesByCategory())
250 naveen 122
    <!-- Incomplete -->
123
    <h3>Incomplete</h3>
124
 
125
    <div>
516 rajveer 126
        #drawEntities($incompleteentities 1)
250 naveen 127
    </div>
128
    <p/>
129
    <!-- Completes -->
130
    <h3>Complete</h3>
131
 
579 rajveer 132
 
250 naveen 133
    <div>
579 rajveer 134
	#drawAllEntities($entities)
135
	<!--
136
		<ul>
137
		#*	
516 rajveer 138
		#foreach( $catid in $catEntities.keySet())
579 rajveer 139
			#if($catEntities.get($catid))
140
				#set ( $entities = $catEntities.get($catid))
141
			<li><a href="" class="category" id="$catid">$catid - ($action.getCategoryName($entities.get(0).getCategoryID()) )</a></li>
142
			#end
143
		#end
144
		</ul>	
145
 
146
		#foreach( $catid in $catEntities.keySet())
516 rajveer 147
			#set ( $entities = $catEntities.get($catid))
148
			#drawEntities($entities $catid)
579 rajveer 149
		#end
150
	*#	
151
     -->
250 naveen 152
    </div>
153
</div>
154
 
155
<div id="dialog" title="">
156
    <iframe src="" id="dialog-iframe" width="430px" height="360px">
157
    </iframe>
158
</div>
159
</body>
160
</html>
161
 
579 rajveer 162
#macro (drawAllEntities $entities)
163
	    <table id="myTable">
164
	        <thead>
165
            <tr style="border: 1px">
166
                <th>#</th>
167
                <th>Entity ID</th>
168
                <th>Category</th>
169
                <th>Brand</th>
170
                <th>Model Number</th>
171
                <th>Model Name</th>
172
                <th></th>
173
                <!--<th></th>-->
174
                <th></th>
175
            </tr>
176
        </thead>
177
        <tbody>
178
    #foreach ( $entity in $entities )
179
            <tr style="border: 1px">
180
                <td>$velocityCount</td>
181
                #set ( $entityid = $entity.getID() )
182
                <td><a href="/content/entity/$entityid/edit">$entityid</a></td>
183
                <td>$action.getCategoryName($entity.getCategoryID())</td>
184
                <td>$entity.getBrand()</td>
185
                <td>$entity.getModelNumber()</td>
186
                <td>$entity.getModelName()</td>
187
                <td><a href="/content/entity/$entityid" target="_blank">View</a></td>
188
                <!-- <td><a href="" id="$entityid" class="opener">Media</a></td> -->
189
                <td><a href=""  id="$entityid" class="delete">Delete</a></td>
190
 
191
            </tr>
192
    #end
193
        </tbody>
194
    </table>
195
 
196
#end	
197
 
516 rajveer 198
#macro (drawEntities $entities $catid)
199
	<!-- style= "display: none; z-index: 1000; outline: 0px none; position: relative;" -->
579 rajveer 200
    <table id="${catid}-table"; class="category-table" >
162 naveen 201
        <thead>
202
            <tr style="border: 1px">
203
                <th>#</th>
204
                <th>Entity ID</th>
205
                <th>Category</th>
206
                <th>Brand</th>
207
                <th>Model Number</th>
208
                <th>Model Name</th>
242 naveen 209
                <th></th>
455 rajveer 210
                <!--<th></th>-->
242 naveen 211
                <th></th>
162 naveen 212
            </tr>
213
        </thead>
214
        <tbody>
215
    #foreach ( $entity in $entities )
216
            <tr style="border: 1px">
217
                <td>$velocityCount</td>
218
                #set ( $entityid = $entity.getID() )
219
                <td><a href="/content/entity/$entityid/edit">$entityid</a></td>
242 naveen 220
                <td>$action.getCategoryName($entity.getCategoryID())</td>
162 naveen 221
                <td>$entity.getBrand()</td>
222
                <td>$entity.getModelNumber()</td>
223
                <td>$entity.getModelName()</td>
242 naveen 224
                <td><a href="/content/entity/$entityid" target="_blank">View</a></td>
455 rajveer 225
                <!-- <td><a href="" id="$entityid" class="opener">Media</a></td> -->
579 rajveer 226
                <td><a href=""  id="$entityid" class="delete">Delete</a></td>
227
 
162 naveen 228
            </tr>
229
    #end
230
        </tbody>
231
    </table>
250 naveen 232
#end