Files
GoMFT/components/notifications/form/utils/utils.go
T
StarFleetCPTN 28fa65df9d feat: Enhance file metadata and notification components
- Added sorting capabilities to file metadata lists, including SortBy and SortDir fields.
- Integrated a toast notification system for user feedback on actions.
- Updated templates and JavaScript for improved user interaction and responsiveness.
- Refactored file metadata handlers to utilize new sorting features and ensure proper data flow.
- Introduced new notification dialog components for better user confirmation on actions.
2025-03-28 22:22:35 -07:00

29 lines
614 B
Go

package utils
// Contains checks if a string is in a slice.
func Contains(slice []string, str string) bool {
for _, s := range slice {
if s == str {
return true
}
}
return false
}
// BoolToString converts bool to string for HTML attributes.
// Returns "true" for true, "" for false (useful for checked attribute).
func BoolToString(b bool) string {
if b {
return "true"
}
return ""
}
// GetNotificationFormTitle returns the appropriate title for the form.
func GetNotificationFormTitle(isNew bool) string {
if isNew {
return "Add Notification Service"
}
return "Edit Notification Service"
}