summaryrefslogtreecommitdiff
path: root/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/data_review_tbody.html
blob: d1d53140193ca593316629903266e07b737319d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
{% load i18n %}
{% load ndf_tags %}

{% if not user_is_joined %}
	{% check_user_join request groupid as user_is_joined %}
{% endif %}

<tr id="view-row-{{resource.pk}}">

	<!-- Autogenerated -->
	<td class="view">{{ resource.pk }}</td>
	<td class="view">{{ resource.created_at }}</td>
	<td class="view">{{ resource.user_details_dict.modified_by }}</td>
	<td class="view">{{ resource.user_details_dict.created_by }}</td>
	<td class="view right-border">{{ resource.user_details_dict.contributors | join:", " }}</td>

	<!-- Base -->
	<td class="view">{{ resource.name }}
	</td>
	<td class="view">{{ resource.altnames }}</td>
	<td class="view" title="{{ resource.content_org }}">{{ resource.content_org | truncatechars:60 }}</td>
	<td class="view">{{ resource.language }}</td>
	<td class="view right-border"> {{resource.tags|safeseq|join:", "}} </td>

	<!-- Attribution -->
	<td class="view">{{ resource.creator }}</td>
	<td class="view">
		{% for each_contr in resource.other_contributors %}
			{{ each_contr }}{% if not forloop.last %}, {% endif %}
		{% endfor %}
	</td>
	<td class="view">{{ resource.license }}</td>
	<td class="view">{{ resource.source }}</td>
	<td class="view">{{ resource.basedonurl }}</td>
	<td class="view">{{ resource.translation_of }}</td>
	<td class="view right-border">{{ resource.adaptation_of }}</td>

	<!-- LRMI -->
	<td class="view">{{ resource.educationaluse }}</td>
	<td class="view right-border">{{ resource.interactivitytype }}</td>

	<!-- Alignment and Level -->
	<td class="view">{{ resource.educationalalignment }}</td>
	<td class="view">
		{% for each_educationallevel in resource.educationallevel %}
			{{ each_educationallevel }}{% if not forloop.last %}, {% endif %}
		{% endfor %}
	</td>

	<td class="view right-border">{{ resource.educationalsubject }}</td>

	<!-- Curate -->
	<td class="view">{{ resource.curricular }}</td>
	<td class="view">
		{% for each_audience in resource.audience %}
			{{ each_audience }}{% if not forloop.last %}, {% endif %}
		{% endfor %}
	</td>
	<td class="view">
		{% for each_teaches in resource.teaches %}
		{{ each_teaches.name }}{% if not forloop.last %}, {% endif %}
		{% endfor %}
	</td>
	<td class="view"><!-- prior_node processing -->
		{% for index_key, each_node in resource.prior_node_dict.items %}
		{{ each_node.name }}{% if not forloop.last %}, {% endif %}
		{% endfor %}
	</td>
	<td class="view">{{ resource.featured }}</td>
	<td class="view">{{ resource.status }}</td>
	<td class="view right-border">{{ resource.access_policy }}</td>

	<!-- Advance -->
	<td class="view">{{ resource.readinglevel }}</td>
	<td class="view">{{ resource.timerequired }}</td>
	<td class="right-border">{{ resource.textcomplexity }}</td>

	<!-- moderation -->
	{% if title == "moderation" %}

		<td class="view"> <!-- editorial discussion -->
			0 | Replies
			<!-- get the count of editorial discussion here -->
		</td>
		<td class="view"> <!-- approval -->
			Not Approved
		</td>
		<td class="view right-border"> <!-- approval -->
			Not Rejected
		</td>

	{% endif %}


</tr>
<!-- ======================================= -->
<tr id="blank-row-{{resource.pk}}"></tr>
<!-- ======================================= -->

