]> git.wh0rd.org - tt-rss.git/commitdiff
rework filter and label edit/create dialog layouts
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 6 Aug 2008 06:47:56 +0000 (07:47 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 6 Aug 2008 06:47:56 +0000 (07:47 +0100)
modules/popup-dialog.php
modules/pref-filters.php
modules/pref-labels.php
tt-rss.css

index 1dc381979ed2b713d3aa1d592946402b403c06a2..baead1c37aa479dc5618aba49b624d952dfbc70c 100644 (file)
                        print "<input type=\"hidden\" name=\"op\" value=\"pref-labels\">";
                        print "<input type=\"hidden\" name=\"subop\" value=\"add\">"; 
 
-                       print "<table width='100%'>";
+                       print "<div class=\"dlgSec\">".__("Caption")."</div>";
+
+                       print "<div class=\"dlgSecCont\">";
 
-                       print "<tr><td>".__('Caption:')."</td>
-                               <td><input onkeypress=\"return filterCR(event, addLabel)\"
+                       print "<input onkeypress=\"return filterCR(event, labelEditSave)\"
                                        onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
                                        onchange=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
-                                       name=\"description\" class=\"iedit\">";
+                                        name=\"description\" size=\"30\" value=\"$description\">";
+                       print "</div>";
 
-                       print "</td></tr>";
+                       print "<div class=\"dlgSec\">".__("Match SQL")."</div>";
 
-                       print "<tr><td colspan=\"2\">
-                               <p>".__('SQL Expression:')."</p>";
+                       print "<div class=\"dlgSecCont\">";
 
                        print "<textarea onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
-                                        rows=\"4\" name=\"sql_exp\" class=\"iedit\"></textarea>";
-                       print "</td></tr></table>";
+                                        rows=\"6\" name=\"sql_exp\" class=\"labelSQL\" cols=\"50\">$sql_exp</textarea>";
+
+                       print "</div>";
 
                        print "</form>";
 
                        print "<div style=\"display : none\" id=\"label_test_result\"></div>";
 
-                       print "<div align='right'>";
+                       print "<div class=\"dlgButtons\">";
 
                        print "<div style='float : left'>";
                        print "<input type=\"submit\" 
                                $filter_types[$line["id"]] = __($line["description"]);
                        }
 
-                       print "<table width='100%'>";
+/*                     print "<table width='100%'>";
 
                        print "<tr><td>".__('Match:')."</td>
                                <td><input onkeypress=\"return filterCR(event, createFilter)\"
 
                        print "</table>";
 
+                       print "</form>"; */
+
+                       print "<div class=\"dlgSec\">".__("Match")."</div>";
+
+                       print "<div class=\"dlgSecCont\">";
+
+                       print "<input onkeypress=\"return filterCR(event, filterEditSave)\"
+                                        onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
+                                        onchange=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
+                                        name=\"reg_exp\" size=\"30\" value=\"$reg_exp\">";
+
+                       print " " . __("on field") . " ";
+                       print_select_hash("filter_type", 1, $filter_types);
+
+                       print "<br/>";
+
+                       print __("in") . " ";
+                       print_feed_select($link, "feed_id", $active_feed_id);
+
+                       print "</div>";
+
+                       print "<div class=\"dlgSec\">".__("Perform action")."</div>";
+
+                       print "<div class=\"dlgSecCont\">";
+
+                       print "<select name=\"action_id\"
+                               onchange=\"filterDlgCheckAction(this)\">";
+       
+                       $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions 
+                               ORDER BY name");
+
+                       while ($line = db_fetch_assoc($result)) {
+                               printf("<option value='%d'>%s</option>", $line["id"], __($line["description"]));
+                       }
+       
+                       print "</select>";
+
+                       print " " . __("with params") . " ";
+
+                       print "<input disabled size=\"20\"
+                               name=\"action_param\">";
+
+                       print "</div>";
+
+                       print "<div class=\"dlgSec\">".__("Options")."</div>";
+                       print "<div class=\"dlgSecCont\">";
+
+                       print "<input type=\"checkbox\" name=\"enabled\" id=\"enabled\" checked=\"1\">
+                                       <label for=\"enabled\">".__('Enabled')."</label><br/>";
+
+                       print "<input type=\"checkbox\" name=\"inverse\" id=\"inverse\">
+                               <label for=\"inverse\">".__('Inverse match')."</label>";
+
+                       print "</div>";
+
                        print "</form>";
 
-                       print "<div align='right'>";
+                       print "<div class=\"dlgButtons\">";
 
                        print "<input type=\"submit\" 
                                id=\"infobox_submit\"
index b7f29705ecd5bd09075f424f16a3cd2a9eccfa31..49fed08b5a65fa7e1965c7ca449ca2728081e526 100644 (file)
@@ -38,7 +38,7 @@
                                $filter_types[$line["id"]] = __($line["description"]);
                        }
 
