diff options
author | Adam Mathes <adam@trenchant.org> | 2018-04-22 18:43:49 -0700 |
---|---|---|
committer | Adam Mathes <adam@trenchant.org> | 2018-04-22 18:43:49 -0700 |
commit | 0a6d8c78730f1da263a855d1f17c0ff92ac1070a (patch) | |
tree | 5b55c350f99f499c74d2379d33576763f688d994 | |
parent | b376d197b51f2e67c314e23b8ac484dc2ae8f4a5 (diff) | |
download | neko-0a6d8c78730f1da263a855d1f17c0ff92ac1070a.tar.gz neko-0a6d8c78730f1da263a855d1f17c0ff92ac1070a.tar.bz2 neko-0a6d8c78730f1da263a855d1f17c0ff92ac1070a.zip |
wip category stuff
-rw-r--r-- | models/feed/feed.go | 1 | ||||
-rw-r--r-- | static/style.css | 4 | ||||
-rw-r--r-- | static/ui.html | 10 | ||||
-rw-r--r-- | static/ui.js | 12 |
4 files changed, 21 insertions, 6 deletions
diff --git a/models/feed/feed.go b/models/feed/feed.go index 17f344f..ce7aafe 100644 --- a/models/feed/feed.go +++ b/models/feed/feed.go @@ -85,7 +85,6 @@ func (f *Feed) Update() { } func (f *Feed) Delete() { - log.Println("lets delete some shiteeee") _, err := models.DB.Exec(`DELETE FROM feed WHERE id=?`, f.Id) if err != nil { diff --git a/static/style.css b/static/style.css index 8a3e1a3..a91915a 100644 --- a/static/style.css +++ b/static/style.css @@ -29,6 +29,10 @@ p, ul { margin-bottom: 1.25rem; } +#filters h4 { + margin-bottom: 0; +} + blockquote { padding: 1rem 1rem 0 1rem; } diff --git a/static/ui.html b/static/ui.html index a7bd3a4..8604e43 100644 --- a/static/ui.html +++ b/static/ui.html @@ -26,13 +26,12 @@ <h4 onclick="$('#feeds').toggle();">Feeds</h4> <ul id="feeds" style="display: none;"> - <li><a href="/import/">import</a></li> </ul> </div> <div id="c"> - <div id="items"> + <div id="items"> </div> </div> @@ -70,9 +69,14 @@ {{else}} ${feed.url} {{/if}} + </span> + {{if feed.category}} + <i>${feed.category}</i> + {{/if}} + <span class="edit">[edit]</span> - <span class="delete" style="color: red;">[X]</span> + <span class="delete">[x]</span> </script> <script id="controls_template" type="text/jqtmp"> diff --git a/static/ui.js b/static/ui.js index 49f6ad0..6dcb6ab 100644 --- a/static/ui.js +++ b/static/ui.js @@ -465,6 +465,7 @@ var FeedView = Backbone.View.extend({ events: { "click .txt": "filterTo", "click .delete": "del", + "click .edit": "edit", }, initialize: function() { _.bindAll(this, 'render', 'filterTo', "del"); @@ -480,8 +481,15 @@ var FeedView = Backbone.View.extend({ App.filterToFeed(this.model); }, del: function() { - this.model.destroy(); - this.$el.remove(); + if( window.confirm("Unsubscribe from " + this.model.get("url") + "?" ) ) { + this.model.destroy(); + this.$el.remove(); + } + }, + edit: function() { + var cat = window.prompt("Category for this feed?", this.model.get("category")); + this.model.set("category", cat); + this.model.save(); }, }); |