##// END OF EJS Templates
jars edit...
Fiorella Quino -
r294:e0240bbcf96b
parent child
Show More
@@ -12,9 +12,13 class SpectralWidget(forms.widgets.TextInput):
12 12
13 13 def render(self, label, value, attrs=None):
14 14
15 disabled = 'disabled' if attrs.get('disabled', False) else ''
15 readonly = 'readonly' if attrs.get('readonly', False) else ''
16 16 name = attrs.get('name', label)
17 #print value
17 print 'ESTO!'
18 print value
19 if value == None:
20 value = '[0, 0],'
21 print readonly
18 22 if '[' in value:
19 23 if value[len(value)-1] == ",":
20 24 value = ast.literal_eval(value)
@@ -34,7 +38,7 class SpectralWidget(forms.widgets.TextInput):
34 38 else:
35 39 codes=''
36 40
37 html = '''<textarea rows="5" {0} class="form-control" id="id_{1}" name="{2}" disabled style="white-space:nowrap; overflow:scroll;">{3}</textarea>
41 html = '''<textarea rows="5" {0} class="form-control" id="id_{1}" name="{2}" style="white-space:nowrap; overflow:scroll;">{3}</textarea>
38 42 <input type="text" class="col-md-1 col-no-padding" id="num1" value=0>
39 43 <input type="text" class="col-md-1 col-no-padding" id="num2" value=0>
40 44 <button type="button" class="button" id="add_spectral_button"> Add </button>
@@ -42,7 +46,7 class SpectralWidget(forms.widgets.TextInput):
42 46 <button type="button" class="button pull-right" id="cross_spectral_button"> Cross </button>
43 47 <button type="button" class="button pull-right" id="self_spectral_button"> Self </button>
44 48 <button type="button" class="button pull-right" id="all_spectral_button"> All </button>
45 '''.format(disabled, label, name, codes)
49 '''.format(readonly, label, name, codes)
46 50
47 51 script = '''
48 52 <script type="text/javascript">
General Comments 0
You need to be logged in to leave comments. Login now