From a98cd4637716d783c20bb08d903978d06abf9d31 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 17 Jul 2010 21:41:48 +0000 Subject: customer tags, RT#9192 --- httemplate/elements/pickcolor.html | 60 +++++++++++++++++++++++++++++++++++ httemplate/elements/tr-pickcolor.html | 11 +++++++ 2 files changed, 71 insertions(+) create mode 100644 httemplate/elements/pickcolor.html create mode 100644 httemplate/elements/tr-pickcolor.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/pickcolor.html b/httemplate/elements/pickcolor.html new file mode 100644 index 000000000..d410ebfc7 --- /dev/null +++ b/httemplate/elements/pickcolor.html @@ -0,0 +1,60 @@ + + + + + + +
change
+ +% for (1..$rows) { + +% for (1..$cols) { +% last unless @colors; +% my $color = shift(@colors); + +% } + +% } + + +<%init> + +my %opt = @_; + +my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value}; + +my $unum = int(rand(100000)); + +my $id = $opt{'id'} || $opt{'field'}.$unum; + +my @colors = ( + '', #none/white + 'FF6666', #red + 'FF9966', #orange + 'FFFF66', #yellow + '66FF66', #green + '66FFFF', #cyan? + '6666FF', #blue + 'CC66FF', #purple? FF66FF looks more like pink. +); + +my $rows = 2; + +my $cols = int(.5+scalar(@colors)/$rows); + + diff --git a/httemplate/elements/tr-pickcolor.html b/httemplate/elements/tr-pickcolor.html new file mode 100644 index 000000000..2b6cc23ca --- /dev/null +++ b/httemplate/elements/tr-pickcolor.html @@ -0,0 +1,11 @@ +<% include('tr-td-label.html', @_ ) %> + <% $cell_style %> ID="<% $opt{input_id} || $opt{id}.'_input0' %>"><% include('pickcolor.html', @_ ) %> +<%init> + +my %opt = @_; + +my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; + +my $colspan = $opt{'colspan'} ? 'COLSPAN="'.$opt{'colspan'}.'"' : ''; + + -- cgit v1.2.1