Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2276 rajveer 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 Helpdocs</title>
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>
22
<script type="text/javascript" src="jquery/jquery.chained.js"></script>
23
<script type="text/javascript" src="jquery/jquery.tablesorter.js"></script>
24
<script>
25
// increase the default animation speed to exaggerate the effect
26
jQuery.fx.speeds._default = 1000;
27
$(function() {
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
 
58
	$('.complete').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 be completed, you will not be able to make further changes.  Continue?',
66
                    buttons: {
67
                    "OK":function() { window.location.href = "/content/item-update/" + entityid + "?_method=put&action=complete" },
68
                    "Cancel": function() { $(this).dialog("close"); }
69
            }
70
         });
71
 
72
		$('#dialog').dialog('open');
73
 
74
		return false;
75
	});
76
 
77
 
78
    $('.ready').click(function() {
79
		var entityid = $(this).attr('id');
80
        $('#dialog').dialog({
81
                    autoOpen: false,
82
    				width: 470,
83
            	    height: 100,
84
                    modal: true,
85
    				title: 'The item will become available for consumers to place orders for. Continue?',
86
                    buttons: {
87
                    "OK":function() { window.location.href = "/content/item-update/" + entityid + "?_method=put&action=ready" },
88
                    "Cancel": function() { $(this).dialog("close"); }
89
            }
90
         });
91
 
92
		$('#dialog').dialog('open');
93
 
94
		return false;
95
	});
96
 
97
 
98
	$('.assign').click(function() {
99
		var entityid = $(this).attr('id');
100
 
101
        $('#dialog-form').dialog({
102
                    autoOpen: false,
103
    				width: 470,
104
            	    height: 400,
105
                    modal: true,
106
					title: 'The item will be assigned. Are you sure ?',
107
                    buttons: {
108
                    "OK":function() {
109
					var username = $('#username').val();
110
						window.location.href = "/content/item-update/" + entityid + "?_method=put&action=assign&username=" + username; 
111
					},
112
                    "Cancel": function() { $(this).dialog("close"); }
113
            }
114
         });
115
 
116
		$('#dialog-form').dialog('open');
117
 
118
		return false;
119
	});
120
 
121
 
122
});
123
 
124
$(document).ready(function() 
125
    { 
126
        $("#myTable").tablesorter(); 
127
    } 
128
); 
129
 
130
</script>
131
 
132
 
133
<link type="text/css" href="jquery/jqueryui/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
134
<style type="text/css">
135
 
136
* { font-family: Verdana; font-size: 96%; }
137
label { width: 10em; float: left; }
138
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
139
p { clear: both; }
140
.submit { margin-left: 12em; }
141
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
142
 
143
table {
144
    border-width: 1px 1px 1px 1px;
145
    border-spacing: 2px;
146
    border-style: outset outset outset outset;
147
    border-color: gray gray gray gray;
148
    border-collapse: separate;
149
    background-color: white;
150
}
151
th {
152
    border-width: 1px 1px 1px 1px;
153
    padding: 1px 1px 1px 1px;
154
    border-style: inset inset inset inset;
155
    border-color: gray gray gray gray;
156
    background-color: white;
157
    -moz-border-radius: 0px 0px 0px 0px;
158
}
159
td {
160
    border-width: 1px 1px 1px 1px;
161
    padding: 1px 1px 1px 1px;
162
    border-style: inset inset inset inset;
163
    border-color: gray gray gray gray;
164
    background-color: white;
165
    -moz-border-radius: 0px 0px 0px 0px;
166
}
167
div.dialog {
168
    padding:12px;
169
    font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif";
170
}
171
</style>
172
 
173
</head>
174
<body>
175
<div>
176
	<span align="right"> Welcome $action.getUsername()   <a href="$request.contextPath/logout">logout</a></span>
177
</div>
178
<div>
179
    <h1>Help Docs</h1>
180
 
181
	<a href="$request.contextPath/helpdoc/new">Create New</a>
182
 
183
	<div style="color:green;">
184
    #sactionmessage()
185
	</div>
186
	<div style="color:red;">
187
	#sactionerror()
188
	</div>
189
 
190
	#drawAllHelpDocs($action.getHelpdocs())
191
</div>
192
 
193
</body>
194
</html>
195
 
196
#macro (drawAllHelpDocs $helpdocs)
197
	    <table id="myTable">
198
	        <thead>
199
            <tr style="border: 1px">
200
                <th>#</th>
201
                <th>HelpDocId</th>
202
                <th>Name</th>
203
                <th colspan="2">Actions</th>
204
            </tr>
205
        </thead>
206
        <tbody>
207
 
208
 
209
    #foreach ( $helpdocid in $helpdocs.keySet() )
210
			#set($helpdoc = $helpdocs.get($helpdocid))
211
            <tr style="border: 1px">
212
                <td>$velocityCount</td>
213
                <td><a href="/content/helpdoc/$helpdocid/edit">$helpdocid</a></td>
214
                <td>$helpdoc.getName()</td>
215
 
216
				<td><a href="/content/helpdoc/$helpdocid" target="_blank">View</a></td>
217
                <td><a href=""  id="$helpdocid" class="delete">Delete</a></td>
218
 
219
            </tr>
220
    #end
221
        </tbody>
222
    </table>
223
 
224
#end