forked from 18F/osbu-forecast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
126 lines (122 loc) · 4.94 KB
/
index.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
---
---
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="{{site.baseurl}}/assets/js/vendor/jquery-1.11.3.min.js"></script>
<link rel="stylesheet" href="{{site.baseurl}}/assets/css/jquery.dataTables.min.css">
<script src="{{site.baseurl}}/assets/js/vendor/jquery.dataTables.min.js"></script>
<script src="{{site.baseurl}}/assets/js/vendor/remodal.min.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="{{site.baseurl}}/assets/css/remodal.css" type="text/css" media="screen" />
<link rel="stylesheet" href="{{site.baseurl}}/assets/css/remodal-default-theme.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/assets/css/main.css">
<link rel="stylesheet" href="/assets/css/styleguide.css">
<link rel="stylesheet" href="/assets/css/google-fonts.css">
<script src="/assets/js/components.js"></script>
<title></title>
</head>
<body class>
{% include header.html %}
{% include sidenav.html %}
<div class="main-content">
<article class="styleguide-content usa-content">
<h1>View Opportunities</h1>
<table id="forecastTable" class="display usa-table-borderless" cellspacing="0" width="100%">
<thead>
<tr>
<th>GSA Organization</th>
<th>Region</th>
<th>Award Status</th>
<th>Product or Service Description</th>
<th>Place of Performance (City)</th>
<th>Place of Performance (State)</th>
<th>Primary NAICS Code</th>
<th>Estimated Award Fiscal Year and Quarter</th>
<th>Socioeconomic Category</th>
</tr>
<tr>
<th>GSA Organization</th>
<th>Region</th>
<th>Award Status</th>
<th>Product or Service Description</th>
<th>Place of Performance (City)</th>
<th>Place of Performance (State)</th>
<th>Primary NAICS Code</th>
<th>Estimated Award Fiscal Year and Quarter</th>
<th>Socioeconomic Category</th>
</tr>
</thead>
<tfoot>
<tr>
<th>GSA Organization</th>
<th>Region</th>
<th>Award Status</th>
<th>Product or Service Description</th>
<th>Place of Performance (City)</th>
<th>Place of Performance (State)</th>
<th>Primary NAICS Code</th>
<th>Estimated Award Fiscal Year and Quarter</th>
<th>Socioeconomic Category</th>
</tr>
</tfoot>
<tbody>
</tbody>
</table>
</article>
</div>
<script>
var data;
var generateModalHtml = function (d) {
var html = "<button data-remodal-action='close' class='remodal-close'></button><h1>Opportunity Detail View</h1><table class='usa-table-borderless' style='overflow: scroll'><tbody>";
for (k in d) {
html += "<tr><td>" + k + ":</td><td>" + d[k] + "</td>"
}
html += "</tbody></table>"
return html;
}
$(document).ready(function() {
$('#forecastTable thead tr:nth-child(2) th').each(function() {
var title = $('#forecastTable thead th').eq($(this).index()).text();
$(this).html('<input type"text" placeholder="Search ' + title + '">');
});
var table = $('#forecastTable').DataTable( {
"sDom": '<"top"i>rt<"bottom"lp><"clear">',
"sort": false,
"ajax": {url:'data/2015data.json',"dataSrc": ""},
"columns": [
{ "data": "GSA Organization",
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
$(nTd).html("<a href='#" + iRow + "' data-remodal-target='modal'>" +oData["GSA Organization"] + "</a>");
$(nTd).click(function(event) {
$(".remodal").html(generateModalHtml(oData)).remodal().open()
return false;
});
} },
{ "data": "Region" },
{ "data": "Award Status" },
{ "data": "Product or Service Description" },
{ "data": "Place of Performance (City)" },
{ "data": "Place of Performance (State)" },
{ "data": "Primary NAICS Code" },
{ "data": "Estimated Award Fiscal Year and Quarter" },
{ "data": "Socioeconomic Category" }
]
});
table.columns().eq(0).each(function(colIdx) {
$('input', table.column(colIdx).header()).on('keyup change', function() {
table
.column(colIdx)
.search(this.value)
.draw();
});
$('input', table.column(colIdx).header()).on('click', function(e) {
e.stopPropagation();
});
})
data = table;
})
</script>
<div class="remodal-bg"><div class="remodal" data-remodal-id="modal"></div></div>
</body>
</html>