Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:CodeForPhilly/chime into changes…
Browse files Browse the repository at this point in the history
…_v1_1_3
  • Loading branch information
jlubken committed Apr 7, 2020
2 parents 9358060 + 22a6248 commit ab2ebbd
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/chime_dash/app/utils/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@
path.abspath(path.dirname(path.dirname(__file__))), "templates"
)

LABEL_STYLE = {
"fontSize": "0.875rem",
"marginBottom": "0.3333em"
}
LABEL_STYLE = {"fontSize": "0.875rem", "marginBottom": "0.3333em"}

HEADER_STYLE = {
"fontSize": "1rem",
"fontWeight": "bold",
"margin": "2rem 0 1rem",
}


def read_localization_yml(file: str, language: str) -> Dict[str, Any]:
"""Reads localization template.
Expand Down Expand Up @@ -119,7 +117,11 @@ def cast_type(val):


def create_number_input(
idx: str, data: Dict[str, Any], content: Dict[str, str], defaults: Parameters
idx: str,
data: Dict[str, Any],
content: Dict[str, str],
defaults: Parameters,
debounce: bool = True,
):
"""Returns number formgroup for given form data.
Expand All @@ -128,6 +130,7 @@ def create_number_input(
data: Input form kwargs.
content: Localization text
defaults: Parameters to infer defaults
debounce: Trigger callback on enter or unfocus
"""
input_kwargs = data.copy()
input_kwargs.pop("percent", None)
Expand All @@ -139,7 +142,7 @@ def create_number_input(
return FormGroup(
children=[
Label(html_for=idx, children=content[idx], style=LABEL_STYLE),
Input(id=idx, **input_kwargs),
Input(id=idx, debounce=debounce, **input_kwargs),
]
)

Expand Down

0 comments on commit ab2ebbd

Please sign in to comment.