diff --git a/handlers.go b/handlers.go index 8107de9..bea847a 100644 --- a/handlers.go +++ b/handlers.go @@ -96,7 +96,6 @@ func handleMetricsDisplay(w http.ResponseWriter, _ *http.Request) { } func handleCreateFeed(w http.ResponseWriter, r *http.Request, secret *string) { - tmpl := template.Must(template.ParseFiles(fmt.Sprintf("%s/created.html", s.TemplatePath))) metrics.CreateRequests.Inc() entry := createFeed(r, secret) @@ -125,6 +124,7 @@ func handleCreateFeed(w http.ResponseWriter, r *http.Request, secret *string) { ErrorMessage: entry.ErrorMessage, } + tmpl := template.Must(template.ParseFiles(fmt.Sprintf("%s/created.html", s.TemplatePath))) err := tmpl.Execute(w, data) if err != nil { log.Print("[ERROR] ", err) @@ -243,52 +243,8 @@ func handleDeleteFeed(w http.ResponseWriter, r *http.Request) { log.Printf("[ERROR] could not delete feed '%q'...Error: %s ", feedPubkey, err) } - /*items, err := getSavedEntries() - if err != nil { - log.Printf("[ERROR] %s", err) - http.Error(w, err.Error(), http.StatusInternalServerError) - } - - npub, _ := nip19.EncodePublicKey(s.RelayPubkey) - tmpl := template.Must(template.ParseFiles(fmt.Sprintf("%s/index.html", s.TemplatePath))) - - data := struct { - RelayName string - RelayPubkey string - RelayNPubkey string - RelayDescription string - RelayURL string - Count int - Entries []GUIEntry - KindTextNoteCreated string - KindTextNoteDeleted string - QueryEventsRequests string - NotesBlasted string - }{ - RelayName: s.RelayName, - RelayPubkey: s.RelayPubkey, - RelayNPubkey: npub, - RelayDescription: s.RelayDescription, - RelayURL: s.RelayURL, - Count: len(items), - Entries: items, - KindTextNoteCreated: getPrometheusMetric(metrics.KindTextNoteCreated.Desc()), - KindTextNoteDeleted: getPrometheusMetric(metrics.KindTextNoteDeleted.Desc()), - QueryEventsRequests: getPrometheusMetric(metrics.QueryEventsRequests.Desc()), - NotesBlasted: getPrometheusMetric(metrics.NotesBlasted.Desc()), - } */ - - //http.Redirect(w, r, "/", http.StatusTemporaryRedirect) - tmpl := template.New("t") tmpl.Execute(w, nil) - - /* - if err := tmpl.Execute(w, data); err != nil { - log.Printf("[ERROR] %s", err) - http.Error(w, err.Error(), http.StatusInternalServerError) - } - */ } func handleImportOpml(w http.ResponseWriter, r *http.Request) { diff --git a/web/assets/css/styles.css b/web/assets/css/styles.css index a48398c..5e1800f 100644 --- a/web/assets/css/styles.css +++ b/web/assets/css/styles.css @@ -23,4 +23,8 @@ padding: .125em; } +tr.htmx-swapping td { + opacity: 0; + transition: opacity 1s ease-out; + } diff --git a/web/templates/index.html b/web/templates/index.html index 936a6ce..564a246 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -1,4 +1,5 @@ - + + @@ -7,201 +8,220 @@ - + {{.RelayName}} - -
- -
- -
-
- -
-
-
- - - +
-

Getting Started:

-
-
    -
  1. Add the URL of an RSS or Atom feed below in the Get Public Key box and click the button to get its corresponding nostr public key. -
  2. If you have an opml file, import RSS feeds using the Import link at the top of the page.
  3. -
  4. Add your rssnotes relay to your Nostr client: wss://{{.RelayURL}}
  5. -
  6. To follow an rss feed using your existing nostr profile. Follow the feed's public key from your Nostr client.
  7. -
  8. To follow all rss feeds using the relay's public key. Login to nostr using the relay's public key from your Nostr client.
  9. -
- -
- -
-

Create a nostr profile for a RSS feed:

-
-
-
- + + +

Getting Started:

+
+
    +
  1. Add the URL of an RSS or Atom feed below in the Get Public Key box and click the + button to get its corresponding nostr public key. +
  2. If you have an opml file, import RSS feeds using the Import link at the top of the + page.
  3. +
  4. Add your rssnotes relay to your Nostr client: wss://{{.RelayURL}}
  5. +
  6. To follow an rss feed using your existing nostr profile. Follow the feed's public + key from your Nostr client.
  7. +
  8. To follow all rss feeds using the relay's public key. Login to nostr using the + relay's public key from your Nostr client.
  9. +
+ +
+ +
+

Create a nostr profile for a RSS feed:

+
+
+
+ +
+
+ +
+
+
+
-

Existing feeds:

- - - - - - - - - - - - {{range .Entries}} - - - - - - - - {{end}} - -
IconFeed URLPublic keys (npub / hex)SubscribeManage
feed icon{{.BookmarkEntity.URL}} - {{.NPubKey}} -

---

- {{.BookmarkEntity.PubKey}} -
npub qrcode - -
-

-
-
-
-

- rssnotes original work by fiatjaf and piraces modifications by trinidz. The source code is - UNlicensed. Keep the good vibes 🤙 +

+
+

Search feeds by URL (min. 5 characters):

+
+
+ +
+
+ +
+
+
+
+ +

Existing feeds:

+ + + + + + + + + + + + {{ block "feeds-display-fragment" .}} + {{range .Entries}} + + + + + + + + {{end}} + {{end}} + +
IconFeed URLPublic keys (npub / hex)SubscribeManage
feed icon{{.BookmarkEntity.URL}} + + {{.NPubKey}} +

---

+ {{.BookmarkEntity.PubKey}} +
npub qrcode + +

-
+ + \ No newline at end of file