diff --git a/db/migrations/20150514072125_exported.sql b/db/migrations/20150514072125_exported.sql new file mode 100644 index 0000000..51516e6 --- /dev/null +++ b/db/migrations/20150514072125_exported.sql @@ -0,0 +1,13 @@ + +-- +goose Up +-- SQL in section 'Up' is executed when this migration is applied + +ALTER TABLE news DROP COLUMN exported; +ALTER TABLE news ADD COLUMN exported timestamp DEFAULT NULL; +CREATE INDEX ON news (exported); + +-- +goose Down +-- SQL section 'Down' is executed when this migration is rolled back + +ALTER TABLE news DROP COLUMN exported; +ALTER TABLE news ADD COLUMN exported boolean DEFAULT false; diff --git a/js/funcs.js b/js/funcs.js index d0fad2c..75ba0f4 100644 --- a/js/funcs.js +++ b/js/funcs.js @@ -1,3 +1,11 @@ $(document).ready( function () { - $( "#datepicker" ).datepicker(); + $("#datepicker").datepicker(); + + $("confirm-export").confirm({ + "text": "Mark current batch exported?", + "title": "Export confrimation", + confirm: function() { + alert('exported!'); + }, + }); }); diff --git a/news/news.go b/news/news.go index 934efb3..6c757bd 100644 --- a/news/news.go +++ b/news/news.go @@ -60,7 +60,7 @@ func addContainer(category_id int, flat, tree map[int]*NewsContainer) { func Unexported(db *sql.DB) (map[int]*NewsContainer, error) { categories.LoadCategories(db) - rows, err := db.Query("SELECT url, title, category_id, timestamp, notes FROM news WHERE exported=false order by category_id ASC") + rows, err := db.Query("SELECT url, title, category_id, timestamp, notes FROM news WHERE exported is null order by category_id ASC") if err != nil { fmt.Println("DB errpr reading unexported news: ", err) return nil, err diff --git a/templates/pages/list.html b/templates/pages/list.html index 434bc9d..d8bc9b4 100644 --- a/templates/pages/list.html +++ b/templates/pages/list.html @@ -2,7 +2,6 @@

List

{{template "flashes" .}} -
Add to transmet @@ -11,7 +10,7 @@
- +
@@ -24,7 +23,7 @@ Click this to mark the current queue of news items as exported (clearing them)
 
- +