mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-11-04 01:12:08 +01:00 
			
		
		
		
	🐛 Better entry page
This commit is contained in:
		@@ -14,3 +14,29 @@
 | 
			
		||||
        <button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
 | 
			
		||||
    </form>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block extrajavascript %}
 | 
			
		||||
    <script>
 | 
			
		||||
    $(document).ready(function() {
 | 
			
		||||
        function refreshTeams() {
 | 
			
		||||
            let buses = [];
 | 
			
		||||
            $("input[name='bus']:checked").each(function(ignored) {
 | 
			
		||||
                buses.push($(this).parent().text().trim());
 | 
			
		||||
            });
 | 
			
		||||
            console.log(buses);
 | 
			
		||||
            $("input[name='team']").each(function() {
 | 
			
		||||
                let label = $(this).parent();
 | 
			
		||||
                $(this).parent().addClass('d-none');
 | 
			
		||||
                buses.forEach(function(bus) {
 | 
			
		||||
                    if (label.text().includes(bus))
 | 
			
		||||
                        label.removeClass('d-none');
 | 
			
		||||
                });
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $("input[name='bus']").change(refreshTeams);
 | 
			
		||||
 | 
			
		||||
        refreshTeams();
 | 
			
		||||
    });
 | 
			
		||||
    </script>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user