Skip to content

Commit

Permalink
Merge pull request #162 from ComputerScienceHouse/eval-table
Browse files Browse the repository at this point in the history
Table Views for Evals Pages
  • Loading branch information
mbillow authored Dec 2, 2017
2 parents ecdc5b4 + c54caae commit 276b093
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 0 deletions.
95 changes: 95 additions & 0 deletions conditional/templates/intro_evals.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
{% endblock %}
{% block body %}
<div class="container main">
<div class="row mobile-hide">
<div class="col-sm-10">
<h3 class="page-title">Intro Evaluations</h3>
</div>
<div class="col-sm-2">
<div class="material-switch align-center">
<div class="switch-label">Table View</div>
<input id="evalToggle" name="evalToggle" type="checkbox" data-module="evalToggle"/>
<label for="evalToggle" class="label-primary"></label>
</div>
</div>
</div>
<div id="eval-blocks">
{% if members|length > 0 %}
{% for m in members %}
<div class="panel panel-default">
Expand Down Expand Up @@ -169,8 +182,90 @@ <h4>Other Comments</h4>

</div>
{% endfor %}
</div>
{% else %}
<div class="alert alert-info" role="alert"><span class="glyphicon glyphicon-info-sign white" style="padding-right:5px"></span> There are currently no active intro members.</div>
{% endif %}

<div id="eval-table" style="display:none;">
<div class="panel panel-default">
<div class="panel-body table-fill">
<div class="panel-body table-fill">
<div class="table-responsive">
<table class="table table-striped no-bottom-margin" data-module="table" data-searchable="true" data-sort-column="3" data-sort-order="asc" data-length-changable="true" data-paginated="false">
<thead>
<tr>
<th>Name</th>
<th>Result</th>
<th>Meetings</th>
<th>Signatures Missed</th>
<th>Freshman Project</th>
<th>Technical Seminars</th>
<th>House Meetings Missed</th>
</tr>
</thead>
<tbody>
{% for m in members %}
<tr>
<td>
<img class="eval-user-img" alt="{{m['uid']}}" src="https://profiles.csh.rit.edu/image/{{m['uid']}}" width="30" height="30" /> {{m['name']}} ({{m['uid']}})
</td>
<td>
{% if m['status'] == "Passed" %}
<span class="glyphicon glyphicon-ok green"></span> Passed
{% elif m['status'] == "Pending" %}
<span class="glyphicon glyphicon-hourglass yellow"></span> Pending
{% else %}
<span class="glyphicon glyphicon-remove red"></span> Failed
{% endif %}
</td>
<td>
{% if m['committee_meetings'] < 10 %}
<span class="glyphicon glyphicon-remove-sign red eval-info-status"></span> {{m['committee_meetings']}}
{% else %}
<span class="glyphicon glyphicon-ok-sign green eval-info-status"></span> {{m['committee_meetings']}}
{% endif %}
</td>
<td>
{% if m['signatures_missed'] == 0 %}
<span class="glyphicon glyphicon-ok-sign green eval-info-status"></span> {{ m['signatures_missed'] }}
{% elif m['signatures_missed'] > 0 %}
<span class="glyphicon glyphicon-remove-sign red eval-info-status"></span> {{ m['signatures_missed'] }}
{% else %}
<span class="glyphicon glyphicon-hourglass yellow eval-info-status"></span> Pending
{% endif %}
</td>
<td>
{% if m['freshman_project'] == "Passed" %}
<span class="glyphicon glyphicon-ok-sign green eval-info-status"></span> Passed
{% elif m['freshman_project'] == "Failed" %}
<span class="glyphicon glyphicon-remove-sign red eval-info-status"></span> Failed
{% else %}
<span class="glyphicon glyphicon-hourglass yellow eval-info-status"></span> Pending
{% endif %}
</td>
<td>
{% if m['technical_seminars']|length >= 2 %}
<span class="glyphicon glyphicon-ok-sign green eval-info-status"></span> {{m['technical_seminars']|length}}
{% else %}
<span class="glyphicon glyphicon-remove-sign red eval-info-status"></span> {{m['technical_seminars']|length}}
{% endif %}
</td>
<td>
{% if m['house_meetings_missed']|length == 0 %}
<span class="glyphicon glyphicon-ok-sign green eval-info-status"></span> {{m['house_meetings_missed']|length}}
{% else %}
<span class="glyphicon glyphicon-remove-sign red eval-info-status"></span> {{m['house_meetings_missed']|length}}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
74 changes: 74 additions & 0 deletions conditional/templates/spring_evals.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
{% endblock %}
{% block body %}
<div class="container main">
<div class="row mobile-hide">
<div class="col-sm-10">
<h3 class="page-title">Spring Evaluations</h3>
</div>
<div class="col-sm-2">
<div class="material-switch align-center">
<div class="switch-label">Table View</div>
<input id="evalToggle" name="evalToggle" type="checkbox" data-module="evalToggle"/>
<label for="evalToggle" class="label-primary"></label>
</div>
</div>
</div>
<div id="eval-blocks">
{% for m in members %}
<div class="panel panel-default">
<div class="panel-body eval-panel">
Expand Down Expand Up @@ -163,5 +176,66 @@ <h4>Major Projects</h4>


