Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct EventCardButton: View {
let eventEnd = event.eventEnd.convertToHoursAndMinutes(),
let eventStart = event.eventStart.convertToHoursAndMinutes()
{
Text(String(format: NSLocalizedString("%@, from %@ - %@", comment: ""), eventDate, eventStart, eventEnd))
Text(String(format: NSLocalizedString("%@, from %@ to %@", comment: ""), eventDate, eventStart, eventEnd))
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct UpcomingEventCardButton: View {
let eventEnd = event.eventEnd.toDate(),
let eventStart = event.eventStart.convertToHoursAndMinutes()
{
Text(String(format: NSLocalizedString("%@, from %@ - %@", comment: ""), eventDate, eventStart, eventEnd))
Text(String(format: NSLocalizedString("%@, from %@ to %@", comment: ""), eventDate, eventStart, eventEnd))
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct ExamDetailsSheet: View {
let date = event.eventStart.toDate() ?? NSLocalizedString("No date", comment: "")
let start = event.eventStart.convertToHoursAndMinutes() ?? NSLocalizedString("(no time)", comment: "")
let end = event.eventEnd.convertToHoursAndMinutes() ?? NSLocalizedString("(no time)", comment: "")
Text(String(format: NSLocalizedString("%@, from %@ - %@", comment: ""), date, start, end))
Text(String(format: NSLocalizedString("%@, from %@ to %@", comment: ""), date, start, end))
.font(.system(size: 16))
.foregroundColor(.onSurface)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct ResourceDetailSheet: View {
let date = confirmationOpen.toDate() ?? "(missing)"
let from = confirmationOpen.convertToHoursAndMinutes() ?? NSLocalizedString("(missing)", comment: "")
let to = confirmationClosed.convertToHoursAndMinutes() ?? NSLocalizedString("(missing)", comment: "")
Text(String(format: NSLocalizedString("%@, from %@ - %@", comment: ""), date, from, to))
Text(String(format: NSLocalizedString("%@, from %@ to %@", comment: ""), date, from, to))
.font(.system(size: 16))
.foregroundColor(.onSurface)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,40 +40,17 @@ struct ResourceCard: View {
onClick()
}, label: {
HStack {
VStack(alignment: .leading, spacing: 10) {
Text(title ?? NSLocalizedString("No title", comment: ""))
.font(.system(size: 17, weight: .medium))
.foregroundColor(.onSurface)
.lineLimit(1)
.truncationMode(.tail)
VStack(alignment: .leading, spacing: 0) {
TitleView(title: title)

if let type = type {
HStack {
Image(systemName: "info.circle")
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
Text(type)
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
}
InformationView(imageName: "info.circle", text: type)
}
if let location = location {
HStack {
Image(systemName: "mappin.and.ellipse")
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
Text(location)
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
}
}
HStack {
Image(systemName: "calendar.badge.clock")
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
Text(String(format: NSLocalizedString("%@, from %@ - %@", comment: ""), date, eventStart, eventEnd))
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
InformationView(imageName: "mappin.and.ellipse", text: location)
}

DateView(date: date, start: eventStart, end: eventEnd)
}
.padding()
Spacer()
Expand All @@ -83,3 +60,54 @@ struct ResourceCard: View {
.buttonStyle(CompactButtonStyle(colored: true))
}
}

struct TitleView: View {
let title: String?

var body: some View {
Text(title ?? NSLocalizedString("No title", comment: ""))
.font(.system(size: 17, weight: .medium))
.foregroundColor(.onSurface)
.lineLimit(1)
.truncationMode(.tail)
}
}

struct InformationView: View {
let imageName: String
let text: String

var body: some View {
VStack (spacing: 0) {
Spacer()
HStack (alignment: .top) {
Image(systemName: imageName)
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
Text(text)
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
}
}
}
}

struct DateView: View {
let date: String
let start: String
let end: String

var body: some View {
VStack (spacing: 0) {
Spacer()
HStack (alignment: .top) {
Image(systemName: "calendar.badge.clock")
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
Text(String(format: NSLocalizedString("%@, from %@ to %@", comment: ""), date, start, end))
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct CompactEventButtonLabel: View {
Image(systemName: "arrow.down")
.font(.system(size: 10, weight: .semibold))
.foregroundColor(.onSurface)
.padding(.vertical, 5)
.padding(.vertical, 7.5)
Text("\(timeTo)")
.font(.system(size: 14, weight: .semibold))
.foregroundColor(.onSurface)
Expand Down
4 changes: 1 addition & 3 deletions Assets/ar.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@

"No date"="بدون تاريخ";

"%@, from %@ - %@"="%@، من %@ - %@";
"%@, from %@ to %@"="%@، من %@ إلى %@";

"Available until"="متاح حتى";

Expand All @@ -379,8 +379,6 @@

"(missing)"="(مفقود)";

"%@, from %@ - %@"="%@، من %@ - %@";

"Confirm booking"="تأكيد الحجز";

"Remove booking"="إزالة الحجز";
Expand Down
4 changes: 1 addition & 3 deletions Assets/bs-BA.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@

"No date"="Nema datuma";

"%@, from %@ - %@"="%@, od %@ - %@";
"%@, from %@ to %@"="%@, od %@ do %@";

"Available until"="Dostupno do";

Expand All @@ -378,8 +378,6 @@

"(missing)"="(nedostaje)";

"%@, from %@ - %@"="%@, od %@ - %@";

"Confirm booking"="Potvrdite rezervaciju";

"Remove booking"="Ukloni rezervaciju";
Expand Down
4 changes: 1 addition & 3 deletions Assets/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@

"No date"="Kein Datum";

"%@, from %@ - %@"="%@, aus %@ - %@";
"%@, from %@ to %@"="%@, von %@ bis %@";

"Available until"="Verfügbar bis";

Expand All @@ -378,8 +378,6 @@

"(missing)"="(fehlen)";

"%@, from %@ - %@"="%@, aus %@ - %@";

"Confirm booking"="Buchung bestätigen";

"Remove booking"="Buchung entfernen";
Expand Down
4 changes: 1 addition & 3 deletions Assets/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@

"No date"="No date";

"%@, from %@ - %@"="%@, from %@ - %@";
"%@, from %@ to %@"="%@, from %@ to %@";

"Available until"="Available until";

Expand All @@ -374,8 +374,6 @@

"(missing)"="(missing)";

"%@, from %@ - %@"="%@, from %@ - %@";

"Confirm booking"="Confirm booking";

"Remove booking"="Remove booking";
Expand Down
4 changes: 1 addition & 3 deletions Assets/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@

"No date"="Pas de date";

"%@, from %@ - %@"="%@, de %@ - %@";
"%@, from %@ to %@"="%@, de %@ à %@";

"Available until"="Disponible jusqu'au";

Expand All @@ -378,8 +378,6 @@

"(missing)"="(manquant)";

"%@, from %@ - %@"="%@, depuis %@ - %@";

"Confirm booking"="Confirmer la réservation";

"Remove booking"="Supprimer la réservation";
Expand Down
4 changes: 1 addition & 3 deletions Assets/it.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@

"No date"="Nessuna data";

"%@, from %@ - %@"="%@, da %@ - %@";
"%@, from %@ to %@"="%@, da %@ a %@";

"Available until"="Disponibile fino";

Expand All @@ -378,8 +378,6 @@

"(missing)"="(mancante)";

"%@, from %@ - %@"="%@, da %@ - %@";

"Confirm booking"="Conferma prenotazione";

"Remove booking"="Rimuovi prenotazione";
Expand Down
4 changes: 1 addition & 3 deletions Assets/sv.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@

"No date"="Inget datum";

"%@, from %@ - %@"="%@, från %@ - %@";
"%@, from %@ to %@"="%@, från %@ till %@";

"Available until"="Tillgänglig till";

Expand All @@ -378,8 +378,6 @@

"(missing)"="(saknas)";

"%@, from %@ - %@"="%@, från %@ - %@";

"Confirm booking"="Bekräfta bokningen";

"Remove booking"="Ta bort bokningen";
Expand Down
10 changes: 2 additions & 8 deletions Tumble.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
D46BB10A298AC31E00887A24 /* DetailsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = D46BB109298AC31E00887A24 /* DetailsBuilder.swift */; };
D46BB112298B0E2800887A24 /* SettingsButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = D46BB111298B0E2800887A24 /* SettingsButton.swift */; };
D46BB118298B21DA00887A24 /* InfoLoading.swift in Sources */ = {isa = PBXBuildFile; fileRef = D46BB117298B21DA00887A24 /* InfoLoading.swift */; };
D46CE0842B8D4C530069207A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = D4CD0F0729D5DC9D00AB5FD0 /* Localizable.strings */; };
D4722149292454560063BDB7 /* tumble_iosApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4722148292454560063BDB7 /* tumble_iosApp.swift */; };
D472214D292454570063BDB7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D472214C292454570063BDB7 /* Assets.xcassets */; };
D4722161292455710063BDB7 /* KronoxManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D472215E292455710063BDB7 /* KronoxManager.swift */; };
Expand Down Expand Up @@ -1364,7 +1365,6 @@
children = (
D4D778E62B8CE6DE00D82C94 /* Assets.xcassets */,
D4D779142B8D12C000D82C94 /* Extensions */,
D4D779112B8D0F6400D82C94 /* Intents */,
D4D7790E2B8D0F5200D82C94 /* Model */,
D4D779082B8CFE0900D82C94 /* Views */,
D4D778E22B8CE6DD00D82C94 /* tumble_iosWidgetBundle.swift */,
Expand Down Expand Up @@ -1401,13 +1401,6 @@
path = Model;
sourceTree = "<group>";
};
D4D779112B8D0F6400D82C94 /* Intents */ = {
isa = PBXGroup;
children = (
);
path = Intents;
sourceTree = "<group>";
};
D4D779142B8D12C000D82C94 /* Extensions */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1715,6 +1708,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D46CE0842B8D4C530069207A /* Localizable.strings in Resources */,
D4D778E72B8CE6DE00D82C94 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
7 changes: 3 additions & 4 deletions Widget/Views/EventViews/MediumEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ struct MediumEvent: View {

var body: some View {
HStack {
VStack(alignment: .leading, spacing: 20) {
VStack(alignment: .leading, spacing: 25) {
VStack(alignment: .leading, spacing: 2) {
Text(event.course?.englishName ?? "")
Text(event.title)
.font(.system(size: 17, weight: .semibold))
.foregroundColor(.onSurface)
Text(event.title)
Text(event.course?.englishName ?? "")
.lineLimit(1)
.truncationMode(.tail)
.font(.system(size: 15))
Expand Down Expand Up @@ -103,6 +103,5 @@ struct MediumEvent_Previews: PreviewProvider {
lastModified: "2024-01-30T10:14:04Z"
))
.previewContext(WidgetPreviewContext(family: .systemMedium))
.widgetBackground(Color.surface)
}
}
15 changes: 9 additions & 6 deletions Widget/Views/EventViews/SmallEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ import WidgetKit

struct SmallEvent: View {
let event: Event

var body: some View {
HStack {
VStack(alignment: .leading, spacing: 10) {
VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: 7.5) {
VStack(alignment: .leading, spacing: 7.5) {
Text(event.title)
.font(.system(size: 16, weight: .semibold))
.font(.system(size: 14, weight: .semibold))
.foregroundColor(.onSurface)
.lineLimit(4)
.lineLimit(3)
Text(event.course?.englishName ?? "")
.lineLimit(3)
.truncationMode(.tail)
.font(.system(size: 12))
.foregroundColor(.onSurface.opacity(0.7))
}
Spacer()
if let timeFrom = event.from.convertToHoursAndMinutesISOString(),
Expand Down Expand Up @@ -78,6 +82,5 @@ struct SmallEvent_Previews: PreviewProvider {
lastModified: "2024-01-30T10:14:04Z"
))
.previewContext(WidgetPreviewContext(family: .systemSmall))
.widgetBackground(Color.surface)
}
}
12 changes: 7 additions & 5 deletions Widget/tumble_iosWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ struct tumble_iosWidget: Widget {

var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: Provider()) { entry in
if let event = entry.event {
WidgetView(event: event)
.widgetBackground(Color.surface)
} else {
Text(LocalizedStringKey("No upcoming events available"))
VStack {
if let event = entry.event {
WidgetView(event: event)
} else {
Text(NSLocalizedString("No upcoming events available", comment: ""))
}
}
.widgetBackground(Color.surface)
}
.configurationDisplayName("Upcoming event")
.description("Shows the earliest upcoming event.")
Expand Down