aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--model/entry.go29
-rw-r--r--reader/rss/rss.go2
-rw-r--r--sql/schema_version_16.sql1
-rw-r--r--sql/sql.go4
-rw-r--r--storage/entry.go10
-rw-r--r--storage/entry_query_builder.go3
-rw-r--r--storage/migration.go2
-rw-r--r--template/common.go9
-rw-r--r--template/html/common/item_meta.html5
-rw-r--r--template/html/entry.html5
-rw-r--r--template/views.go9
11 files changed, 54 insertions, 25 deletions
diff --git a/model/entry.go b/model/entry.go
index e08e844..2b46daa 100644
--- a/model/entry.go
+++ b/model/entry.go
@@ -20,20 +20,21 @@ const (
// Entry represents a feed item in the system.
type Entry struct {
- ID int64 `json:"id"`
- UserID int64 `json:"user_id"`
- FeedID int64 `json:"feed_id"`
- Status string `json:"status"`
- Hash string `json:"hash"`
- Title string `json:"title"`
- URL string `json:"url"`
- Date time.Time `json:"published_at"`
- Content string `json:"content"`
- Author string `json:"author"`
- Starred bool `json:"starred"`
- Enclosures EnclosureList `json:"enclosures,omitempty"`
- Feed *Feed `json:"feed,omitempty"`
- Category *Category `json:"category,omitempty"`
+ ID int64 `json:"id"`
+ UserID int64 `json:"user_id"`
+ FeedID int64 `json:"feed_id"`
+ Status string `json:"status"`
+ Hash string `json:"hash"`
+ Title string `json:"title"`
+ URL string `json:"url"`
+ CommentsURL string `json:"comments"`
+ Date time.Time `json:"published_at"`
+ Content string `json:"content"`
+ Author string `json:"author"`
+ Starred bool `json:"starred"`
+ Enclosures EnclosureList `json:"enclosures,omitempty"`
+ Feed *Feed `json:"feed,omitempty"`
+ Category *Category `json:"category,omitempty"`
}
// Entries represents a list of entries.
diff --git a/reader/rss/rss.go b/reader/rss/rss.go
index 1cd82ba..bc901db 100644
--- a/reader/rss/rss.go
+++ b/reader/rss/rss.go
@@ -43,6 +43,7 @@ type rssItem struct {
Title string `xml:"title"`
Links []rssLink `xml:"link"`
OriginalLink string `xml:"http://rssnamespace.org/feedburner/ext/1.0 origLink"`
+ Comments string `xml:"comments"`
Description string `xml:"description"`
Content string `xml:"http://purl.org/rss/1.0/modules/content/ encoded"`
PubDate string `xml:"pubDate"`
@@ -219,6 +220,7 @@ func (r *rssItem) GetEnclosures() model.EnclosureList {
func (r *rssItem) Transform() *model.Entry {
entry := new(model.Entry)
entry.URL = r.GetURL()
+ entry.CommentsURL = r.Comments
entry.Date = r.GetDate()
entry.Author = r.GetAuthor()
entry.Hash = r.GetHash()
diff --git a/sql/schema_version_16.sql b/sql/schema_version_16.sql
new file mode 100644
index 0000000..e4f6d23
--- /dev/null
+++ b/sql/schema_version_16.sql
@@ -0,0 +1 @@
+alter table entries add column comments_url text default ''; \ No newline at end of file
diff --git a/sql/sql.go b/sql/sql.go
index f6aa19e..d576d8d 100644
--- a/sql/sql.go
+++ b/sql/sql.go
@@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
-// 2018-03-14 19:16:10.293618552 -0700 PDT m=+0.003182755
+// 2018-04-06 23:00:49.983090069 +0100 BST m=+0.002610702
package sql
@@ -130,6 +130,7 @@ create index feeds_user_category_idx on feeds(user_id, category_id);
alter table integrations add column nunux_keeper_url text default '';
alter table integrations add column nunux_keeper_api_key text default '';`,
"schema_version_15": `alter table enclosures alter column size set data type bigint;`,
+ "schema_version_16": `alter table entries add column comments_url text default '';`,
"schema_version_2": `create extension if not exists hstore;
alter table users add column extra hstore;
create index users_extra_idx on users using gin(extra);
@@ -176,6 +177,7 @@ var SqlMapChecksums = map[string]string{
"schema_version_13": "9073fae1e796936f4a43a8120ebdb4218442fe7d346ace6387556a357c2d7edf",
"schema_version_14": "4622e42c4a5a88b6fe1e61f3d367b295968f7260ab5b96481760775ba9f9e1fe",
"schema_version_15": "13ff91462bdf4cda5a94a4c7a09f757761b0f2c32b4be713ba4786a4837750e4",
+ "schema_version_16": "9d006faca62fd7ab787f64aef0e0a5933d142466ec4cab0e096bb920d2797e34",
"schema_version_2": "e8e9ff32478df04fcddad10a34cba2e8bb1e67e7977b5bd6cdc4c31ec94282b4",
"schema_version_3": "a54745dbc1c51c000f74d4e5068f1e2f43e83309f023415b1749a47d5c1e0f12",
"schema_version_4": "216ea3a7d3e1704e40c797b5dc47456517c27dbb6ca98bf88812f4f63d74b5d9",
diff --git a/storage/entry.go b/storage/entry.go
index 7df88c3..d56d5de 100644
--- a/storage/entry.go
+++ b/storage/entry.go
@@ -25,9 +25,9 @@ func (s *Storage) NewEntryQueryBuilder(userID int64) *EntryQueryBuilder {
func (s *Storage) createEntry(entry *model.Entry) error {
query := `
INSERT INTO entries
- (title, hash, url, published_at, content, author, user_id, feed_id)
+ (title, hash, url, comments_url, published_at, content, author, user_id, feed_id)
VALUES
- ($1, $2, $3, $4, $5, $6, $7, $8)
+ ($1, $2, $3, $4, $5, $6, $7, $8, $9)
RETURNING id
`
err := s.db.QueryRow(
@@ -35,6 +35,7 @@ func (s *Storage) createEntry(entry *model.Entry) error {
entry.Title,
entry.Hash,
entry.URL,
+ entry.CommentsURL,
entry.Date,
entry.Content,
entry.Author,
@@ -82,14 +83,15 @@ func (s *Storage) UpdateEntryContent(entry *model.Entry) error {
func (s *Storage) updateEntry(entry *model.Entry) error {
query := `
UPDATE entries SET
- title=$1, url=$2, content=$3, author=$4
- WHERE user_id=$5 AND feed_id=$6 AND hash=$7
+ title=$1, url=$2, comments_url=$3, content=$4, author=$5
+ WHERE user_id=$6 AND feed_id=$7 AND hash=$8
RETURNING id
`
err := s.db.QueryRow(
query,
entry.Title,
entry.URL,
+ entry.CommentsURL,
entry.Content,
entry.Author,
entry.UserID,
diff --git a/storage/entry_query_builder.go b/storage/entry_query_builder.go
index 6650dbb..4525ce5 100644
--- a/storage/entry_query_builder.go
+++ b/storage/entry_query_builder.go
@@ -158,7 +158,7 @@ func (e *EntryQueryBuilder) GetEntries() (model.Entries, error) {
query := `
SELECT
e.id, e.user_id, e.feed_id, e.hash, e.published_at at time zone u.timezone, e.title,
- e.url, e.author, e.content, e.status, e.starred,
+ e.url, e.comments_url, e.author, e.content, e.status, e.starred,
f.title as feed_title, f.feed_url, f.site_url, f.checked_at,
f.category_id, c.title as category_title, f.scraper_rules, f.rewrite_rules, f.crawler,
fi.icon_id,
@@ -199,6 +199,7 @@ func (e *EntryQueryBuilder) GetEntries() (model.Entries, error) {
&entry.Date,
&entry.Title,
&entry.URL,
+ &entry.CommentsURL,
&entry.Author,
&entry.Content,
&entry.Status,
diff --git a/storage/migration.go b/storage/migration.go
index 9d6316a..d7d40e8 100644
--- a/storage/migration.go
+++ b/storage/migration.go
@@ -12,7 +12,7 @@ import (
"github.com/miniflux/miniflux/sql"
)
-const schemaVersion = 15
+const schemaVersion = 16
// Migrate run database migrations.
func (s *Storage) Migrate() {
diff --git a/template/common.go b/template/common.go
index 8240b2d..197478e 100644
--- a/template/common.go
+++ b/template/common.go
@@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
-// 2018-02-24 17:47:34.998457627 +0000 GMT
+// 2018-04-06 23:04:38.601763638 +0100 BST m=+0.010102865
package template
@@ -63,6 +63,11 @@ var templateCommonMap = map[string]string{
data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}"
>{{ if eq .entry.Status "read" }}✘ {{ t "Unread" }}{{ else }}✔ {{ t "Read" }}{{ end }}</a>
</li>
+ {{ if .entry.CommentsURL }}
+ <li>
+ <a href="{{ .entry.CommentsURL }}" title="{{ t "View Comments" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Comments" }}</a>
+ </li>
+ {{ end }}
</ul>
</div>
{{ end }}`,
@@ -215,7 +220,7 @@ var templateCommonMap = map[string]string{
var templateCommonMapChecksums = map[string]string{
"entry_pagination": "f1465fa70f585ae8043b200ec9de5bf437ffbb0c19fb7aefc015c3555614ee27",
- "item_meta": "4796b74adca0567f3dbf8bdf6ac8cda59f455ea34cb6d4a92c83660fa72a883d",
+ "item_meta": "c14b5b36076e087346def2ebcef4876ed5e8165218f40dc017db44e754c22d03",
"layout": "c7565e2cf904612e236bc1d7167c6c124ffe5d27348608eb5c2336606f266896",
"pagination": "6ff462c2b2a53bc5448b651da017f40a39f1d4f16cef4b2f09784f0797286924",
}
diff --git a/template/html/common/item_meta.html b/template/html/common/item_meta.html
index 5b00d9a..7d83c15 100644
--- a/template/html/common/item_meta.html
+++ b/template/html/common/item_meta.html
@@ -38,6 +38,11 @@
data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}"
>{{ if eq .entry.Status "read" }}✘ {{ t "Unread" }}{{ else }}✔ {{ t "Read" }}{{ end }}</a>
</li>
+ {{ if .entry.CommentsURL }}
+ <li>
+ <a href="{{ .entry.CommentsURL }}" title="{{ t "View Comments" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Comments" }}</a>
+ </li>
+ {{ end }}
</ul>
</div>
{{ end }} \ No newline at end of file
diff --git a/template/html/entry.html b/template/html/entry.html
index 237acf4..55d0390 100644
--- a/template/html/entry.html
+++ b/template/html/entry.html
@@ -36,6 +36,11 @@
data-label-done="{{ t "Done!" }}"
>{{ t "Fetch original content" }}</a>
</li>
+ {{ if .entry.CommentsURL }}
+ <li>
+ <a href="{{ .entry.CommentsURL }}" title="{{ t "View Comments" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Comments" }}</a>
+ </li>
+ {{ end }}
</ul>
</div>
<div class="entry-meta">
diff --git a/template/views.go b/template/views.go
index 6f04da9..d8116d1 100644
--- a/template/views.go
+++ b/template/views.go
@@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
-// 2018-03-01 23:04:58.998374277 -0800 PST m=+0.022158179
+// 2018-04-06 23:00:49.988275328 +0100 BST m=+0.007796083
package template
@@ -501,6 +501,11 @@ var templateViewsMap = map[string]string{
data-label-done="{{ t "Done!" }}"
>{{ t "Fetch original content" }}</a>
</li>
+ {{ if .entry.CommentsURL }}
+ <li>
+ <a href="{{ .entry.CommentsURL }}" title="{{ t "View Comments" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Comments" }}</a>
+ </li>
+ {{ end }}
</ul>
</div>
<div class="entry-meta">
@@ -1233,7 +1238,7 @@ var templateViewsMapChecksums = map[string]string{
"edit_category": "cee720faadcec58289b707ad30af623d2ee66c1ce23a732965463250d7ff41c5",
"edit_feed": "d2c1c8486d7faf4ee58151ccf3e3c690e53bd6872050d291c5db8452a83c3d53",
"edit_user": "321e0a60cf3bf7441bff970f4920e4c5b7c1883f80ab1d1674f8137954b25033",
- "entry": "27ea028515e79beb546f0b2792a3918c455fd877eea4c41d1a061f8e7b54a430",
+ "entry": "656a33552c3662c5d38a6178c811316ff55b38460b1f57d4087d51d631efe896",
"feed_entries": "420da786e827a77fecc8794207d158af3a30e489ca2b2019f48d5228919af4a7",
"feeds": "2a5abe37968ea34a0576dbef52341645cb1fc9562e351382fbf721491da6f4fa",
"history": "967bc95236269ab3a77455910aca1939f43f93171fe1af77eb3b1b4eac579e55",