mirror of
https://github.com/Yubico/yubiadmin.git
synced 2024-12-01 16:24:13 +01:00
Improved layout of forms.
This commit is contained in:
parent
5a89e40eb1
commit
494481c500
@ -6,3 +6,7 @@ html {
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
label {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
{%- macro form_field_description(field) -%}
|
||||
{% if field.description %}
|
||||
<span class="descr">{{ field.description }}</span>
|
||||
<span class="help-block">{{ field.description }}</span>
|
||||
{% endif %}
|
||||
{%- endmacro -%}
|
||||
|
||||
@ -42,6 +42,7 @@
|
||||
{% else %}
|
||||
{{ form_field_label(field) }}
|
||||
<div class="input" id="{{field.id}}-div">
|
||||
{{ form_field_description(field) }}
|
||||
{% if field.type == 'RadioField' %}
|
||||
{{ field(class='radio-group', **attrs) }}
|
||||
{% elif field.type == 'IntegerField' %}
|
||||
@ -49,7 +50,6 @@
|
||||
{% else %}
|
||||
{{ field(**attrs) }}
|
||||
{% endif %}
|
||||
{{ form_field_description(field) }}
|
||||
{{ form_field_errors(field) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -62,6 +62,9 @@
|
||||
{% if fieldset.legend %}
|
||||
<legend>{{ fieldset.legend }}</legend>
|
||||
{% endif %}
|
||||
{% if fieldset.description %}
|
||||
<p>{{ fieldset.description }}</p>
|
||||
{% endif %}
|
||||
{% for field in fieldset %}
|
||||
{% if field.type == 'HiddenField' %}
|
||||
{{ field() }}
|
||||
|
@ -75,11 +75,12 @@ ykval_config = FileConfig(
|
||||
|
||||
class SyncLevelsForm(ConfigForm):
|
||||
legend = 'Sync Levels'
|
||||
description = 'Percentage of syncing required for pre-defined levels.'
|
||||
config = ykval_config
|
||||
|
||||
sync_default = IntegerField('Default', [NumberRange(1, 100)])
|
||||
sync_secure = IntegerField('Secure', [NumberRange(1, 100)])
|
||||
sync_fast = IntegerField('Fast', [NumberRange(1, 100)])
|
||||
sync_default = IntegerField('Default Level', [NumberRange(1, 100)])
|
||||
sync_secure = IntegerField('Secure Level', [NumberRange(1, 100)])
|
||||
sync_fast = IntegerField('Fast Level', [NumberRange(1, 100)])
|
||||
|
||||
|
||||
class MiscForm(ConfigForm):
|
||||
@ -97,11 +98,18 @@ class SyncPoolForm(ConfigForm):
|
||||
'allowed_sync_pool': {'rows': 5, 'class': 'input-xlarge'}
|
||||
}
|
||||
|
||||
sync_interval = IntegerField('Sync Interval', [NumberRange(1)])
|
||||
sync_interval = IntegerField(
|
||||
'Sync Interval', [NumberRange(1)],
|
||||
description='How often (in seconds) to sync with other server.')
|
||||
resync_timeout = IntegerField('Resync Timeout', [NumberRange(1)])
|
||||
old_limit = IntegerField('Old Limit', [NumberRange(1)])
|
||||
sync_pool = ListField('Sync Pool URLs', [URL()])
|
||||
allowed_sync_pool = ListField('Allowed Sync IPs', [IPAddress()])
|
||||
sync_pool = ListField(
|
||||
'Sync Pool URLs', [URL()],
|
||||
description='List of URLs to other servers in the sync pool.')
|
||||
allowed_sync_pool = ListField(
|
||||
'Allowed Sync IPs', [IPAddress()],
|
||||
description='List of IP-addresses of other servers that are ' +
|
||||
'allowed to sync with this server.')
|
||||
|
||||
|
||||
class YubikeyVal(App):
|
||||
|
@ -62,12 +62,13 @@ class DBConfigForm(ConfigForm):
|
||||
Complete form for editing a dbconfig-common generated for PHP.
|
||||
"""
|
||||
legend = 'Database'
|
||||
dbtype = StringField('DB type')
|
||||
description = 'Settings for connecting to the database.'
|
||||
dbtype = StringField('Database type')
|
||||
dbserver = StringField('Host')
|
||||
dbport = IntegerField('Port', [Optional(), NumberRange(1, 65535)])
|
||||
dbname = StringField('DB name')
|
||||
dbuser = StringField('DB username')
|
||||
dbpass = PasswordField('DB password',
|
||||
dbname = StringField('Database name')
|
||||
dbuser = StringField('Username')
|
||||
dbpass = PasswordField('Password',
|
||||
widget=PasswordInput(hide_value=False))
|
||||
|
||||
def db_handler(self, varname, default):
|
||||
|
Loading…
Reference in New Issue
Block a user