1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-22 23:42:25 +00:00

Disable turbolinks for pages that require custom JS, like calendars or autocomplete fields

This commit is contained in:
Yohann D'ANELLO 2020-08-09 15:31:38 +02:00
parent 11fbbca2a8
commit 49bda926c6
12 changed files with 25 additions and 21 deletions

View File

@ -156,7 +156,10 @@ class ButtonTable(tables.Table):
edit = tables.LinkColumn('note:template_update',
args=[A('pk')],
attrs={'td': {'class': 'col-sm-1'},
'a': {'class': 'btn btn-sm btn-primary'}},
'a': {
'class': 'btn btn-sm btn-primary',
'data-turbolinks': 'false',
}},
text=_('edit'),
accessor='pk',
verbose_name=_("Edit"),)

View File

@ -47,7 +47,8 @@ class WEIRegistrationTable(tables.Table):
text=_("Edit"),
attrs={
'a': {
'class': 'btn btn-warning'
'class': 'btn btn-warning',
'data-turbolinks': 'false',
}
}
)

View File

@ -68,10 +68,10 @@
<a class="btn btn-success btn-sm my-1" id="validate_activity"> {% if activity.valid %}{% trans "invalidate"|capfirst %}{% else %}{% trans "validate"|capfirst %}{% endif %}</a>
{% endif %}
{% if ".change_"|has_perm:activity %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'activity:activity_update' pk=activity.pk %}"> {% trans "edit"|capfirst %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'activity:activity_update' pk=activity.pk %}" data-turbolinks="false"> {% trans "edit"|capfirst %}</a>
{% endif %}
{% if activity.activity_type.can_invite and not activity_started %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'activity:activity_invite' pk=activity.pk %}"> {% trans "Invite" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'activity:activity_invite' pk=activity.pk %}" data-turbolinks="false"> {% trans "Invite" %}</a>
{% endif %}
{% endif %}
</div>

View File

@ -19,7 +19,7 @@
</div>
{% endif %}
<a class="btn btn-primary" href="{% url 'activity:activity_create' %}">{% trans 'New activity' %}</a>
<a class="btn btn-primary" href="{% url 'activity:activity_create' %}" data-turbolinks="false">{% trans 'New activity' %}</a>
<hr>

View File

@ -61,10 +61,10 @@
{% if not club.weiclub %}
<div class="card-footer text-center">
{% if can_add_members %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_add_member' club_pk=club.pk %}"> {% trans "Add member" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_add_member' club_pk=club.pk %}" data-turbolinks="false"> {% trans "Add member" %}</a>
{% endif %}
{% if ".change_"|has_perm:club %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_update' pk=club.pk %}"> {% trans "Edit" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_update' pk=club.pk %}" data-turbolinks="false"> {% trans "Edit" %}</a>
{% endif %}
{% url 'member:club_detail' club.pk as club_detail_url %}
{%if request.path_info != club_detail_url %}

View File

@ -6,7 +6,7 @@
<div class="col-md-10 text-center">
<input class="form-control mx-auto w-25" type="text" id="search_field"/>
<hr>
<a class="btn btn-primary text-center my-4" href="{% url 'member:club_create' %}">{% trans "Create club" %}</a>
<a class="btn btn-primary text-center my-4" href="{% url 'member:club_create' %}" data-turbolinks="false">{% trans "Create club" %}</a>
</div>
</div>
<div class="row justify-content-center">

View File

@ -7,7 +7,7 @@
<div class="col-md-10 text-center">
<input class="form-control mx-auto w-25" type="text" id="search_field" placeholder="{% trans "Name of the button..." %}">
<hr>
<a class="btn btn-primary text-center my-1" href="{% url 'note:template_create' %}">{% trans "New button" %}</a>
<a class="btn btn-primary text-center my-1" href="{% url 'note:template_create' %}" data-turbolinks="false">{% trans "New button" %}</a>
</div>
</div>
<div class="row justify-content-center">

View File

