-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathform.html
121 lines (111 loc) · 4.82 KB
/
form.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
---
layout: default
page: form
---
<div class="formblock">
{% for form in site.data.grantseeker %}
{% assign loopindex = forloop.index0%}
<section class="page {% if loopindex == 0 %}show{% endif %} col col--xs-12 col--sm-12 col--md-8 col--lg-8 col--md-offset-2 col--lg-offset-2" id="{{form.grantinfo}}">
{% if form.desc %}
<section class="block">
<div class="form-desc col col--xs-12 col--sm-12 col--md-12 col--lg-12">
{{form.desc}}
</div>
</section>
{% endif %}
{% if forloop.first %}
<section class="block" id="template">
<div class="form col col--xs-12 col--sm-12 col--md-12 col--lg-12">
<h3>Load from template?</h3>
<p>
If you’ve visited this tool before and saved your template, you may pre-load your data to start from in order to analyze a different potential grant. Note: Any changes you have already made will not be changed by the template.</p>
<p>If this is your first time using this tool, you will not have any templates below to choose from.</p>
<h3>Grant Information, Details, and Logistics</h3>
<p>Fill in the information below about a specific grant, details, and logistics, . We will use this to calculate the final net grant. You may choose whether to save your own work as a template to work from for additional grants you may analyze using this tool.</p>
</p>
<p>Note: Any changes you have made will not bechanged by the template.</p>
<select id="templateselect">
<option>Loading templates...</option>
</select>
</div>
</section>
{% endif %}
<div class="pages">
{% if forloop.index > 1 %}<button class="turn prev">Prev</button>{% endif %}
{% if forloop.index < forloop.length %}<button class="turn next">Next</button>{% endif %}
</div>
<div class="title"><h2>{{ form.name }}</h2></div>
{% for section in form.sections %}
<section class="block" id="{{section.name}}">
<h3>{{section.header}}</h3>
<form class="form">
{% for question in section.questions %}
<div class="question {% if question.required %}required{% endif%}">
<div class="load"><img src="{{ "/img/load.gif" | prepend: site.baseurl | prepend: site.url }}" /></div>
<label>{{question.label}}</label>
{% if question.type == "dropdown" %}
<select id="{{question.dbfield}}" class="live">
{% for option in question.content %}
<option data_id="{{option.label}}">{{option.label}}</option>
{% endfor %}
</select>
{% elsif question.type == "text" %}
<input class="live" type="text" id="{{question.dbfield}}" />
{% elsif question.type == "number" %}
<input class="live" type="number" min="0.0" step="0.01" id="{{question.dbfield}}" />
{% elsif question.type == "money" %}
<div class="money"><input class="live" type="number" min="0.0" step="0.01" id="{{question.dbfield}}" /></div>
{% elsif question.type == "percentage" %}
<div class="percentage"><input class="live" type="number" min="0.0" max="100.0" step="0.1" id="{{question.dbfield}}" /></div>
{% elsif question.type == "radio" %}
<div class="radio">
{% for option in question.content %}
<p>
<input class="live" type="radio" id="{{question.dbfield}}-{{option.label}}"
name="{{question.dbfield}}" value="{{option.label}}" />
<label for="{{question.dbfield}}-{{option.label}}">{{option.label}}</label>
</p>
{% endfor %}
</div>
{% elsif question.type == "peoplelist" %}
<div class="peoplelist" id="{{question.dbfield}}">
<div class="header">
<div>Contributor</div>
<div>Hours</div>
</div>
<div class="bod">
</div>
<a class="button people-button" id="{{question.dbfield}}">Add contributor</a>
</div>
{% else %}
{% endif %}
{% if question.desc %}
<div class="tag" data-tooltip="{{question.desc}}">
<img src="{{ "/img/tooltip.png" | prepend: site.baseurl | prepend: site.url }}" />
</div>
{% endif %}
</div>
{% endfor %}
</form>
</section>
{% endfor %}
<div class="pages">
{% if forloop.index > 1 %}<button class="turn prev">Prev</button>{% endif %}
{% if forloop.index < forloop.length %}<button class="turn next">Next</button>{% endif %}
</div>
{% if forloop.last %}<a class="button local bottomgrant" href="{{ "/result" | prepend: site.baseurl | prepend: site.url }}">Grant Result</a>{% endif %}
<div class="del col col--xs-12 col--sm-12 col--md-8 col--lg-8 col--md-offset-2 col--lg-offset-2"">
<a href="#" class="delete">Delete Grant?</a>
</div>
</section>
{% endfor %}
</div>
<div style="display:none" id="ppllistTemplate">
<div class="time" db_id="<%= id %>" obj_id="<%= id %>">
<select id="<%= dbid %>" class="live ppl objlist">
<option>Loading contributors...</option>
</select>
<input class="live ppl hours" type="number" min="0.0" step="0.1" id="<%= dbid %>" value="0" />
<a class="ppllistdel">x</a>
</div>
</div>