Skip to content

Commit

Permalink
Merge pull request #88 from it-at-m/feature-1629-adjust-calldisplay
Browse files Browse the repository at this point in the history
feat(ZMS-1629-1804): adjust call display
  • Loading branch information
manjencic authored Dec 21, 2023
2 parents 22bc286 + 0f0a469 commit b393418
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 50 deletions.
1 change: 1 addition & 0 deletions zmsadmin/templates/block/scope/form.twig
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@
"parameter": {
"name": "preferences[queue][callDisplayText]",
"id": "aufrufanzeigetext",
"maxlength": 120,
"value": scope.preferences.queue.callDisplayText|default('Herzlich Willkommen'),
}
}]
Expand Down
29 changes: 24 additions & 5 deletions zmscalldisplay/js/block/analogClock.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ class View {
}

setClock() {
if (document.querySelector('.second-hand')) {
this.setAnalogClock();
}

if (document.querySelector('.digital-clock')) {
const now = new Date();

document.querySelector('.digital-clock').innerHTML =
new Intl.DateTimeFormat('de-DE', {hour: '2-digit', minute: '2-digit'}).format(now)

document.querySelector('.digital-datum').innerHTML =
new Intl.DateTimeFormat('de-DE', { weekday: 'long', year: 'numeric', month: '2-digit', day: '2-digit' }).format(now)
}
}

setAnalogClock() {
const now = new Date();

const secondHand = document.querySelector('.second-hand');
Expand All @@ -16,22 +32,25 @@ class View {
const seconds = now.getSeconds();
const secondsDegrees = ((seconds / 60) * 360) + 90;
secondHand.style.transform = `rotate(${secondsDegrees}deg)`;

const mins = now.getMinutes();
const minsDegrees = ((mins / 60) * 360) + ((seconds/60)*6) + 90;
minsHand.style.transform = `rotate(${minsDegrees}deg)`;

const hour = now.getHours();
const hourDegrees = ((hour / 12) * 360) + ((mins/60)*30) + 90;
hourHand.style.transform = `rotate(${hourDegrees}deg)`;
hourHand.style.transform = `rotate(${hourDegrees}deg)`;
}

setDate() {
const dateString = document.querySelector('#aufrufanzeige_Datum');
const now = new Date();
let options = { weekday: 'long', year: 'numeric', month: '2-digit', day: '2-digit' }
dateString.innerHTML = new Intl.DateTimeFormat('de-DE', options).format(now)
}

if (dateString) {
dateString.innerHTML = new Intl.DateTimeFormat('de-DE', options).format(now)
}
}
}

export default View;
2 changes: 1 addition & 1 deletion zmscalldisplay/public/_css/calldisplay.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion zmscalldisplay/public/_css/calldisplay.css.map

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions zmscalldisplay/public/_js/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion zmscalldisplay/public/_js/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion zmscalldisplay/scss/block/aufrufanzeige.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@
.aufrufanzeige .infotext
{
top: 77px;
position: absolute;
left: 0;
position: fixed;
padding: 10px 40px;
font-size:2em;
font-weight:normal;
Expand Down
4 changes: 2 additions & 2 deletions zmscalldisplay/scss/block/tabellen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ div.aufrufanzeige_anzeigebereich_zweizeilig
border-top: 3px solid $borderLight;
color: $white;
font-size: 36px;
font-family: Arial, sans-serif;
font-family: Roboto Condensed, Arial, sans-serif;
font-weight: bold;
line-height: 45px;
text-align:center;
Expand All @@ -55,7 +55,7 @@ div.aufrufanzeige_anzeigebereich_zweizeilig
border-top: 3px solid $borderLight;
/*font-size: 70px;
line-height: 108px;*/
font-family: Arial, sans-serif;
font-family: Roboto Condensed, Arial, sans-serif;
font-weight: bold;
text-align: left;
padding:8px 0px;
Expand Down
3 changes: 2 additions & 1 deletion zmscalldisplay/src/Zmscalldisplay/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ public function readResponse(
$response,
'block/queue/queueTable.twig',
array(
'text' => 'asdsadsa',
'tableSettings' => $validator->getParameter('tableLayout')->isArray()->getValue(),
'calldisplay' => $calldisplay->getEntity(false),
'calldisplay' => $calldisplay->getEntity(true),
'scope' => $calldisplay->getSingleScope(),
'queueList' => $queueList
)
Expand Down
14 changes: 14 additions & 0 deletions zmscalldisplay/templates/block/queue/queueTable.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
{% set text = '' %}
{% if calldisplay.clusters|length == 1 and calldisplay.clusters|first.callDisplayText %}
{% set text = calldisplay.clusters|first.callDisplayText|raw|nl2br %}
{% elseif calldisplay.scopes|length == 1 and calldisplay.scopes|first.preferences.queue.callDisplayText%}
{% set text = calldisplay.scopes|first.preferences.queue.callDisplayText|raw|nl2br %}
{% endif %}

{% if text %}
<div class="infotext">
<span id="infoicon"></span>
<div class="infotext-content">{{ text }}</div>
</div>
{% endif %}

{% block queueTable %}
{% if tableSettings.multiColumns == 1 %}
{% include "block/queue/table/oneColumn.twig" with {"settings": tableSettings} %}
Expand Down
11 changes: 1 addition & 10 deletions zmscalldisplay/templates/element/queueTable/leftCol.twig
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
<td class="rechterRand wartenummer" data-callTime="{{ queue.callTime }}">
<div class="highlight {{ queue.status }}">
{% if queue.withAppointment %}
{% if queue.number|length == 7 %}
{% set addClass = " smallerFont7Chars" %}
{% elseif queue.number|length == 8 %}
{% set addClass = " smallerFont8Chars" %}
{% endif %}
<span class="terminkundennummer{{ addClass }}" data-appointment="{{ queue.number }}" data-status="{{ queue.status }}">{{ queue.number }}</span>
{% else %}
<span class="wartenummer" data-appointment="{{ queue.number }}" data-status="{{ queue.status }}">{{ queue.number }}</span>
{% endif %}
<span class="terminkundennummer" data-appointment="{{ queue.number }}" data-status="{{ queue.status }}">{{ queue.number }}</span>
</div>
</td>
13 changes: 0 additions & 13 deletions zmscalldisplay/templates/page/customized/base.twig
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@
</div>
</div>
{% endif %}
{% set text = '' %}
{% if calldisplay.clusters|length == 1 and calldisplay.clusters|first.callDisplayText %}
{% set text = calldisplay.clusters|first.callDisplayText|raw|nl2br %}
{% elseif calldisplay.scopes|length == 1 and calldisplay.scopes|first.preferences.queue.callDisplayText%}
{% set text = calldisplay.scopes|first.preferences.queue.callDisplayText|raw|nl2br %}
{% endif %}

{% if text %}
<div class="infotext">
<span id="infoicon"></span>
<div class="infotext-content">{{ text }}</div>
</div>
{% endif %}
<div class="aufrufanzeige_main{% if skipAll %} aufrufanzeige_full{% endif %}">
{% block messages %}
{% include "block/messages/messages.twig" %}
Expand Down

0 comments on commit b393418

Please sign in to comment.