mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-25 03:30:30 +02:00
Entry page (we can search people)
This commit is contained in:
@ -48,6 +48,10 @@
|
||||
</div>
|
||||
|
||||
<div class="card-footer text-center">
|
||||
{% if activity.open %}
|
||||
<a class="btn btn-warning btn-sm my-1" href="{% url 'activity:activity_entry' pk=activity.pk %}"> {% trans "Entry page" %}</a>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.valid and "change__open"|has_perm:activity %}
|
||||
<a class="btn btn-warning btn-sm my-1" id="open_activity"> {% if activity.open %}{% trans "close"|capfirst %}{% else %}{% trans "open"|capfirst %}{% endif %}</a>
|
||||
{% endif %}
|
||||
|
30
templates/activity/activity_entry.html
Normal file
30
templates/activity/activity_entry.html
Normal file
@ -0,0 +1,30 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load pretty_money %}
|
||||
{% load perms %}
|
||||
|
||||
{% block content %}
|
||||
<input id="alias" type="text" class="form-control" placeholder="Nom/note ...">
|
||||
|
||||
<div id="entry_table">
|
||||
{% render_table table %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrajavascript %}
|
||||
<script>
|
||||
old_pattern = null;
|
||||
alias_obj = $("#alias");
|
||||
|
||||
alias_obj.keyup(function() {
|
||||
let pattern = alias_obj.val();
|
||||
|
||||
if (pattern === old_pattern || pattern === "")
|
||||
return;
|
||||
|
||||
$("#entry_table").load(location.href + "?search=" + pattern.replace(" ", "%20") + " #entry_table");
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user