-                       print "<table width='100%'>";
+/*                     print "<table width='100%'>";
 
                        print "<tr><td>".__('Match:')."</td>
                                <td><input onkeypress=\"return filterCR(event, filterEditSave)\"
 
                        print "</form>";
 
-                       print "<div align='right'>";
+                       print "<hr>"; */
+
+                       print "<div class=\"dlgSec\">".__("Match")."</div>";
+
+                       print "<div class=\"dlgSecCont\">";
+
+                       print "<input onkeypress=\"return filterCR(event, filterEditSave)\"
+                                        onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
+                                        onchange=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
+                                        name=\"reg_exp\" size=\"30\" value=\"$reg_exp\">";
+
+                       print " " . __("on field") . " ";
+                       print_select_hash("filter_type", $filter_type, $filter_types);
+
+                       print "<br/>";
+
+                       print __("in") . " ";
+                       print_feed_select($link, "feed_id", $feed_id);
+
+                       print "</div>";
+
+                       print "<div class=\"dlgSec\">".__("Perform action")."</div>";
+
+                       print "<div class=\"dlgSecCont\">";
+
+                       print "<select name=\"action_id\"
+                               onchange=\"filterDlgCheckAction(this)\">";
+       
+                       $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions 
+                               ORDER BY name");
+
+                       while ($line = db_fetch_assoc($result)) {
+                               $is_sel = ($line["id"] == $action_id) ? "selected" : "";                        
+                               printf("<option value='%d' $is_sel>%s</option>", $line["id"], __($line["description"]));
+                       }
+       
+                       print "</select>";
+
+                       print " " . __("with params") . " ";
+
+                       $param_disabled = ($action_id == 4 || $action_id == 6) ? "" : "disabled";
+
+                       print "<input $param_disabled size=\"20\"
+                               name=\"action_param\" value=\"$action_param\">";
+
+                       print "</div>";
+
+                       print "<div class=\"dlgSec\">".__("Options")."</div>";
+                       print "<div class=\"dlgSecCont\">";
+
+                       if ($enabled) {
+                               $checked = "checked";
+                       } else {
+                               $checked = "";
+                       }
+
+                       print "<input type=\"checkbox\" name=\"enabled\" id=\"enabled\" $checked>
+                                       <label for=\"enabled\">".__('Enabled')."</label><br/>";
+
+                       if ($inverse) {
+                               $checked = "checked";
+                       } else {
+                               $checked = "";
+                       }
+
+                       print "<input type=\"checkbox\" name=\"inverse\" id=\"inverse\" $checked>
+                               <label for=\"inverse\">".__('Inverse match')."</label>";
+
+                       print "</div>";
+
+                       print "<div class=\"dlgButtons\">";
 
                        print "<input type=\"submit\" 
                                id=\"infobox_submit\"
index fda73ecf069e6436be1268de805d63bcbd7abc6d..9eeb54174ff2820193436d39ff2a4695bd6d63fb 100644 (file)
                        print "<input type=\"hidden\" name=\"id\" value=\"$label_id\">";
                        print "<input type=\"hidden\" name=\"subop\" value=\"editSave\">"; 
 
-                       print "<table width='100%'>";
+                       print "<div class=\"dlgSec\">".__("Caption")."</div>";
 
-                       print "<tr><td>Caption:</td>
-                               <td><input onkeypress=\"return filterCR(event, labelEditSave)\"
+                       print "<div class=\"dlgSecCont\">";
+
+                       print "<input onkeypress=\"return filterCR(event, labelEditSave)\"
                                        onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
                                        onchange=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
-                                        name=\"description\" class=\"iedit\" value=\"$description\">";
+                                        name=\"description\" size=\"30\" value=\"$description\">";
+                       print "</div>";
 
-                       print "</td></tr>";
+                       print "<div class=\"dlgSec\">".__("Match SQL")."</div>";
 
-                       print "<tr><td colspan=\"2\">
-                               <p>SQL Expression:</p>";
+                       print "<div class=\"dlgSecCont\">";
 
                        print "<textarea onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
-                                        rows=\"4\" name=\"sql_exp\" class=\"iedit\">$sql_exp</textarea>";
-                       print "</td></tr></table>";
+                                        rows=\"6\" name=\"sql_exp\" class=\"labelSQL\" cols=\"50\">$sql_exp</textarea>";
+
+                       print "</div>";
 
                        print "</form>";
 
                        print "<div style=\"display : none\" id=\"label_test_result\"></div>";
 
-                       print "<div align='right'>";
+                       print "<div class=\"dlgButtons\">";
 
                        print "<div style='float : left'>";
                        print "<input type=\"submit\" 
index 17cc8e9361f312665e1ce1d6ef744f8676608bc6..322d3b6788cc44e8a6d46a77db277b0afa4bf767 100644 (file)
@@ -2002,3 +2002,33 @@ div#l_progress_i {
        bottom : 0px;
        top : 6px; 
 }
+
+div.dlgSec {
+       font-size : 14px;
+       color : gray;
+       font-weight : bold;
+       clear : both;
+       height : 20px;
+}
+
+div.dlgSecCont {
+       position : relative;
+       left : 150px;
+       top : -20px;
+       float : left;
+       font-size : 12px;
+       font-weight : medium;
+}
+
+div.dlgButtons {
+       text-align : right;
+       clear : both;
+}
+
+textarea.labelSQL {
+       font-family : monospace;
+}
+
+div#label_test_result {
+       clear : both;
+}