Commit 143e759f authored by Franco Fichtner's avatar Franco Fichtner

ids: first pass for simpler ruleset handling #1129

This does:

o Enable/disable all text as opposed to confusing icons of
  checkboxes.  Also mark them as "primary".
o Make the info button a pencil / edit button as we can modify
  data from there.
o Minor cleanups.

Missing:

o Removing the toggle buttons for each rule (the edit button
  is sufficient).  Haven't done this because the rowtoggle
  mechanism is probably better adapted by @adschellevis.
o Maybe move the enable disable all buttons back to the bottom.
parent 1611955b
...@@ -226,7 +226,7 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -226,7 +226,7 @@ POSSIBILITY OF SUCH DAMAGE.
rowCount:[10, 25, 50,100,500,1000] , rowCount:[10, 25, 50,100,500,1000] ,
formatters:{ formatters:{
rowtoggle: function (column, row) { rowtoggle: function (column, row) {
var toggle = " <button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.sid + "\"><span class=\"fa fa-info-circle\"></span></button> "; var toggle = " <button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.sid + "\"><span class=\"fa fa-pencil\"></span></button> ";
if (parseInt(row[column.id], 2) == 1) { if (parseInt(row[column.id], 2) == 1) {
toggle += "&nbsp; <span style=\"cursor: pointer;\" class=\"fa fa-check-square-o command-toggle\" data-value=\"1\" data-row-id=\"" + row.sid + "\"></span>"; toggle += "&nbsp; <span style=\"cursor: pointer;\" class=\"fa fa-check-square-o command-toggle\" data-value=\"1\" data-row-id=\"" + row.sid + "\"></span>";
} else { } else {
...@@ -257,7 +257,7 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -257,7 +257,7 @@ POSSIBILITY OF SUCH DAMAGE.
requestHandler:addAlertQryFilters, requestHandler:addAlertQryFilters,
formatters:{ formatters:{
info: function (column, row) { info: function (column, row) {
return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.filepos + "/" + row.fileid + "\"><span class=\"fa fa-info-circle\"></span></button> "; return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.filepos + "/" + row.fileid + "\"><span class=\"fa fa-pencil\"></span></button> ";
} }
}, },
} }
...@@ -277,8 +277,6 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -277,8 +277,6 @@ POSSIBILITY OF SUCH DAMAGE.
} }
}) })
/** /**
* grid for installable rule files * grid for installable rule files
*/ */
...@@ -291,7 +289,7 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -291,7 +289,7 @@ POSSIBILITY OF SUCH DAMAGE.
navigation:0, navigation:0,
formatters:{ formatters:{
rowtoggle: function (column, row) { rowtoggle: function (column, row) {
var toggle = " <button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.filename + "\"><span class=\"fa fa-info-circle\"></span></button> "; var toggle = " <button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.filename + "\"><span class=\"fa fa-pencil\"></span></button> ";
if (parseInt(row[column.id], 2) == 1) { if (parseInt(row[column.id], 2) == 1) {
toggle += "<span style=\"cursor: pointer;\" class=\"fa fa-check-square-o command-toggle\" data-value=\"1\" data-row-id=\"" + row.filename + "\"></span>"; toggle += "<span style=\"cursor: pointer;\" class=\"fa fa-check-square-o command-toggle\" data-value=\"1\" data-row-id=\"" + row.filename + "\"></span>";
} else { } else {
...@@ -532,9 +530,8 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -532,9 +530,8 @@ POSSIBILITY OF SUCH DAMAGE.
<table class="table table-condensed table-responsive"> <table class="table table-condensed table-responsive">
<tr> <tr>
<td> <td>
<button data-toggle="tooltip" title="{{ lang._('Disable selected') }}" id="disableSelectedRuleSets" type="button" class="btn btn-xs btn-default"><span class="fa fa-square-o command-toggle"></span></button> <button data-toggle="tooltip" id="enableSelectedRuleSets" type="button" class="btn btn-xs btn-default btn-primary">{{ lang._('Enable selected') }}</span></button>
<button data-toggle="tooltip" title="{{ lang._('Enable selected') }}" id="enableSelectedRuleSets" type="button" class="btn btn-xs btn-default"><span class="fa fa-check-square-o command-toggle"></span></button> <button data-toggle="tooltip" id="disableSelectedRuleSets" type="button" class="btn btn-xs btn-default btn-primary">{{ lang._('Disable selected') }}</span></button>
&nbsp;<small>{{lang._('Use selectboxes on the left for multiselect') }}</small>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -545,7 +542,7 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -545,7 +542,7 @@ POSSIBILITY OF SUCH DAMAGE.
<th data-column-id="description" data-type="string" data-sortable="false" data-visible="true">{{ lang._('Description') }}</th> <th data-column-id="description" data-type="string" data-sortable="false" data-visible="true">{{ lang._('Description') }}</th>
<th data-column-id="modified_local" data-type="rulets" data-sortable="false" data-visible="true">{{ lang._('Last updated') }}</th> <th data-column-id="modified_local" data-type="rulets" data-sortable="false" data-visible="true">{{ lang._('Last updated') }}</th>
<th data-column-id="filter_str" data-type="string" data-identifier="true">{{ lang._('Filter') }}</th> <th data-column-id="filter_str" data-type="string" data-identifier="true">{{ lang._('Filter') }}</th>
<th data-column-id="enabled" data-formatter="rowtoggle" data-sortable="false" data-width="10em">{{ lang._('Enabled') }}</th> <th data-column-id="enabled" data-formatter="rowtoggle" data-sortable="false" data-width="10em">{{ lang._('Commands') }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment