Revision 2867
Added by sgarg almost 19 years ago
lib/style/common/templates/getReviews.tmpl | ||
---|---|---|
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
3 |
<head> |
|
4 |
<title>Reviews</title> |
|
5 |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
|
6 |
<link href="/esa/style/skins/esa/esa.css" type="text/css" rel="stylesheet"> |
|
7 |
<script src="/esa/style/common/prototype.js"></script> |
|
8 |
<script> |
|
9 |
function get_reviews() { |
|
10 |
|
|
11 |
new Ajax.Request("@servlet-path@?action=read&docid=[%reviewdocid%]", |
|
12 |
{asynchronous:true, evalScripts:true, method:'post', |
|
13 |
onLoading:function(request){Element.show('busy')}, |
|
14 |
onComplete: render_reviews}); |
|
15 |
} |
|
16 |
|
|
17 |
function render_reviews(request) { |
|
18 |
//alert(request.responseText); |
|
19 |
var reviews = request.responseXML.getElementsByTagName("review"); |
|
20 |
|
|
21 |
var ul = document.createElement("ul"); |
|
22 |
|
|
23 |
// for each review... |
|
24 |
for (var i=0; i<reviews.length; i++) { |
|
25 |
|
|
26 |
// create a new <li> |
|
27 |
|
|
28 |
var packageId = document.createTextNode(getText(reviews[i], "packageId")); |
|
29 |
var action = document.createTextNode(getText(reviews[i], "action")); |
|
30 |
var datetime = document.createTextNode(getText(reviews[i], "datetime")); |
|
31 |
var text = document.createTextNode(getText(reviews[i], "text")); |
|
32 |
|
|
33 |
var li = document.createElement("li"); |
|
34 |
var dl = document.createElement("dl"); |
|
35 |
var dt = document.createElement("dt"); |
|
36 |
var dd1 = document.createElement("dd"); |
|
37 |
var dd2 = document.createElement("dd"); |
|
38 |
var p = document.createElement("p"); |
|
39 |
|
|
40 |
dt.appendChild(packageId); |
|
41 |
dd1.appendChild(datetime); |
|
42 |
dd2.appendChild(action); |
|
43 |
|
|
44 |
dl.appendChild(dt); |
|
45 |
dl.appendChild(dd1); |
|
46 |
dl.appendChild(dd2); |
|
47 |
p.appendChild(text); |
|
48 |
|
|
49 |
li.appendChild(dl); |
|
50 |
li.appendChild(p); |
|
51 |
|
|
52 |
// add to parent |
|
53 |
ul.appendChild(li); |
|
54 |
} |
|
55 |
|
|
56 |
document.getElementById("review_list").appendChild(ul); |
|
57 |
|
|
58 |
// not busy anymore |
|
59 |
setTimeout("Element.hide('busy')", 1000); |
|
60 |
} |
|
61 |
|
|
62 |
function getText(elem, tag) { |
|
63 |
return elem.getElementsByTagName(tag)[0].firstChild.nodeValue; |
|
64 |
} |
|
65 |
</script> |
|
66 |
|
|
67 |
<style type="text/css"> |
|
68 |
ul { |
|
69 |
font: 12pt "arial,sans-serif"; |
|
70 |
margin-bottom: 4px; |
|
71 |
padding: 0px; |
|
72 |
width: 200px; |
|
73 |
} |
|
74 |
|
|
75 |
li { |
|
76 |
list-style: none; |
|
77 |
padding-left: 0; |
|
78 |
padding-bottom: 4px; |
|
79 |
font-size: 12pt; |
|
80 |
margin-bottom: 12px; |
|
81 |
line-height: .85em; |
|
82 |
background: #DEF1F1; |
|
83 |
border: 1px solid #eee; |
|
84 |
} |
|
85 |
|
|
86 |
dl { |
|
87 |
margin-bottom: -6px; |
|
88 |
} |
|
89 |
|
|
90 |
/* text */ |
|
91 |
li p { |
|
92 |
padding: 2px; |
|
93 |
font-size: 10pt; |
|
94 |
line-height: .9em; |
|
95 |
} |
|
96 |
|
|
97 |
/* packageId */ |
|
98 |
dt { |
|
99 |
text-align: right; |
|
100 |
font-size: 120%; |
|
101 |
font-weight: bold; |
|
102 |
line-height: 1.1em; |
|
103 |
background: #A3DADA; |
|
104 |
padding: 6px; |
|
105 |
border: 1px solid #ddd; |
|
106 |
border-width: 1px 0 2px 0; |
|
107 |
} |
|
108 |
|
|
109 |
/* datetime, action */ |
|
110 |
dd { |
|
111 |
color: #333; |
|
112 |
font-variant: small-caps; |
|
113 |
margin-left: 8px; |
|
114 |
margin-bottom: 0px; |
|
115 |
padding-bottom: 0px; |
|
116 |
font-size: 90%; |
|
117 |
line-height: 1.2em; |
|
118 |
} |
|
119 |
</style> |
|
120 |
|
|
121 |
</head> |
|
122 |
|
|
123 |
[% IF reviewdocid != ''%] |
|
124 |
<body onload="get_reviews()"> |
|
125 |
<!-- ajax will populate this node --> |
|
126 |
Reviews <img id="busy" src="/esa/style/images/spinner.gif" style="display:none"/> |
|
127 |
<div id="review_list"></div> |
|
128 |
[% ELSE %] |
|
129 |
<body> |
|
130 |
Reviews: No reviews found |
|
131 |
[% END %] |
|
132 |
|
|
133 |
[% IF isModerator == 'true' %] |
|
134 |
<br> |
|
135 |
<br> |
|
136 |
<center> |
|
137 |
<p class="sectionnames">Moderator Actions</p> |
|
138 |
<form target="_top" id="reviewForm" method="POST" action="@cgi-prefix@/register-dataset.cgi"> |
|
139 |
<input value="mod_accept" name="stage" type="hidden"> |
|
140 |
<input value="esa" name="cfg" type="hidden"> |
|
141 |
<input name="docid" type="hidden" value="[%docid%]"> |
|
142 |
<br> |
|
143 |
<textarea name="review" rows="10"></textarea> |
|
144 |
<br> |
|
145 |
<br> |
|
146 |
<input name="Accept" value=" Accept " type="SUBMIT" onClick="this.parentNode.stage.value='mod_accept';"> |
|
147 |
<br> |
|
148 |
<br> |
|
149 |
<input name="Decline" value="Decline" type="SUBMIT" onClick="this.parentNode.stage.value='mod_decline';"> |
|
150 |
<br> |
|
151 |
<br> |
|
152 |
<input name="Revise" value=" Revise " type="SUBMIT" onClick="this.parentNode.stage.value='mod_revise';"> |
|
153 |
</form> |
|
154 |
</center> |
|
155 |
[% END %] |
|
156 |
|
|
157 |
</body> |
|
158 |
</html> |
|
159 |
|
|
160 |
|
|
0 | 161 |
Also available in: Unified diff
Added template file for getting the reviews from metacat