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

This commit is contained in:
Antoine Bartuccio 2019-07-08 15:25:28 +02:00
parent c15ea345dd
commit fd1f89de1d
Signed by: klmp200
GPG Key ID: E7245548C53F904B
3 changed files with 422 additions and 420 deletions

View File

@ -1683,392 +1683,391 @@ $pedagogy-light-blue: #caf0ff;
$pedagogy-white-text: #f0f0f0; $pedagogy-white-text: #f0f0f0;
.pedagogy { .pedagogy {
&.star-not-checked { font-family: "Fira Sans";
color : #f7f7f7;
margin-bottom: 0px;
margin-top: 0px;
}
&.star-checked {
color: $pedagogy-orange;
margin-bottom: 0px;
margin-top: 0px;
}
@media screen and (max-width: $large-devices){
&.star-not-checked { &.star-not-checked {
margin-left: 5px; color : #f7f7f7;
margin-right: 5px; margin-bottom: 0px;
margin-top: 0px;
} }
&.star-checked { &.star-checked {
margin-left: 5px; color: $pedagogy-orange;
margin-right: 5px; margin-bottom: 0px;
margin-top: 0px;
} }
}
}
#dynamic_view { @media screen and (max-width: $large-devices){
font-family: "Fira Sans"; &.star-not-checked {
font-size: 1.1em; margin-left: 5px;
margin-right: 5px;
table { }
} &.star-checked {
margin-left: 5px;
td { margin-right: 5px;
text-align: center;
border: none;
}
}
#search_form {
font-family: "Fira Sans";
margin: 0px;
width: 100%;
.input-search {
background: $pedagogy-light-blue;
width: 300px;
height: 21px;
}
.button-search {
background: $pedagogy-orange;
color: white;
font-weight: bold;
margin-left: 20px;
}
.radio-guide input[type="radio"],input[type="checkbox"] {
display:none;
}
.radio-guide {
margin-top: 10px;
color: white;
}
.radio-guide label {
display:inline-block;
background-color: $pedagogy-blue;
padding: 10px 20px;
font-family:Arial;
font-size:16px;
border-radius: 4px;
}
.radio-guide input[type="radio"]:checked + label {
background-color:$pedagogy-orange;
}
.radio-guide input[type="checkbox"]:checked + label {
background-color:$pedagogy-orange;
}
.radio-guide label:hover {
background-color: $pedagogy-hover-blue;
}
#radioAUTUMN + label {
margin-left: 50px;
}
}
#pedagogy {
font-family: "Fira Sans";
color: #062f38;
.uv-quick-info-container {
display: grid;
grid-template-columns: 20% 20% 20% 20% auto;
grid-template-rows: auto auto;
grid-template-areas: "hours-cm hours-td hours-tp hours-te hours-the" "department credit-type semester . ." ;
}
.department {
grid-area: department;
}
.credit-type {
grid-area: credit-type;
}
.semester {
grid-area: semester;
}
.hours-cm {
grid-area: hours-cm;
}
.hours-td {
grid-area: hours-td;
}
.hours-tp {
grid-area: hours-tp;
}
.hours-te {
grid-area: hours-te;
}
.hours-the {
grid-area: hours-the;
}
#leave_comment {
.leave-comment-grid-container {
display: grid;
grid-template-columns: 270px auto;
grid-template-rows: 100%;
grid-template-areas: "stars comment";
@media screen and (max-width: $large-devices){
grid-template-columns: 100%;
grid-template-rows: auto auto;
grid-template-areas: "stars" "comment";
} }
} }
.ui-accordion-content { #dynamic_view {
background-color: $white-color; font-size: 1.1em;
border-color: $pedagogy-orange;
border-right: none; table {
} }
.form-stars { td {
grid-area: stars; text-align: center;
border: none;
} }
.form-comment {
grid-area: comment;
}
.ui-accordion-header {
background-color: $pedagogy-orange;
color: $pedagogy-white-text;
clip-path: polygon(0 0%, 0 100%, 30% 100%, 33% 0);
@media screen and (max-width: $large-devices){
clip-path: none;
}
}
.ui-accordion-header-icon {
color: $pedagogy-white-text;
margin-right: 10px;
}
.input-stars {
margin-top: 20px;
}
input[type="submit"] {
float: right;
}
} }
.uv-details-container { #search_form {
display: grid; margin: 0px;
grid-template-columns: 150px 100px auto; width: 100%;
grid-template-rows: 156px 1fr;
grid-template-areas: "grade grade-stars uv-infos" ". . uv-infos";
@media screen and (max-width: $large-devices){ .input-search {
grid-template-columns: 50% 50%; background: $pedagogy-light-blue;
grid-template-rows: auto auto;
grid-template-areas: "grade grade-stars" "uv-infos uv-infos";
}
}
.grade {
grid-area: grade;
color: $pedagogy-white-text;
background-color: $pedagogy-blue;
padding-right: 10px;
> p {
text-align: right;
font-weight: bold;
}
}
.grade-stars {
grid-area: grade-stars;
color: $pedagogy-white-text;
background-color: $pedagogy-blue;
font-weight: bold;
}
.uv-infos {
grid-area: uv-infos;
padding-left: 10px;
}
.comment-container {
display: grid;
grid-template-columns: auto auto;
grid-template-rows: 156px auto auto;
grid-template-areas: "grade-block comment" "grade-block info" "comment-end-bar comment-end-bar";
margin-bottom: 30px;
margin-top: 10px;
@media screen and (max-width: $large-devices){
grid-template-columns: auto;
grid-template-rows: auto auto auto auto;
grid-template-areas: "grade-block" "comment" "info" "comment-end-bar"
}
.grade-block {
grid-area: grade-block;
width: 300px; width: 300px;
height: 21px;
display: grid; }
grid-template-columns: 150px 150px; .button-search {
grid-template-rows: auto; background: $pedagogy-orange;
grid-template-areas: "grade-type grade-stars"; color: white;
grid-gap: 15px; font-weight: bold;
margin-left: 20px;
clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 20%, 80% 0); }
align-content: space-evenly; .radio-guide input[type="radio"],input[type="checkbox"] {
display:none;
}
.radio-guide {
margin-top: 10px;
color: white;
}
.radio-guide label {
display:inline-block;
background-color: $pedagogy-blue; background-color: $pedagogy-blue;
padding: 10px 20px;
font-family:Arial;
font-size:16px;
border-radius: 4px;
}
.radio-guide input[type="radio"]:checked + label {
background-color:$pedagogy-orange;
}
.radio-guide input[type="checkbox"]:checked + label {
background-color:$pedagogy-orange;
}
.radio-guide label:hover {
background-color: $pedagogy-hover-blue;
}
@media screen and (max-width: $large-devices){ #radioAUTUMN + label {
grid-template-columns: auto auto; margin-left: 50px;
grid-template-rows: auto; }
grid-template-areas: "grade-type grade-stars"; }
width: auto;
clip-path: none;
}
.grade-type { #uv_detail {
grid-area: grade-type; color: #062f38;
> p { .uv-quick-info-container {
color: $pedagogy-white-text; display: grid;
font-weight: bold; grid-template-columns: 20% 20% 20% 20% auto;
text-align: right; grid-template-rows: auto auto;
grid-template-areas: "hours-cm hours-td hours-tp hours-te hours-the" "department credit-type semester . ." ;
}
.department {
grid-area: department;
}
.credit-type {
grid-area: credit-type;
}
.semester {
grid-area: semester;
}
.hours-cm {
grid-area: hours-cm;
}
.hours-td {
grid-area: hours-td;
}
.hours-tp {
grid-area: hours-tp;
}
.hours-te {
grid-area: hours-te;
}
.hours-the {
grid-area: hours-the;
}
#leave_comment {
.leave-comment-grid-container {
display: grid;
grid-template-columns: 270px auto;
grid-template-rows: 100%;
grid-template-areas: "stars comment";
@media screen and (max-width: $large-devices){
grid-template-columns: 100%;
grid-template-rows: auto auto;
grid-template-areas: "stars" "comment";
} }
} }
.grade-stars { .ui-accordion-content {
grid-area: grade-stars; background-color: $white-color;
} border-color: $pedagogy-orange;
} border-right: none;
.comment {
grid-area: comment;
display: grid;
grid-template-columns: auto;
grid-template-rows: auto auto;
grid-template-areas: "anchor" "markdown";
@media screen and (max-width: $large-devices){
border-left: solid;
border-right: solid;
border-color: $pedagogy-blue;
} }
.anchor { .form-stars {
grid-area: anchor; grid-area: stars;
text-align: right;
margin-right: 15px;
} }
.markdown { .form-comment {
grid-area: markdown; grid-area: comment;
overflow: scroll;
margin-top: 0px;
margin-right: 0px;
padding: 10px;
padding-left: 40px;
text-align: justify;
}
}
.info {
grid-area: info;
margin-bottom: 0px;
@media screen and (max-width: $large-devices){
border-left: solid;
border-right: solid;
border-color: $pedagogy-blue;
} }
.status-reported { .ui-accordion-header {
color: red; background-color: $pedagogy-orange;
float: left; color: $pedagogy-white-text;
padding-left: 10px; clip-path: polygon(0 0%, 0 100%, 30% 100%, 33% 0);
padding-bottom: 10px;
@media screen and (max-width: $large-devices){
clip-path: none;
}
} }
.actions { .ui-accordion-header-icon {
color: $pedagogy-white-text;
margin-right: 10px;
}
.input-stars {
margin-top: 20px;
}
input[type="submit"] {
float: right; float: right;
} }
} }
.comment-end-bar { .uv-details-container {
grid-area: comment-end-bar;
display: grid; display: grid;
grid-template-columns: auto auto auto; grid-template-columns: 150px 100px auto;
grid-template-rows: 2.5em; grid-template-rows: 156px 1fr;
grid-template-areas: "report date author"; grid-template-areas: "grade grade-stars uv-infos" ". . uv-infos";
@media screen and (max-width: $large-devices){
grid-template-columns: 50% 50%;
grid-template-rows: auto auto;
grid-template-areas: "grade grade-stars" "uv-infos uv-infos";
}
}
.grade {
grid-area: grade;
color: $pedagogy-white-text;
background-color: $pedagogy-blue; background-color: $pedagogy-blue;
margin-top: 0px; padding-right: 10px;
> p {
text-align: right;
font-weight: bold;
}
}
.grade-stars {
grid-area: grade-stars;
color: $pedagogy-white-text;
background-color: $pedagogy-blue;
font-weight: bold;
}
.uv-infos {
grid-area: uv-infos;
padding-left: 10px;
}
.comment-container {
display: grid;
grid-template-columns: auto auto;
grid-template-rows: 156px auto auto;
grid-template-areas: "grade-block comment" "grade-block info" "comment-end-bar comment-end-bar";
margin-bottom: 30px;
margin-top: 10px;
@media screen and (max-width: $large-devices){ @media screen and (max-width: $large-devices){
grid-template-columns: auto; grid-template-columns: auto;
grid-template-rows: auto auto auto auto;
grid-template-areas: "grade-block" "comment" "info" "comment-end-bar"
}
.grade-block {
grid-area: grade-block;
width: 300px;
display: grid;
grid-template-columns: 150px 150px;
grid-template-rows: auto; grid-template-rows: auto;
grid-template-areas: "author" "date" "report" grid-template-areas: "grade-type grade-stars";
} grid-gap: 15px;
.report { clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 20%, 80% 0);
grid-area: report; align-content: space-evenly;
padding-top: 6px;
padding-left: 20px; background-color: $pedagogy-blue;
background-color: $pedagogy-orange;
clip-path: polygon(0 0%, 0 200%, 300px 200%, 250px 0);
@media screen and (max-width: $large-devices){ @media screen and (max-width: $large-devices){
grid-template-columns: auto auto;
grid-template-rows: auto;
grid-template-areas: "grade-type grade-stars";
width: auto;
clip-path: none; clip-path: none;
text-align: center; }
.grade-type {
grid-area: grade-type;
> p {
color: $pedagogy-white-text;
font-weight: bold;
text-align: right;
}
}
.grade-stars {
grid-area: grade-stars;
}
}
.comment {
grid-area: comment;
display: grid;
grid-template-columns: auto;
grid-template-rows: auto auto;
grid-template-areas: "anchor" "markdown";
@media screen and (max-width: $large-devices){
border-left: solid;
border-right: solid;
border-color: $pedagogy-blue;
}
.anchor {
grid-area: anchor;
text-align: right;
margin-right: 15px;
}
.markdown {
grid-area: markdown;
overflow: scroll;
margin-top: 0px;
margin-right: 0px;
padding: 10px;
padding-left: 40px;
text-align: justify;
}
}
.info {
grid-area: info;
margin-bottom: 0px;
@media screen and (max-width: $large-devices){
border-left: solid;
border-right: solid;
border-color: $pedagogy-blue;
}
.status-reported {
color: red;
float: left;
padding-left: 10px;
padding-bottom: 10px;
}
.actions {
float: right;
}
}
.comment-end-bar {
grid-area: comment-end-bar;
display: grid;
grid-template-columns: auto auto auto;
grid-template-rows: 2.5em;
grid-template-areas: "report date author";
background-color: $pedagogy-blue;
margin-top: 0px;
@media screen and (max-width: $large-devices){
grid-template-columns: auto;
grid-template-rows: auto;
grid-template-areas: "author" "date" "report"
}
.report {
grid-area: report;
padding-top: 6px; padding-top: 6px;
padding-bottom: 6px; padding-left: 20px;
padding-left: 0px; background-color: $pedagogy-orange;
clip-path: polygon(0 0%, 0 200%, 300px 200%, 250px 0);
@media screen and (max-width: $large-devices){
clip-path: none;
text-align: center;
padding-top: 6px;
padding-bottom: 6px;
padding-left: 0px;
}
& a {
color: $pedagogy-white-text;
font-weight: bold;
}
} }
& a { .date {
grid-area: date;
color: $pedagogy-white-text; color: $pedagogy-white-text;
font-weight: bold;
@media screen and (max-width: $large-devices){
text-align: center;
}
} }
} .author {
grid-area: author;
justify-self: right;
padding-right: 30px;
.date { a {
grid-area: date; color: $pedagogy-white-text;
color: $pedagogy-white-text; font-weight: bold;
}
@media screen and (max-width: $large-devices){ a:hover {
text-align: center; color: $pedagogy-light-blue;
} }
}
.author { @media screen and (max-width: $large-devices){
grid-area: author; text-align: center;
justify-self: right; justify-self: inherit;
padding-right: 30px; padding-right: 0px;
}
a {
color: $pedagogy-white-text;
font-weight: bold;
}
a:hover {
color: $pedagogy-light-blue;
}
@media screen and (max-width: $large-devices){
text-align: center;
justify-self: inherit;
padding-right: 0px;
} }
} }
} }

