Skip to content

Commit

Permalink
Create example_markdown_evaluations.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
vingerha authored Jan 23, 2023
1 parent 06a68dd commit 026be6d
Showing 1 changed file with 111 additions and 0 deletions.
111 changes: 111 additions & 0 deletions example_markdown_evaluations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
type: markdown
content: |
<div>Evaluations Florian</div>
<table>
{% set dates = state_attr('sensor.pronote_vingerhoeds_florian_evaluation','date')%}
{% for i in range(0, dates | count, 1) %}
<tr>
{% if state_attr('sensor.pronote_vingerhoeds_florian_evaluation','acquisition_level')[i] == 'Expert' %}
<td>
<mark>
{{ dates[i].split("/",1)[1] }}</mark></td>
{% elif state_attr('sensor.pronote_vingerhoeds_florian_evaluation','acquisition_level')[i] == 'Maîtrise satisfaisante' %}
<td><p>{{dates[i].split("/",1)[1]}}</p></td>
{% elif state_attr('sensor.pronote_vingerhoeds_florian_evaluation','acquisition_level')[i] == 'Maîtrise insuffisante' %}
<td><strong>{{dates[i].split("/",1)[1]}}</strong></td>
{% elif state_attr('sensor.pronote_vingerhoeds_florian_evaluation','acquisition_level')[i] == 'Absent' %}
<td><u>{{dates[i].split("/",1)[1]+'A'}}</u></td>
{% else %}
<td><em>{{dates[i].split("/",1)[1]}}</em></td>
{% endif %}
<td>{{ state_attr('sensor.pronote_vingerhoeds_florian_evaluation','subject')[i] }}</td>
<td>{{ state_attr('sensor.pronote_vingerhoeds_florian_evaluation','acquisition_name')[i] }}</td>
</tr>
{% endfor %}
card_mod:
style:
.: |
ha-card ha-markdown {
padding:0px
}
ha-markdown $: |
h1 {
font-weight: normal;
font-size: 24px;
}
div {
background-color:rgb(100, 100, 100);
padding: 12px 12px;
color:white;
font-weight:normal;
font-size:1.2em;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
table{
border-collapse: collapse;
font-size: 0.9em;
font-family: Roboto;
width: auto;
outline: 0px solid #393c3d;
margin-top: 10px;
} caption {
text-align: center;
font-weight: bold;
font-size: 1.2em;
} td {
padding: 5px 5px 5px 5px;
text-align: left;
border-bottom: 0px solid #1c2020;
}
tr {
border-bottom: 0px solid #1c2020;
}
tr:nth-of-type(even) {
background-color: rgb(54, 54, 54, 0.3);
}
tr:last-of-type {
border-bottom: transparent;
}
mark {
background: green;
color: #222627;
border-radius: 5px;
padding: 5px;
}
span {
background: red;
color: #222627;
border-radius: 5px;
padding: 5px;
}
p {
background: lightgreen;
color: #222627;
border-radius: 5px;
padding: 5px;
}
strong {
background: red;
color: #222627;
border-radius: 5px;
padding: 5px;
}
em {
background: yellow;
color: #222627;
border-radius: 5px;
padding: 5px;
}
u {
background: lightblue;
color: #222627;
border-radius: 5px;
padding: 5px;
}
span {
padding: 5px;
}
tr:nth-child(n+2) > td:nth-child(2) {
text-align: left;
}

0 comments on commit 026be6d

Please sign in to comment.