Skip to content

Commit f14f1b5

Browse files
authored
Merge pull request #118 from Vauhtijuoksu/develop
Minor tweaks to time constraints
2 parents 3dc6a61 + 8fcca23 commit f14f1b5

File tree

3 files changed

+55
-28
lines changed

3 files changed

+55
-28
lines changed

static/css/_globals.scss

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,29 @@ body {
147147
flex-direction: row;
148148
justify-content: center;
149149
.tc-col-times{
150-
width: 3em;
150+
width: auto;
151+
.tc-time-start, .tc-time-end {
152+
width: 3em
153+
}
154+
.tc-time-dash {
155+
width: 0.8em;
156+
}
151157
}
152158
.tc-col{
153159
display: flex;
154160
flex-direction: column;
155161
.tc-row{
156162
height: 1.3em;
157163
padding: 1px;
164+
display: flex;
165+
flex-direction: column;
166+
justify-content: center;
167+
168+
&.tc-time{
169+
display: flex;
170+
flex-direction: row;
171+
align-items: center;
172+
}
158173
.tc-input{
159174
width: 100%;
160175
height: 100%;
@@ -252,14 +267,14 @@ body {
252267
margin: auto;
253268
line-height: 0.9em;
254269
&:after{
255-
content: "🠋"
270+
content: ""
256271
}
257272
}
258273
.tc-hour-input {
259274
float: right;
260275
margin: 0.2em;
261276
&:after{
262-
content: "🠊"
277+
content: ""
263278
}
264279
}
265280
.tc-score-indicators {
@@ -453,8 +468,28 @@ body {
453468
}
454469
.field-time-constraints{
455470
font-size: 0.9rem;
456-
.hide-if-small{
457-
display: none;
471+
.tc-col {
472+
.tc-row {
473+
height: 2em;
474+
.tc-input {
475+
line-height: 1.6em;
476+
477+
}
478+
&.tc-time{
479+
flex-direction: column;
480+
justify-content: center;
481+
.tc-time-start, .tc-time-end {
482+
font-size: 0.7em;
483+
line-height: 1;
484+
485+
}
486+
.tc-time-dash {
487+
font-size: 0.6em;
488+
height: 4px;
489+
line-height: 4px;
490+
}
491+
}
492+
}
458493
}
459494
}
460495
}

templates/marathon/plugins/fields/gdprCheck.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
<div class="field-input">
1414
<input class="form-check-input" type="checkbox" name="{{ field.name }}" {{ field.field.required }} id="{{ field.id_for_label }}">
1515
</div>
16-
{% with splitlabel=field.label|split:"%%" %}
17-
<label for="{{ field.id_for_label }}">{{ splitlabel.0 }}<a href="{{ gdpr_url }}">{{ splitlabel.1 }}</a>{{ splitlabel.2 }}</label>
18-
{% endwith %}
16+
{% with splitlabel=field.label|split:"%%" %}
17+
<label for="{{ field.id_for_label }}">{{ splitlabel.0 }}<a href="{{ gdpr_url }}">{{ splitlabel.1 }}</a>{{ splitlabel.2 }}</label>
18+
{% endwith %}
1919
</div>
2020
<div class="field-help-text">
2121
{{ field.help_text }}

templates/marathon/plugins/fields/timeConstraints.html

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="field-row">
1414
<div class="field-label tc-label-row">
1515
<label for="{{ field.id_for_label }}">{{ field.label }}{% if field.field.required %}*{% endif %}</label>
16-
<div class="tc-legend"><div class="ok"></div> Käy, <div class="maybe"></div> Ehkä, <div class="notok"></div> Ei käy</div>
16+
<div class="tc-legend"><div class="ok"></div> Käy,<div class="notok"></div> Ei käy, <div class="maybe"></div> Ehkä</div>
1717
</div>
1818
<script>
1919
function set_focus(elId) {
@@ -22,7 +22,7 @@
2222
</script>
2323
<div class="hidden-inputs">
2424
<input class="hidden-input" type="text" name="{{ field.name }}" required id="{{ field.id_for_label }}" onfocus="set_focus('dummy-{{ field.id_for_label }}')">
25-
<input class="hidden-input dummy-input" type="text" id="dummy-{{ field.id_for_label }}">
25+
<input class="hidden-input dummy-input" type="checkbox" id="dummy-{{ field.id_for_label }}">
2626
</div>
2727
<div class="field-time-constraints">
2828
{% with ''|center:24 as range %}
@@ -36,29 +36,21 @@
3636
<div class="tc-col tc-col-times">
3737
<div class="tc-day"></div>
3838
{% for _ in range %}
39-
<div class="tc-row">
39+
<div class="tc-row tc-time">
4040
{% with start=forloop.counter|add:'-1' %}
41-
{{ start|stringformat:".2d" }}:00
41+
<div class="tc-time-start">
42+
{{ start|stringformat:".2d" }}:00
43+
</div>
44+
<div class="tc-time-dash">
45+
-
46+
</div>
47+
<div class="tc-time-end">
48+
{{ forloop.counter|stringformat:".2d" }}:00
49+
</div>
4250
{% endwith %}
4351
</div>
4452
{% endfor %}
4553
</div>
46-
<div class="tc-col tc-col-autosize hide-if-small">
47-
<div class="tc-day"></div>
48-
{% for _ in range %}
49-
<div class="tc-row">
50-
-
51-
</div>
52-
{% endfor %}
53-
</div>
54-
<div class="tc-col tc-col-times hide-if-small">
55-
<div class="tc-day"></div>
56-
{% for _ in range %}
57-
<div class="tc-row">
58-
{{ forloop.counter|stringformat:".2d" }}:00
59-
</div>
60-
{% endfor %}
61-
</div>
6254
<div class="tc-col tc-col-autosize">
6355
<div class="tc-day"></div>
6456
{% for _ in range %}

0 commit comments

Comments
 (0)