@ -12,8 +12,8 @@
</div>
<div class="card-footer text-center">
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus' pk=object.pk %}">{% trans "Edit" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_team' pk=object.pk %}">{% trans "Add team" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus' pk=object.pk %}" data-turbolinks="false">{% trans "Edit" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_team' pk=object.pk %}" data-turbolinks="false">{% trans "Add team" %}</a>
</div>
</div>

View File

@ -12,8 +12,8 @@
</div>
<div class="card-footer text-center">
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus' pk=bus.pk %}">{% trans "Edit" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_team' pk=bus.pk %}">{% trans "Add team" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus' pk=bus.pk %}" data-turbolinks="false">{% trans "Edit" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_team' pk=bus.pk %}" data-turbolinks="false">{% trans "Add team" %}</a>
</div>
</div>

View File

@ -59,16 +59,16 @@
{% endif %}
{% if club.is_current_wei %}
{% if can_add_first_year_member %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_register_1A' wei_pk=club.pk %}"> {% trans "Register 1A" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_register_1A' wei_pk=club.pk %}" data-turbolinks="false"> {% trans "Register 1A" %}</a>
{% endif %}
{% if can_add_any_member %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_register_2A' wei_pk=club.pk %}"> {% trans "Register 2A+" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_register_2A' wei_pk=club.pk %}" data-turbolinks="false"> {% trans "Register 2A+" %}</a>
{% endif %}
{% if "wei.change_"|has_perm:club %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_update' pk=club.pk %}"> {% trans "Edit" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_update' pk=club.pk %}" data-turbolinks="false"> {% trans "Edit" %}</a>
{% endif %}
{% if can_add_bus %}
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_bus' pk=club.pk %}"> {% trans "Add bus" %}</a>
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_bus' pk=club.pk %}" data-turbolinks="false"> {% trans "Add bus" %}</a>
{% endif %}
{% url 'wei:wei_detail' club.pk as club_detail_url %}
{%if request.path_info != club_detail_url %}

View File

@ -13,11 +13,11 @@
<div class="card-footer text-center">
{% if not my_registration %}
{% if not not_first_year %}
<a href="{% url "wei:wei_register_1A_myself" wei_pk=club.pk %}"><button class="btn btn-success">{% trans "Register to the WEI! 1A" %}</button></a>
<a href="{% url "wei:wei_register_1A_myself" wei_pk=club.pk %}" data-turbolinks="false"><button class="btn btn-success">{% trans "Register to the WEI! 1A" %}</button></a>
{% endif %}
<a href="{% url "wei:wei_register_2A_myself" wei_pk=club.pk %}"><button class="btn btn-success">{% trans "Register to the WEI! 2A+" %}</button></a>
<a href="{% url "wei:wei_register_2A_myself" wei_pk=club.pk %}" data-turbolinks="false"><button class="btn btn-success">{% trans "Register to the WEI! 2A+" %}</button></a>
{% else %}
<a href="{% url "wei:wei_update_registration" pk=my_registration.pk %}"><button class="btn btn-warning">{% trans "Update my registration" %}</button></a>
<a href="{% url "wei:wei_update_registration" pk=my_registration.pk %}" data-turbolinks="false"><button class="btn btn-warning">{% trans "Update my registration" %}</button></a>
{% endif %}
</div>
{% endif %}

View File

@ -125,7 +125,7 @@
</dl>
</div>
<div class="card-footer text-center">
<a class="btn btn-primary btn-sm" href="{% url 'wei:wei_update_registration' registration.pk %}">{% trans 'Update registration' %}</a>
<a class="btn btn-primary btn-sm" href="{% url 'wei:wei_update_registration' registration.pk %}" data-turbolinks="false">{% trans 'Update registration' %}</a>
{% if "auth.change_user"|has_perm:registration.user %}
<a class="btn btn-primary btn-sm" href="{% url 'member:user_update_profile' registration.user.pk %}">{% trans 'Update Profile' %}</a>
{% endif %}