Changeset 61472 in vbox for trunk/src/VBox/ValidationKit/testmanager/webui
- Timestamp:
- Jun 5, 2016 5:46:15 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 107799
- Location:
- trunk/src/VBox/ValidationKit/testmanager/webui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testmanager/webui/wuiadminschedgroup.py
r56295 r61472 84 84 fReadOnly = self._sMode == WuiFormContentBase.ksMode_Show); 85 85 86 oForm.addMultilineText (SchedGroupData.ksParam_sComment, oData.sComment, 'Comment'); 86 87 oForm.addSubmit() 87 88 … … 100 101 self._asColumnHeaders = [ 101 102 'ID', 'Name', 'Enabled', 'Scheduler Type', 102 'Build Source', 'Validation Kit Source', 'Test Groups', 'TestBoxes', ' Actions',103 'Build Source', 'Validation Kit Source', 'Test Groups', 'TestBoxes', 'Note', 'Actions', 103 104 ]; 104 105 105 106 self._asColumnAttribs = [ 106 107 'align="right"', 'align="center"', 'align="center"', 'align="center"', 107 'align="center"', 'align="center"', '', '', 'align="center"', 108 'align="center"', 'align="center"', '', '', 'align="center"', 'align="center"', 108 109 ]; 109 110 … … 181 182 aoMembers, 182 183 aoTestBoxes, 184 self._formatCommentCell(oEntry.sComment), 183 185 aoActions, 184 186 ]; -
trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmintestbox.py
r61468 r61472 235 235 fBracketed = False); 236 236 # Comment 237 oComment = None; 238 if oEntry.sComment is not None: 239 sComment = oEntry.sComment.strip(); 240 if len(sComment) > 64: 241 oComment = WuiRawHtml('<span title="%s">%s...</span>' 242 % (webutils.escapeAttr(sComment), webutils.escapeElem(sComment[:60]),)); 243 elif len(sComment) > 0: 244 oComment = WuiRawHtml(webutils.escapeElem(sComment)); 237 oComment = self._formatCommentCell(oEntry.sComment); 245 238 246 239 # Group link. -
trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmintestcase.py
r61272 r61472 64 64 self._asColumnHeaders = \ 65 65 [ 66 'Name', 'Active', ' DefaultTimeout', 'Base Command / Variations', 'Validation Kit Files',67 'Test Case Prereqs', 'Global R esources', 'Actions'66 'Name', 'Active', 'Timeout', 'Base Command / Variations', 'Validation Kit Files', 67 'Test Case Prereqs', 'Global Rsrces', 'Note', 'Actions' 68 68 ]; 69 69 self._asColumnAttribs = \ 70 70 [ 71 '', '', ' ', '', '',72 'valign="top"', 'valign="top"', 'align="center"' 71 '', '', 'align="center"', '', '', 72 'valign="top"', 'valign="top"', 'align="center"', 'align="center"' 73 73 ]; 74 74 … … 154 154 aoRet.append(WuiRawHtml(sHtml)); 155 155 156 # Comment (note). 157 aoRet.append(self._formatCommentCell(oEntry.sComment)); 158 156 159 # Show actions that can be taken. 157 160 aoActions = [ WuiTmLink('Details', WuiAdmin.ksScriptName, … … 237 240 oForm.addListOfResources(TestCaseDataEx.ksParam_aoDepGlobalResources, aoGlobalResrcDeps, 'Depends on resources') 238 241 242 oForm.addMultilineText(TestCaseDataEx.ksParam_sComment, oData.sComment, 'Comment'); 243 239 244 oForm.addSubmit(); 240 245 -
trunk/src/VBox/ValidationKit/testmanager/webui/wuiadmintestgroup.py
r56295 r61472 74 74 fReadOnly = self._sMode == WuiFormContentBase.ksMode_Show); 75 75 76 oForm.addMultilineText (TestGroupData.ksParam_sComment, self._oData.sComment, 'Comment'); 76 77 oForm.addSubmit(); 77 78 return True; … … 88 89 WuiListContentBase.__init__(self, aoEntries, iPage, cItemsPerPage, tsEffective, 89 90 sTitle = 'Test Groups', fnDPrint = fnDPrint, oDisp = oDisp); 90 self._asColumnHeaders = [ 'ID', 'Name', 'Description', 'Test Cases', ' Actions' ];91 self._asColumnAttribs = [ 'align="right"', '', '', '', 'align="center"' ];91 self._asColumnHeaders = [ 'ID', 'Name', 'Description', 'Test Cases', 'Note', 'Actions' ]; 92 self._asColumnAttribs = [ 'align="right"', '', '', '', 'align="center"', 'align="center"' ]; 92 93 93 94 … … 178 179 oEntry.sDescription if oEntry.sDescription is not None else '', 179 180 oTestCases, 181 self._formatCommentCell(oEntry.sComment, cMaxLines = max(3, len(oEntry.aoMembers) * 2)), 180 182 aoActions ]; 181 183 -
trunk/src/VBox/ValidationKit/testmanager/webui/wuicontentbase.py
r61424 r61472 203 203 Outputs the given text within a span of the given CSS class. 204 204 """ 205 def __init__(self, sSpanClass, sText): 206 WuiRawHtml.__init__(self, 207 u'<span class="%s">%s</span>' 208 % (webutils.escapeAttr(sSpanClass), webutils.escapeElem(sText),)); 205 def __init__(self, sSpanClass, sText, sTitle = None): 206 if sTitle is None: 207 WuiRawHtml.__init__(self, 208 u'<span class="%s">%s</span>' 209 % ( webutils.escapeAttr(sSpanClass), webutils.escapeElem(sText),)); 210 else: 211 WuiRawHtml.__init__(self, 212 u'<span class="%s" title="%s">%s</span>' 213 % ( webutils.escapeAttr(sSpanClass), webutils.escapeAttr(sTitle), webutils.escapeElem(sText),)); 214 209 215 210 216 … … 692 698 self._asColumnAttribs = []; 693 699 700 def _formatCommentCell(self, sComment, cMaxLines = 3, cchMaxLine = 63): 701 """ 702 Helper functions for formatting comment cell. 703 Returns None or WuiRawHtml instance. 704 """ 705 # Nothing to do for empty comments. 706 if sComment is None: 707 return None; 708 sComment = sComment.strip(); 709 if len(sComment) == 0: 710 return None; 711 712 # Restrict the text if necessary, making the whole text available thru mouse-over. 713 ## @todo this would be better done by java script or smth, so it could automatically adjust to the table size. 714 if len(sComment) > cchMaxLine or sComment.count('\n') >= cMaxLines: 715 sShortHtml = ''; 716 for iLine, sLine in enumerate(sComment.split('\n')): 717 if iLine >= cMaxLines: 718 break; 719 if iLine > 0: 720 sShortHtml += '<br>\n'; 721 if len(sLine) > cchMaxLine: 722 sShortHtml += webutils.escapeElem(sLine[:(cchMaxLine - 3)]); 723 sShortHtml += '...'; 724 else: 725 sShortHtml += webutils.escapeElem(sLine); 726 return WuiRawHtml('<span class="tmcomment" title="%s">%s</span>' % (webutils.escapeAttr(sComment), sShortHtml,)); 727 728 return WuiRawHtml('<span class="tmcomment">%s</span>' % (webutils.escapeElem(sComment).replace('\n', '<br>'),)); 729 694 730 def _formatListEntry(self, iEntry): 695 731 """
Note:
See TracChangeset
for help on using the changeset viewer.