mirror of
				https://github.com/ae-utbm/sith.git
				synced 2025-11-04 02:53:06 +00:00 
			
		
		
		
	pedagogy: basic display of the guide
This commit is contained in:
		@@ -6,7 +6,7 @@
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
	<form id="search_form" action="{{ url('pedagogy:guide') }}" method="get">
 | 
			
		||||
<form id="search_form" action="{{ url('pedagogy:guide') }}" method="get">
 | 
			
		||||
	<p>
 | 
			
		||||
		<input type="text" name="search">
 | 
			
		||||
		<button>{% trans %}Details{% endtrans %}</button>
 | 
			
		||||
@@ -31,21 +31,41 @@
 | 
			
		||||
		<input type="checkbox" name="semester" value="SPRING">P
 | 
			
		||||
		<input type="checkbox" name="semester" value="AUTUMN_AND_SPRING">
 | 
			
		||||
	</p>
 | 
			
		||||
	</form>
 | 
			
		||||
	{% if can_create_uv(user) %}
 | 
			
		||||
		<p>
 | 
			
		||||
</form>
 | 
			
		||||
{% if can_create_uv(user) %}
 | 
			
		||||
<p>
 | 
			
		||||
	<a href="{{ url('pedagogy:uv_create') }}">{% trans %}Create UV{% endtrans %}</a>
 | 
			
		||||
		</p>
 | 
			
		||||
</p>
 | 
			
		||||
<br>
 | 
			
		||||
{% endif %}
 | 
			
		||||
<table>
 | 
			
		||||
	<thead>
 | 
			
		||||
		<tr>
 | 
			
		||||
			<td>{% trans %}UV{% endtrans %}</td>
 | 
			
		||||
			<td>{% trans %}Title{% endtrans %}</td>
 | 
			
		||||
			<td>{% trans %}Department{% endtrans %}</td>
 | 
			
		||||
			<td>{% trans %}Credit type{% endtrans %}</td>
 | 
			
		||||
			{% if can_create_uv(user) %}
 | 
			
		||||
			<td>{% trans %}Edit{% endtrans %}</td>
 | 
			
		||||
			<td>{% trans %}Delete{% endtrans %}</td>
 | 
			
		||||
			{% endif %}
 | 
			
		||||
		</tr>
 | 
			
		||||
	</thead>
 | 
			
		||||
	<tbody>
 | 
			
		||||
		{% for uv in object_list %}
 | 
			
		||||
    	<p>
 | 
			
		||||
	    	<a href="{{ url('pedagogy:uv_detail', uv_id=uv.id) }}">{{ uv.code }}</a>
 | 
			
		||||
		<tr>
 | 
			
		||||
			<td><a href="{{ url('pedagogy:uv_detail', uv_id=uv.id) }}">{{ uv.code }}</a></td>
 | 
			
		||||
			<td>{{ uv.title }}</td>
 | 
			
		||||
			<td>{{ uv.department }}</td>
 | 
			
		||||
			<td>{{ uv.credit_type }}</td>
 | 
			
		||||
			{% if user.is_owner(uv) -%}
 | 
			
		||||
	    	  	<a href="{{ url('pedagogy:uv_update', uv_id=uv.id) }}">{% trans %}Edit{% endtrans %}</a>
 | 
			
		||||
	    	  	<a href="{{ url('pedagogy:uv_delete', uv_id=uv.id) }}">{% trans %}Delete{% endtrans %}</a>
 | 
			
		||||
			<td><a href="{{ url('pedagogy:uv_update', uv_id=uv.id) }}">{% trans %}Edit{% endtrans %}</a></td>
 | 
			
		||||
			<td><a href="{{ url('pedagogy:uv_delete', uv_id=uv.id) }}">{% trans %}Delete{% endtrans %}</a></td>
 | 
			
		||||
			{%- endif -%}
 | 
			
		||||
	    </p>
 | 
			
		||||
		</tr>
 | 
			
		||||
		{% endfor %}
 | 
			
		||||
	</tbody>
 | 
			
		||||
</table>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
 | 
			
		||||
@@ -57,12 +77,12 @@
 | 
			
		||||
				$(this).prop("checked", true);
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
	}
 | 
			
		||||
	if (urlParams.has("search"))
 | 
			
		||||
}
 | 
			
		||||
if (urlParams.has("search"))
 | 
			
		||||
	$("input[name='search']").first().prop("value", urlParams.get("search"));
 | 
			
		||||
	autofillCheckboxRadio("department");
 | 
			
		||||
	autofillCheckboxRadio("credit_type");
 | 
			
		||||
	autofillCheckboxRadio("semester");
 | 
			
		||||
autofillCheckboxRadio("department");
 | 
			
		||||
autofillCheckboxRadio("credit_type");
 | 
			
		||||
autofillCheckboxRadio("semester");
 | 
			
		||||
 | 
			
		||||
	// Allow unchecking a radio button when we click on it
 | 
			
		||||
	// Keep a state of what is checked
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user