From: Diane Trout Date: Fri, 23 Jan 2009 02:23:21 +0000 (+0000) Subject: Add in Rami's report template, and adjust the paths to use "reports" instead X-Git-Tag: 0.2.0.1~33 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=b998b62b8544e94ea1c090ae85d75f0da79c4589 Add in Rami's report template, and adjust the paths to use "reports" instead of "htsw_reports" --- diff --git a/htsworkflow/frontend/reports/reports.py b/htsworkflow/frontend/reports/reports.py index 712dd14..30d9ad4 100755 --- a/htsworkflow/frontend/reports/reports.py +++ b/htsworkflow/frontend/reports/reports.py @@ -27,8 +27,8 @@ def getBgColor(reads_cnt,exp_type): def report1(request): EXP = 'ChIP-seq' - if request.has_key('aflid'): - AFL_Id = request['aflid'] + if request.GET.has_key('aflid'): + AFL_Id = request.GET['aflid'] try: AFL = Affiliation.objects.get(id=AFL_Id).name AFL_CNT = Affiliation.objects.get(id=AFL_Id).contact @@ -62,15 +62,15 @@ def report1(request): str += '' + str += ' onclick="window.location=\'/reports/report?aflid='+af.id.__str__()+'\'; return false;">'+af.name+' '+af.contact+'' str += '' str += 'color scheme: > 12 M > 5 M > 3 M < 3 M' str += '' - str += 'Switch to: '+AFL+' '+AFL_CNT+' RNA-Seq Report' + str += 'Switch to: '+AFL+' '+AFL_CNT+' RNA-Seq Report' str += ' | ' - str += 'Methyl-Seq Report' + str += 'Methyl-Seq Report' bgc = '#ffffff' pbgc = '#f7f7f7' @@ -160,17 +160,17 @@ def report1(request): str += '' str += '' - return render_to_response('htsw_reports/report.html',{'main': str}) + return render_to_response('reports/report.html',{'main': str}) def report_RM(request): #for RNA-Seq and Methyl-Seq EXP = 'RNA-seq' - if request.has_key('exp'): - EXP = request['exp'] # Methyl-seq + if request.GET.has_key('exp'): + EXP = request.GET['exp'] # Methyl-seq - if request.has_key('aflid'): - AFL_Id = request['aflid'] + if request.GET.has_key('aflid'): + AFL_Id = request.GET['aflid'] try: AFL = Affiliation.objects.get(id=AFL_Id).name AFL_CNT = Affiliation.objects.get(id=AFL_Id).contact @@ -200,21 +200,21 @@ def report_RM(request): #for RNA-Seq and Methyl-Seq str += '' + str += ' onclick="window.location=\'/reports/report_RM?exp='+EXP+'&aflid='+af.id.__str__()+'\'; return false;">'+af.name+' '+af.contact+'' str += '' if EXP == 'RNA-seq': str += 'color scheme: > 20 M > 10 M > 6 M < 6 M' str += '' - str += 'Switch to: '+AFL+' '+AFL_CNT+' ChIP-Seq Report' + str += 'Switch to: '+AFL+' '+AFL_CNT+' ChIP-Seq Report' str += ' | ' - str += 'Methyl-Seq Report' + str += 'Methyl-Seq Report' else: str += 'color scheme: > 12 M > 5 M > 3 M < 3 M' str += '' - str += 'Switch to: '+AFL+' '+AFL_CNT+' ChIP-Seq Report' + str += 'Switch to: '+AFL+' '+AFL_CNT+' ChIP-Seq Report' str += ' | ' - str += 'RNA-Seq Report' + str += 'RNA-Seq Report' str += '

' str += '' @@ -269,7 +269,7 @@ def report_RM(request): #for RNA-Seq and Methyl-Seq str += '' str += '
'+AFL+' '+AFL_CNT+' '+EXP+'
' - return render_to_response('htsw_reports/report.html',{'main': str}) + return render_to_response('reports/report.html',{'main': str}) def getNotRanFCs(request): FCall = FlowCell.objects.order_by('-run_date').distinct() @@ -280,7 +280,7 @@ def getNotRanFCs(request): except ObjectDoesNotExist: str += ''+f.flowcell_id+''+f.Lanes()+''+f.run_date.__str__()+'' str += "" - return render_to_response('htsw_reports/report.html',{'main':str}) + return render_to_response('reports/report.html',{'main':str}) def test_Libs(request): str = '' diff --git a/htsworkflow/frontend/templates/reports/report.html b/htsworkflow/frontend/templates/reports/report.html new file mode 100644 index 0000000..c134377 --- /dev/null +++ b/htsworkflow/frontend/templates/reports/report.html @@ -0,0 +1,11 @@ +{% extends "admin/base_site.html" %} + +{% if main %} +{% block content %} + + {{ main|safe }} + +{% endblock %} +{% else %} +

No content. Can't create report.

+{% endif %}