layout cleanups
parent
b495cae6cd
commit
7b71359733
14
sso/forms.py
14
sso/forms.py
|
@ -23,6 +23,18 @@ class MultiCheckboxField(SelectMultipleField):
|
|||
option_widget = widgets.CheckboxInput()
|
||||
|
||||
|
||||
class RadioField(SelectField):
|
||||
"""
|
||||
A multiple-select, except displays a list of checkboxes.
|
||||
|
||||
Iterating the field will produce subfields, allowing custom rendering of
|
||||
the enclosed checkbox fields.
|
||||
"""
|
||||
|
||||
widget = widgets.ListWidget(prefix_label=False)
|
||||
option_widget = widgets.RadioInput()
|
||||
|
||||
|
||||
class LoginForm(FlaskForm):
|
||||
username = StringField("username", validators=[DataRequired()])
|
||||
password = PasswordField("password", validators=[DataRequired()])
|
||||
|
@ -48,7 +60,7 @@ class ClientForm(FlaskForm):
|
|||
default=["code"],
|
||||
)
|
||||
|
||||
token_endpoint_auth_method = SelectField(
|
||||
token_endpoint_auth_method = RadioField(
|
||||
"Token endpoint authentication method",
|
||||
choices=[("client_secret_basic", "Basic"), ("client_secret_post", "POST"), ("client_secret_get", "Query args (DEPRECATED)")],
|
||||
validators=[DataRequired()],
|
||||
|
|
|
@ -11,7 +11,7 @@ None
|
|||
{% macro format_currency_raw(amount, precision=0) -%}
|
||||
{{ ("%%.%sf" | format(precision) | format(amount/100)) }}SOG
|
||||
{%- endmacro %}
|
||||
{% macro render_field(field, prefix=None, suffix=None, layout=True, label=True, split=3) %}
|
||||
{% macro render_field(field, prefix=None, suffix=None, layout=True, label=True, split=4) %}
|
||||
{% if field.type == 'HiddenField' or field.type == 'CSRFTokenField' %}
|
||||
{{ field(**kwargs) }}
|
||||
{% else %}
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
|
||||
{% macro static_field(id, label, value) %}
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label control-label-required" for="{{ id }}">{{ label }}</label>
|
||||
<div class="col-md-9">
|
||||
<label class="col-md-4 control-label control-label-required" for="{{ id }}">{{ label }}</label>
|
||||
<div class="col-md-8">
|
||||
<input class="form-control" id="{{ id }}" name="{{ id }}" required="" type="text" value="{{ value }}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
|
||||
<h2 class="page-header">
|
||||
{% if client is defined %}Client edit{% else %}Client registration{% endif %}
|
||||
</h2>
|
||||
|
@ -26,15 +26,15 @@
|
|||
{{ render_field(form.response_types) }}
|
||||
{{ render_field(form.scope) }}
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<div class="col-md-8 col-md-offset-4">
|
||||
<button type="submit" class="btn btn-primary btn-block">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
{% if client is defined %}
|
||||
{{ static_field('client_id', 'Client ID', client.client_id) }}
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label control-label-required" for="client_secret">Client secret</label>
|
||||
<div class="col-md-9">
|
||||
<label class="col-md-4 control-label control-label-required" for="client_secret">Client secret</label>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group">
|
||||
<input class="form-control" id="client_secret" name="client_secret" required="" type="password" value="{{ client.client_secret }}" readonly>
|
||||
<span class="input-group-btn">
|
||||
|
|
Loading…
Reference in New Issue