Commit fd1f89de authored by Sli's avatar Sli

pedagogy: wrap all css inside a class named pedagogy to avoid name clashes

parent c15ea345
Pipeline #1898 failed with stage
in 60 minutes and 4 seconds
This diff is collapsed.
...@@ -6,78 +6,79 @@ ...@@ -6,78 +6,79 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<form id="search_form" action="{{ url('pedagogy:guide') }}" method="get"> <div class="pedagogy">
{% if can_create_uv(user) %} <form id="search_form" action="{{ url('pedagogy:guide') }}" method="get">
<p> {% if can_create_uv(user) %}
<a href="{{ url('pedagogy:uv_create') }}">{% trans %}Create UV{% endtrans %}</a> <p>
</p> <a href="{{ url('pedagogy:uv_create') }}">{% trans %}Create UV{% endtrans %}</a>
<p> </p>
<a href="{{ url('pedagogy:moderation') }}">{% trans %}Moderate comments{% endtrans %}</a> <p>
</p> <a href="{{ url('pedagogy:moderation') }}">{% trans %}Moderate comments{% endtrans %}</a>
{% endif %} </p>
<p> {% endif %}
<input id="search_input" class="input-search" type="text" name="search"> <p>
<button class="button-search">{% trans %}Search{% endtrans %}</button> <input id="search_input" class="input-search" type="text" name="search">
</p> <button class="button-search">{% trans %}Search{% endtrans %}</button>
<div class="radio-guide"> </p>
{% for department in [("EDIM", "EDIM"), ("ENERGIE", "EE"), ("IMSI", "IMSI"), ("INFO", "GI"), ("GMC", "MC"), ("HUMA", "HUMA"), ("TC", "TC")] %} <div class="radio-guide">
{% set display_name, real_name = department %} {% for department in [("EDIM", "EDIM"), ("ENERGIE", "EE"), ("IMSI", "IMSI"), ("INFO", "GI"), ("GMC", "MC"), ("HUMA", "HUMA"), ("TC", "TC")] %}
<input type="radio" name="department" id="radio{{ real_name }}" value="{{ real_name }}"><label for="radio{{ real_name }}">{% trans %}{{ display_name }}{% endtrans %}</label> {% set display_name, real_name = department %}
{% endfor %} <input type="radio" name="department" id="radio{{ real_name }}" value="{{ real_name }}"><label for="radio{{ real_name }}">{% trans %}{{ display_name }}{% endtrans %}</label>
</div> {% endfor %}
<div class="radio-guide"> </div>
{% for credit_type in ["CS", "TM", "EC", "QC", "OM"] %} <div class="radio-guide">
<input type="radio" name="credit_type" id="radio{{ credit_type }}" value="{{ credit_type }}"><label for="radio{{ credit_type }}">{% trans %}{{ credit_type }}{% endtrans %}</label> {% for credit_type in ["CS", "TM", "EC", "QC", "OM"] %}
{% endfor %} <input type="radio" name="credit_type" id="radio{{ credit_type }}" value="{{ credit_type }}"><label for="radio{{ credit_type }}">{% trans %}{{ credit_type }}{% endtrans %}</label>
{% endfor %}
<input type="checkbox" name="semester" id="radioAUTUMN" value="AUTUMN"><label for="radioAUTUMN"><i class="fa fa-leaf"></i></label>
<input type="checkbox" name="semester" id="radioSPRING" value="SPRING"><label for="radioSPRING"><i class="fa fa-sun-o"></i></label> <input type="checkbox" name="semester" id="radioAUTUMN" value="AUTUMN"><label for="radioAUTUMN"><i class="fa fa-leaf"></i></label>
<span><input type="checkbox" name="semester" id="radioAP" value="AUTUMN_AND_SPRING"><label for="radioAP">AP</label></span> <input type="checkbox" name="semester" id="radioSPRING" value="SPRING"><label for="radioSPRING"><i class="fa fa-sun-o"></i></label>
</div> <span><input type="checkbox" name="semester" id="radioAP" value="AUTUMN_AND_SPRING"><label for="radioAP">AP</label></span>
<input type="text" name="json" hidden> </div>
</form> <input type="text" name="json" hidden>
<br> </form>
<table id="dynamic_view"> <br>
<thead> <table id="dynamic_view">
<tr> <thead>
<td>{% trans %}UV{% endtrans %}</td> <tr>
<td>{% trans %}Title{% endtrans %}</td> <td>{% trans %}UV{% endtrans %}</td>
<td>{% trans %}Department{% endtrans %}</td> <td>{% trans %}Title{% endtrans %}</td>
<td>{% trans %}Credit type{% endtrans %}</td> <td>{% trans %}Department{% endtrans %}</td>
<td><i class="fa fa-leaf"></i></td> <td>{% trans %}Credit type{% endtrans %}</td>
<td><i class="fa fa-sun-o"></i></td> <td><i class="fa fa-leaf"></i></td>
{% if can_create_uv(user) %} <td><i class="fa fa-sun-o"></i></td>
<td>{% trans %}Edit{% endtrans %}</td> {% if can_create_uv(user) %}
<td>{% trans %}Delete{% endtrans %}</td> <td>{% trans %}Edit{% endtrans %}</td>
{% endif %} <td>{% trans %}Delete{% endtrans %}</td>
</tr>
</thead>
<tbody id="dynamic_view_content">
{% for uv in object_list %}
<tr onclick="window.location.href = `{{ url('pedagogy:uv_detail', uv_id=uv.id) }}`">
<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>
<td>
{% if uv.semester in ["AUTUMN", "AUTUMN_AND_SPRING"] %}
<i class="fa fa-leaf"></i>
{% endif %}
</td>
<td>
{% if uv.semester in ["SPRING", "AUTUMN_AND_SPRING"] %}
<i class="fa fa-sun-o"></i>
{% endif %} {% endif %}
</td> </tr>
{% if user.is_owner(uv) -%} </thead>
<td><a href="{{ url('pedagogy:uv_update', uv_id=uv.id) }}">{% trans %}Edit{% endtrans %}</a></td> <tbody id="dynamic_view_content">
<td><a href="{{ url('pedagogy:uv_delete', uv_id=uv.id) }}">{% trans %}Delete{% endtrans %}</a></td> {% for uv in object_list %}
{%- endif -%} <tr onclick="window.location.href = `{{ url('pedagogy:uv_detail', uv_id=uv.id) }}`">
</tr> <td><a href="{{ url('pedagogy:uv_detail', uv_id=uv.id) }}">{{ uv.code }}</a></td>
{% endfor %} <td>{{ uv.title }}</td>
</tbody> <td>{{ uv.department }}</td>
</table> <td>{{ uv.credit_type }}</td>
<td>
{% if uv.semester in ["AUTUMN", "AUTUMN_AND_SPRING"] %}
<i class="fa fa-leaf"></i>
{% endif %}
</td>
<td>
{% if uv.semester in ["SPRING", "AUTUMN_AND_SPRING"] %}
<i class="fa fa-sun-o"></i>
{% endif %}
</td>
{% if user.is_owner(uv) -%}
<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 -%}
</tr>
{% endfor %}
</tbody>
</table>
</div>
<script> <script>
function autofillCheckboxRadio(name){ function autofillCheckboxRadio(name){
if (urlParams.has(name)){ $("input[name='" + name + "']").each(function(){ if (urlParams.has(name)){ $("input[name='" + name + "']").each(function(){
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div id="pedagogy"> <div class="pedagogy">
<div id="uv_detail">
<p id="return_noscript"><a href="{{ url('pedagogy:guide') }}">{% trans %}Back{% endtrans %}</a></p> <p id="return_noscript"><a href="{{ url('pedagogy:guide') }}">{% trans %}Back{% endtrans %}</a></p>
<button id="return_js" onclick='(function(){ <button id="return_js" onclick='(function(){
// If comes from the guide page, go back with history // If comes from the guide page, go back with history
...@@ -192,25 +193,26 @@ ...@@ -192,25 +193,26 @@
{% endif %} {% endif %}
</div> </div>
</div>
<script type="text/javascript">
$("#return_noscript").hide(); <script type="text/javascript">
$("#return_js").show(); $("#return_noscript").hide();
var icons = { $("#return_js").show();
header: "fa fa-toggle-right", var icons = {
activeHeader: "fa fa-toggle-down" header: "fa fa-toggle-right",
}; activeHeader: "fa fa-toggle-down"
$(function(){ };
$("#leave_comment").accordion({ $(function(){
icons: icons, $("#leave_comment").accordion({
heightStyle: "content", icons: icons,
active: false, heightStyle: "content",
collapsible: true active: false,
}); collapsible: true
});
// Remove jquery-ui icons to make fontawesome work
$(document).ready(function(){
$(".ui-accordion-header-icon").first().removeClass("ui-icon");
}); });
</script> });
// Remove jquery-ui icons to make fontawesome work
$(document).ready(function(){
$(".ui-accordion-header-icon").first().removeClass("ui-icon");
});
</script>
{% endblock %} {% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment