[Debtags-commits] [svn] r1525 - central-database/branches/alioth/webfrontend

Enrico Zini enrico at costa.debian.org
Wed Nov 23 15:48:52 UTC 2005


Author: enrico
Date: Wed Nov 23 15:48:51 2005
New Revision: 1525

Modified:
   central-database/branches/alioth/webfrontend/edit.cgi
   central-database/branches/alioth/webfrontend/edittemplate.html
Log:
submit works again

Modified: central-database/branches/alioth/webfrontend/edit.cgi
==============================================================================
--- central-database/branches/alioth/webfrontend/edit.cgi	(original)
+++ central-database/branches/alioth/webfrontend/edit.cgi	Wed Nov 23 15:48:51 2005
@@ -21,16 +21,6 @@
 ## Configuration options
 ##
 
-#my $release="unstable";
-#my $qry_pkg= "SELECT Package, Description, Section, Longdesc FROM packages".
-#             " WHERE Package = ?";
-#my $qry_deltag="DELETE FROM packagetags WHERE".
-#               " Package = ? AND Tag = ?";
-#my $qry_addtag="INSERT INTO packagetags (Package,Tag)".
-#               " VALUES (?,?)";
-#my $qry_tags="SELECT Tag FROM packagetags WHERE Package = ?";
-#my $qry_taglist="SELECT Tag, Title, implies FROM tagsdesc ORDER BY Title";
-
 ##
 ## Generic functions
 ##
@@ -50,11 +40,6 @@
 	return $1;
 }
 
-sub linkself (@);
-
-sub array_index($$);
-
-
 ##
 ## Startup
 ##
@@ -79,13 +64,6 @@
 my @tags;
 my $nav_tags;
 
-#($p) = Engine::package('debtags');
-#my ($t) = Engine::tag('game::toys');
-#die "socce" if not defined $p;
-#die "soccelo" if not defined $t;
-#Engine::addTag($p, $t);
-#Engine::removeTag($p, $t);
-
 ($p) = Engine::packages(sanitize(param('pkg')));
 
 if (not defined $p)
@@ -163,62 +141,13 @@
 
 
 # Build HTML::Template data structures
-#if (@pkg_tags) {
-#	foreach my $tag (@pkg_tags) {
-#		push @ht_tags, {
-#			TAG => $tag,
-#			TAGTITLE => $tag_desc{$tag},
-#			URL => "edit.cgi?package=".uri_escape($package)."&remove-tag=".uri_escape($tag).$seltags
-#		};
-#	}
-#}
-
-
-## Add add links.
-#open(TAGLIST,"<taglist.txt");
-#my $count=0;
-#while(<TAGLIST>) { chomp;
-#	next unless (m/((?:[\|\+] )*)\s*(.*)/);
-#	my $tag=$2;
-#	my $depth=int(length($1)/2);
-#	my ($addurl,$remurl);
-#	unless (&array_index(\@pkg_tags,$tag) >= 0) {
-#		$addurl="edit.cgi?package=".uri_escape($package)."&add-tag=".uri_escape($tag).$seltags;
-#	} else {
-#		$remurl="edit.cgi?package=".uri_escape($package)."&remove-tag=".uri_escape($tag).$seltags;
-#	}
-#	$count++;
-#	push @ht_alltags, {
-#		TAG => $tag,
-#		TAGTITLE => $tag_desc{$tag},
-#		ODDROW => ($count % 2),
-#		DEPTH => "&nbsp; "x$depth,
-#		ADDURL => $addurl,
-#		REMURL => $remurl
-#	};
-#}
-#close(TAGLIST);
-
-#sub tagsorter {
-#	return ($tag_desc{$a} cmp $tag_desc{$b});
-#}
-
-# fill out the template
-#$template->param(RETURNLINK => $returnlink);
-#$template->param(PACKAGE => $package);
-#$template->param(PACKAGETITLE => $description);
-#$template->param(PACKAGEDESC => $longdesc);
-#$template->param(PACKAGEURL => $packageurl);
-#$template->param(MESSAGE => $ht_message);
-#$template->param(TAGS => \@ht_tags);
-#$template->param(ADDTAGS => \@ht_alltags);
 
 $template->param(TAGS => [ map { { NAME => $_ } } @tags ]);
-if ($p and $p->hasBayesian)
-{
-	$template->param(SWITCHBAYES => linkself_nob("b=".($bayesian ? "false" : "true")));
-	$template->param(SWITCHBAYESTXT => ($bayesian ? "turn prediction off" : "turn prediction on"));
-}
+#if ($p and $p->hasBayesian)
+#{
+#	$template->param(SWITCHBAYES => linkself_nob("b=".($bayesian ? "false" : "true")));
+#	$template->param(SWITCHBAYESTXT => ($bayesian ? "turn prediction off" : "turn prediction on"));
+#}
 $template->param(NAVIGATE => "index.cgi?tags=$nav_tags");
 $template->param(NAV_TAGS => $nav_tags);
 if (defined $p)
@@ -237,37 +166,4 @@
 print "Content-Type: text/html\n\n";
 print $template->output();
 
-#sub array_index($$) { my($haystack,$needle) = @_;
-#	for my $i (0..$#$haystack) {
-#		return $i if ($$haystack[$i] eq $needle);
-#	}
-#	return -1;
-#}
-
-#sub add_tag { my ($package,$tag,$result) = @_;
-#	if ($tag_desc{$tag}) {
-#		my $sth_add = $dbh->prepare($qry_addtag);
-#		$sth_add->execute($package,$tag);
-#		if ($sth_add->err) {
-#			if ($sth_add->errstr =~ m/Duplicate/) {
-#				$$result .= "<div>Already has tag $tag.\n</div>";
-#			} else {
-#				$$result .= "<div class=err>Error while adding tag $tag:<br>";
-#				$$result .= "<tt>".$sth_add->errstr."</tt></div>";
-#			}
-#		} else {
-#			$$result .= "<div>Successfully added tag $tag.</div>";
-#			if ($tag_impl{$tag}) {
-#				my @impl = split(/,\s*/,$tag_impl{$tag});
-#				foreach my $impl (@impl) {
-#					add_tag($package,$impl,$result);
-#				}
-#			}
-#		}
-#		$sth_add->finish;
-#	} else {
-#		$$result .= "<div class=err>Error while adding tag: unknown tag</div>";
-#	}
-#}
-
 # vim:set ts=4 sw=4:

Modified: central-database/branches/alioth/webfrontend/edittemplate.html
==============================================================================
--- central-database/branches/alioth/webfrontend/edittemplate.html	(original)
+++ central-database/branches/alioth/webfrontend/edittemplate.html	Wed Nov 23 15:48:51 2005
@@ -54,14 +54,14 @@
   	for (t in this.tags)
 		this.tags[t].cur = this.tags[t].orig
   }
-  Tags.prototype.mkpatch = function() {
+  Tags.prototype.mkPatch = function() {
   	var res = new Array();
   	for (t in this.tags)
 		if (this.tags[t].orig && !this.tags[t].cur)
 		{
-			res.push("-"+t.name);
+			res.push("-"+t);
 		} else if (!this.tags[t].orig && this.tags[t].cur) {
-			res.push("+"+t.name);
+			res.push("+"+t);
 		}
 	return res.join(', ');
   }



More information about the Debtags-commits mailing list