Skip to content

Commit

Permalink
馃毀 show running and future sessions
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Fihlon <[email protected]>
  • Loading branch information
McPringle committed Mar 25, 2024
1 parent fb207a2 commit 75b6598
Show file tree
Hide file tree
Showing 12 changed files with 278 additions and 2 deletions.
17 changes: 17 additions & 0 deletions frontend/themes/apus/views/future-session-view.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Apus - A social wall for conferences with additional features.
* Copyright (C) Marcus Fihlon and the individual contributors to Apus.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
17 changes: 17 additions & 0 deletions frontend/themes/apus/views/future-sessions-view.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Apus - A social wall for conferences with additional features.
* Copyright (C) Marcus Fihlon and the individual contributors to Apus.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
17 changes: 17 additions & 0 deletions frontend/themes/apus/views/running-session-view.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Apus - A social wall for conferences with additional features.
* Copyright (C) Marcus Fihlon and the individual contributors to Apus.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
17 changes: 17 additions & 0 deletions frontend/themes/apus/views/running-sessions-view.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Apus - A social wall for conferences with additional features.
* Copyright (C) Marcus Fihlon and the individual contributors to Apus.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
17 changes: 17 additions & 0 deletions frontend/themes/apus/views/sessions-view.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Apus - A social wall for conferences with additional features.
* Copyright (C) Marcus Fihlon and the individual contributors to Apus.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Binary file modified src/main/bundles/dev.bundle
Binary file not shown.
36 changes: 36 additions & 0 deletions src/main/java/swiss/fihlon/apus/ui/view/FutureSessionView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Apus - A social wall for conferences with additional features.
* Copyright (C) Marcus Fihlon and the individual contributors to Apus.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package swiss.fihlon.apus.ui.view;

import com.vaadin.flow.component.dependency.CssImport;
import com.vaadin.flow.component.html.H4;
import com.vaadin.flow.component.html.Paragraph;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import org.jetbrains.annotations.NotNull;
import swiss.fihlon.apus.conference.Session;

@CssImport(value = "./themes/apus/views/future-session-view.css")
public class FutureSessionView extends VerticalLayout {

public FutureSessionView(@NotNull final Session session) {
add(new H4(session.title()));
add(new Paragraph(session.speaker()));
add(new Paragraph(String.format("starts at %s", session.startDate().toLocalTime())));
}

}
39 changes: 39 additions & 0 deletions src/main/java/swiss/fihlon/apus/ui/view/FutureSessionsView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Apus - A social wall for conferences with additional features.
* Copyright (C) Marcus Fihlon and the individual contributors to Apus.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package swiss.fihlon.apus.ui.view;

import com.vaadin.flow.component.dependency.CssImport;
import com.vaadin.flow.component.html.H3;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import org.jetbrains.annotations.NotNull;
import swiss.fihlon.apus.conference.Session;
import swiss.fihlon.apus.service.ConferenceService;

@CssImport(value = "./themes/apus/views/future-sessions-view.css")
public class FutureSessionsView extends VerticalLayout {

public FutureSessionsView(@NotNull final ConferenceService conferenceService) {
final HorizontalLayout futureSessions = new HorizontalLayout();
for (final Session session : conferenceService.getFutureSessions()) {
futureSessions.add(new FutureSessionView(session));
}
add(new H3("Future Sessions"), futureSessions);
}

}
42 changes: 42 additions & 0 deletions src/main/java/swiss/fihlon/apus/ui/view/RunningSessionView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Apus - A social wall for conferences with additional features.
* Copyright (C) Marcus Fihlon and the individual contributors to Apus.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package swiss.fihlon.apus.ui.view;

import com.vaadin.flow.component.dependency.CssImport;
import com.vaadin.flow.component.html.H4;
import com.vaadin.flow.component.html.Paragraph;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import org.jetbrains.annotations.NotNull;
import swiss.fihlon.apus.conference.Session;

import java.time.Duration;
import java.time.LocalDateTime;

@CssImport(value = "./themes/apus/views/running-session-view.css")
public class RunningSessionView extends VerticalLayout {

public RunningSessionView(@NotNull final Session session) {
final Duration duration = Duration.between(LocalDateTime.now(), session.endDate());
final long timeLeft = Math.round(duration.getSeconds() / 60f);
final String timeUnit = timeLeft == 1 ? "minute" : "minutes";
add(new H4(session.title()));
add(new Paragraph(session.speaker()));
add(new Paragraph(String.format("%d %s left", timeLeft, timeUnit)));
}

}
39 changes: 39 additions & 0 deletions src/main/java/swiss/fihlon/apus/ui/view/RunningSessionsView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Apus - A social wall for conferences with additional features.
* Copyright (C) Marcus Fihlon and the individual contributors to Apus.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package swiss.fihlon.apus.ui.view;

import com.vaadin.flow.component.dependency.CssImport;
import com.vaadin.flow.component.html.H3;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import org.jetbrains.annotations.NotNull;
import swiss.fihlon.apus.conference.Session;
import swiss.fihlon.apus.service.ConferenceService;

@CssImport(value = "./themes/apus/views/running-sessions-view.css")
public class RunningSessionsView extends VerticalLayout {

public RunningSessionsView(@NotNull final ConferenceService conferenceService) {
final HorizontalLayout runningSessions = new HorizontalLayout();
for (final Session session : conferenceService.getRunningSessions()) {
runningSessions.add(new RunningSessionView(session));
}
add(new H3("Running Sessions"), runningSessions);
}

}
33 changes: 33 additions & 0 deletions src/main/java/swiss/fihlon/apus/ui/view/SessionsView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Apus - A social wall for conferences with additional features.
* Copyright (C) Marcus Fihlon and the individual contributors to Apus.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package swiss.fihlon.apus.ui.view;

import com.vaadin.flow.component.dependency.CssImport;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import org.jetbrains.annotations.NotNull;
import swiss.fihlon.apus.service.ConferenceService;

@CssImport(value = "./themes/apus/views/sessions-view.css")
public class SessionsView extends VerticalLayout {

public SessionsView(@NotNull final ConferenceService conferenceService) {
add(new RunningSessionsView(conferenceService));
add(new FutureSessionsView(conferenceService));
}

}
6 changes: 4 additions & 2 deletions src/main/java/swiss/fihlon/apus/ui/view/SocialWall.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;
import org.jetbrains.annotations.NotNull;
import swiss.fihlon.apus.service.ConferenceService;

import java.io.Serial;

Expand All @@ -32,10 +34,10 @@ public class SocialWall extends VerticalLayout {
@Serial
private static final long serialVersionUID = 7909437130138135008L;

public SocialWall() {
public SocialWall(@NotNull final ConferenceService conferenceService) {
setId("social-wall");
add(new HorizontalLayout(
new Div("Agenda"),
new SessionsView(conferenceService),
new Div("Posts")));
add(new Div("Footer"));
}
Expand Down

0 comments on commit 75b6598

Please sign in to comment.