#!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
from os.path import getmtime, exists
import time
import types
import __builtin__
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
from Cheetah.Template import Template
from Cheetah.DummyTransaction import DummyTransaction
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
##################################################
## MODULE CONSTANTS
try:
True, False
except NameError:
True, False = (1==1), (1==0)
VFFSL=valueFromFrameOrSearchList
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.0rc8'
__CHEETAH_versionTuple__ = (2, 0, 0, 'candidate', 8)
__CHEETAH_genTime__ = 1189741982.350836
__CHEETAH_genTimestamp__ = 'Thu Sep 13 23:53:02 2007'
__CHEETAH_src__ = 'PSQuestionDetailsView.tmpl'
__CHEETAH_srcLastModified__ = 'Wed Aug 22 23:06:30 2007'
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
raise AssertionError(
'This template was compiled with Cheetah version'
' %s. Templates compiled before version %s must be recompiled.'%(
__CHEETAH_version__, RequiredCheetahVersion))
##################################################
## CLASSES
class PSQuestionDetailsView(Template):
##################################################
## CHEETAH GENERATED METHODS
def __init__(self, *args, **KWs):
Template.__init__(self, *args, **KWs)
if not self._CHEETAH__instanceInitialized:
cheetahKWArgs = {}
allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
for k,v in KWs.items():
if k in allowedKWs: cheetahKWArgs[k] = v
self._initCheetahInstance(**cheetahKWArgs)
def respond(self, trans=None):
## CHEETAH: main method generated for this template
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
write('''<h1>Question: ''')
_v = VFFSL(SL,"qname",True) # '$qname' on line 2, col 15
if _v is not None: write(_filter(_v, rawExpr='$qname')) # from line 2, col 15.
write('''</h1>\r
<div id="error_div" class="errmsg">''')
_v = VFFSL(SL,"err_msg",True) # '$err_msg' on line 3, col 36
if _v is not None: write(_filter(_v, rawExpr='$err_msg')) # from line 3, col 36.
write('''</div>\r
<div id="status_div" class="statmsg">''')
_v = VFFSL(SL,"status_msg",True) # '$status_msg' on line 4, col 38
if _v is not None: write(_filter(_v, rawExpr='$status_msg')) # from line 4, col 38.
write('''</div>\r
<input type="hidden" name="top_status" id="top_status" value="ready"/>\r
\r
<h2>Question Properties</h2>\r
<p>\r
The Question \'''')
_v = VFFSL(SL,"qname",True) # '$qname' on line 9, col 15
if _v is not None: write(_filter(_v, rawExpr='$qname')) # from line 9, col 15.
write('''\' has the following properties:\r
</p>\r
<table border="0" class="ps_properties">\r
\r
<!-- Question name -->\r
<tr>\r
<td>\r
<label class="right" for="sqp_name">Question\'s name:</label>\r
</td>\r
<td>\r
<input id="sqp_name" class="left" type="text" size="50" maxlength="125" onclick="enable_button(\'sqp_button\')" name="name" value="''')
_v = VFFSL(SL,"qname",True) # '$qname' on line 19, col 142
if _v is not None: write(_filter(_v, rawExpr='$qname')) # from line 19, col 142.
write('''"/>\r
</td>\r
</tr>\r
<tr>\r
<td/>\r
<td>\r
The Question\'s name is not visible to the end-user. It is for configuration purposes only.\r
</td>\r
</tr>\r
\r
<!-- Question prompt -->\r
<tr>\r
<td>\r
<label class="right" for="sqp_prompt">Prompt:</label>\r
</td>\r
<td>\r
<textarea id="sqp_prompt" name="prompt" class="left" rows="2" cols="50" onclick="enable_button(\'sqp_button\')">''')
_v = VFFSL(SL,"prompt",True) # '$prompt' on line 35, col 124
if _v is not None: write(_filter(_v, rawExpr='$prompt')) # from line 35, col 124.
write('''</textarea>\r
</td>\r
</tr>\r
\r
<!-- Question answer type -->\r
<tr>\r
<td>\r
<label class="right">Answer Type:</label>\r
</td>\r
<td>\r
''')
if VFFSL(SL,"answer_type",True) == 'top:no_answer': # generated from line 45, col 13
write(''' <input id="sqp_no_answer" checked="y" name="answer_type" type="radio" onclick="hide_qdt_modules()"/>\r
''')
else: # generated from line 47, col 13
write(''' <input id="sqp_no_answer" name="answer_type" type="radio" onclick="hide_qdt_modules()"/>\r
''')
write(''' <label for="sqp_no_answer">No Answer Requested</label>\r
<br/>\r
\r
''')
if VFFSL(SL,"answer_type",True) == 'top:literal_answer_type': # generated from line 53, col 13
write(''' <input id="sqp_literal_answer_type" checked="y" name="answer_type" type="radio" onclick="show_qdt_literal_module()"/>\r
''')
else: # generated from line 55, col 13
write(''' <input id="sqp_literal_answer_type" name="answer_type" type="radio" onclick="show_qdt_literal_module()"/>\r
''')
write(''' <label for="sqp_literal_answer_type">Text/Numeric Answer</label>\r
<br/>\r
\r
''')
if VFFSL(SL,"answer_type",True) == 'top:tag_answer_type': # generated from line 61, col 13
write(''' <input id="sqp_tag_answer_type" checked="y" name="answer_type" type="radio" onclick="show_qdt_tag_module()"/>\r
''')
else: # generated from line 63, col 13
write(''' <input id="sqp_tag_answer_type" name="answer_type" type="radio" onclick="show_qdt_tag_module()"/>\r
''')
write(''' <label for="sqp_tag_answer_type">Tag Answer</label>\r
</td>\r
</tr>\r
\r
<!-- Question literal answer type -->\r
<tr>\r
<td/>\r
<td>\r
<div id="qdt_literal_module_div">\r
<div class="hd"/>\r
<div class="bd">\r
<div class="ptext1">Select the data type for the answer:<br clear="all" /></div>\r
''')
if VFFSL(SL,"literal_type",True) == 'top:text_literal': # generated from line 78, col 21
write(''' <input id="sqp_lt_text" checked="y" name="sqp_lt_gp" type="radio" onclick="text_literal_type_selected()"/>\r
<label for="sqp_lt_text">Text,</label>\r
(lenght: \r
<input id="sqp_lt_text_min" type="text" size="3" maxlength="4" onclick="enable_button(\'sqp_button\')" name="text_min" value="''')
_v = VFFSL(SL,"literal_text_min",True) # '$literal_text_min' on line 82, col 149
if _v is not None: write(_filter(_v, rawExpr='$literal_text_min')) # from line 82, col 149.
write('''"/>\r
<label for="sqp_lt_text_min">Min</label>\r
\r
<input id="sqp_lt_text_max" type="text" size="3" maxlength="4" onclick="enable_button(\'sqp_button\')" name="text_max" value="''')
_v = VFFSL(SL,"literal_text_max",True) # '$literal_text_max' on line 85, col 149
if _v is not None: write(_filter(_v, rawExpr='$literal_text_max')) # from line 85, col 149.
write('''"/>\r
<label for="sqp_lt_text_max">Max)</label>\r
''')
else: # generated from line 87, col 21
write(''' <input id="sqp_lt_text" name="sqp_lt_gp" type="radio" onclick="text_literal_type_selected()"/>\r
<label for="sqp_lt_text">Text,</label>\r
(lenght: \r
<input id="sqp_lt_text_min" disabled="y" type="text" size="3" maxlength="4" onclick="enable_button(\'sqp_button\')" name="text_min" value="''')
_v = VFFSL(SL,"literal_text_min",True) # '$literal_text_min' on line 91, col 162
if _v is not None: write(_filter(_v, rawExpr='$literal_text_min')) # from line 91, col 162.
write('''"/>\r
<label for="sqp_lt_text_min">Min</label>\r
\r
<input id="sqp_lt_text_max" disabled="y" type="text" size="3" maxlength="4" onclick="enable_button(\'sqp_button\')" name="text_max" value="''')
_v = VFFSL(SL,"literal_text_max",True) # '$literal_text_max' on line 94, col 162
if _v is not None: write(_filter(_v, rawExpr='$literal_text_max')) # from line 94, col 162.
write('''"/>\r
<label for="sqp_lt_text_max">Max)</label>\r
''')
write(''' <br/>\r
\r
''')
if VFFSL(SL,"literal_type",True) == 'top:int_literal': # generated from line 99, col 21
write(''' <input id="sqp_lt_int" checked="y" name="sqp_lt_gp" type="radio" onclick="int_literal_type_selected()"/>\r
<label for="sqp_lt_int">Integer,</label>\r
(range: \r
<input id="sqp_lt_int_min" type="text" size="6" maxlength="8" onclick="enable_button(\'sqp_button\')" name="int_min" value="''')
_v = VFFSL(SL,"literal_int_min",True) # '$literal_int_min' on line 103, col 147
if _v is not None: write(_filter(_v, rawExpr='$literal_int_min')) # from line 103, col 147.
write('''"/>\r
<label for="sqp_lt_int_min">Min</label>\r
\r
<input id="sqp_lt_int_max" type="text" size="6" maxlength="8" onclick="enable_button(\'sqp_button\')" name="int_max" value="''')
_v = VFFSL(SL,"literal_int_max",True) # '$literal_int_max' on line 106, col 147
if _v is not None: write(_filter(_v, rawExpr='$literal_int_max')) # from line 106, col 147.
write('''"/>\r
<label for="sqp_lt_int_max">Max)</label>\r
''')
else: # generated from line 108, col 21
write(''' <input id="sqp_lt_int" name="sqp_lt_gp" type="radio" onclick="int_literal_type_selected()"/>\r
<label for="sqp_lt_int">Integer,</label>\r
(range: \r
<input id="sqp_lt_int_min" disabled="y" type="text" size="6" maxlength="8" onclick="enable_button(\'sqp_button\')" name="int_min" value="''')
_v = VFFSL(SL,"literal_int_min",True) # '$literal_int_min' on line 112, col 160
if _v is not None: write(_filter(_v, rawExpr='$literal_int_min')) # from line 112, col 160.
write('''"/>\r
<label for="sqp_lt_int_min">Min</label>\r
\r
<input id="sqp_lt_int_max" disabled="y" type="text" size="6" maxlength="8" onclick="enable_button(\'sqp_button\')" name="int_max" value="''')
_v = VFFSL(SL,"literal_int_max",True) # '$literal_int_max' on line 115, col 160
if _v is not None: write(_filter(_v, rawExpr='$literal_int_max')) # from line 115, col 160.
write('''"/>\r
<label for="sqp_lt_int_max">Max)</label>\r
''')
write(''' <br/>\r
\r
''')
if VFFSL(SL,"literal_type",True) == 'top:date_literal': # generated from line 120, col 21
write(''' <input id="sqp_lt_date" checked="y" name="sqp_lt_gp" type="radio" onclick="date_literal_type_selected()"/>\r
''')
else: # generated from line 122, col 21
write(''' <input id="sqp_lt_date" name="sqp_lt_gp" type="radio" onclick="date_literal_type_selected()"/>\r
''')
write(''' <label for="sqp_lt_date">Date,</label>\r
(format: \'YYYY-MM-DD\')\r
\r
<!-- Added 07/10/07 for domain_predicate -->\r
<div class="ptext2">Select the Domain Property associated with this Question:<br clear="all" /></div>\r
<select id="sqp_l_domain_predicate" name="dpredicate" onchange="enable_button(\'sqp_button\')">\r
<option value ="_none_"\r
''')
if VFFSL(SL,"domain_predicate",True) == '': # generated from line 132, col 25
write(''' selected="selected"\r
''')
write(''' >Select a Domain Property</option>\r
''')
for predicate_name in VFFSL(SL,"all_domain_properties",True): # generated from line 136, col 25
write(''' <option value ="''')
_v = VFFSL(SL,"predicate_name",True) # '$predicate_name' on line 137, col 45
if _v is not None: write(_filter(_v, rawExpr='$predicate_name')) # from line 137, col 45.
write('''"\r
''')
if VFFSL(SL,"domain_predicate",True) == VFFSL(SL,"predicate_name",True): # generated from line 138, col 29
write(''' selected="selected"\r
''')
write(''' >''')
_v = VFFSL(SL,"predicate_name",True) # '$predicate_name' on line 141, col 30
if _v is not None: write(_filter(_v, rawExpr='$predicate_name')) # from line 141, col 30.
write('''</option>\r
''')
write(''' </select>\r
<div class="ptext2">\r
''')
if VFFSL(SL,"answer_required",True): # generated from line 145, col 25
write(''' <input id="sqp_answer_required1" type="checkbox" onclick="toggle_answer_required(\'sqp_answer_required1\')" checked="y" name="answer_required1"/>\r
''')
else: # generated from line 147, col 25
write(''' <input id="sqp_answer_required1" type="checkbox" onclick="toggle_answer_required(\'sqp_answer_required1\')" name="answer_required1"/>\r
''')
write(''' <label for="sqp_answer_required1">Answer is required.</label>\r
</div>\r
</div>\r
<div class="ft"/>\r
</div>\r
</td>\r
</tr>\r
\r
<!-- Question tag answer type -->\r
<tr>\r
<td/>\r
<td>\r
<div id="qdt_tag_module_div">\r
<div class="hd"/>\r
<div class="bd">\r
<div class="ptext1">Select the Tag Category for the answer:<br clear="all" /></div>\r
<select id="sqp_tag_category" name="qcategory" onchange="enable_button(\'sqp_button\')">\r
<option value ="_none_"\r
''')
if VFFSL(SL,"category",True) == '': # generated from line 168, col 25
write(''' selected="selected"\r
''')
write(''' >Select a Category</option>\r
''')
for category_index in VFN(VFFSL(SL,"psearch_db",True),"get_categories_iterator",False)(): # generated from line 172, col 25
write(''' <option value ="''')
_v = VFN(VFFSL(SL,"category_index",True),"get_name",False)() # '$category_index.get_name()' on line 173, col 45
if _v is not None: write(_filter(_v, rawExpr='$category_index.get_name()')) # from line 173, col 45.
write('''"\r
''')
if VFFSL(SL,"category",True) == VFN(VFFSL(SL,"category_index",True),"get_name",False)(): # generated from line 174, col 29
write(''' selected="selected"\r
''')
write(''' >''')
_v = VFN(VFFSL(SL,"category_index",True),"get_name",False)() # '$category_index.get_name()' on line 177, col 30
if _v is not None: write(_filter(_v, rawExpr='$category_index.get_name()')) # from line 177, col 30.
write('''</option>\r
''')
write(''' </select>\r
\r
<!-- Added 07/10/07 for domain_predicate -->\r
<div class="ptext2">Select the Domain Property associated with this Question:<br clear="all" /></div>\r
<select id="sqp_domain_predicate" name="dpredicate" onchange="enable_button(\'sqp_button\')">\r
<option value ="_none_"\r
''')
if VFFSL(SL,"domain_predicate",True) == '': # generated from line 185, col 25
write(''' selected="selected"\r
''')
write(''' >Select a Domain Property</option>\r
''')
for predicate_name in VFFSL(SL,"all_domain_properties",True): # generated from line 189, col 25
write(''' <option value ="''')
_v = VFFSL(SL,"predicate_name",True) # '$predicate_name' on line 190, col 45
if _v is not None: write(_filter(_v, rawExpr='$predicate_name')) # from line 190, col 45.
write('''"\r
''')
if VFFSL(SL,"domain_predicate",True) == VFFSL(SL,"predicate_name",True): # generated from line 191, col 29
write(''' selected="selected"\r
''')
write(''' >''')
_v = VFFSL(SL,"predicate_name",True) # '$predicate_name' on line 194, col 30
if _v is not None: write(_filter(_v, rawExpr='$predicate_name')) # from line 194, col 30.
write('''</option>\r
''')
write(''' </select>\r
\r
<div class="ptext2">\r
''')
if VFFSL(SL,"answer_required",True): # generated from line 199, col 25
write(''' <input id="sqp_answer_required2" type="checkbox" onclick="toggle_answer_required(\'sqp_answer_required2\')" checked="y" name="answer_required1"/>\r
''')
else: # generated from line 201, col 25
write(''' <input id="sqp_answer_required2" type="checkbox" onclick="toggle_answer_required(\'sqp_answer_required2\')" name="answer_required1"/>\r
''')
write(''' <label class="ptext2" for="sqp_answer_required2">Answer is required.</label>\r
</div>\r
</div>\r
<div class="ft"/>\r
</div>\r
</td>\r
</tr>\r
\r
<!-- Question help -->\r
<tr>\r
<td>\r
<label class="right" for="sqp_help">Help:</label>\r
</td>\r
<td>\r
<textarea id="sqp_help" name="help" class="left" rows="3" cols="50" onclick="enable_button(\'sqp_button\')">''')
_v = VFFSL(SL,"help",True) # '$help' on line 218, col 120
if _v is not None: write(_filter(_v, rawExpr='$help')) # from line 218, col 120.
write('''</textarea>\r
</td>\r
</tr>\r
\r
<!-- Question submit -->\r
<tr>\r
<td></td>\r
<td class="right">\r
<input type="hidden" name="literal_type" id="sqp_literal_type" value="''')
_v = VFFSL(SL,"literal_type",True) # '$literal_type' on line 226, col 83
if _v is not None: write(_filter(_v, rawExpr='$literal_type')) # from line 226, col 83.
write('''"/>\r
<input type="hidden" name="answer_required" id="sqp_answer_required" value="''')
_v = VFFSL(SL,"answer_required",True) # '$answer_required' on line 227, col 89
if _v is not None: write(_filter(_v, rawExpr='$answer_required')) # from line 227, col 89.
write('''"/>\r
<input type="hidden" name="qname" id="sqp_qname" value="''')
_v = VFFSL(SL,"qname",True) # '$qname' on line 228, col 69
if _v is not None: write(_filter(_v, rawExpr='$qname')) # from line 228, col 69.
write('''"/>\r
<input class="dt_button" id="sqp_button" type="button" value="Save Properties" disabled="y" onclick="get_sqp()"/>\r
</td>\r
</tr>\r
</table>\r
\r
<input type="hidden" name="pname" id="bk_pname" value="''')
_v = VFFSL(SL,"page_name",True) # '$page_name' on line 234, col 56
if _v is not None: write(_filter(_v, rawExpr='$page_name')) # from line 234, col 56.
write('''"/>\r
<input class="go_back_button" id="bk_button" type="submit" value="< Back to Page" onclick="do_view_page_details(\'bk_pname\')"/>\r
\r
<input type="hidden" name="iname" id="bk_iname" value="''')
_v = VFFSL(SL,"iw_name",True) # '$iw_name' on line 237, col 56
if _v is not None: write(_filter(_v, rawExpr='$iw_name')) # from line 237, col 56.
write('''"/>\r
<input class="go_back_button" id="bk_iw_button" type="submit" value="< Back to Interview" onclick="do_view_interview(\'bk_iname\')"/>\r
\r
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
##################################################
## CHEETAH GENERATED ATTRIBUTES
_CHEETAH__instanceInitialized = False
_CHEETAH_version = __CHEETAH_version__
_CHEETAH_versionTuple = __CHEETAH_versionTuple__
_CHEETAH_genTime = __CHEETAH_genTime__
_CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
_CHEETAH_src = __CHEETAH_src__
_CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
_mainCheetahMethod_for_PSQuestionDetailsView= 'respond'
## END CLASS DEFINITION
if not hasattr(PSQuestionDetailsView, '_initCheetahAttributes'):
templateAPIClass = getattr(PSQuestionDetailsView, '_CHEETAH_templateClass', Template)
templateAPIClass._addCheetahPlumbingCodeToClass(PSQuestionDetailsView)
# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
# For more information visit http://www.CheetahTemplate.org/
##################################################
## if run from command line:
if __name__ == '__main__':
from Cheetah.TemplateCmdLineIface import CmdLineIface
CmdLineIface(templateObj=PSQuestionDetailsView()).run()