<tr id="edit-row-{{resource.pk}}" data-row-name="{{resource.name}}">

	<!-- Autogenerated -->
	<td class="right-border" colspan="5">
		<div class="button tiny expand" data-id="edit-btn-{{resource.pk}}" onclick="editResRow('{{resource.pk}}')">
			Edit
		</div>
		<div class="row" style="display:none;" data-id="save-cancel-div-{{resource.pk}}">
			<span class="small-push-1 small-4 columns button success tiny" onclick="saveResource('{{resource.pk}}')" data-id="save-btn-{{resource.pk}}" data-action="save">
				Save
			</span>
			<span class="small-pull-1 small-4 columns button alert tiny" data-id="cancel-btn-{{resource.pk}}" onclick="CancelEditResRow('{{resource.pk}}')" data-action="cancel">
				Cancel
			</span>
		</div>
	</td>

	<!-- Base -->
	<td class="hide-el" data-field="name"><input type="text" value="{{ resource.name }}" /></td>
	<td class="hide-el" data-field="altnames"><input type="text" value="{{ resource.altnames }}" /></td>
	<td class="hide-el" data-field="content_org">
		<input type="button" data-reveal-id="content_org_overlay" class="button tiny expand" value="Edit content in editor" data-content-org="{{ resource.content_org }}" data-content-org-row-id="{{resource.pk}}" />
	</td>
	<td class="hide-el" data-field="language">
		<select name="language">
			<option value="{{resource.language}}">-- Select --</option>
			{% for each_lang in static_language %}
			<option {%if each_lang|lower == resource.language|lower %}selected="selected"{%endif%} value="{{ each_lang }}">{{ each_lang }}</option>
			{% endfor %}
				<!-- <option {%if not resource.language %}selected="selected"{%endif%} value="None">
					None
				</option> -->
				
				{% comment %}
				<!-- <option {%if resource.language|lower == "english" %}selected="selected"{%endif%} value="English">English</option>
				<option {%if resource.language|lower == "hindi" %}selected="selected"{%endif%} value="Hindi">Hindi</option> -->
				<!-- {% for lang_code, lang_info in static_language.items %}
					<option {%if lang_info.name == resource.language %}selected="selected"{%endif%} value="{{ lang_info.name }}">{{ lang_info.name }}</option>
					{% endfor %} -->
				{% endcomment %}
		</select>
	</td>
	<td class="hide-el right-border" data-field="tags"><input type="text" value='{{resource.tags|safeseq|join:", "}}' />
	</td>

	<!-- Attribution -->
	<td class="hide-el" data-field="creator"><input type="text" value="{{ resource.creator }}" /></td>
	<td class="hide-el" data-field="other_contributors"><input type="text" value="{% for each_contr in resource.other_contributors %}{{ each_contr }}{% if not forloop.last %}, {% endif %}{% endfor %}" /></td>
	<td class="hide-el" data-field="license"><input type="text" value="{{ resource.license }}" /></td>
	<td class="hide-el" data-field="source"><input type="text" value="{{ resource.source }}" /></td>
	<td class="hide-el" data-field="basedonurl"><input type="text" value="{{ resource.basedonurl }}" /></td>
	<td class="hide-el" data-field="translation_of">
		<!-- <input type="button" fill-data-reveal-id="" class="button tiny expand" value="Testing"/> -->
	</td>
	<td class="hide-el right-border" data-field="adaptation_of" >
		<input type="text" value="{{ resource.adaptation_of }}" />
	</td>

	<!-- LRMI -->
	<!-- <td class="view">{{ resource.educationaluse }}</td> -->
	<!-- <td class="view right-border">{{ resource.interactivitytype }}</td> -->

	<!-- LRMI -->
	<td class="hide-el" data-field="educationaluse">
		<select name="educationaluse">
			<option value="{{resource.educationaluse}}"> -- Select -- </option>
			{% for each_edu_use in static_educationaluse %}
			<option {%if each_edu_use == resource.educationaluse %}selected="selected"{%endif%} value="{{ each_edu_use }}">
				{{ each_edu_use }}
			</option>
			{% endfor %}
			<!-- <option {%if not resource.educationaluse %}selected="selected"{%endif%} value="None">
				None
			</option> -->
		</select>
	</td>
	<td class="hide-el right-border" data-field="interactivitytype">
		<select name="interactivitytype">
			<option value="{{resource.interactivitytype}}"> -- Select -- </option>
			{% for each_intertype in static_interactivitytype %}
			<option {%if each_intertype == resource.interactivitytype %}selected="selected"{%endif%} value="{{ each_intertype }}">{{ each_intertype }}</option>
			{% endfor %}
			<!-- <option {%if not resource.interactivitytype %}selected="selected"{%endif%} value="None">
				None
			</option> -->
		</select>
	</td>

	<!-- Alignment and Level -->
	<td class="hide-el" data-field="educationalalignment">
		<select name="educationalalignment">
			<option value="{{resource.educationalalignment}}"> -- Select -- </option>
			{% for each_edu_align in static_educationalalignment %}
			<option {%if each_edu_align == resource.educationalalignment %}selected="selected"{%endif%} value="{{ each_edu_align }}">{{ each_edu_align }}</option>
			{% endfor %}
			<!-- <option {%if not resource.educationalalignment %}selected="selected"{%endif%} value=""></option> -->
		</select>
	</td>
	<td class="hide-el" data-field="educationallevel">
		<select name="educationallevel" multiple>
			<option value="{{resource.educationallevel}}"> -- Select -- </option>
			{% for each_edulevel in static_educationallevel %}
			<option {%if each_edulevel in resource.educationallevel %}selected="selected"{%endif%} value="{{ each_edulevel }}">{{ each_edulevel }}</option>
			{% endfor %}
			<!-- <option {%if not resource.educationallevel %}selected="selected"{%endif%} value="None">
				None
			</option> -->
		</select>
	</td>
	<td class="hide-el right-border" data-field="educationalsubject">
		<select name="educationalsubject">
			<option value="{{resource.educationalsubject}}"> -- Select -- </option>
			{% for each_sub in static_educationalsubject %}
			<option {%if each_sub == resource.educationalsubject %}selected="selected"{%endif%} value="{{each_sub}}">{{ each_sub }}</option>
			{% endfor %}
			<!-- <option {%if not resource.educationalsubject %}selected="selected"{%endif%} value="None">
				None
			</option> -->
		</select>
	</td>

	<!-- Curate -->
	<td class="hide-el" data-field="curricular">
		<select name="curricular">
			<option value="{{resource.curricular}}"> -- Select -- </option>
			{% for each_curr in static_curricular %}		
			<option {%if each_curr == resource.curricular %}selected="selected"{%endif%} value="{{ each_curr }}">{{ each_curr }}</option>
			{% endfor %}
			<!-- <option {%if not resource.curricular %}selected="selected"{%endif%} value=""></option> -->
		</select>
	</td>
	<td class="hide-el" data-field="audience">
		<select name="audience" multiple>
			<option value="{{resource.audience}}"> -- Select -- </option>
			{% for each_aud in static_audience %}		
			<option {%if each_aud in resource.audience %}selected="selected"{%endif%} value="{{ each_aud }}">{{ each_aud }}</option>
			{% endfor %}
		<!-- 	<option {%if not resource.audience %}selected="selected"{%endif%} value="None">
				None
			</option> -->
		</select>
	</td>
	<td class="hide-el" data-field="teaches">
		<input type="button" data-reveal-id="teaches-overlay" class="button tiny expand" value="Edit in drawer"/>
	</td>
	<td class="hide-el" data-field="prior_node">
		<input type="button" data-reveal-id="prior_node-overlay" class="button tiny expand" value="Edit in drawer"/>
	</td>
	<td class="hide-el" data-field="featured">
		<select name="featured">
			<option value="{{resource.featured}}"> -- Select -- </option>
			<option {% if resource.featured == False %}selected="selected"{%endif%} value="False">False</option>
			<option {% if resource.featured == True %}selected="selected"{%endif%} value="True">True</option>
			<!-- <option {%if not resource.featured %}selected="selected"{%endif%} value="None">
				None
			</option> -->
		</select>
	</td>
	<td class="hide-el" data-field="status">
		<!-- <select name="status" {% if not user_is_joined == "author" or not user.is_superuser %}disabled{%endif%}> -->
		<select name="status" {% if not user.is_superuser %}disabled{%endif%}>
			<option value="{{resource.status}}"> -- Select -- </option>
			{% for each_status in static_status %}		
			<option {%if each_status == resource.status %}selected="selected"{%endif%} value="{{ each_status }}">{{ each_status }}</option>
			{% endfor %}	
		</select>
	</td>
	<td class="hide-el right-border" data-field="access_policy">
		<select name="access_policy">
			<option value="{{resource.access_policy}}"> -- Select -- </option>
			<option {%if resource.access_policy == "PUBLIC"%}selected="selected"{%endif%} value="PUBLIC">PUBLIC</option>
			<option {%if resource.access_policy == "PRIVATE"%}selected="selected"{%endif%} value="PRIVATE">PRIVATE</option>
			<!-- <option {%if not resource.access_policy %}selected="selected"{%endif%} value="None">
				None
			</option> -->
		</select>
	</td>

	<!-- Advance -->
	<td class="hide-el" data-field="readinglevel"></td>
	<td class="hide-el" data-field="timerequired">
		<input type="text" class="time-required" value="{{resource.timerequired}}"/>
	</td>
	<td class="hide-el right-border" data-field="textcomplexity" class="right-border">
		<select name="textcomplexity">
			<option value="{{resource.textcomplexity}}"> -- Select -- </option>
			{% for each_tc in static_textcomplexity %}		
			<option {%if each_tc == resource.textcomplexity %}selected="selected"{%endif%} value="{{ each_tc }}">{{ each_tc }}</option>
			{% endfor %}	
			<!-- <option {%if not resource.textcomplexity %}selected="selected"{%endif%} value="None">
				None
			</option> -->
		</select>				
	</td>
	{% if user.is_superuser %}
		<td class="deletedata">
		   	 
			<div class="button tiny exapnd" id = "{{resource.pk}}" onclick = "deleteNode('{{resource.pk}}')"> Delete </div> 
		</td>
		<td>
			<div class="button tiny exapnd" id = "{{resource.pk}}" onclick = "restoreNode('{{resource.pk}}')"> restore </div>
		</td>
	{% endif %}


	{% if title == "moderation" %}

	<!-- editorial discussion -->
	<td class="hide-el"> 
		<input type="button" data-reveal-id="editorial_discussion_overlay" class="button tiny expand"  data-id="editorial-discussion" value="Discuss" data-action="editorial-discussion"/>
		<!-- get the count of editorial discussion here -->
	</td>

	<!-- approval -->
	<td class="hide-el"> 
		<input type="button" class="button tiny expand success" data-approve-id="{{resource.pk}}" data-id="action-btn-approve-{{resource.pk}}" value="Approve" data-action="approve" onclick="approveResource('{{resource.pk}}')">
	</td>

	<!-- rejection -->
	<td class="hide-el"> 
		<input type="button" class="button tiny expand alert" data-approve-id="{{resource.pk}}" value="Reject"  data-id="action-btn-reject-{{resource.pk}}" data-action="reject" onclick="rejectResource('{{resource.pk}}')">
	</td>

	{% endif %}
</tr>