-
Notifications
You must be signed in to change notification settings - Fork 5
/
externals.html
158 lines (148 loc) · 5.63 KB
/
externals.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="brand" href="http://cms-sw.github.com/cmssw/faq.html">CMS Topic Collector</a>
<ul class="nav">
<li><a href=".">Pull requests</a></li>
<li class="active"><a href="externals">Externals</a></li>
<li><a href="buildrequests">Build requests</a></li>
</ul>
<ul class="nav pull-right">
<li>
<form id="formbox" class="navbar-search pull-left" target="_blank" action="https://github.com/cms-sw/cmssw/search">
<input name="q" type="text" class="search-query" placeholder="Search"/>
</form>
<li>
<li class="dropdown">
<a id="userInfo" class="dropdown-toggle" data-toggle="dropdown" href="#"></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li id="userCern"></li>
<li id="userGithub"></li>
<li class="divider"></li>
<li><a href="https://login.cern.ch/adfs/ls/?wa=wsignout1.0">Logout</a></li>
</ul>
<li><a href="http://cms-sw.github.com/cmssw/faq.html">Help</a></li>
</li>
</ul>
</div>
</div>
</div>
<div class="row-fluid">
<div class="container-fluid">
<div id="myAlert" class="span12" style='padding: 15px;'></div>
</div>
</div>
<div class="row-fluid">
<div class="container-fluid">
<div id="releaseTabs" class="span12"></div>
</div>
</div>
<div class="row-fluid">
<div class="container-fluid">
<table id="externals" class="table">
<thead>
<tr><th>Architecture</th><th>PKGTOOLS</th><th>CMSDIST</th></tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/mustache.min.js"></script>
<script>
function mainLoop() {
var currentBranch = window.location.hash.slice(1, window.location.hash.length);
$("#releaseTabs li.active").removeClass("active");
$.get("../externals/" + currentBranch).done(function(d,a,b) {
$("#myAlert").html("");
var table = "";
var tableRow = "<tr><td>{{SCRAM_ARCH}}</td><td>{{PKGTOOLS_TAG}}</td><td>{{CMSDIST_TAG}}</td></th>";
for (var i = 0; i < d.length; ++i)
table += Mustache.render(tableRow, d[i]);
$("#externals tbody").html(table);
$("#releaseTabs li.active").removeClass("active");
$("#li_" + currentBranch).addClass("active");
}).error(function(d,a,b){
$("#externals tbody").html("");
$("#releaseTabs li.active").removeClass("active");
$("#li_" + currentBranch).addClass("active");
$("#myAlert").html('<div class="alert alert-error"><strong>No CMSDIST branch for ' + currentBranch + '.</strong></div></div>');
});
}
$(document).ready(function() {
$(window).bind('hashchange', mainLoop);
var userInfoPromise = $.post("api/auth").done(function(d,a,b) {
$("#formbox").attr("action", "https://github.com/" + d["repository"] + "/search");
$("#userInfo").html("Welcome " + d["firstname"] + "<b class='caret'></b>");
$("#userCern").html("<a href='#'>CERN: " + d["user"] + "</a>");
$("#userGithub").html("<a href='#'>github: " + d["githubUser"] + "</a>");
var userCategories = d["categories"];
var userCanSign = {}
var mapEgroups = {
"cms-git-core": "Core",
"cms-git-analysis": "Analysis",
"cms-git-alca": "Calibration and Alignment",
"cms-git-daq": "DAQ",
"cms-git-dqm": "DQM",
"cms-git-db": "Database",
"cms-git-docs": "Docs",
"cms-git-fastsim": "Fast Simulation",
"cms-git-simulation": "Full Simulation",
"cms-git-generators": "Generators",
"cms-git-geometry": "Geometry",
"cms-git-hlt": "HLT",
"cms-git-l1": "L1",
"cms-git-operations": "Operations",
"cms-git-reconstruction": "Reconstruction",
"cms-git-visualization": "Visualization"
}
userInfo = d;
var realCategories = [];
for (var i = 0; i < userCategories.length; ++i) {
if (userCategories[i] == "cms-git-admins")
userInfo["isAdmin"] = true;
var realName = mapEgroups[userCategories[i]];
if (!realName)
continue;
userCanSign[realName] = true;
realCategories[realCategories.length] = realName;
}
userInfo["canSign"] = userCanSign;
var categoriesSummaryTmpl = "<a>Signs for: <ul>{{#categories}}<li>{{.}}</li>{{/categories}}</ul></a>";
$("#userCategories").html(Mustache.render(categoriesSummaryTmpl, {"categories": realCategories}));
});
var currentBranch = undefined;
userInfoPromise.done(function () {
var currentBranchPromise = $.get("../externals").done(function(d, a, b) {
// Create the tabs
var tabs = '<div class="navbar"><div class="navbar-inner"><ul class="nav">';
if (d.length == 0)
{
$("#myAlert").html('<div class="alert alert-error"><strong>No CMSSW_X_Y_Z branches found.</strong></div></div>');
return;
}
var currentBranch = d[0]["ref"];
if (window.location.hash)
currentBranch = window.location.hash.slice(1, window.location.hash.length);
var releaseQueueTemplate = "<li id='li_{{queue}}' {{#active}}class='active'{{/active}}><a href='externals#{{queue}}'>{{queue}}</a></li>";
for (var i = 0; i != d.length; ++i)
{
var r = d[i];
var view = {
active: currentBranch == r["ref"],
queue: r["ref"]
}
tabs += Mustache.render(releaseQueueTemplate, view);
}
tabs += "</ul></div></div>";
$("#releaseTabs").html(tabs);
window.location.hash = "#" + currentBranch;
mainLoop();
});
});
});
</script>
</body>