def gentransInputPage(request, model='', header='Generate Transformation Pathways', formData=None): import gentrans_parameters # from cts_app.models.pchemprop import pchemprop_parameters from cts_app.models.chemspec import chemspec_parameters html = render_to_string('04cts_uberinput_jquery.html', { 'model': model }) # loads scripts_gentrans.js html = html + render_to_string('04cts_uberinput_start_tabbed.html', { 'model': model, 'model_attributes': header }) html = html + render_to_string('04cts_uberinput_tabbed_nav.html', { 'nav_dict': { 'class_name': ["Chemical", "ReactionPathSim"], 'tab_label': ['Chemical Editor', 'Reaction Pathway Simulator'], }, 'nextTabName': 'Reaction Pathway Simulator' }) html = html + str(chemspec_parameters.form(formData)) # Loads the Chemical Speciation tables to the page html = html + render_to_string('cts.html', {}) # Builds Marvin JS, lookup table, and results table html = html + str(gentrans_parameters.form(formData)) html = html + render_to_string('04cts_uberinput_tabbed_end.html', {'sub_title': 'Submit'}) # Check if tooltips dictionary exists # try: # import gentrans_tooltips # hasattr(gentrans_tooltips, 'tooltips') # tooltips = gentrans_tooltips.tooltips # except: # tooltips = {} # html = html + render_to_string('05cts_ubertext_tooltips_right.html', {'tooltips':tooltips}) return html
def chemspecBatchInputPage(request, model='', header='Chemical Speciation Properties', formData=None): """ Currently, I'm using these model specific batch input page functions for drawing the models' unique input selection. For chemspec, the p-chem appears after the user has uploaded a chemical file for batch """ from cts_app.models.chemspec import chemspec_parameters # for chemspec batch, use p-chem for selecting inputs for batch data: html = """ <div id="pchem_batch_wrap" hidden> <h3>Edit speciation parameters for batch chemicals</h3> """ html += str(chemspec_parameters.form(None)) html += """ <div class="input_nav"> <div class="input_right"> <input type="button" value="Clear" id="clearbutton" class="input_button"> <input class="submit input_button" type="submit" value="Submit"> </div> </div> </div> """ return html
def pchempropInputPage(request, model='', header='P-Chem Properties', formData=None): import pchemprop_parameters from cts_app.models.chemspec import chemspec_parameters html = render_to_string('04cts_uberinput_jquery.html', { 'model': model}) # loads scripts_pchemprop.js html = html + render_to_string('04cts_uberinput_start_tabbed.html', { 'model': model, 'model_attributes': header }) html = html + render_to_string('04cts_uberinput_tabbed_nav.html', { 'nav_dict': { 'class_name': ['Chemical', 'ChemCalcs'], 'tab_label': ['Chemical Editor', 'P-Chem Calculators'] }, 'nextTabName': 'P-Chem Calculators' }) # chemspec inputs html = html + str(chemspec_parameters.form(formData)) # Loads the Chemical Speciation tables to the page html = html + render_to_string('cts.html', {}) # pchemprop inputs html = html + render_to_string('cts_pchem.html', {}) # html = html + str(pchemprop_parameters.form(formData)) # str(pchemprop_properties.form()) returns html table with ids html = html + render_to_string('04cts_ubercts_end.html', {'sub_title': 'Submit'}) # Check if tooltips dictionary exists # try: # import pchemprop_tooltips # hasattr(pchemprop_tooltips, 'tooltips') # tooltips = pchemprop_tooltips.tooltips # except: # tooltips = {} # html = html + render_to_string('05cts_ubertext_tooltips_right.html', {'tooltips':tooltips}) return html