Skip to content

Commit 3857d95

Browse files
committed
projects.html: Add filters for searching projects
This commit adds filters for filtering the projects based on project work status, tags, difficulty level, initiatives and collaborating projects, using angular. Also, due to addition of new changes, the file length (i.e. line count) got increased to 500+. Therefore, the coala module directives are splitted and added a new folder named directives that consists of all the app directives. Also, it makes the project more understandable to users, that what all directives does this project uses instead of scrolling down through the large lines of code (if not splitted out). Closes coala#559
1 parent 4c8db7f commit 3857d95

File tree

8 files changed

+658
-340
lines changed

8 files changed

+658
-340
lines changed

index.html

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
<script src="resources/vendors/showdown/showdown.js"></script>
2121
<script src="resources/vendors/markdown/markdown.js"></script>
2222
<script src="resources/js/app.js"></script>
23+
<!-- Import coala module directives -->
24+
<script src="resources/js/directives/projects.js"></script>
25+
<script src="resources/js/directives/mentors.js"></script>
26+
<script src="resources/js/directives/faqs.js"></script>
27+
<script src="resources/js/directives/students.js"></script>
28+
2329
<script src="resources/js/analytics.js"></script>
2430
<link rel="stylesheet" href="resources/vendors/materialize/css/materialize.css">
2531
<link rel="stylesheet" href="https://rawgit.com/coala/coalaCSS/master/coala.css">

partials/tabs/projects.html

+39-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,39 @@
55
<br>
66
<div class="main-content container">
77
<div class="col m8 col offset-m2 s12">
8-
<div class="input-field searchbar">
9-
<input ng-model="searchText" placeholder="Search for a project" id="search" type="search" class="validate"> </div>
8+
<div class="filter-projects-inputs">
9+
<div class="input-field searchbar">
10+
<input ng-model="searchText" placeholder="Search for a project" id="search" type="search" class="validate"> </div>
11+
<div class="filter-btn apply-flex center-content">
12+
<a id="filters" class="waves-effect waves-light btn-large" ng-click="toggleFiltersDisplay()">
13+
<b>Filter Projects</b>
14+
</a>
15+
</div>
16+
</div>
17+
<div ng-class="{'display-none':!lc.displayFilters}" ng-click="toggleFiltersDisplay()">
18+
<i class="fa fa-times close-filters"></i>
19+
</div>
20+
<div class="all-filters-option apply-flex center-content fade-in" ng-class="{'display-none':!lc.displayFilters}">
21+
<h6><b>Filter Projects</b></h6>
22+
<div class="filters-inputs apply-flex">
23+
<div class="filter-select-fields apply-flex evenly-spread-content">
24+
<label class="project-filter" ng-repeat="(filter, metadata) in projectFilterOptions">
25+
<select class="{{ filter }}-selector" ng-model="metadata.model" ng-change="setModelList(filter, metadata.model)" name="{{ filter }}-selector" multiple>
26+
<option value="" disabled>{{ metadata.label }}</option>
27+
<option value="{{ value }}" ng-repeat="(key, value) in metadata.options">{{ key }}</option>
28+
</select>
29+
</label>
30+
</div>
31+
<div class="filter-btns">
32+
<a class="waves-effect waves-light btn" ng-click="applyFilters()">
33+
<i class="fa fa-check" aria-hidden="true"> Apply Filters</i>
34+
</a>
35+
<a class="waves-effect waves-light btn" ng-click="clearFilters()">
36+
<i class="fa fa-trash-o clear-filters"> Clear Filters</i>
37+
</a>
38+
</div>
39+
</div>
40+
</div>
1041
<div style="text-align: center;">
1142
For more project ideas, <a href="https://github.com/coala/projects/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22Project+Proposal%22">click here</a>.
1243
</div>
@@ -18,7 +49,10 @@
1849
<div class="row outline">
1950
<div class="parent-wrapper">
2051
<div class="parent">
21-
<div ng-repeat="project in projectList | filter: searchText" class="card child">
52+
<div class="no-projects-found" ng-show="projectList.length === 0">
53+
{{ message.noProjectsFound }}
54+
</div>
55+
<div ng-repeat="project in projectList | filter: searchText | orderBy: sortOrder" class="card child">
2256
<div class="card-content waves-effect" ng-click="lc.showProject(project)">
2357
<div class="card-title center">{{ project.name }}</div>
2458
<div btf-markdown="project.desc" class="markdown"></div>
@@ -98,6 +132,8 @@
98132
'slow');
99133
})
100134

135+
$('.filter-select-fields select').material_select();
136+
101137
$('.modal').modal({
102138
dismissible: true, // Modal can be dismissed by clicking outside of the modal
103139
opacity: 0.8, // Opacity of modal background

resources/css/style.css

+80
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
1+
.all-filters-option {
2+
animation-duration: 1s;
3+
animation-fill-mode: both;
4+
background-color: white;
5+
border-radius: 20px;
6+
box-shadow: 0 0 15px 2px black;
7+
margin: 10px 0;
8+
min-width: 350px;
9+
position: relative;
10+
z-index: 1002;
11+
-webkit-animation-duration: 1s;
12+
-webkit-animation-fill-mode: both;
13+
}
14+
.apply-flex {
15+
align-items: center;
16+
display: flex;
17+
flex-flow: row wrap;
18+
}
119
.break-word {
220
word-wrap: break-word;
321
}
22+
.center-content {
23+
justify-content: center;
24+
}
25+
.close-filters {
26+
margin-top: 1.25rem;
27+
position: absolute;
28+
right: 6%;
29+
z-index: 1003;
30+
}
31+
.display-none {
32+
display: none;
33+
}
34+
.evenly-spread-content {
35+
justify-content: space-evenly;
36+
}
437
.hash_value_dup {
538
position: 'absolute';
639
left: '-9999px';
@@ -35,6 +68,33 @@
3568
.fa-clipboard:hover .hinttext {
3669
visibility: visible;
3770
}
71+
.filter-projects-inputs {
72+
display: flex;
73+
flex-flow: row wrap;
74+
justify-content: space-evenly;
75+
margin-top: 1rem;
76+
}
77+
.filter-btn {
78+
width: 165px;
79+
z-index: 0;
80+
}
81+
.filter-btn .btn-large {
82+
border-radius: 100px;
83+
box-shadow: 0 0 10px 1px darkslategray;
84+
}
85+
.filters-btns {
86+
width: 50%;
87+
}
88+
.filters-inputs {
89+
justify-content: space-around;
90+
padding: 20px 0;
91+
}
92+
.filter-select-fields {
93+
justify-content: space-around;
94+
padding-top: 20px;
95+
padding-bottom: 10px;
96+
width: 100%;
97+
}
3898
.footer-icons {
3999
display: flex;
40100
flex-wrap: wrap;
@@ -47,6 +107,9 @@
47107
.icon {
48108
color: white;
49109
}
110+
.fa {
111+
cursor: pointer;
112+
}
50113
.justify-text {
51114
text-align: justify;
52115
}
@@ -141,6 +204,11 @@ nav {
141204
border: 0;
142205
z-index: 9;
143206
}
207+
.searchbar {
208+
width: 85%;
209+
min-width: 340px;
210+
margin-top: 0;
211+
}
144212
.sha256sum_hash {
145213
display: flex;
146214
justify-content: space-evenly;
@@ -156,3 +224,15 @@ nav {
156224
#sha256sum_hash_value {
157225
word-wrap: break-word;
158226
}
227+
@-webkit-keyframes fade-in {
228+
0% {opacity: 0;}
229+
100% {opacity: 1;}
230+
}
231+
@keyframes fade-in {
232+
0% {opacity: 0;}
233+
100% {opacity: 1;}
234+
}
235+
.fade-in {
236+
-webkit-animation-name: fade-in;
237+
animation-name: fade-in;
238+
}

0 commit comments

Comments
 (0)