mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-22 01:14:21 +01:00
fixing two columns layout
This commit is contained in:
parent
d755a6fc8f
commit
22fb758c83
@ -6,7 +6,7 @@
|
||||
<div class="col-md-12 column">
|
||||
<div class="well well-sm">
|
||||
<form method='POST' action='/adduser' role="form" class="form-signin" data-toggle="validator">
|
||||
<h2 class="h3">Fill user attributes:</h2>
|
||||
<h2 class="h3">Fill new user attributes:</h2>
|
||||
${form}
|
||||
<h2 class="h3">Enable/Disable roles:</h2>
|
||||
${roles}
|
||||
|
@ -1,10 +1,20 @@
|
||||
<%
|
||||
len_second_column = len(attributes) / 2
|
||||
counter = -1
|
||||
len_attr = len(attributes)
|
||||
switch = len_attr / 2
|
||||
if not switch * 2 == len_attr:
|
||||
switch = switch + 1
|
||||
counter = 1
|
||||
lc1 = []
|
||||
lc2 = []
|
||||
for a in sorted(attributes.keys(), key=lambda attr: attributes[attr]['weight']):
|
||||
if counter <= switch:
|
||||
lc1.append(a)
|
||||
else:
|
||||
lc2.append(a)
|
||||
counter = counter + 1
|
||||
%>
|
||||
<div class="row">
|
||||
<div class="col-md-6 column">
|
||||
% for a in sorted(attributes.keys(), key=lambda attr: attributes[attr]['weight']):
|
||||
<%def name="form_col(l)">
|
||||
% for a in l:
|
||||
<% attr = attributes[a] %>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
@ -16,7 +26,6 @@ counter = -1
|
||||
value = ''
|
||||
value2 = ''
|
||||
%>
|
||||
<% counter = counter + 1 %>
|
||||
<span class="input-group-addon" id="basic-addon1">${attr['display_name']}</span>
|
||||
% if attr['type'] == 'string':
|
||||
<input type="text" name="${a}" class="form-control" placeholder="${attr['description']}" aria-describedby="basic-addon1" required ${value}>
|
||||
@ -41,10 +50,13 @@ counter = -1
|
||||
% endif
|
||||
</div>
|
||||
</div>
|
||||
% if counter == len_second_column:
|
||||
% endfor
|
||||
</%def>
|
||||
<div class="row">
|
||||
<div class="col-md-6 column">
|
||||
${form_col(lc1)}
|
||||
</div>
|
||||
<div class="col-md-6 column">
|
||||
% endif
|
||||
% endfor
|
||||
${form_col(lc2)}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -3,9 +3,10 @@
|
||||
<div class="row clearfix top-buffer bottom-buffer">
|
||||
<div class="col-md-2 column">
|
||||
</div>
|
||||
<div class="col-md-8 column">
|
||||
<div class="col-md-12 column">
|
||||
<div class="well well-sm">
|
||||
<form method='POST' action='/selfmodify' role="form" class="form-signin" data-toggle="validator">
|
||||
<h2 class="h3">Modify your attributes:</h2>
|
||||
${form}
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
|
Loading…
Reference in New Issue
Block a user