Skip to content

Commit d7d858f

Browse files
mbillowstevenmirabito
authored andcommitted
Add actual form to conditional page
1 parent dcd7890 commit d7d858f

File tree

2 files changed

+95
-47
lines changed

2 files changed

+95
-47
lines changed
Lines changed: 87 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,98 @@
11
{% extends "nav.html" %}
22
{% block title %}
3-
Conditionals
3+
Conditionals
44
{% endblock %}
55
{% block extraFooter %}
6-
<script src="../static/js/conditional.js"></script>
6+
<script src="../static/js/conditional.js"></script>
77
{% endblock %}
88
{% block body %}
9-
<div class="container main">
10-
<div class="panel panel-default">
11-
<div class="panel-heading">
12-
<h3 class="panel-title">Conditionals</h3>
13-
</div>
14-
<div class="panel-body table-fill">
15-
<div class="table-responsive">
16-
{% if conditionals_len == 0 %}
17-
<div class="alert alert-info" style="margin:15px;">No conditionals.</div>
18-
{% else %}
19-
<table class="table table-striped no-bottom-margin">
20-
<tbody id="conditionals">
21-
<tr>
22-
<th>Name</th>
23-
<th>Date Created</th>
24-
<th>Date Due</th>
25-
<th>Description</th>
26-
{% if is_eval_director %}
27-
<th>Controls</th>
28-
{% endif %}
29-
</tr>
30-
<!-- ng-repeat="conditional in conditionals.data"-->
31-
{% for c in conditionals %}
32-
<tr id="conditional-{{c['id']}}" conditional_id="{{c['id']}}">
33-
<td>{{c['name']}}</td> <!-- If showing all users -->
34-
<td>{{c['date_created']}}</td>
35-
<td>{{c['date_due']}}</td>
36-
<td>{{c['description']}}</td>
37-
{% if is_eval_director %}
38-
<th>
39-
<button role="button" class="btn btn-raised btn-primary btn-success" style="width:100%;" id="pass-{{c['id']}}">
40-
Pass
41-
</button>
42-
<button role="button" class="btn btn-raised btn-primary btn-danger" style="width:100%;" id="fail-{{c['id']}}">
43-
Fail
44-
</button>
9+
<div class="container main">
10+
<div class="panel panel-default">
11+
<div class="panel-heading">
12+
<h3 class="panel-title">
13+
Conditionals
14+
{% if is_eval_director %}
15+
<button type="button" class="btn btn-primary btn-sm btn-conditional" data-toggle="modal" data-target="#createConditional">
16+
<span class="glyphicon glyphicon-plus"></span> Add
17+
</button>
18+
{% endif %}
19+
</h3>
20+
</div>
21+
<div class="panel-body table-fill">
22+
<div class="table-responsive">
23+
{% if conditionals_len == 0 %}
24+
<div class="alert alert-info" style="margin:15px;">No conditionals.</div>
25+
{% else %}
26+
<table class="table table-striped no-bottom-margin">
27+
<tbody id="conditionals">
28+
<tr>
29+
<th>Name</th>
30+
<th>Date Created</th>
31+
<th>Date Due</th>
32+
<th>Description</th>
33+
{% if is_eval_director %}
34+
<th>Controls</th>
35+
{% endif %}
36+
</tr>
37+
<!-- ng-repeat="conditional in conditionals.data"-->
38+
{% for c in conditionals %}
39+
<tr id="conditional-{{ c['id'] }}" conditional_id="{{ c['id'] }}">
40+
<td>{{ c['name'] }}</td> <!-- If showing all users -->
41+
<td>{{ c['date_created'] }}</td>
42+
<td>{{ c['date_due'] }}</td>
43+
<td>{{ c['description'] }}</td>
44+
{% if is_eval_director %}
45+
<th>
46+
<button role="button" class="btn btn-raised btn-primary btn-success"
47+
style="width:100%;" id="pass-{{ c['id'] }}">
48+
Pass
49+
</button>
50+
<button role="button" class="btn btn-raised btn-primary btn-danger"
51+
style="width:100%;" id="fail-{{ c['id'] }}">
52+
Fail
53+
</button>
4554

46-
</th>
47-
{% endif %}
48-
</tr>
49-
{% endfor %}
50-
</tbody>
51-
</table>
52-
{% endif %}
55+
</th>
56+
{% endif %}
57+
</tr>
58+
{% endfor %}
59+
</tbody>
60+
</table>
61+
{% endif %}
62+
</div>
5363
</div>
5464
</div>
5565
</div>
56-
<div >
66+
<div class="modal fade" id="createConditional" tabindex="-1">
67+
<div class="vertical-alignment-helper">
68+
<div class="modal-dialog vertical-align-center">
69+
<div class="modal-content">
70+
<div class="modal-header">
71+
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
72+
<h4 class="modal-title" id="editUserTitle">Conditional</h4>
73+
</div>
74+
<div class="modal-body">
75+
<div class="row user-edit-row">
76+
<label class="control-label" for="memberName">Member Name</label>
77+
<input type="text" name="attendees" class="form-control" data-module="memberSelect" data-src="cm_members"/>
78+
</div>
79+
80+
<div class="row user-edit-row">
81+
<label class="control-label" for="memberName">Due Date</label>
82+
<input type="text" name="date" class="form-control" value="{{ date }}" data-module="datepicker" />
83+
</div>
84+
<div class="row user-edit-row">
85+
<label class="control-label" for="memberName">Requirement</label>
86+
<input class="form-control" id="memberName" name="name" type="text">
87+
</div>
88+
</div>
89+
<div class="modal-footer">
90+
<button type="button" class="btn btn-success save-btn pull-left">Pass</button>
91+
<button type="button" class="btn btn-danger save-btn pull-left">Fail</button>
92+
<button type="button" class="btn btn-primary save-btn">Save</button>
93+
</div>
94+
</div>
95+
</div>
5796
</div>
58-
{% endblock %}
97+
</div>
98+
{% endblock %}

frontend/stylesheets/pages/_evals.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@
5353
text-align: center;
5454
}
5555
}
56+
57+
.btn-conditional {
58+
float: right;
59+
margin-top: -4px;
60+
padding: 3px 7px;
61+
box-shadow: none;
62+
63+
}

0 commit comments

Comments
 (0)