-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1948 from nextcloud/set-out-of-office
Set out of office
Showing
24 changed files
with
699 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct AbsenceLabelView: View { | ||
@Binding var absenceStatus: UserAbsence? | ||
|
||
var replacement: AttributedString { | ||
var result = AttributedString("Replacement") | ||
result.font = .preferredFont(for: .body, weight: .bold) | ||
return result | ||
} | ||
|
||
var body: some View { | ||
VStack(alignment: .leading) { | ||
if let absenceStatus, absenceStatus.isValid { | ||
if absenceStatus.firstDay == absenceStatus.lastDay { | ||
Text(absenceStatus.firstDay.format(dateStyle: .medium)) | ||
.foregroundColor(.primary) | ||
} else { | ||
Text(absenceStatus.firstDay.format(dateStyle: .medium) + " - " + absenceStatus.lastDay.format(dateStyle: .medium)) | ||
.foregroundColor(.primary) | ||
} | ||
|
||
if absenceStatus.hasReplacementSet { | ||
// Make genstrings happy | ||
let displayedString = NSLocalizedString("Replacement", comment: "Replacement in case of out of office") + ": " + absenceStatus.replacementName | ||
Text(verbatim: displayedString) | ||
.foregroundStyle(.primary) | ||
} | ||
|
||
Text(absenceStatus.messageOrStatus) | ||
.foregroundColor(.secondary) | ||
.padding(.top, 8) | ||
} else { | ||
Text("Configure your next absence period") | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
// | ||
|
||
import SwiftUI | ||
import NextcloudKit | ||
|
||
struct ButtonContainerSwiftUI<Content: View>: View { | ||
var content: () -> Content | ||
|
||
@Environment(\.horizontalSizeClass) var horizontalSizeClass | ||
|
||
init(@ViewBuilder content: @escaping () -> Content) { | ||
self.content = content | ||
} | ||
|
||
var body: some View { | ||
if horizontalSizeClass == .compact { | ||
VStack(spacing: 10, content: content) | ||
.padding(.bottom, 16) | ||
} else { | ||
HStack(spacing: 10) { | ||
Spacer() | ||
content() | ||
Spacer() | ||
} | ||
.padding(.bottom, 16) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.