new design for edit list

This commit is contained in:
Kay Marquardt (Gnadelwartz)
2017-05-25 18:26:12 +02:00
parent 989c759036
commit 581ddd1491
5 changed files with 105 additions and 27 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/local/bin/perl
#!/usr/bin/perl
# delete_list.cgi
# Delete a mailing list, after asking the user if he is sure
@@ -84,11 +84,8 @@ if ($in{'confirm'}) {
}
else {
# ask the user if he is sure
&ui_print_header(undef, $text{'delete_title'}, "");
print "<form action=delete_list.cgi>\n";
print "<input type=hidden name=name value=\"$name\">\n";
print "<input type=hidden name=confirm value=1>\n";
print "<b>",&text('delete_rusure', "<tt>".&html_escape($name)."</tt>"),
&ui_print_header(undef, $text{'delete_title'}."<br><font color=\"red\"><em>".&html_escape($name)."</em></font>", "");
print "<b>",&text('delete_rusure', "<font color=\"red\"><em>".&html_escape($name)."</em></font>"),
"</b><br>\n";
print "<ul>\n";
foreach $f (@files) {
@@ -102,9 +99,9 @@ else {
"</tt><br>\n";
}
print "</ul>\n";
print "<center><input type=submit ",
"value='$text{'delete_ok'}'></center>\n";
print "</form>\n";
local $bcss=' style="padding: 10px; text-align: center;"';
print "<div $bcss><form action=\"delete_list.cgi".$name_link."&confirm=1\" method=\"post\">",
&ui_submit($text{'delete_ok'})."</form></div>\n";
&ui_print_footer("edit_list.cgi?name=$name", $text{'edit_return'});
}

View File

@@ -1,4 +1,4 @@
#!/usr/local/bin/perl
#!/usr/bin/perl
# edit_list.cgi
# Edit an existing mailing list
@@ -7,11 +7,14 @@ require './majordomo-lib.pl';
%access = &get_module_acl();
&can_edit_list(\%access, $in{'name'}) ||
&error($text{'edit_ecannot'});
$desc = &text('edit_for', "<tt>".&html_escape($in{'name'})."</tt>");
&ui_print_header($desc, $text{'edit_title'}, "");
$list = &get_list($in{'name'}, &get_config());
$conf = &get_list_config($list->{'config'});
local $moderate= (&find_value('moderate', $conf) =~ /no/) ? "" : " (".$text{'index_moderated'}.")";
@links = ( "edit_members.cgi", "edit_info.cgi", "edit_subs.cgi",
"edit_mesg.cgi", "edit_access.cgi", "edit_head.cgi",
&ui_print_header(undef, $text{'edit_title'}."<br><em>".&html_escape($in{'name'})."</em><tt>$moderate</tt>", "");
@links = ( "edit_subs.cgi",
"edit_mesg.cgi", "edit_access.cgi",
"edit_misc.cgi" );
foreach $a (&foreign_call($aliases_module, "list_aliases",
&get_aliases_file())) {
@@ -23,19 +26,90 @@ foreach $a (&foreign_call($aliases_module, "list_aliases",
if ($isdigest) {
push(@links, "edit_digest.cgi");
}
map { s/edit_(\S+).cgi/images\/$1.gif/ } (@icons = @links);
map { s/edit_(\S+).cgi/$text{"$1_title"}/ } (@titles = @links);
@links = map { $_."?name=".&urlize($in{'name'}) } @links;
&icons_table(\@links, \@titles, \@icons);
# name to add to links
$name_link="?name=".&urlize($in{'name'});
# other buttons
local $otherbut, $bcss=' style="display: box; float: left; padding: 10px;"';
foreach (@links)
{
$action = $_ .$name_link, ($submit=$_) =~ s/edit_(\S+).cgi/$1_title/;
$otherbut .= "<div $bcss><form action=\"".$action."\" method=\"post\">".&ui_submit($text{$submit})."</form></div>\n";
}
print $otherbut;
# css for table
local $tcss='style="width: 98%; margin: 1% !important;"';
local $dcss='style="text-align: right; vertical-align: top; padding: 5px !important; min_heigth: 5em;"';
local $vcss='style="width: 40%; border: 1px solid lightgrey; padding: 5px !important;"';
# title, descritpion, info
print "<table border width=100%>\n";
print "<tr $tb> <td><b>".$text{'info_title'}."</b></td>";
print "<td width=10% nowrap><form action=\"edit_info.cgi".$name_link."\" method=\"post\">",
&ui_submit($text{'modify'}),"</form>\n</tr>\n";
print "<tr $cb> <td colspan=2><table $tcss>\n";
print "<tr> <td $dcss><b>".$text{'info_desc'}."</b></td>\n";
$desc = &find_value("description", $conf);
print "<td $vcss>$desc</td> </tr>\n";
print "<tr> <td $dcss><b>",&text('info_info', $in{'name'}),"</b></td>\n";
print "<td $vcss>";
open(INFO, $list->{'info'});
while(<INFO>) {
print if (!/^\[Last updated on:/);
}
close(INFO);
print "</td> </tr>\n";
print "<tr> <td $dcss><b>".$text{'info_intro'}."</b></td> <td $vcss>\n";
open(INTRO, $list->{'intro'});
while(<INTRO>) {
print if (!/^\[Last updated on:/);
}
close(INTRO);
print "</td> </tr>\n";
print "</table></td></tr></table>\n";
# header and footer
print "<table border width=100%>\n";
print "<tr $tb> <td><b>".$text{'head_title'}."</b></td>";
print "<td width=10% nowrap><form action=\"edit_head.cgi".$name_link."\" method=\"post\">",
&ui_submit($text{'modify'}),"</form>\n</tr>\n";
print "<tr $cb> <td colspan=2><table $tcss>\n";
print "<tr> <td $dcss><b>".$text{'head_fronter'}."</b></td> <td $vcss>\n";
print &find_value("message_fronter", $conf);
print "</td></tr>\n";
print "<tr> <td $dcss><b>".$text{'head_footer'}."</b></td> <td $vcss>\n";
print &find_value("message_footer", $conf);
print "</td></tr>\n";
print "<tr> <td $dcss><b>".$text{'head_headers'}."</b></td> <td $vcss>\n";
print &find_value("message_headers", $conf);
print "</td></tr>\n";
print "</table></td></tr></table>\n";
# members
print "<table border width=100%>\n";
print "<tr $tb> <td><b>".$text{'members_title'}."</b></td>";
print "<td width=10% nowrap><form action=\"edit_members.cgi".$name_link."\" method=\"post\">",
&ui_submit($text{'modify'}),"</form>\n</tr>\n";
print "<tr $cb> <td colspan=2>\n";
local @cols, @tds, $count=0;
print &ui_columns_start(\@cols, $tcss, 0, \@tds);
open(MEMS, $list->{'members'});
while(<MEMS>) {
$count++;
push(@cols, $_);
if($count % 3 == 0) {print &ui_columns_row(\@cols, \@tds); @cols=();}
}
close(MEMS);
push(@cols,"","") if $count % 3 == 1;
push(@cols, "") if $count % 3 == 2;
print &ui_columns_row(\@cols, \@tds);
print "</table></td></tr></table>\n";
#delete list
print "<div $bcss><form action=\"delete_list.cgi".$name_link."\" method=\"post\">",
&ui_submit($text{'edit_delete'})."</form></div>\n";
print "<div style=\"padding-top: 20px;\">$text{'edit_deletemsg'}</div>\n";
print &ui_hr();
print "<table>\n";
print "<form action=delete_list.cgi>\n";
print "<input type=hidden name=name value=\"$in{'name'}\">\n";
print "<tr> <td><input type=submit value=\"$text{'edit_delete'}\"></td>\n";
print "<td>$text{'edit_deletemsg'}</td> </tr>\n";
print "</form>\n";
print "</table>\n";
&ui_print_footer("", $text{'index_return'});

View File

@@ -218,3 +218,7 @@ access_adv0=Jedermann
create_archive=Mailingliste archivieren?
index_globaldesc=Bearbeiten der globalen Majordomo-Einstellungen, die auf alle Mailinglisten angewandt werden
delete_title=L&#246;sche die Liste
index_name=Name der Mailingliste
index_info=Kurzbescheibung
index_moderated=Modieriert
index_count=# der Teilnehmer

View File

@@ -220,4 +220,6 @@ index_globaldesc=Bearbeiten der globalen Majordomo-Einstellungen, die auf alle M
delete_title=Lösche die Liste
index_name=Name der Mailingliste
index_info=Kurzbescheibung
index_count=# der Teilnehmer
index_moderated=Modieriert
index_count=# der Teilnehmer
list_title=&Uuml;bersicht Mailingliste

View File

@@ -20,6 +20,7 @@ index_return=mailing lists
index_version=Majordomo version $1
index_name=Name of list
index_info=List info
index_moderated=Moderated
index_count=# of users
global_title=Global Options