Skip to content

Commit

Permalink
frontend.form: center form
Browse files Browse the repository at this point in the history
  • Loading branch information
div72 committed Sep 26, 2022
1 parent 62f49d6 commit 54e4eb6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
28 changes: 28 additions & 0 deletions formie/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ nav a {
padding: 10px;
padding-left: 20px;
padding-right: 20px;
margin-top: 20px;
}

.content ul {
Expand Down Expand Up @@ -77,3 +78,30 @@ tr:nth-child(odd) {
tr:nth-child(even) {
background-color: #DDDDDD;
}

form {
margin: 0 auto;
width: 75%
}

.question-outer {
margin-top: 2px;
margin-bottom: 2px;
}

.question-inner {
margin: 0 auto;
width: 75%;
min-width: 250px;
}

input[type="text"] {
width: 90%;
min-width: 250px;
}

input[type="number"] {
min-width: 250px;
}


8 changes: 8 additions & 0 deletions formie/templates/forms/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
{% block content %}
<form method="POST">
{% for index, field in schema %}
<div class="question-outer">
<div class="question-inner">
{{ field['name'] }}<br>
{% if field['type'] == 'text' %}
<input type="text" name="col{{ index }}" value="{{ field['default'] }}"/>
Expand All @@ -25,8 +27,14 @@
{% elif field['type'] == 'range' %}
<input type="number" name="col{{ index }}" min="{{ field['min'] }}" max="{{ field['max'] }}" value="{{ field['default'] }}"></input>
{% endif %}
</div>
</div>
<br>
{% endfor %}
<div class="question-outer">
<div class="question-inner">
<input type="submit" value="Submit">
<div class="question-inner">
</div>
</form>
{% endblock %}

0 comments on commit 54e4eb6

Please sign in to comment.