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>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% block organisation_form %}
|
{% block organisation_form %}
|
||||||
{% block organisation_field_name %}
|
{% block input_organisation_name %}
|
||||||
{% if 'name' not in form.fields.hidden %}
|
{% include "forms/inputs/organisation-name.html.twig" with { 'col_width': 'col-sm-12' } %}
|
||||||
<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 %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block organisation_field_slug %}
|
{% block input_organisation_slug %}
|
||||||
{% if 'slug' not in form.fields.hidden %}
|
{% include "forms/inputs/organisation-slug.html.twig" with { 'col_width': 'col-sm-12' } %}
|
||||||
<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 %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block organisation_field_description %}
|
{% block input_organisation_description %}
|
||||||
{% if 'description' not in form.fields.hidden %}
|
{% include "forms/inputs/organisation-description.html.twig" with { 'col_width': 'col-sm-12' } %}
|
||||||
<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 %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div><br>
|
</div><br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% block organisation_form_buttons %}
|
|
||||||
<div class="col-xs-6 col-sm-4">
|
<div class="col-xs-6 col-sm-4">
|
||||||
<button type="submit" class="btn btn-block btn-lg btn-success">{{form.submit_text}}</button>
|
<button type="submit" class="btn btn-block btn-lg btn-success">{{form.submit_text}}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4 col-sm-3 pull-right">
|
<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>
|
<button type="button" class="btn btn-block btn-lg btn-link" data-dismiss="modal">{{translate("CANCEL")}}</button>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<!-- Include validation rules -->
|
<!-- Include validation rules -->
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{% if checkAccess('uri_organisations') %}
|
||||||
|
<li>
|
||||||
|
<a href="{{site.uri.public}}/organisations"><i class="fas fa-sitemap fa-fw"></i> <span>{{ translate("ORGANISATION", 2) }}</span></a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if current_user.organisations.count() > 0 %}
|
||||||
|
{% if organisationConfig.membership.single_membership == false %}
|
||||||
|
<li>
|
||||||
|
<a href="#" data-toggle="collapse" data-target="#submenu-organisations" aria-expanded="false"><i class="fa fa-fw fa-sitemap"></i> <span>{{ translate("ORGANISATION.SELF") }}</span> <i class="fa fa-fw pull-right fa-angle-down"></i></a>
|
||||||
|
<ul id="submenu-organisations" class="collapsable collapse" aria-expanded="false" style="height: 1px;">
|
||||||
|
{% for organisation in current_user.organisations %}
|
||||||
|
{% if organisation.flag_approved or isOrganisationRegistrant(organisation) %}
|
||||||
|
<li>
|
||||||
|
<a href="{{site.uri.public}}/organisations/o/{{organisation.slug}}"><i class="fas fa-angle-double-right"></i> <span>{{organisation.name}}</span></a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
{% set organisation = current_user.organisations.0 %}
|
||||||
|
{% if organisation.flag_approved or isOrganisationRegistrant(organisation) %}
|
||||||
|
<li>
|
||||||
|
<a href="{{site.uri.public}}/organisations/o/{{organisation.slug}}"><i class="fas fa-sitemap fa-fw"></i> <span>{{ translate("ORGANISATION.SELF") }}</span></a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
@@ -1,37 +1,6 @@
|
|||||||
{% extends "@admin/navigation/sidebar-menu.html.twig" %}
|
{% extends "@admin/navigation/sidebar-menu.html.twig" %}
|
||||||
|
|
||||||
{% block organisations_nav %}
|
|
||||||
{% if checkAccess('uri_organisations') %}
|
|
||||||
<li>
|
|
||||||
<a href="{{site.uri.public}}/organisations"><i class="fas fa-sitemap fa-fw"></i> <span>{{ translate("ORGANISATION", 2) }}</span></a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% if current_user.organisations.count() > 0 %}
|
|
||||||
{% if organisationConfig.membership.single_membership == false %}
|
|
||||||
<li>
|
|
||||||
<a href="#" data-toggle="collapse" data-target="#submenu-organisations" aria-expanded="false"><i class="fa fa-fw fa-sitemap"></i> <span>{{ translate("ORGANISATION.SELF") }}</span> <i class="fa fa-fw pull-right fa-angle-down"></i></a>
|
|
||||||
<ul id="submenu-organisations" class="collapsable collapse" aria-expanded="false" style="height: 1px;">
|
|
||||||
{% for organisation in current_user.organisations %}
|
|
||||||
{% if organisation.flag_approved or isOrganisationRegistrant(organisation) %}
|
|
||||||
<li>
|
|
||||||
<a href="{{site.uri.public}}/organisations/o/{{organisation.slug}}"><i class="fas fa-angle-double-right"></i> <span>{{organisation.name}}</span></a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
{% else %}
|
|
||||||
{% set organisation = current_user.organisations.0 %}
|
|
||||||
{% if organisation.flag_approved or isOrganisationRegistrant(organisation) %}
|
|
||||||
<li>
|
|
||||||
<a href="{{site.uri.public}}/organisations/o/{{organisation.slug}}"><i class="fas fa-sitemap fa-fw"></i> <span>{{ translate("ORGANISATION.SELF") }}</span></a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block navigation %}
|
{% block navigation %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ block('organisations_nav') }}
|
{% include "navigation/partials/sidebar-organisations.html.twig" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user