Created
April 1, 2015 19:51
-
-
Save matejskubic/a40e4cf2c85c772636d5 to your computer and use it in GitHub Desktop.
Add background color to requirements on the backlog taskboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- \Program Files\Microsoft Team Foundation Server 12.0\Application Tier\Web Services\_areas\Agile\Views\Backlogs\IterationBoard.aspx --> | |
<!-- add at the end of <asp:Content ContentPlaceHolderID="RightHubContent" runat="server"> --> | |
<script defer="defer" type="application/javascript"> | |
function popraviOzadje() | |
{ | |
try | |
{ | |
var taskboardData = JSON.parse(document.getElementById('taskboard').children[0].innerHTML); | |
var parentIds = taskboardData.parentIds; | |
var stateCol = 0; | |
for (stateCol in taskboardData.payload.columns) | |
{ | |
if (taskboardData.payload.columns[stateCol] == 'System.State') | |
{ | |
break; | |
} | |
} | |
for(var pid in parentIds) | |
{ | |
var parentId = parentIds[pid]; | |
try | |
{ | |
var rowState = taskboardData.payload.data[parentId][stateCol]; | |
var rowDetail = document.getElementById('taskboard-row-' + (parseInt(pid)+1)); | |
var rowSummary = document.getElementById('taskboard-summary-row-' + (parseInt(pid)+1)); | |
rowDetail.classList.add('row-state-' + rowState); | |
rowSummary.classList.add('row-state-' + rowState); | |
rowDetail.childNodes[1].title+=" State: " + rowState; | |
rowSummary.childNodes[1].title+=" State: " + rowState; | |
} | |
catch(err) | |
{ | |
window.___napaka2 = err; | |
} | |
} | |
} | |
catch(err) | |
{ | |
// jutst ignore | |
window.___napaka = err; | |
} | |
} | |
setTimeout(popraviOzadje, 2000); | |
</script> | |
<style> | |
.row-state-Proposed .taskboard-parent { | |
background-color: rgba(255, 160, 122, 0.10); | |
} | |
.row-state-Active .taskboard-parent { | |
background-color: rgba(152, 251, 152, 0.10); | |
} | |
.row-state-Resolved .taskboard-parent { | |
background-color: rgba(0, 0, 255, 0.10); | |
} | |
.row-state-Closed .taskboard-parent { | |
background-color: rgba(238, 238, 238, 0.10); | |
} | |
</style> | |
<!-- sorry for bad color selection --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment