Abstract the organisation form and sidebar menu
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
{% include "@uf-tweaks/forms/inputs/abstract/description.html.twig" with
|
||||
{
|
||||
"type" : "organisation",
|
||||
"current_value" : organisation.description,
|
||||
"col_width" : col_width
|
||||
}
|
||||
%}
|
||||
8
templates/forms/inputs/organisation-name.html.twig
Normal file
8
templates/forms/inputs/organisation-name.html.twig
Normal file
@@ -0,0 +1,8 @@
|
||||
{% include "@uf-tweaks/forms/inputs/abstract/name.html.twig" with
|
||||
{
|
||||
"type" : "organisation",
|
||||
"current_value" : organisation.name,
|
||||
"field_name" : translate('ORGANISATION.NAME'),
|
||||
"col_width" : col_width
|
||||
}
|
||||
%}
|
||||
7
templates/forms/inputs/organisation-slug.html.twig
Normal file
7
templates/forms/inputs/organisation-slug.html.twig
Normal file
@@ -0,0 +1,7 @@
|
||||
{% include "@uf-tweaks/forms/inputs/abstract/slug.html.twig" with
|
||||
{
|
||||
"type" : "organisation",
|
||||
"current_value" : organisation.slug,
|
||||
"col_width" : col_width
|
||||
}
|
||||
%}
|
||||
@@ -4,64 +4,26 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
{% block organisation_form %}
|
||||
{% block organisation_field_name %}
|
||||
{% if 'name' not in form.fields.hidden %}
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group">
|
||||
<label>{{translate("ORGANISATION.NAME")}}</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fas fa-edit fa-fw"></i></span>
|
||||
<input type="text" class="form-control" name="name" autocomplete="off" value="{{organisation.name}}" placeholder="{{translate("ORGANISATION.NAME.EXPLAIN")}}" {% if 'name' in form.fields.disabled %}disabled{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block input_organisation_name %}
|
||||
{% include "forms/inputs/organisation-name.html.twig" with { 'col_width': 'col-sm-12' } %}
|
||||
{% endblock %}
|
||||
|
||||
{% block organisation_field_slug %}
|
||||
{% if 'slug' not in form.fields.hidden %}
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group">
|
||||
<label>{{translate("SLUG")}}</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fas fa-tag fa-fw"></i></span>
|
||||
<input type="text" class="form-control" name="slug" autocomplete="off" value="{{organisation.slug}}" placeholder="{{translate("SLUG")}}" {% if 'slug' in form.fields.disabled %}disabled{% endif %} readonly>
|
||||
{% if 'slug' not in form.fields.disabled %}
|
||||
<span class="input-group-btn" data-toggle="buttons">
|
||||
<label class="btn btn-primary">
|
||||
<input type="checkbox" id="form-organisation-slug-override" autocomplete="off"> {{translate("OVERRIDE")}}
|
||||
</label>
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<input type="hidden" name="slug" autocomplete="off" value="{{organisation.slug}}">
|
||||
{% endif %}
|
||||
{% block input_organisation_slug %}
|
||||
{% include "forms/inputs/organisation-slug.html.twig" with { 'col_width': 'col-sm-12' } %}
|
||||
{% endblock %}
|
||||
|
||||
{% block organisation_field_description %}
|
||||
{% if 'description' not in form.fields.hidden %}
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group">
|
||||
<label for="input_description">{{translate("DESCRIPTION")}}</label>
|
||||
<textarea id="input_description" class="form-control" type="text" name="description" {% if 'description' in form.fields.disabled %}disabled{% endif %} rows=6>{{organisation.description}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block input_organisation_description %}
|
||||
{% include "forms/inputs/organisation-description.html.twig" with { 'col_width': 'col-sm-12' } %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
</div><br>
|
||||
<div class="row">
|
||||
{% block organisation_form_buttons %}
|
||||
<div class="col-xs-6 col-sm-4">
|
||||
<button type="submit" class="btn btn-block btn-lg btn-success">{{form.submit_text}}</button>
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-3 pull-right">
|
||||
<button type="button" class="btn btn-block btn-lg btn-link" data-dismiss="modal">{{translate("CANCEL")}}</button>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</form>
|
||||
<!-- Include validation rules -->
|
||||
|
||||
Reference in New Issue
Block a user