basic mark export
This commit is contained in:
parent
fd673de247
commit
b7d5f08978
|
@ -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;
|
10
js/funcs.js
10
js/funcs.js
|
@ -1,3 +1,11 @@
|
||||||
$(document).ready( function () {
|
$(document).ready( function () {
|
||||||
$( "#datepicker" ).datepicker();
|
$("#datepicker").datepicker();
|
||||||
|
|
||||||
|
$("confirm-export").confirm({
|
||||||
|
"text": "Mark current batch exported?",
|
||||||
|
"title": "Export confrimation",
|
||||||
|
confirm: function() {
|
||||||
|
alert('exported!');
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -60,7 +60,7 @@ func addContainer(category_id int, flat, tree map[int]*NewsContainer) {
|
||||||
func Unexported(db *sql.DB) (map[int]*NewsContainer, error) {
|
func Unexported(db *sql.DB) (map[int]*NewsContainer, error) {
|
||||||
categories.LoadCategories(db)
|
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 {
|
if err != nil {
|
||||||
fmt.Println("DB errpr reading unexported news: ", err)
|
fmt.Println("DB errpr reading unexported news: ", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
<h2 class="form-add-heading">List</h2>
|
<h2 class="form-add-heading">List</h2>
|
||||||
{{template "flashes" .}}
|
{{template "flashes" .}}
|
||||||
|
|
||||||
<form class="form-add" action="/" method="post" role="form" class="container col-form">
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-2">
|
<div class="col-xs-2">
|
||||||
<a class="btn btn-lg btn-primary btn-block" href="{{template "launch-add" .}}">Add to transmet</a>
|
<a class="btn btn-lg btn-primary btn-block" href="{{template "launch-add" .}}">Add to transmet</a>
|
||||||
|
@ -11,7 +10,7 @@
|
||||||
<div class="col-xs-4"></div>
|
<div class="col-xs-4"></div>
|
||||||
|
|
||||||
<div class="col-xs-2">
|
<div class="col-xs-2">
|
||||||
<input class="btn btn-lg btn-primary btn-block" type="submit" value="Export" />
|
<button class="confirm-export btn btn-lg btn-primary btn-block" type="submit">Export</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
|
@ -24,7 +23,7 @@ Click this to mark the current queue of news items as exported (clearing them)
|
||||||
<div class="col-xs-12"> </div>
|
<div class="col-xs-12"> </div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
|
|
||||||
<textarea class="form-control" name="template" placeholder="Template" rows="16" cols="80">{{.template}}</textarea>
|
<textarea class="form-control" name="template" placeholder="Template" rows="16" cols="80">{{.template}}</textarea>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue