-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added form helper templates, form updates
- Loading branch information
n3vrax
authored and
n3vrax
committed
Mar 12, 2017
1 parent
3b6fe29
commit 8c55a14
Showing
10 changed files
with
132 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{% extends '@layout/default.html.twig' %} | ||
|
||
{% block content_classes %}col-md-6 col-md-offset-3 no-padding{% endblock %} | ||
{% block content_classes %} | ||
col-sm-6 col-sm-offset-3 col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3 no-padding | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{% if showLabels is not defined %} | ||
{% set showLabels = false %} | ||
{% endif %} | ||
|
||
{% if validationGroup is not defined %} | ||
{% set validationGroup = form.getValidationGroup() %} | ||
{% endif %} | ||
|
||
{% for k,v in validationGroup %} | ||
|
||
{% if form.has(k) %} | ||
|
||
{% include '@partial/form-display-validationgroup.html.twig' with { | ||
'form' : form.get(k), | ||
'validationGroup': validationGroup[k], | ||
'showLabels' : showLabels} only | ||
%} | ||
|
||
{% else %} | ||
|
||
{% if form.has(v) %} | ||
|
||
{% set element = form.get(v) %} | ||
{% if element is Captcha %} | ||
|
||
<div class="form-group"> | ||
|
||
{% set dummy = element.setAttribute('class', 'form-control') %} | ||
|
||
{{ formLabel(element) }} | ||
{{ formCaptcha(element) }} | ||
|
||
</div> | ||
|
||
{% elseif element is Checkbox %} | ||
|
||
<div class="checkbox"> | ||
<label> | ||
{{ formCheckbox(element) }} {{ element.getLabel() }} | ||
</label> | ||
</div> | ||
|
||
{% elseif element is Hidden %} | ||
|
||
{{ formElement(element) }} | ||
|
||
{% elseif element is Button and element.getName() != 'submit' %} | ||
|
||
{% set dummy = element.setAttribute('class', 'btn btn-block') %} | ||
{{ formButton(element) }} | ||
|
||
{% elseif element is Submit or element is Button and element.getName() == 'submit' %} | ||
|
||
{% set dummy = element.setAttribute('class', 'btn btn-lg btn-primary btn-block') %} | ||
{{ formSubmit(element) }} | ||
|
||
{% else %} | ||
|
||
<div class="form-group {% if element.getMessages() %}has-error{% endif %}"> | ||
|
||
{% set dummy = element.setAttribute('class', 'form-control') %} | ||
|
||
{% if showLabels and element.getLabel() is defined and element.getLabel() is not empty %} | ||
|
||
{{ formLabel(element) }} | ||
|
||
{% endif %} | ||
|
||
{{ formElement(element) }} | ||
|
||
</div> | ||
|
||
{% endif %} | ||
|
||
{% endif %} | ||
|
||
{% endif %} | ||
|
||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters