From 6873aec01740ea7c70a5e20a3f3bce6e76bca410 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 30 Apr 2010 02:32:39 +0000 Subject: communigate (phase 2): rules: show conditions/actions on rule browse, fix rule edit for conditions and actions without op/param, fix rule edit stickiness on errors. RT#7514 --- httemplate/browse/cgp_rule.html | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'httemplate/browse') diff --git a/httemplate/browse/cgp_rule.html b/httemplate/browse/cgp_rule.html index 3bf4d69bd..ea11d62bf 100644 --- a/httemplate/browse/cgp_rule.html +++ b/httemplate/browse/cgp_rule.html @@ -7,13 +7,15 @@ 'order_by' => 'ORDER BY priority DESC', }, 'count_query' => $count_query, - 'header' => [ 'Priority', 'Name', '' ], + 'header' => [ 'Priority', 'Name', 'Conditions', 'Actions', '' ], 'fields' => [ sub { shift->priority || 'Inactive'; }, 'name', + $condition_sub, + $action_sub, sub { 'Delete'; }, ], #'align' - 'links' => [ $edit_sub, $edit_sub, $del_sub ], + 'links' => [ $edit_sub, $edit_sub, '', '', $del_sub ], ) %> <%init> @@ -40,6 +42,40 @@ my $html_init = qq(View this $svc_label

). qq!Add new rule

!; +my $condition_sub = sub { + my $cgp_rule = shift; + + [ map { + [ + { data => $_->condition, + #align => + }, + { data => $_->op, + align => 'center', + }, + { data => $_->params, + #align => + }, + ]; + } + $cgp_rule->cgp_rule_condition + ]; +}; + +my $action_sub = sub { + my $cgp_rule = shift; + + [ map { + [ + { data => $_->action }, + #{ data => '
'.$_->params.'
' }, #gets very big.. limit to + { data => $_->params }, # some actions? + ]; + } + $cgp_rule->cgp_rule_action + ]; +}; + my $edit_sub = [ $p.'edit/cgp_rule.html?', 'rulenum' ]; my $del_sub = [ $p.'misc/delete-cgp_rule.html?', 'rulenum' ]; #XXX javascript areyousure or something -- cgit v1.2.1