-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.01.html
197 lines (180 loc) · 6.74 KB
/
index.01.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Demo Course Catalog Search...</title>
<script src="https://use.fontawesome.com/b5e9d8f8da.js"></script>
<link rel="stylesheet" href="https://unpkg.com/basscss@8.0.1/css/basscss.min.css">
<link rel="stylesheet" href="https://unpkg.com/basscss-btn@1.1.1/css/btn.css">
<link rel="stylesheet" href="https://unpkg.com/basscss-btn-outline@1.1.0/css/btn-outline.css">
<link rel="stylesheet" href="https://unpkg.com/basscss-btn-primary@1.1.0/css/btn-primary.css">
<link rel="stylesheet" href="https://unpkg.com/basscss-btn-sizes@1.2.0/css/btn-sizes.css">
<link rel="stylesheet" href="https://unpkg.com/basscss-background-colors@2.1.0/css/background-colors.css">
<link rel="stylesheet" href="https://unpkg.com/basscss-border-colors@2.1.0/css/border-colors.css">
<link rel="stylesheet" href="https://unpkg.com/basscss-colors@2.2.0/css/colors.css">
<link rel="stylesheet" href="https://use.fontawesome.com/b5e9d8f8da.css" media="all">
<style>/* using http://www.basscss.com/ as based CSS framework */
* {
box-sizing: inherit;
transition: all 400ms;
}
html {
box-sizing: border-box;
}
body {
font-family: Helvetica, Arial, Sans-serif;
}
.clear {clear:both;}
.search-wrapper {
position: relative;
font-size: 1.5rem;
line-height: 3rem;
}
.search-wrapper label {
position: absolute;
left: 1rem;
display: inline-block;
line-height: 3rem;
}
.search-wrapper input {
padding: .5rem;
padding-left: 3rem;
padding-right: 3rem;
border-radius: 1.5rem;
height: 3rem;
font-size: 1.25rem;
line-height: 3rem;
display: block;
width: 100%;
background-color: transparent;
background-image: none;
border: 1px solid currentColor;
outline: 0;
-moz-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-transition: all 400ms;
transition: all 400ms;
}
#courseList {
border-bottom: 1px solid gray;
}
#courseList > li {
border-top: 1px solid gray;
padding: 0.75em;
font-size: .8rem;
}
#courseList > li:nth-child(odd) {
background-color: rgba(0, 0, 0, .05);
}
#courseList > li:hover {
background-color: rgba(10, 20, 100, .1);
cursor: pointer;
}
#courseList > li h3,
#courseList > li p,
.head p {
margin: 0;
}
#courseList > li.active,
#courseList > li.active:hover {
background-color: Ivory;
}
</style>
</head>
<body>
<!-- v 0.1 -->
<div class="wrapper mt4 mb4">
<header class="clearfix mb2">
<h1 class="center">Course Catalog Search</h1>
<p class="col-6 mx-auto center">Type whatever you know — department, course number, random keyword or idea, what you think the name might be... We'll try to filter your results as best we are able.</p>
</header>
<div id="course-search">
<div class="search-wrapper col-10 mx-auto">
<label><i class="fa fa-search" aria-hidden="true"></i>
</label>
<input class="search">
</div>
<div class="sort-wrapper center mt1 mb1 filters">
<button class="sort btn btn-outline" data-sort="courseCode">Sort by Course Code</button>
<button class="sort btn btn-outline" data-sort="courseDepartment">Sort by Department</button>
<button class="sort btn btn-outline" data-sort="courseTitle">Sort by Course Name</button>
<button class="sort btn btn-outline" data-sort="courseTerm">Sort by Term</button>
<p>
Actual filters? Only show a specific term? show open/closed? show specific days of the week?
</p>
<p>
<a href="https://portal.cca.edu/courses/?term=2016FA&subject=GRAPH&campus=&acad_level=&q=TBD">CCA course search as an example...</a>
</p>
</div>
<ul id="courseList" class="list list-reset col-10 m0 mt3 mx-auto">
<p>Loading...</p>
<script id="individualCourse" type="x-tmpl-mustache">
{{#courses}}
<li class="clearfix course">
<h3 class="courseId hide"> {{crseid}} </h3>
<p class="courseCode col col-1"> {{subject}} {{catalognbr}} </p>
<p class="courseCode2 hide"> {{subject}}{{catalognbr}} </p>
<p class="courseDepartment col col-2"> {{subjectdescrformal}} </p>
<p class="courseTitle col col-4"> {{ccdescr}} </p>
<p class="courseTerm col col-2"> {{term}} </p>
<p class="courseFaculty col col-3"> {{instrfirstname}} {{instrlastname}}</p>
<div class="pt1 mb1 extra clear clearfix" style="display:none;">
<div class="courseDescription col col-7">
<p class="pt1"> {{ccdescrlong}} </p>
</div>
<div class="col col-5">
<ul class="list-reset p1">
<li class="courseCredits">Credits: {{ccunitsminimum}}</li>
<li>Enrollment: {{enrltot}}/{{enrlcap}}</li>
</ul>
<ul class="list-reset p1">
<li>{{buildingdescr}}</li>
<li>{{facilitydescr}}</li>
</ul>
<ul class="list-reset p1">
<li class="acadCareer">{{acadcareer}}</li>
</ul>
</div>
</div>
</li>
{{/courses}}
</script>
</ul>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.2.1/mustache.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/1.2.0/list.min.js"></script>
<script>
$.getJSON('courseSearch.json', function(data) {
//mustache for projects
var template = $('#individualCourse').html();
var info = Mustache.to_html(template, data);
$('#courseList').html(info);
$('.course').click(function() {
$(this).toggleClass('active');
$(this).siblings().removeClass('active');
$(this).find('.extra').toggle();
$(this).siblings().find('.extra').hide();
});
var options = {
valueNames: [
'courseId',
'courseCode',
'courseCode2',
'courseDepartment',
'courseTitle',
'courseTerm',
'courseFaculty',
'courseCredits',
'acadCareer'
]
};
var userList = new List('course-search', options);
});
</script>
</body>
</html>