Skip to content

Commit

Permalink
Merge pull request #993 from ae-utbm/elections
Browse files Browse the repository at this point in the history
Quick fix for election display
  • Loading branch information
imperosol authored Jan 8, 2025
2 parents bc9cb9b + 672bc91 commit 4226ba8
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 50 deletions.
102 changes: 58 additions & 44 deletions election/static/election/css/election.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ $min_col_width: 100px;
flex-direction: row;
gap: $gap;

> input,
> label {
>input,
>label {
margin: 0;
}

Expand All @@ -25,12 +25,12 @@ $min_col_width: 100px;
}
}

.election_vote {
overflow-x: scroll !important;
#page #content {
overflow-x: clip;
}

.election_table {
width: 100%;
width: inherit;

>.lists {
display: flex;
Expand Down Expand Up @@ -93,16 +93,24 @@ $min_col_width: 100px;
align-items: center;
justify-content: space-between;
margin: 0;
row-gap: 10px;
padding: $padding;
width: 100%;


>.role_text {
display: flex;
flex-direction: column;

>h4 {
margin: 0;
}

>p {
flex-grow: 1;
margin-top: .5em;
text-wrap: auto;
text-align: left;
}
}

Expand All @@ -112,9 +120,9 @@ $min_col_width: 100px;
align-items: center;
gap: $gap;

> button,
> button > i,
> a {
>button,
>button>i,
>a {
width: 20px;
height: 20px;
background-color: #e9e9e9;
Expand All @@ -127,23 +135,23 @@ $min_col_width: 100px;
justify-content: center;

&:hover,
&:hover > i {
&:hover>i {
background-color: #fff;
}
}

> button {
>button {
width: 30px;
height: 30px;
}

> button[disabled] {
>button[disabled] {
background-color: #eee;
cursor: not-allowed;

>i,
&:hover,
&:hover > i {
&:hover>i {
background-color: #eee;
}
}
Expand Down Expand Up @@ -178,12 +186,12 @@ $min_col_width: 100px;
width: 100%;
gap: $gap;

>input[type="radio"]:checked + label,
>input[type="checkbox"]:checked + label {
>input[type="radio"]:checked+label,
>input[type="checkbox"]:checked+label {
background-color: lightgray;
border-radius: 10px;

>figure>.edit_btns>a:hover{
>figure>.edit_btns>a:hover {
background-color: #fff;
}
}
Expand Down Expand Up @@ -215,7 +223,9 @@ $min_col_width: 100px;
margin: 0;
text-align: center;
}

.candidate_program {
text-wrap: auto;
margin: 5px 0;
}
}
Expand All @@ -228,7 +238,7 @@ $min_col_width: 100px;
right: $gap;
gap: $gap;

> a {
>a {
width: 20px;
height: 20px;
background-color: #e9e9e9;
Expand All @@ -253,40 +263,44 @@ $min_col_width: 100px;
}
}

.election_details {
margin: .5em 0;
}
#content {

.buttons {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: $gap;
}
.election_details {
margin: .5em 0;
}

.button {
border: none;
color: black;
text-decoration: none;
background-color: $primary-neutral-light-color;
padding: 0.4em;
margin: 0.1em;
font-size: 1.18em;
border-radius: 5px;
box-shadow: #dfdfdf 0 0 1px;
cursor: pointer;
.buttons {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: $gap;
}

&:hover {
.button {
border: none;
color: black;
background: #d4d4d4;
}
text-decoration: none;
background-color: $primary-neutral-light-color;
padding: 0.4em;
margin: 0.1em;
font-size: 1.18em;
border-radius: 5px;
box-shadow: #dfdfdf 0 0 1px;
cursor: pointer;

&_send {
background-color: #59aee2;
&:hover {
background-color: rgb(130, 186, 235);
color: black;
background: #d4d4d4;
}

&_send {
background-color: #59aee2;

&:hover {
background-color: rgb(130, 186, 235);
}
}
}
}
10 changes: 4 additions & 6 deletions election/templates/election/election_detail.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
{{ object.title }}
{% endblock %}

{% block head %}
{{ super() -}}
{% block additional_css %}
<link rel="stylesheet" href="{{ static('election/css/election.scss') }}">
{%- endblock %}
{% endblock %}

{% block additional_css %}
{% block additional_js %}
<script src="{{ static('bundled/vendored/jquery.shorten.min.js') }}"></script>
{% endblock %}

Expand Down Expand Up @@ -47,7 +46,6 @@
{% csrf_token %}
<table class="election_table">
{%- set election_lists = election.election_lists.all() -%}
<caption></caption>
<thead class="lists">
<tr>
<th class="column" style="width: {{ 100 / (election_lists.count() + 1) }}%">{% trans %}Blank vote{% endtrans %}</th>
Expand Down Expand Up @@ -204,7 +202,7 @@
$('.role_description').shorten({
moreText: "{% trans %}Show more{% endtrans %}",
lessText: "{% trans %}Show less{% endtrans %}",
showChars: 50
showChars: 300
});
$('.candidate_program').shorten({
moreText: "{% trans %}Show more{% endtrans %}",
Expand Down

0 comments on commit 4226ba8

Please sign in to comment.