Skip to content

Commit

Permalink
make bb quality table sortable
Browse files Browse the repository at this point in the history
  • Loading branch information
piberger committed May 24, 2016
1 parent 27c08ac commit b3c7a5e
Show file tree
Hide file tree
Showing 6 changed files with 528 additions and 4 deletions.
25 changes: 24 additions & 1 deletion Analyse/AbstractClasses/GeneralProductionOverview.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import copy
import sys
import traceback
import shutil

class GeneralProductionOverview:
LastUniqueIDCounter = 1
Expand Down Expand Up @@ -61,6 +62,7 @@ def __init__(self, TestResultEnvironmentObject = None, InitialAttributes = None,
self.FullQualificationFullTests = ['m20_1', 'm20_2', 'p17_1']
self.HiddenData = {}
self.SubtestResults = {}
self.IncludeSorttable = False
### custom init
self.CustomInit()

Expand Down Expand Up @@ -273,6 +275,25 @@ def GenerateOverviewHTML(self):
'###HEAD_STYLESHEETS###',
StylesheetHTML
)

# Javsscripts
ScriptHTML = ''
if self.IncludeSorttable:
ScriptHTML += "\n<script src='sorttable.js'></script>\n"
sorttableSource = 'HTML/ProductionOverview/sorttable.js'
sorttableDest = self.GlobalOverviewPath+'/'+self.Attributes['BasePath'] + 'sorttable.js'
try:
shutil.copy(sorttableSource, sorttableDest)
except:
print "can't copy sorttable.js from:"
print " <- ", sorttableSource
print " -> ", sorttableDest

FinalHTML = HtmlParser.substituteMarkerArray(
FinalHTML,
{'###ADDITIONALSCRIPTS###': ScriptHTML}
)

FinalHTML = HtmlParser.substituteSubpart(
FinalHTML,
'###HEAD_STYLESHEET_TEMPLATE###',
Expand Down Expand Up @@ -433,7 +454,7 @@ def Image(self, URL, Style = None):
)
return HTML

def Table(self, TableData, RowLimit = 999):
def Table(self, TableData, RowLimit = 999, TableClass = '', TableStyle = ''):

HtmlParser = self.TestResultEnvironmentObject.HtmlParser
TableHTMLTemplate = self.TestResultEnvironmentObject.ProductionOverviewTableHTMLTemplate
Expand Down Expand Up @@ -487,6 +508,8 @@ def Table(self, TableData, RowLimit = 999):
HtmlParser.substituteSubpart(TableHTMLTemplate, '###TABLE_ROW###', TableRows),
{
'###TABLEID###': TableID,
'###TABLECLASS###': TableClass,
'###TABLESTYLE###': TableStyle
})

# button to show hidden rows
Expand Down
1 change: 1 addition & 0 deletions Analyse/HTML/ProductionOverview/OverviewTemplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<style>###STYLESHEET###</style>
<!-- ###HEAD_STYLESHEET_TEMPLATE### -->
<meta name="viewport" content="width=device-width,initial-scale=1">
###ADDITIONALSCRIPTS###
</head>
<body>
<!-- ###TEMPLATE### -->
Expand Down
2 changes: 1 addition & 1 deletion Analyse/HTML/ProductionOverview/Table.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="ProductionOverviewTable">
<table id="###TABLEID###">
<table id="###TABLEID###" class="###TABLECLASS###" style="###TABLESTYLE###">
<tbody>
<!-- ###TABLE_ROW### -->
<tr class="###CLASS###">
Expand Down
Loading

0 comments on commit b3c7a5e

Please sign in to comment.