Custom page link texts, optional post title
This commit is contained in:
@ -7,6 +7,11 @@ struct LocalizedPostDetailView: View {
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
OptionalStringPropertyView(
|
||||
title: "Custom Page Link Text",
|
||||
text: $post.pageLinkText,
|
||||
footer: "The custom text to show for the link to the linked page")
|
||||
|
||||
OptionalStringPropertyView(
|
||||
title: "Preview Title",
|
||||
text: $post.linkPreviewTitle,
|
||||
|
@ -38,7 +38,7 @@ private struct LocalizedTitle: View {
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
TextField("", text: $post.title)
|
||||
OptionalTextField("", text: $post.title)
|
||||
.font(.system(size: 24, weight: .bold))
|
||||
.foregroundStyle(Color.primary)
|
||||
.textFieldStyle(.plain)
|
||||
|
@ -22,7 +22,7 @@ struct PostListView: View {
|
||||
guard !searchString.isEmpty else {
|
||||
return content.posts
|
||||
}
|
||||
return content.posts.filter { $0.localized(in: language).title.contains(searchString) }
|
||||
return content.posts.filter { $0.contains(searchString) }
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
@ -31,7 +31,7 @@ struct PostListView: View {
|
||||
.textFieldStyle(.roundedBorder)
|
||||
.padding(.horizontal, 8)
|
||||
List(filteredPosts, selection: $selectedPost) { post in
|
||||
Text(post.localized(in: language).title).tag(post)
|
||||
Text(post.title(in: language)).tag(post)
|
||||
}
|
||||
}.onAppear {
|
||||
if selectedPost == nil {
|
||||
|
@ -7,6 +7,11 @@ struct LocalizedPostFeedSettingsView: View {
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
StringPropertyView(
|
||||
title: "Default Page Link Text",
|
||||
text: $settings.defaultPageLinkText,
|
||||
footer: "The text to display when linking from a post to a page. Each post can provide a custom text.")
|
||||
|
||||
StringPropertyView(
|
||||
title: "Title",
|
||||
text: $settings.title,
|
||||
|
@ -17,7 +17,7 @@ private struct PostSelectionView: View {
|
||||
let isSelected = post.contains(tag)
|
||||
Image(systemSymbol: isSelected ? .checkmarkCircleFill : .circle)
|
||||
.foregroundStyle(Color.blue)
|
||||
Text(post.localized(in: language).title)
|
||||
Text(post.title(in: language))
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
|
@ -39,7 +39,7 @@ struct TagContentView: View {
|
||||
}
|
||||
Section("Posts") {
|
||||
ForEach(selectedPosts) { post in
|
||||
Text(post.localized(in: language).title)
|
||||
Text(post.title(in: language))
|
||||
}
|
||||
Button(action: { showPostSelection = true }) {
|
||||
Text("Select posts")
|
||||
|
Reference in New Issue
Block a user