Skip to content
Snippets Groups Projects
Commit 356a6b13 authored by Lukas Ruge's avatar Lukas Ruge
Browse files

Merge branch 'presence-feature' into 'master'

Presence feature

See merge request !15
parents d691e013 edcfb597
No related branches found
No related tags found
1 merge request!15Presence feature
Pipeline #8937 passed
......@@ -192,3 +192,4 @@ postadresse: Chaotikum e.V. <br> Postfach 12 64 <br> 23502 Lübeck
iban: DE86 8306 5408 0004 1480 61
bic: GENODEF1SLR
bank: Deutsche Skatbank
presence_service: http://127.0.0.1:5050/presence
......@@ -48,13 +48,14 @@ applyToggle('.list--nav', '.button', 640)
<script>
$(document).ready(function(){
spaceopen();
nextevent();
presence();
});
function spaceopen() {
//http://nobreakspace.org/status/spaceapi.json
$.get( "https://status.nobreakspace.org/spaceapi.json", function( data ) {
console.log(data);
if(data.open) {
$("#spaceopen").css( "border", "3px solid green" );
$("#spaceopen").html("<div style='float:left'><img src='{{ site.baseurl }}/assets/open.png' width='35'></div>Der Nbsp ist offen!<br><div style='text-align: right;'><a href='https://status.nobreakspace.org' target='_blank' style='color: #EAEAEA;'>Status</a></div>");
......@@ -68,6 +69,30 @@ function spaceopen() {
}
});
}
function nextevent() {
if($("#nextevent").text().trim().length) {
$("#event_soon").css( "border", "3px solid orange");
} else {
$("event_soon").hide();
}
if($("#nextevent_mobile").text().trim().length) {
$("#event_soon_mobile").css( "border", "3px solid orange");
} else {
$("event_soon_mobile").hide();
}
}
function presence() {
$.getJSON( "{{site.presence_service}}", function( data ) {
console.log(data)
for (var hash of data) {
console.log(hash);
$("#presence" ).append('<img class="gravatar" src="https://www.gravatar.com/avatar/'+hash+'.jpg"/>');
$("#presence_mobile" ).append('<img class="gravatar" src="https://www.gravatar.com/avatar/'+hash+'.jpg"/>');
}
});
}
</script>
<!-- Core CSS file -->
......
......@@ -20,6 +20,8 @@
{% if nofeature %}
{% else %}
<div class="presence_mobile" id="presence_mobile" style="width: 80%; margin:0 auto; margin-bottom: 30px; background-color: transparent;">
</div>
<div class="statusmobile" style="width: 80%; margin:0 auto; margin-top: -45px; background-color: #FAFAFA;">
{% include space-status-mobile.html %}
</div>
......
<div id="spaceopenmobile" class="chaotikum-about">
Ob der Nobreakspace offen ist siehst du <a href='https://status.nobreakspace.org' target='_blank'>hier</a><p>Oder aktiviere Javascript</p>
</div>
<div id="event_soon_mobile">
{% capture nowunix %}{{'now' | date: '%s'}}{% endcapture -%}
{% for e in site.events -%}
{% capture event_start_plus %}{{e.eventdate | date: '%s' | minus: 86400 }}{% endcapture -%}
{% capture event_start %}{{e.eventdate | date: '%s' }}{% endcapture -%}
{% if event_start_plus < nowunix and event_start > nowunix -%}
<p id="nextevent_mobile"> {{ e.eventdate | date: "%d.%m.%Y %H:%M" }}: {{e.title}}</p>
{% endif -%}
{% endfor -%}
</div>
<div id="event_soon">
{% capture nowunix %}{{'now' | date: '%s'}}{% endcapture -%}
{% for e in site.events -%}
{% capture event_start_plus %}{{e.eventdate | date: '%s' | minus: 86400 }}{% endcapture -%}
{% capture event_start %}{{e.eventdate | date: '%s' }}{% endcapture -%}
{% if event_start_plus < nowunix and event_start > nowunix -%}
<p id="nextevent"> {{ e.eventdate | date: "%d.%m.%Y %H:%M" }}: {{e.title}}</p>
{% endif -%}
{% endfor -%}
</div>
<div id="spaceopen" class="chaotikum-about">
Ob der Nobreakspace offen ist siehst du <a href='https://status.nobreakspace.org' target='_blank'>hier</a><p>Oder aktiviere Javascript</p>
</div>
<div class="presence" id="presence" style="width: 80%; margin:0 auto; margin-top: -20px;">
</div>
\ No newline at end of file
......@@ -42,6 +42,13 @@ h2 a {
font-family: "TabletGothic","Helvetica Neue",Helvetica,Arial,FreeSans,sans-serif;
}
.gravatar {
object-fit: cover;
border-radius:50%;
width: 50px;
height: 50px;
}
.list--nav {
font-family: "TabletGothic","Helvetica Neue",Helvetica,Arial,FreeSans,sans-serif;
}
......@@ -145,6 +152,9 @@ figcaption {
.statusmobile {
display: none;
}
.presence_mobile {
display: none;
}
.teaser {
font-size: 1rem!important;
letter-spacing: .03em!important;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment