Skip to content

Commit cdaf5a1

Browse files
author
veeck
committed
run prettier over all njk files
1 parent 7118faa commit cdaf5a1

File tree

9 files changed

+302
-320
lines changed

9 files changed

+302
-320
lines changed
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{% if imageUrl or imageFA %}
2-
{% set imageHeight = imageHeight if imageHeight else "80px" %}
3-
{% if imageUrl %}
4-
<img src="{{ imageUrl }}"
5-
height="{{ imageHeight }}"
6-
style="margin-bottom: 10px" />
7-
{% else %}
8-
<span class="bright fas fa-{{ imageFA }}"
9-
style="margin-bottom: 10px;
10-
font-size: {{ imageHeight }}"></span>
11-
{% endif %}
12-
<br />
2+
{% set imageHeight = imageHeight if imageHeight else "80px" %}
3+
{% if imageUrl %}
4+
<img src="{{ imageUrl }}" height="{{ imageHeight }}" style="margin-bottom: 10px" />
5+
{% else %}
6+
<span
7+
class="bright fas fa-{{ imageFA }}"
8+
style="margin-bottom: 10px;
9+
font-size: {{ imageHeight }}"
10+
></span>
11+
{% endif %}
12+
<br />
1313
{% endif %}
1414
{% if title %}
15-
<span class="thin dimmed medium">{{ title if titleType == 'text' else title | safe }}</span>
15+
<span class="thin dimmed medium">{{ title if titleType == 'text' else title | safe }}</span>
1616
{% endif %}
1717
{% if message %}
18-
{% if title %}<br />{% endif %}
19-
<span class="light bright small">{{ message if messageType == 'text' else message | safe }}</span>
18+
{% if title %}<br />{% endif %}
19+
<span class="light bright small">{{ message if messageType == 'text' else message | safe }}</span>
2020
{% endif %}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% if title %}
2-
<span class="thin dimmed medium">{{ title if titleType == 'text' else title | safe }}</span>
2+
<span class="thin dimmed medium">{{ title if titleType == 'text' else title | safe }}</span>
33
{% endif %}
44
{% if message %}
5-
{% if title %}<br />{% endif %}
6-
<span class="light bright small">{{ message if messageType == 'text' else message | safe }}</span>
5+
{% if title %}<br />{% endif %}
6+
<span class="light bright small">{{ message if messageType == 'text' else message | safe }}</span>
77
{% endif %}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<div>
2-
<iframe class="newsfeed-fullarticle" src="{{ url }}"></iframe>
2+
<iframe class="newsfeed-fullarticle" src="{{ url }}"></iframe>
33
</div>
Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,89 @@
11
{% macro escapeText(text, dangerouslyDisableAutoEscaping=false) %}
2-
{% if dangerouslyDisableAutoEscaping -%}
3-
{{ text | safe }}
4-
{%- else -%}
5-
{{ text }}
6-
{%- endif %}
2+
{% if dangerouslyDisableAutoEscaping -%}
3+
{{ text | safe }}
4+
{%- else -%}
5+
{{ text }}
6+
{%- endif %}
77
{% endmacro %}
88
{% macro escapeTitle(title, url, dangerouslyDisableAutoEscaping=false, showTitleAsUrl=false) %}
9-
{% if dangerouslyDisableAutoEscaping %}
10-
{% if showTitleAsUrl %}
11-
<a href="{{ url }}"
12-
style="text-decoration:none;
9+
{% if dangerouslyDisableAutoEscaping %}
10+
{% if showTitleAsUrl %}
11+
<a
12+
href="{{ url }}"
13+
style="text-decoration:none;
1314
color:#ffffff"
14-
target="_blank">{{ title | safe }}</a>
15-
{% else %}
16-
{{ title | safe }}
17-
{% endif %}
15+
target="_blank"
16+
>{{ title | safe }}</a
17+
>
1818
{% else %}
19-
{% if showTitleAsUrl %}
20-
<a href="{{ url }}"
21-
style="text-decoration:none;
19+
{{ title | safe }}
20+
{% endif %}
21+
{% else %}
22+
{% if showTitleAsUrl %}
23+
<a
24+
href="{{ url }}"
25+
style="text-decoration:none;
2226
color:#ffffff"
23-
target="_blank">{{ title }}</a>
24-
{% else %}
25-
{{ title }}
26-
{% endif %}
27+
target="_blank"
28+
>{{ title }}</a
29+
>
30+
{% else %}
31+
{{ title }}
2732
{% endif %}
33+
{% endif %}
2834
{% endmacro %}
2935
{% if loaded %}
30-
{% if config.showAsList %}
31-
<ul class="newsfeed-list">
32-
{% for item in items %}
33-
<li>
34-
{% if (config.showSourceTitle and item.sourceTitle) or config.showPublishDate %}
35-
<div class="newsfeed-source light small dimmed">
36-
{% if item.sourceTitle and config.showSourceTitle %}
37-
{{ item.sourceTitle }}{% if config.showPublishDate %}, {% else %}:{% endif %}
38-
{% endif %}
39-
{% if config.showPublishDate %}{{ item.publishDate }}:{% endif %}
40-
</div>
41-
{% endif %}
42-
<div class="newsfeed-title bright medium light{{ ' no-wrap' if not config.wrapTitle }}">
43-
{{ escapeTitle(item.title, item.url, config.dangerouslyDisableAutoEscaping, config.showTitleAsUrl) }}
44-
</div>
45-
{% if config.showDescription %}
46-
<div class="newsfeed-desc small light{{ ' no-wrap' if not config.wrapDescription }}">
47-
{% if config.truncDescription %}
48-
{{ escapeText(item.description | truncate(config.lengthDescription) , config.dangerouslyDisableAutoEscaping) }}
49-
{% else %}
50-
{{ escapeText(item.description, config.dangerouslyDisableAutoEscaping) }}
51-
{% endif %}
52-
</div>
53-
{% endif %}
54-
</li>
55-
{% endfor %}
56-
</ul>
57-
{% else %}
58-
<div>
59-
{% if (config.showSourceTitle and sourceTitle) or config.showPublishDate %}
60-
<div class="newsfeed-source light small dimmed">
61-
{% if sourceTitle and config.showSourceTitle %}
62-
{{ escapeText(sourceTitle, config.dangerouslyDisableAutoEscaping) }}{% if config.showPublishDate %}, {% else %}:{% endif %}
63-
{% endif %}
64-
{% if config.showPublishDate %}{{ publishDate }}:{% endif %}
65-
</div>
66-
{% endif %}
67-
<div class="newsfeed-title bright medium light{{ ' no-wrap' if not config.wrapTitle }}">
68-
{{ escapeTitle(title, url, config.dangerouslyDisableAutoEscaping, config.showTitleAsUrl) }}
36+
{% if config.showAsList %}
37+
<ul class="newsfeed-list">
38+
{% for item in items %}
39+
<li>
40+
{% if (config.showSourceTitle and item.sourceTitle) or config.showPublishDate %}
41+
<div class="newsfeed-source light small dimmed">
42+
{% if item.sourceTitle and config.showSourceTitle %}
43+
{{ item.sourceTitle }}{% if config.showPublishDate %},{% else %}:{% endif %}
44+
{% endif %}
45+
{% if config.showPublishDate %}{{ item.publishDate }}:{% endif %}
6946
</div>
70-
{% if config.showDescription %}
71-
<div class="newsfeed-desc small light{{ ' no-wrap' if not config.wrapDescription }}">
72-
{% if config.truncDescription %}
73-
{{ escapeText(description | truncate(config.lengthDescription) , config.dangerouslyDisableAutoEscaping) }}
74-
{% else %}
75-
{{ escapeText(description, config.dangerouslyDisableAutoEscaping) }}
76-
{% endif %}
77-
</div>
78-
{% endif %}
47+
{% endif %}
48+
<div class="newsfeed-title bright medium light{{ ' no-wrap' if not config.wrapTitle }}">{{ escapeTitle(item.title, item.url, config.dangerouslyDisableAutoEscaping, config.showTitleAsUrl) }}</div>
49+
{% if config.showDescription %}
50+
<div class="newsfeed-desc small light{{ ' no-wrap' if not config.wrapDescription }}">
51+
{% if config.truncDescription %}
52+
{{ escapeText(item.description | truncate(config.lengthDescription) , config.dangerouslyDisableAutoEscaping) }}
53+
{% else %}
54+
{{ escapeText(item.description, config.dangerouslyDisableAutoEscaping) }}
55+
{% endif %}
56+
</div>
57+
{% endif %}
58+
</li>
59+
{% endfor %}
60+
</ul>
61+
{% else %}
62+
<div>
63+
{% if (config.showSourceTitle and sourceTitle) or config.showPublishDate %}
64+
<div class="newsfeed-source light small dimmed">
65+
{% if sourceTitle and config.showSourceTitle %}
66+
{{ escapeText(sourceTitle, config.dangerouslyDisableAutoEscaping) }}{% if config.showPublishDate %},{% else %}:{% endif %}
67+
{% endif %}
68+
{% if config.showPublishDate %}{{ publishDate }}:{% endif %}
7969
</div>
80-
{% endif %}
81-
{% elseif empty %}
82-
<div class="small dimmed">{{ "NEWSFEED_NO_ITEMS" | translate | safe }}</div>
83-
{% elseif error %}
84-
<div class="small dimmed">
85-
{{ "MODULE_CONFIG_ERROR" | translate({MODULE_NAME: "Newsfeed", ERROR: error}) | safe }}
70+
{% endif %}
71+
<div class="newsfeed-title bright medium light{{ ' no-wrap' if not config.wrapTitle }}">{{ escapeTitle(title, url, config.dangerouslyDisableAutoEscaping, config.showTitleAsUrl) }}</div>
72+
{% if config.showDescription %}
73+
<div class="newsfeed-desc small light{{ ' no-wrap' if not config.wrapDescription }}">
74+
{% if config.truncDescription %}
75+
{{ escapeText(description | truncate(config.lengthDescription) , config.dangerouslyDisableAutoEscaping) }}
76+
{% else %}
77+
{{ escapeText(description, config.dangerouslyDisableAutoEscaping) }}
78+
{% endif %}
79+
</div>
80+
{% endif %}
8681
</div>
82+
{% endif %}
83+
{% elseif empty %}
84+
<div class="small dimmed">{{ "NEWSFEED_NO_ITEMS" | translate | safe }}</div>
85+
{% elseif error %}
86+
<div class="small dimmed">{{ "MODULE_CONFIG_ERROR" | translate({MODULE_NAME: "Newsfeed", ERROR: error}) | safe }}</div>
8787
{% else %}
88-
<div class="small dimmed">{{ "LOADING" | translate | safe }}</div>
88+
<div class="small dimmed">{{ "LOADING" | translate | safe }}</div>
8989
{% endif %}
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
<div class="small bright">
2-
{{ "MODULE_CONFIG_CHANGED" | translate({MODULE_NAME: "Newsfeed"}) | safe }}
3-
</div>
1+
<div class="small bright">{{ "MODULE_CONFIG_CHANGED" | translate({MODULE_NAME: "Newsfeed"}) | safe }}</div>
Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
{% if not suspended %}
2-
{% if needRestart %}
3-
<div class="small bright">
4-
<i class="fas fa-rotate"></i>
5-
<span>
6-
{% set restartTextLabel = "UPDATE_NOTIFICATION_NEED-RESTART" %}
7-
{{ restartTextLabel | translate() | safe }}
8-
</span>
9-
</div>
10-
{% endif %}
11-
{% for name, status in moduleList %}
12-
<div class="small bright">
13-
<i class="fas fa-exclamation-circle"></i>
14-
<span>
15-
{% set mainTextLabel = "UPDATE_NOTIFICATION" if name === "MagicMirror" else "UPDATE_NOTIFICATION_MODULE" %}
16-
{{ mainTextLabel | translate({MODULE_NAME: name}) }}
17-
</span>
18-
</div>
19-
<div class="xsmall dimmed">
20-
{% set subTextLabel = "UPDATE_INFO_SINGLE" if status.behind === 1 else "UPDATE_INFO_MULTIPLE" %}
21-
{{ subTextLabel | translate({COMMIT_COUNT: status.behind, BRANCH_NAME: status.current}) | diffLink(status) | safe }}
22-
</div>
23-
{% endfor %}
24-
{% for name, status in updatesList %}
25-
<div class="small bright">
26-
{% if status.done %}
27-
<i class="fas fa-check" style="color: lightgreen;"></i>
28-
<span>
29-
{% set updateTextLabel = "UPDATE_NOTIFICATION_DONE" %}
30-
{{ updateTextLabel | translate({MODULE_NAME: name}) | safe }}
31-
</span>
32-
{% else %}
33-
<i class="fas fa-xmark" style="color: red;"></i>
34-
<span>
35-
{% set updateTextLabel = "UPDATE_NOTIFICATION_ERROR" %}
36-
{{ updateTextLabel | translate({MODULE_NAME: name}) | safe }}
37-
</span>
38-
{% endif %}
39-
</div>
40-
{% endfor %}
2+
{% if needRestart %}
3+
<div class="small bright">
4+
<i class="fas fa-rotate"></i>
5+
<span>
6+
{% set restartTextLabel = "UPDATE_NOTIFICATION_NEED-RESTART" %}
7+
{{ restartTextLabel | translate() | safe }}
8+
</span>
9+
</div>
10+
{% endif %}
11+
{% for name, status in moduleList %}
12+
<div class="small bright">
13+
<i class="fas fa-exclamation-circle"></i>
14+
<span>
15+
{% set mainTextLabel = "UPDATE_NOTIFICATION" if name === "MagicMirror" else "UPDATE_NOTIFICATION_MODULE" %}
16+
{{ mainTextLabel | translate({MODULE_NAME: name}) }}
17+
</span>
18+
</div>
19+
<div class="xsmall dimmed">
20+
{% set subTextLabel = "UPDATE_INFO_SINGLE" if status.behind === 1 else "UPDATE_INFO_MULTIPLE" %}
21+
{{ subTextLabel | translate({COMMIT_COUNT: status.behind, BRANCH_NAME: status.current}) | diffLink(status) | safe }}
22+
</div>
23+
{% endfor %}
24+
{% for name, status in updatesList %}
25+
<div class="small bright">
26+
{% if status.done %}
27+
<i class="fas fa-check" style="color: lightgreen;"></i>
28+
<span>
29+
{% set updateTextLabel = "UPDATE_NOTIFICATION_DONE" %}
30+
{{ updateTextLabel | translate({MODULE_NAME: name}) | safe }}
31+
</span>
32+
{% else %}
33+
<i class="fas fa-xmark" style="color: red;"></i>
34+
<span>
35+
{% set updateTextLabel = "UPDATE_NOTIFICATION_ERROR" %}
36+
{{ updateTextLabel | translate({MODULE_NAME: name}) | safe }}
37+
</span>
38+
{% endif %}
39+
</div>
40+
{% endfor %}
4141
{% endif %}

0 commit comments

Comments
 (0)