1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-22 17:34:21 +01:00
ldapcherry/resources/templates/form.tmpl

29 lines
1.7 KiB
Cheetah
Raw Normal View History

% for a in sorted(attributes.keys(), key=lambda attr: attributes[attr]['weight']):
2015-05-31 22:38:13 +02:00
<% attr = attributes[a] %>
<div class="form-group">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">${attr['display_name']}</span>
% if attr['type'] == 'string':
2015-06-03 00:06:59 +02:00
<input type="text" name="${a}" class="form-control" placeholder="${attr['description']}" aria-describedby="basic-addon1" required>
2015-05-31 22:38:13 +02:00
% elif attr['type'] == 'email':
2015-06-03 23:57:22 +02:00
<input type="email" name="${a}" class="form-control" placeholder="${attr['description']}" aria-describedby="basic-addon1" required data-error="email address is invalid">
2015-05-31 22:38:13 +02:00
% elif attr['type'] == 'int':
2015-06-03 00:06:59 +02:00
<input type="number" name="${a}" class="form-control" placeholder="${attr['description']}" aria-describedby="basic-addon1" required>
2015-05-31 22:38:13 +02:00
% elif attr['type'] == 'fix':
<input type="hidden" name="${a}" class="form-control" placeholder="${attr['description']}" aria-describedby="basic-addon1" required value="${attr['value']}">
<span class="form-control" placeholder="${attr['description']}" aria-describedby="basic-addon1">${attr['value']}</span>
2015-05-31 22:38:13 +02:00
% elif attr['type'] == 'stringlist':
2015-06-02 08:33:46 +02:00
<select class="form-control" name="type">
%for val in attr['values']:
<option>${val}</option>
%endfor
</select>
2015-05-31 22:38:13 +02:00
% elif attr['type'] == 'password':
2015-06-03 23:57:22 +02:00
<input type="password" class="form-control" name="${a}1" id="${a}1" placeholder="${attr['description']}" required>
<span class="input-group-addon" id="basic-addon1">Retype ${attr['display_name']}</span>
<input type="password" class="form-control" name="${a}2" id="#${a}2" data-match="#${a}1" placeholder="Confirm" required>
2015-05-31 22:38:13 +02:00
% endif
</div>
</div>
% endfor