From c082dd1a35a2e25b97f28ee137ec2c5b3b8052ca Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 22 Sep 2007 21:31:13 +0000 Subject: improve config UI, especially for textareas --- httemplate/config/config-view.cgi | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'httemplate/config/config-view.cgi') diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index bca1f1603..f5cead575 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -1,12 +1,14 @@ <% include("/elements/header.html", $title, menubar( - 'Main Menu' => $p, 'View all agents' => $p.'browse/agent.cgi', ) ) %> +Click on a configuration value to change it. +

+ @@ -38,20 +40,31 @@ % }
- <% include('/elements/table.html', '#cccccc' ) %> + % foreach my $i (grep $_->section eq $section, @config_items) { +% my @types = ref($i->type) ? @{$i->type} : ($i->type); +% my( $width, $height ) = ( 522, 336 ); +% if ( grep $_ eq 'textarea', @types ) { +% #800x600 +% $width = 763; +% $height = 408; +% #1024x768 +% #$width = +% #$height = +% } -
<% ucfirst($section || 'unclassified') %> configuration options
- <% $i->key %> - <% $i->description %> + +%# <% $i->key %> - <% $i->description %> + <% $i->key %>: <% $i->description %> -% foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { +% foreach my $type (@types) { % my $n = 0; % if ( $type eq '' ) { @@ -72,9 +85,13 @@ % } elsif ( $type eq 'checkbox' ) { -- cgit v1.2.1
-
-<% encode_entities(join("\n", $conf->config($i->key, $agentnum) ) ) %>
-
+
+<% encode_entities(join("\n",
+     map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
+         $conf->config($i->key, $agentnum)
+   ) )
+%>
+