View File

@ -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="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="radioSPRING" value="SPRING"><label for="radioSPRING"><i class="fa fa-sun-o"></i></label>
<span><input type="checkbox" name="semester" id="radioAP" value="AUTUMN_AND_SPRING"><label for="radioAP">AP</label></span> <span><input type="checkbox" name="semester" id="radioAP" value="AUTUMN_AND_SPRING"><label for="radioAP">AP</label></span>
</div> </div>
<input type="text" name="json" hidden> <input type="text" name="json" hidden>
</form> </form>
<br> <br>
<table id="dynamic_view"> <table id="dynamic_view">
<thead> <thead>
<tr> <tr>
<td>{% trans %}UV{% endtrans %}</td> <td>{% trans %}UV{% endtrans %}</td>
<td>{% trans %}Title{% endtrans %}</td> <td>{% trans %}Title{% endtrans %}</td>
<td>{% trans %}Department{% endtrans %}</td> <td>{% trans %}Department{% endtrans %}</td>
<td>{% trans %}Credit type{% endtrans %}</td> <td>{% trans %}Credit type{% endtrans %}</td>
<td><i class="fa fa-leaf"></i></td> <td><i class="fa fa-leaf"></i></td>
<td><i class="fa fa-sun-o"></i></td> <td><i class="fa fa-sun-o"></i></td>
{% if can_create_uv(user) %} {% if can_create_uv(user) %}
<td>{% trans %}Edit{% endtrans %}</td> <td>{% trans %}Edit{% endtrans %}</td>
<td>{% trans %}Delete{% endtrans %}</td> <td>{% trans %}Delete{% endtrans %}</td>
{% endif %}
</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 %} {% endif %}
</td> </tr>
<td> </thead>
{% if uv.semester in ["SPRING", "AUTUMN_AND_SPRING"] %} <tbody id="dynamic_view_content">
<i class="fa fa-sun-o"></i> {% for uv in object_list %}
{% endif %} <tr onclick="window.location.href = `{{ url('pedagogy:uv_detail', uv_id=uv.id) }}`">
</td> <td><a href="{{ url('pedagogy:uv_detail', uv_id=uv.id) }}">{{ uv.code }}</a></td>
{% if user.is_owner(uv) -%} <td>{{ uv.title }}</td>
<td><a href="{{ url('pedagogy:uv_update', uv_id=uv.id) }}">{% trans %}Edit{% endtrans %}</a></td> <td>{{ uv.department }}</td>
<td><a href="{{ url('pedagogy:uv_delete', uv_id=uv.id) }}">{% trans %}Delete{% endtrans %}</a></td> <td>{{ uv.credit_type }}</td>
{%- endif -%} <td>
</tr> {% if uv.semester in ["AUTUMN", "AUTUMN_AND_SPRING"] %}
{% endfor %} <i class="fa fa-leaf"></i>
</tbody> {% endif %}
</table> </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(){

View File

@ -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 @@
{% endif %} {% endif %}
</div> </div>
</div>
<script type="text/javascript"> <script type="text/javascript">
$("#return_noscript").hide(); $("#return_noscript").hide();
$("#return_js").show(); $("#return_js").show();
var icons = { var icons = {
header: "fa fa-toggle-right", header: "fa fa-toggle-right",
activeHeader: "fa fa-toggle-down" activeHeader: "fa fa-toggle-down"
}; };
$(function(){ $(function(){
$("#leave_comment").accordion({ $("#leave_comment").accordion({
icons: icons, icons: icons,
heightStyle: "content", heightStyle: "content",
active: false, active: false,
collapsible: true collapsible: true
});
}); });
// Remove jquery-ui icons to make fontawesome work });
$(document).ready(function(){ // Remove jquery-ui icons to make fontawesome work
$(".ui-accordion-header-icon").first().removeClass("ui-icon"); $(document).ready(function(){
}); $(".ui-accordion-header-icon").first().removeClass("ui-icon");
</script> });
</script>
{% endblock %} {% endblock %}