| 8024 |
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">
|
|
|
13 |
$(document).ready(function(){
|
|
|
14 |
$("#updateslides").click(function(){
|
|
|
15 |
var changed = false;
|
|
|
16 |
var isValid = true;
|
|
|
17 |
$("tr").find("input").each(function(i, val){
|
|
|
18 |
var newVal = val.value.trim();
|
|
|
19 |
if (isNaN(newVal)){
|
|
|
20 |
isValid = false;
|
|
|
21 |
alert("Non numbers are not allowed");
|
|
|
22 |
return false;
|
|
|
23 |
}else if(Number(newVal)>10 || Number(newVal)<0){
|
|
|
24 |
alert("Numbers should be between 0 and 10");
|
|
|
25 |
isValid = false;
|
|
|
26 |
return false;
|
|
|
27 |
}
|
|
|
28 |
var customVal = $(val).closest("tr").find("td.mk_custom").html() == "-" ? "" : $(val).closest("tr").find("td.mk_custom").html();
|
|
|
29 |
if(Number(customVal) != Number(newVal)){
|
|
|
30 |
changed = true;
|
|
|
31 |
}
|
|
|
32 |
});
|
|
|
33 |
if(!isValid){
|
|
|
34 |
return false;
|
|
|
35 |
}
|
|
|
36 |
if(!changed){
|
|
|
37 |
alert("Nothing has been changed");
|
|
|
38 |
return false;
|
|
|
39 |
}
|
|
|
40 |
});
|
|
|
41 |
});
|
|
|
42 |
</script>
|
|
|
43 |
<link type="text/css" href="../jquery/jqueryui/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
|
|
|
44 |
<style type="text/css">
|
|
|
45 |
|
|
|
46 |
* { font-family: Verdana; font-size: 96%; }
|
|
|
47 |
fieldset.label { width: 10em; float: left; }
|
|
|
48 |
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
|
|
|
49 |
p { clear: both; }
|
|
|
50 |
.submit { margin-left: 12em; }
|
|
|
51 |
em { font-weight: bold; padding-right: 1em; vertical-align: top; }
|
|
|
52 |
|
|
|
53 |
table {
|
|
|
54 |
border-width: 1px 1px 1px 1px;
|
|
|
55 |
border-spacing: 0px;
|
|
|
56 |
border-color: gray gray gray gray;
|
|
|
57 |
border-collapse: separate;
|
|
|
58 |
border-style: solid;
|
|
|
59 |
background-color: white;
|
|
|
60 |
}
|
|
|
61 |
th {
|
|
|
62 |
border-width: 1px 1px 1px 1px;
|
|
|
63 |
border-style: solid;
|
|
|
64 |
padding: 3px;
|
|
|
65 |
border-color: gray gray gray gray;
|
|
|
66 |
background-color: white;
|
|
|
67 |
-moz-border-radius: 0px 0px 0px 0px;
|
|
|
68 |
}
|
|
|
69 |
td {
|
|
|
70 |
border-style: solid;
|
|
|
71 |
border-width: 1px 1px 1px 1px;
|
|
|
72 |
padding: 3px 4px;
|
|
|
73 |
border-color: gray gray gray gray;
|
|
|
74 |
background-color: white;
|
|
|
75 |
-moz-border-radius: 0px 0px 0px 0px;
|
|
|
76 |
}
|
|
|
77 |
div.dialog {
|
|
|
78 |
padding:12px;
|
|
|
79 |
font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif";
|
|
|
80 |
}
|
|
|
81 |
</style>
|
|
|
82 |
|
|
|
83 |
</head>
|
|
|
84 |
<body>
|
|
|
85 |
<div>
|
|
|
86 |
<span align="right"> Welcome $action.getUsername() <a href="$request.contextPath/logout">logout</a></span>
|
|
|
87 |
</div>
|
|
|
88 |
<div>
|
|
|
89 |
<h2>Slide Scores - $action.id - $entityName</h2>
|
|
|
90 |
<form method="POST" action="/content/cmp-scores!update">
|
|
|
91 |
<input type="hidden" name="id" value="$action.id" />
|
|
|
92 |
<table>
|
|
|
93 |
<tr>
|
|
|
94 |
<th>Slide name</th>
|
|
|
95 |
<th>Evaluated score</th>
|
|
|
96 |
<th>Custom score</th>
|
|
|
97 |
#if($action.canEdit())
|
|
|
98 |
<th>New score</th>
|
|
|
99 |
#end
|
|
|
100 |
</tr>
|
|
|
101 |
#set ($iter = -1)
|
|
|
102 |
#foreach($entry in $scores.get("actual").entrySet())
|
|
|
103 |
<tr>
|
|
|
104 |
<td>$action.getSlideLabel($entry.getKey())</td>
|
|
|
105 |
<td>$entry.getValue()</td>
|
|
|
106 |
#if($scores.get("custom").containsKey($entry.getKey()))
|
|
|
107 |
<td class="mk_custom">$scores.get("custom").get($entry.getKey())</td>
|
|
|
108 |
#if($action.canEdit())
|
|
|
109 |
#if($entry.getKey()==0)
|
|
|
110 |
<td></td>
|
|
|
111 |
#else
|
|
|
112 |
<td><input type="text" name="$entry.getKey()" value='$scores.get("custom").get($entry.getKey())'/></td>
|
|
|
113 |
#end
|
|
|
114 |
#end
|
|
|
115 |
#else
|
|
|
116 |
<td class="mk_custom">-</td>
|
|
|
117 |
<td><input type="text" name="$entry.getKey()" value=""/></td>
|
|
|
118 |
#end
|
|
|
119 |
</tr>
|
|
|
120 |
#end
|
|
|
121 |
</table>
|
|
|
122 |
<div style="padding:8px">
|
|
|
123 |
<input id="updateslides" type="submit" value="Update">
|
|
|
124 |
</div>
|
|
|
125 |
</form>
|
|
|
126 |
</div>
|
|
|
127 |
</body>
|
| 8025 |
amit.gupta |
128 |
</html>
|