Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
7286 amit.gupta 1
<!DOCTYPE html>
2
 
3
<html lang="en-US">
4
<head>
5
<title>Create Expert Review</title>
6
<script type="text/javascript" src="../jquery/jquery-1.4.2.js"></script>
7
<script type="text/javascript" src="../js/common.js"></script>
8
<script type="text/javascript" src="../jquery/jqueryui/ui/jquery.ui.core.js"></script>
9
<script type="text/javascript" src="../jquery/jqueryui/ui/jquery.ui.widget.js"></script>
10
<script type="text/javascript" src="../jquery/jqueryui/ui/jquery.ui.dialog.js"></script>
11
<script type="text/javascript" src="../js/events.js"></script>
12
<script type="text/javascript" src="../js/tinymce/tinymce.min.js"></script>
13
<script type="text/javascript">
14
	$(document).ready(function(){
7312 amit.gupta 15
		$('#newreview').click(function(e){
16
			$('#addNew').show();
17
		});
7286 amit.gupta 18
		$('div.editable').click(function(e){
19
			var clicked = $(this);
20
			e.preventDefault();
21
			$('<div title="Expert Review"><textarea name="abc" style="height:240px;width:500px"></textarea></div>').find('textarea')
22
			.val($(this).html())
23
			.end()
24
			.dialog( {
25
				height: 470,
26
				width: 700,
27
				buttons: { 
28
					"OK": function() { 
29
						inputContent = tinyMCE.activeEditor.getContent();
30
						if (inputContent == "" || inputContent == '<p><span style="cursor:pointer;color:blue">Click here to Edit</span></p>'){
31
							inputContent = '<span style="cursor:pointer;color:blue">Click here to Edit</span>';
32
						}
7585 amit.gupta 33
						$('#erhtml').val(inputContent);
7286 amit.gupta 34
						clicked.html(inputContent);
7585 amit.gupta 35
						$("#indexid").val(clicked.closest('tr').find('td').html());
36
						$(this).dialog("close");
37
						$("#changeContent").submit();
7286 amit.gupta 38
					}
39
				},
40
				modal: true});
41
			tinymce.init({
42
	    		selector: "textarea",
43
	    		plugins: [
44
					"advlist autolink lists link image charmap print preview anchor",
45
					"searchreplace visualblocks code fullscreen",
46
					"insertdatetime media table contextmenu paste"
47
					],
48
				toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
49
				autosave_ask_before_unload: false 
50
	 		});
51
		});
52
	});
53
</script>
54
<link type="text/css" href="../jquery/jqueryui/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
55
<style type="text/css">
56
 
57
* { font-family: Verdana; font-size: 96%; }
58
fieldset.label { width: 10em; float: left; }
59
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
60
p { clear: both; }
61
.submit { margin-left: 12em; }
62
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
63
 
64
table {
65
    border-width: 1px 1px 1px 1px;
66
    border-spacing: 0px;
67
    border-color: gray gray gray gray;
68
    border-collapse: separate;
69
    border-style: solid;
70
    background-color: white;
71
}
72
th {
73
    border-width: 1px 1px 1px 1px;
74
    border-style: solid;
75
    padding: 3px;
76
    border-color: gray gray gray gray;
77
    background-color: white;
78
    -moz-border-radius: 0px 0px 0px 0px;
79
}
80
td {
81
    border-style: solid;
82
    border-width: 1px 1px 1px 1px;
83
    padding: 3px 4px;
84
    border-color: gray gray gray gray;
85
    background-color: white;
86
    -moz-border-radius: 0px 0px 0px 0px;
87
}
88
div.dialog {
89
    padding:12px;
90
    font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif";
91
}
92
</style>
93
 
94
</head>
95
<body>
96
<div>
97
	<span align="right"> Welcome $action.getUsername()   <a href="$request.contextPath/logout">logout</a></span>
98
</div>
99
<div>
100
	<h2>Expert Review</h2>
7312 amit.gupta 101
	<a style="padding:2px" href="javascript:void(0)" id="newreview">Add New Review</a>
102
	<form method="POST" action="/content/expert-review" style="display:none" id="addNew">
103
		<fieldset style="width:600px">
104
			<label for="entityId">Entity ID</label><br>
105
			<input type="text" name="entityId" id="entityId" class="text ui-widget-content ui-corner-all" disabled value="$entityId"/><br><br>
106
			<input type="hidden" name="entityId" value="$entityId"/>
107
			<label for="source">Source Label</label><br>
108
			<select name="source" id="source" class="text ui-widget-content ui-corner-all" >
109
				#foreach ($source in $sources)
110
					<option title="$source.getSourceUrl()" value="$source.getSource()">$source.getSource()</option>
111
				#end
112
			</select>
113
			<br><br>
114
			<label for="password">Expert  Review</label><br>
115
			<div class="editable" style="border:1px solid red;padding:2px"><span style="cursor:pointer;color:blue">Click here to Edit</span></div><br><br>
116
			<label for="sourceUrl">Source Url</label><br>
117
			<input type="textbox"  style="width:200px" class="text ui-widget-content ui-corner-all" name="sourceUrl" id="sourceUrl"/>
118
			<input type="hidden" name="expertReviewHtml" id="expertReviewHtml"/><br><br>
119
			<input type="submit" value="Create" name="submit"></input>
120
		</fieldset>
121
	</form>
7286 amit.gupta 122
	<h3>$entityId - $entityName</h3>
123
	<table>
124
		<tr>
125
			<th>Score</th>
7312 amit.gupta 126
			<th>Source Label</th>
7286 amit.gupta 127
			<th style="width:50%">Expert Review</th>
128
			<th>Status</th>
7312 amit.gupta 129
			<th>Source Url</th>
7286 amit.gupta 130
			#if($action.canOrder())
7471 amit.gupta 131
			<th>Update Order</th>
7286 amit.gupta 132
			#end
133
			<th>Actions</th>
134
		</tr>
135
		#set ($iter = -1)
136
		#set ($canDelete = $action.canDelete())
137
		#foreach($review in $expertReviewByEntity)
138
		<tr>	
139
			#set ($iter = $iter + 1)
140
			<td>$iter</td>
141
			<td>$review.getSource()</td>
142
			<td><div#if ($action.canAddDelete($review)) class="editable"#end>$review.getReviewContent()</div></td>
143
			<td>$review.getStatus()</td>
7312 amit.gupta 144
			<td>#if ($review.getUrl())
145
					$review.getUrl()
146
				#else Not provided
147
				#end</td>
7286 amit.gupta 148
			#if($action.canOrder())
149
			<td>
150
				<form method="POST" action="$entityId!move">
151
					<input type="text" style="width:50px" name="index"/>
152
					<input type="hidden" name="previous" value="$iter"/>
153
					<input type="submit" value="Move"/>
154
				</form>
155
			</td>
156
			#end
157
			<td>
7471 amit.gupta 158
			#if($action.canSendForApproval($review))
159
			<a style="padding:1px" href="$entityId!sendForApproval?index=$iter" onclick="return confirm('Are you sure?');">Complete</a>
160
			#end
7286 amit.gupta 161
			#if($action.canAddDelete($review) || $canDelete)
162
			<a style="padding:1px" href="$entityId!delete?index=$iter" onclick="return confirm('Are you sure?');">Delete</a>
163
			#end
164
			#if($action.canApprove($review))
165
			<a style="padding:1px" href="$entityId!approve?index=$iter" onclick="return confirm('Are you sure?');">Approve</a>
166
			#end
167
			#if($action.canPublish($review))
168
			<a style="padding:1px" href="$entityId!publish?index=$iter" onclick="return confirm('Are you sure?');">Publish</a>
169
			#end
170
			#if($action.canPhaseOut($review))
171
			<a style="padding:1px" href="$entityId!phaseOut?index=$iter" onclick="return confirm('Are you sure?');">Phase out</a>
172
			#end
7471 amit.gupta 173
 
7286 amit.gupta 174
			</td>
175
		</tr>
176
		#end
177
	</table>
178
</div>
7585 amit.gupta 179
<form id="changeContent" method="POST" action="$entityId!change" style="display:none">
180
					<input id="indexid" type="hidden" style="width:50px" name="index"/>
181
					<input  id="erhtml" type="hidden" name="expertReviewHtml"/>
182
					<input type="submit" value="Move"/>
183
</form>
7286 amit.gupta 184
</body>
185
</html>