resq/templates/role/form.html.twig
2018-01-07 19:21:37 +08:00

73 lines
No EOL
3 KiB
Twig

{% extends 'base.html.twig' %}
{% block body %}
<!-- BEGIN: Subheader -->
<div class="m-subheader">
<div class="d-flex align-items-center">
<div class="mr-auto">
<h3 class="m-subheader__title">Roles</h3>
</div>
</div>
</div>
<!-- END: Subheader -->
<div class="m-content">
<!--Begin::Section-->
<div class="row">
<div class="col-xl-4 offset-xl-4">
<div class="m-portlet m-portlet--mobile">
<div class="m-portlet__head">
<div class="m-portlet__head-caption">
<div class="m-portlet__head-title">
<span class="m-portlet__head-icon">
<i class="la la-key"></i>
</span>
<h3 class="m-portlet__head-text">
{% if row is defined %}
Edit Role
<small>{{ row.getId() }}</small>
{% else %}
New Role
{% endif %}
</h3>
</div>
</div>
</div>
<form class="m-form m-form--fit m-form--label-align-right m-form--group-seperator-dashed" method="post" action="{{ row is defined ? url('role_update_submit', {'id': row.getId()}) : url('role_create_submit') }}">
<div class="m-portlet__body">
<div class="form-group m-form__group row{{ error.id is defined ? ' has-danger' }}">
<label class="col-lg-3 col-form-label">Role ID:</label>
<div class="col-lg-9">
<input type="text" name="id" class="form-control m-input{{ error.id is defined ? ' form-control-danger' }}" value="{{ values.id is defined ? values.id : (row is defined ? row.getId()) }}">
{% if error.id is defined %}
<div class="form-control-feedback">{{ error.id }}</div>
{% endif %}
<span class="m-form__help">Unique identifier for this role</span>
</div>
</div>
<div class="form-group m-form__group row{{ error.name is defined ? ' has-danger' }}">
<label class="col-lg-3 col-form-label">Name:</label>
<div class="col-lg-9">
<input type="text" name="name" class="form-control m-input{{ error.id is defined ? ' form-control-danger' }}" value="{{ values.name is defined ? values.name : (row is defined ? row.getName()) }}">
{% if error.name is defined %}
<div class="form-control-feedback">{{ error.name }}</div>
{% endif %}
<span class="m-form__help">Display name for this role</span>
</div>
</div>
</div>
<div class="m-portlet__foot m-portlet__foot--fit">
<div class="m-form__actions m-form__actions--solid m-form__actions--right">
<div class="row">
<div class="col-lg-12">
<button type="submit" class="btn btn-success">Submit</button>
<a href="{{ url('role_list') }}" class="btn btn-secondary">Cancel</a>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}