summaryrefslogtreecommitdiff
path: root/view.go
diff options
context:
space:
mode:
Diffstat (limited to 'view.go')
-rw-r--r--view.go37
1 files changed, 0 insertions, 37 deletions
diff --git a/view.go b/view.go
deleted file mode 100644
index 4ee430e..0000000
--- a/view.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package main
-
-import (
- "fmt"
- "time"
-
- tea "charm.land/bubbletea/v2"
-)
-
-func (m model) View() tea.View {
- s := "Unpublished drafts of this Hugo site:\n\n"
-
- for i, choice := range m.choices {
- cursor := " " // no cursor
- if m.cursor == i {
- cursor = ">"
- }
-
- checked := " " // not checked
- if _, ok := m.selected[i]; ok {
- checked = "x"
- }
-
- title := choice[2]
- t, err := time.Parse(time.RFC3339, choice[3])
- if err != nil {
-
- }
- datetime := t.Format("2006-01-02 15:04")
-
- s += fmt.Sprintf("%s [%s] %s \t %s\n", cursor, checked, datetime, title)
- }
-
- s += "\n[q] quit | [Enter] edit | [SPACE] select | [↑/k] up | [↓/j] down\n"
-
- return tea.NewView(s)
-}