0byt3m1n1
Path:
/
home
/
mgatv524
/
public_html
/
midiatech
/
views
/
[
Home
]
File: inline.twig
{% macro disabled(name, title, value, helpText, groupClass) %} <div class="form-group {{ groupClass }}"> <label class="control-label" title="{{ helpText }}">{{ title }}</label> <div class=""> <p class="form-control-static">{{ value }}</p> </div> </div> {% endmacro %} {% macro hidden(name, value) %} <input name="{{ name }}" type="hidden" id="{{ name }}" value="{{ value }}" /> {% endmacro %} {% macro raw(text, groupClass) %} <div class="col-sm-12 {{ groupClass }}"> {{ text }} </div> {% endmacro %} {% macro message(message, groupClass) %} <div class="row"> <div class="col-sm-12 {{ groupClass }}"> <p>{{ message }}</p> </div> </div> {% endmacro %} {% macro button(title, type, link, groupClass) %} <div class="form-group {{ groupClass }}"> <div class="col-sm-offset-2 "> {% if type == "link" %} <a class="btn btn-default" href="{{ link }}">{{ title }}</a> {% else %} <button class="btn btn-default" type="{{ type }}">{{ title }}</button> {% endif %} </div> </div> {% endmacro %} {% macro input(name, title, value, helpText, groupClass, validation, accessKey) %} <div class="form-group {{ groupClass }}"> <label class="control-label" title="{{ helpText }}" for="{{ name }}" accesskey="{{ accessKey }}">{{ title }}</label> <div class=""> <input class="form-control" name="{{ name }}" type="text" id="{{ name }}" value="{{ value }}" {{ validation }} /> </div> </div> {% endmacro %} {% macro inputWithTags(name, title, value, helpText, groupClass, validation, accessKey, exactTag, exactTagTitle) %} <div class="form-group {{ groupClass }}"> <label class="control-label" title="{{ helpText }}" for="{{ name }}" accesskey="{{ accessKey }}">{{ title }}</label> {% if exactTag %} <div> <div class="input-group"> <input class="form-control" name="{{ name }}" type="text" id="{{ name }}" value="{{ value }}" data-role="tagsInputInline" {{ validation }} /> <span class="input-group-addon"> <input title="{{ exactTagTitle }}" type="checkbox" id="{{ exactTag }}" name="{{ exactTag }}"> </span> </div> </div> {% else %} <div> <input class="form-control" name="{{ name }}" type="text" id="{{ name }}" value="{{ value }}" data-role="tagsInputInline" {{ validation }} /> </div> {% endif %} </div> {% endmacro %} {% macro number(name, title, value, helpText, groupClass, validation, accessKey) %} <div class="form-group {{ groupClass }}"> <label class="control-label" title="{{ helpText }}" for="{{ name }}" accesskey="{{ accessKey }}">{{ title }}</label> <div class=""> <input class="form-control" name="{{ name }}" type="number" id="{{ name }}" value="{{ value }}" {{ validation }} /> </div> </div> {% endmacro %} {% macro email(name, title, value, helpText, groupClass, validation, accessKey) %} <div class="form-group {{ groupClass }}"> <label class="control-label" title="{{ helpText }}" for="{{ name }}" accesskey="{{ accessKey }}">{{ title }}</label> <div class=""> <input class="form-control" name="{{ name }}" type="email" id="{{ name }}" value="{{ value }}" {{ validation }} /> </div> </div> {% endmacro %} {% macro password(name, title, value, helpText, groupClass, validation, accessKey) %} <div class="form-group {{ groupClass }}"> <label class="control-label" for="{{ name }}" title="{{ helpText }}" accesskey="{{ accessKey }}">{{ title }}</label> <div class=""> <input class="form-control" name="{{ name }}" type="password" id="{{ name }}" value="{{ value }}" {{ validation }} /> </div> </div> {% endmacro %} {% macro checkbox(name, title, value, groupClass, accessKey) %} <div class="form-group {{ groupClass }}"> <div class=""> <div class="checkbox"> <input title="{{ title }}" class="form-control" type="checkbox" id="{{ name }}" name="{{ name }}" {% if value == 1 %}checked{% endif %}> <label for="{{ name }}">{{ title }}</label> </div> </div> </div> {% endmacro %} {% macro radio(name, id, title, value, helpText, groupClass, accessKey, setValue) %} <div class="form-group {{ groupClass }}"> <div class="col-sm-offset-2 "> <div class="radio"> <label for="{{ name }}" title="{{ helpText }}" accesskey="{{ accessKey }}"> <input type="radio" id="{{ id }}" name="{{ name }}" value="{{ setValue }}" {% if value == setValue %}checked{% endif %}> {{ title }} </label> </div> </div> </div> {% endmacro %} {% macro dropdown(name, type, title, value, options, optionId, optionValue, helpText, groupClass, validation, accessKey, callBack, dataAttributes, optionGroups) %} <div class="form-group {{ groupClass }}"> <label class="control-label" for="{{ name }}" title="{{ helpText }}" accesskey="{{ accessKey }}">{{ title }}</label> <div class=""> <select class="form-control" {% if type == "dropdownmulti" %}multiple{% endif %} name="{{ name }}" id="{{ name }}" {{ callBack }} {% if dataAttributes|length > 0 %} {% for attribute in dataAttributes %} {{ attribute.name }}="{{ attribute.value }}" {% endfor %} {% endif %}> {% set hasGroups = optionGroups|length > 0 %} {% if not hasGroups %} {% set optionGroups = {label: "General"} %} {% endif %} {% for group in optionGroups %} {% if hasGroups %} <optgroup label="{{ group.label }}"> {% set tempOptions = attribute(options, group.id) %} {% else %} {% set tempOptions = options %} {% endif %} {% for option in tempOptions %} {% set itemOptionId = attribute(option, optionId) %} {% set itemOptionValue = attribute(option, optionValue) %} {% if type == "dropdownmulti" %} {% set selected = (itemOptionId in value) %} {% else %} {% set selected = (itemOptionId == value) %} {% endif %} <option value="{{ itemOptionId }}" {% if selected %}selected{% endif %}>{{ itemOptionValue }}</option> {% endfor %} {% if hasGroups %} </optgroup> {% endif %} {% endfor %} </select> </div> </div> {% endmacro %} {% macro permissions(name, options) %} <table class="table table-bordered"> <tr> <th>{% trans "Group" %}</th> <th>{% trans "View" %}</th> <th>{% trans "Edit" %}</th> <th>{% trans "Delete" %}</th> </tr> {% for item in options %} <tr> <td>{{ name }}</td> <td><input type="checkbox" name="{{ name }}" value="{{ value_view }}" {{ value_view_checked }}></td> <td><input type="checkbox" name="{{ name }}" value="{{ value_edit }}" {{ value_edit_checked }}></td> <td><input type="checkbox" name="{{ name }}" value="{{ value_del }}" {{ value_del_checked }}></td> </tr> {% endfor %} </table> {% endmacro %} {% macro date(name, title, value, helpText, groupClass, validation, accessKey) %} <div class="form-group {{ groupClass }}"> <label class="control-label" title="{{ helpText }}" for="{{ name }}" accesskey="{{ accessKey }}">{{ title }}</label> <div class=""> <input type="hidden" name="{{ name }}" id="{{ name }}" value="{{ value }}" /> {% set linkedName %}{{ name }}Link{% endset %} <input class="form-control datePicker dateControl" name="{{ linkedName }}" type="text" id="{{ linkedName }}" {{ validation }} data-link-field="{{ name }}" data-link-format="yyyy-mm-dd hh:ii:ss" readonly/> </div> </div> {% endmacro %} {% macro dateMonth(name, title, value, helpText, groupClass, validation, accessKey) %} <div class="form-group {{ groupClass }}"> <label class="control-label" title="{{ helpText }}" for="{{ name }}" accesskey="{{ accessKey }}">{{ title }}</label> <div class=""> <input type="hidden" name="{{ name }}" id="{{ name }}" value="{{ value }}" /> {% set linkedName %}{{ name }}Link{% endset %} <input class="form-control dateMonthPicker dateControl" name="{{ linkedName }}" type="text" id="{{ linkedName }}" {{ validation }} data-link-field="{{ name }}" data-link-format="yyyy-mm-dd hh:ii:ss" readonly/> </div> </div> {% endmacro %} {% macro time(name, title, value, helpText, groupClass, validation, accessKey) %} <div class="form-group {{ groupClass }}"> <label class="control-label" title="{{ helpText }}" for="{{ name }}" accesskey="{{ accessKey }}">{{ title }}</label> <div class=""> <input type="hidden" name="{{ name }}" id="{{ name }}" value="{{ value }}" /> {% set linkedName %}{{ name }}Link{% endset %} <input class="form-control timePicker dateControl" name="{{ linkedName }}" type="text" id="{{ linkedName }}" {{ validation }} data-link-field="{{ name }}" data-link-format="hh:ii" /> </div> </div> {% endmacro %} {% macro switch(name, title, value, labelWidth, switchSize, onText, offText, groupClass, accessKey, disabled) %} <div class="form-group {{ groupClass }}"> <div class=""> <div class="checkbox"> <input type="checkbox" class="bootstrap-switch-target" id="{{ name }}" name="{{ name }}" accesskey="{{ accessKey }}" {% if value == 1 %}checked{% endif %} {% if disabled == 1 %}disabled{% endif %} data-label-text="{{ title }}" {% if onText not in [null, undefined, ""] %} data-on-text="{{ onText }}"{% endif %} {% if offText not in [null, undefined, ""] %} data-off-text="{{ offText }}"{% endif %} {% if switchSize not in [null, undefined, ""] %}data-size="{{ switchSize }}"{% else %}data-size="small"{% endif %} {% if labelWidth not in [null, undefined, ""] %} data-label-width="{{ labelWidth }}"{% endif %} > </div> </div> </div> {% endmacro %}