{% endfor %}
</div>
<div id="eval-table" style="display:none;">
<div class="panel panel-default">
<div class="panel-body table-fill">
<div class="panel-body table-fill">
<div class="table-responsive">
<table class="table table-striped no-bottom-margin" data-module="table" data-searchable="true" data-sort-column="4" data-sort-order="asc" data-length-changable="true" data-paginated="false">
<thead>
<tr>
<th>Name</th>
<th>Result</th>
<th>Meetings</th>
<th>Major Project</th>
<th>House Meetings Missed</th>
</tr>
</thead>
<tbody>
{% for m in members %}
<tr>
<td>
<img class="eval-user-img" alt="{{m['uid']}}" src="https://profiles.csh.rit.edu/image/{{m['uid']}}" width="30" height="30" /> {{m['name']}} ({{m['uid']}})
</td>
<td>
{% if m['status'] == "Passed" %}
<span class="glyphicon glyphicon-ok green"></span> Passed
{% elif m['status'] == "Pending" %}
<span class="glyphicon glyphicon-hourglass yellow"></span> Pending
{% else %}
<span class="glyphicon glyphicon-remove red"></span> Failed
{% endif %}
</td>
<td>
{% if m['committee_meetings'] < 25 %}
<span class="glyphicon glyphicon-remove-sign red eval-info-status"></span> {{m['committee_meetings']}}
{% else %}
<span class="glyphicon glyphicon-ok-sign green eval-info-status"></span> {{m['committee_meetings']}}
{% endif %}
</td>
<td>
{% if m['major_project_passed'] %}
<span class="glyphicon glyphicon-ok-sign green eval-info-status"></span> Passed
{% else %}
<span class="glyphicon glyphicon-remove-sign red eval-info-status"></span> None
{% endif %}
</td>
<td>
{% if m['house_meetings_missed']|length == 0 %}
<span class="glyphicon glyphicon-ok-sign green eval-info-status"></span> {{m['house_meetings_missed']|length}}
{% else %}
<span class="glyphicon glyphicon-remove-sign red eval-info-status"></span> {{m['house_meetings_missed']|length}}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
23 changes: 23 additions & 0 deletions frontend/javascript/modules/evalToggle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default class EvalToggle {
constructor(toggle) {
this.toggle = toggle;

this.render();
}

render() {
this.toggle.addEventListener('click', () => {
this._toggleTable();
});
}

_toggleTable() {
if (this.toggle.checked) {
$("#eval-blocks").hide();
$("#eval-table").show();
} else {
$("#eval-table").hide();
$("#eval-blocks").show();
}
}
}

0 comments on commit 276b093

Please sign in to comment.