mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 12:29:24 +00:00
core/club: allow adding custom js action to pagination link, useful for FormDetailView with pagination
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
|
||||
{% block content %}
|
||||
<h3>{% trans %}Sellings{% endtrans %}</h3>
|
||||
<form action="?page=1" method="post">
|
||||
<form id="form" action="?page=1" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<p><input type="submit" value="{% trans %}Show{% endtrans %}" /></p>
|
||||
@ -28,7 +28,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for s in result %}
|
||||
{% for s in paginated_result %}
|
||||
<tr>
|
||||
<td>{{ s.date|localtime|date(DATETIME_FORMAT) }} {{ s.date|localtime|time(DATETIME_FORMAT) }}</td>
|
||||
<td>{{ s.counter }}</td>
|
||||
@ -53,7 +53,14 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ paginate(result, paginator) }}
|
||||
<script type="text/javascript">
|
||||
function formPagination(link){
|
||||
$("form").attr("action", link.href);
|
||||
link.href = "javascript:void(0)"; // block link action
|
||||
$("form").submit();
|
||||
}
|
||||
</script>
|
||||
{{ paginate(paginated_result, paginator, "formPagination(this)") }}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user