From: Andrew Dolgov Date: Fri, 8 Apr 2011 11:37:50 +0000 (+0400) Subject: rework feed update errors and inactive feeds dialogs X-Git-Tag: 1.5.3~65 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e57e73ef29e050fd33223b009397c5d6c13d38e9;p=tt-rss.git rework feed update errors and inactive feeds dialogs --- diff --git a/functions.js b/functions.js index e9a6d928..3b18b007 100644 --- a/functions.js +++ b/functions.js @@ -1521,4 +1521,59 @@ function feedBrowser() { } } +function showFeedsWithErrors() { + try { + var query = "backend.php?op=dlg&id=feedsWithErrors"; + + if (dijit.byId("errorFeedsDlg")) + dijit.byId("errorFeedsDlg").destroyRecursive(); + + dialog = new dijit.Dialog({ + id: "errorFeedsDlg", + title: __("Feeds with update errors"), + style: "width: 600px", + getSelectedFeeds: function() { + return getSelectedTableRowIds("prefErrorFeedList"); + }, + removeSelected: function() { + var sel_rows = this.getSelectedFeeds(); + + console.log(sel_rows); + + if (sel_rows.length > 0) { + var ok = confirm(__("Remove selected feeds?")); + + if (ok) { + notify_progress("Removing selected feeds...", true); + + var query = "?op=pref-feeds&subop=remove&ids="+ + param_escape(sel_rows.toString()); + + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + notify(''); + dialog.hide(); + updateFeedList(); + } }); + } + + } else { + alert(__("No feeds are selected.")); + } + }, + execute: function() { + if (this.validate()) { + } + }, + href: query}); + + dialog.show(); + + } catch (e) { + exception_error("showFeedsWithErrors", e); + } + +} + diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php index 3192ac57..dbbd1fb3 100644 --- a/modules/popup-dialog.php +++ b/modules/popup-dialog.php @@ -580,15 +580,13 @@ type=\"checkbox\">"; print ""; - print "". - htmlspecialchars($line["title"])." (". - "".__("feed").")"; + print "". + htmlspecialchars($line["title"]).""; print ""; - print make_local_datetime($link, $line['last_article']); + print make_local_datetime($link, $line['last_article'], false); print ""; print ""; @@ -611,39 +609,65 @@ } - if ($id == "feedUpdateErrors") { + if ($id == "feedsWithErrors") { - print "".__('Feeds with update errors').""; - print "".__('Feeds with update errors').""; +# print ""; + print "
"; + + print ""; + + $lnum = 1; while ($line = db_fetch_assoc($result)) { - print "
  • ". - htmlspecialchars($line["title"])." (". - "".__("feed")."): ". - $line["last_error"]."
  • "; + + $class = ($lnum % 2) ? "even" : "odd"; + $feed_id = $line["id"]; + $this_row_id = "id=\"FUPDD-$feed_id\""; + + print ""; + + $edit_title = htmlspecialchars($line["title"]); + + print ""; + print ""; + print ""; + + ++$lnum; } - print ""; + print "
    "; + + print "". + htmlspecialchars($line["title"]).": "; + + print ""; + print htmlspecialchars($line["last_error"]); + print ""; + + print "
    "; + print "
    "; - print "
    "; + print "
    "; + print "
    "; + print " "; + print "
    "; - print ""; - print "]]>"; - - //return; + print "
    "; } if ($id == "editArticleTags") { diff --git a/prefs.js b/prefs.js index 9bca57cd..05052093 100644 --- a/prefs.js +++ b/prefs.js @@ -1159,10 +1159,6 @@ function editFeedCats() { } } -function showFeedsWithErrors() { - displayDlg('feedUpdateErrors'); -} - function showInactiveFeeds() { try { var query = "backend.php?op=dlg&id=inactiveFeeds"; diff --git a/tt-rss.js b/tt-rss.js index ac85b782..cb3fa26f 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -995,10 +995,6 @@ function reverseHeadlineOrder() { } } -function showFeedsWithErrors() { - displayDlg('feedUpdateErrors'); -} - function scheduleFeedUpdate(id, is_cat) { try { if (!id) {