]> git.sesse.net Git - pr0n/commitdiff
Implement unfiltering.
authorSteinar H. Gunderson <sesse@debian.org>
Wed, 25 Jul 2007 10:35:02 +0000 (12:35 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Wed, 25 Jul 2007 10:35:02 +0000 (12:35 +0200)
25 files changed:
perl/Sesse/pr0n/Index.pm
templates/bilder.knatten.com/equipment-item
templates/bilder.knatten.com/equipment-item-singular
templates/bilder.knatten.com/filter [new file with mode: 0644]
templates/bilder.knatten.com/unfilter [new file with mode: 0644]
templates/default/equipment-item
templates/default/equipment-item-singular
templates/default/filter [new file with mode: 0644]
templates/default/unfilter [new file with mode: 0644]
templates/images.tg05.gathering.org/equipment-item
templates/images.tg05.gathering.org/equipment-item-singular
templates/images.tg05.gathering.org/filter [new file with mode: 0644]
templates/images.tg05.gathering.org/unfilter [new file with mode: 0644]
templates/itk-bilder.samfundet.no/equipment-item
templates/itk-bilder.samfundet.no/equipment-item-singular
templates/itk-bilder.samfundet.no/filter [new file with mode: 0644]
templates/itk-bilder.samfundet.no/unfilter [new file with mode: 0644]
templates/skoyen.bilder.knatten.com/equipment-item
templates/skoyen.bilder.knatten.com/equipment-item-singular
templates/skoyen.bilder.knatten.com/filter [new file with mode: 0644]
templates/skoyen.bilder.knatten.com/unfilter [new file with mode: 0644]
templates/skoyen.bildereks.knatten.com/equipment-item
templates/skoyen.bildereks.knatten.com/equipment-item-singular
templates/skoyen.bildereks.knatten.com/filter [new file with mode: 0644]
templates/skoyen.bildereks.knatten.com/unfilter [new file with mode: 0644]

index ee4c0f967a838c8ef2ea4ed9f84b9dfcaf45a09d..b8b954f4be2880d6ac71825944ed3857775e2809 100644 (file)
@@ -253,15 +253,25 @@ sub handler {
                                        $eqspec .= ', ' . $e->{'lens'} if (defined($e->{'lens'}));
 
                                        my %newsettings = %defsettings;
-                                       $newsettings{'model'} = $e->{'model'};
-                                       $newsettings{'lens'} = defined($e->{'lens'}) ? $e->{'lens'} : '';
+
+                                       my $action;
+                                       if (defined($model) && defined($lens)) {
+                                               chomp ($action = Sesse::pr0n::Templates::fetch_template($r, "unfilter"));
+                                               $newsettings{'model'} = undef;
+                                               $newsettings{'lens'} = undef;
+                                       } else {
+                                               chomp ($action = Sesse::pr0n::Templates::fetch_template($r, "filter"));
+                                               $newsettings{'model'} = $e->{'model'};
+                                               $newsettings{'lens'} = defined($e->{'lens'}) ? $e->{'lens'} : '';
+                                       }
+                                       
                                        my $url = "/$event/" . Sesse::pr0n::Common::get_query_string(\%newsettings, \%defsettings);
 
                                        # This isn't correct for all languages. Fix if we ever need to care. :-)
                                        if ($e->{'num'} == 1) {
-                                               Sesse::pr0n::Templates::print_template($r, "equipment-item-singular", { eqspec => $eqspec, filterurl => $url });
+                                               Sesse::pr0n::Templates::print_template($r, "equipment-item-singular", { eqspec => $eqspec, filterurl => $url, action => $action });
                                        } else {
-                                               Sesse::pr0n::Templates::print_template($r, "equipment-item", { eqspec => $eqspec, num => $e->{'num'}, filterurl => $url });
+                                               Sesse::pr0n::Templates::print_template($r, "equipment-item", { eqspec => $eqspec, num => $e->{'num'}, filterurl => $url, action => $action });
                                        }
                                }
                                Sesse::pr0n::Templates::print_template($r, "equipment-end");
index 1ffac4bad015769424a3f6bcbbca8cdfe1f50971..307a5a8cc5754e4f77948687519f72e79a1f049b 100644 (file)
@@ -1 +1 @@
-  <li>%EQSPEC% (%NUM% bilder) <span class="filter">(<a href="%FILTERURL%">filtrer</a>)</span></li>
+  <li>%EQSPEC% (%NUM% bilder) <span class="filter">(<a href="%FILTERURL%">%ACTION%</a>)</span></li>
index 3911531aea6b840039b5a308b7a5d3acc3845328..747bc9ffac792acdfd428386c5912361b4eeffd0 100644 (file)
@@ -1 +1 @@
-  <li>%EQSPEC% (ett bilde) <span class="filter">(<a href="%FILTERURL%">filtrer</a>)</span></li>
+  <li>%EQSPEC% (ett bilde) <span class="filter">(<a href="%FILTERURL%">%ACTION%</a>)</span></li>
diff --git a/templates/bilder.knatten.com/filter b/templates/bilder.knatten.com/filter
new file mode 100644 (file)
index 0000000..eb92ea7
--- /dev/null
@@ -0,0 +1 @@
+filtrer
diff --git a/templates/bilder.knatten.com/unfilter b/templates/bilder.knatten.com/unfilter
new file mode 100644 (file)
index 0000000..ea84948
--- /dev/null
@@ -0,0 +1 @@
+avfiltrer
index f8ce70f63732120f4e83c417ff3e51bbc68cbd9f..861f5f9f96bb0a83a77a783bab4dd9a57d956575 100644 (file)
@@ -1 +1 @@
-  <li>%EQSPEC% (%NUM% images) <span class="filter">(<a href="%FILTERURL%">filter</a>)</span></li>
+  <li>%EQSPEC% (%NUM% images) <span class="filter">(<a href="%FILTERURL%">%ACTION%</a>)</span></li>
index e95d222a9140080aa168298c25e35d215fd995d3..d99d4af2737dd05ab6b44daf80ebe6f8762a9598 100644 (file)
@@ -1 +1 @@
-  <li>%EQSPEC% (one image) <span class="filter">(<a href="%FILTERURL%">filter</a>)</span></li>
+  <li>%EQSPEC% (one image) <span class="filter">(<a href="%FILTERURL%">%ACTION%</a>)</span></li>
diff --git a/templates/default/filter b/templates/default/filter
new file mode 100644 (file)
index 0000000..76f654e
--- /dev/null
@@ -0,0 +1 @@
+filter
diff --git a/templates/default/unfilter b/templates/default/unfilter
new file mode 100644 (file)
index 0000000..3f87e65
--- /dev/null
@@ -0,0 +1 @@
+unfilter
index f8ce70f63732120f4e83c417ff3e51bbc68cbd9f..861f5f9f96bb0a83a77a783bab4dd9a57d956575 100644 (file)
@@ -1 +1 @@
-  <li>%EQSPEC% (%NUM% images) <span class="filter">(<a href="%FILTERURL%">filter</a>)</span></li>
+  <li>%EQSPEC% (%NUM% images) <span class="filter">(<a href="%FILTERURL%">%ACTION%</a>)</span></li>
index e95d222a9140080aa168298c25e35d215fd995d3..d99d4af2737dd05ab6b44daf80ebe6f8762a9598 100644 (file)
@@ -1 +1 @@
-  <li>%EQSPEC% (one image) <span class="filter">(<a href="%FILTERURL%">filter</a>)</span></li>
+  <li>%EQSPEC% (one image) <span class="filter">(<a href="%FILTERURL%">%ACTION%</a>)</span></li>
diff --git a/templates/images.tg05.gathering.org/filter b/templates/images.tg05.gathering.org/filter
new file mode 100644 (file)
index 0000000..76f654e
--- /dev/null
@@ -0,0 +1 @@
+filter
diff --git a/templates/images.tg05.gathering.org/unfilter b/templates/images.tg05.gathering.org/unfilter
new file mode 100644 (file)
index 0000000..3f87e65
--- /dev/null
@@ -0,0 +1 @@
+unfilter
index 1ffac4bad015769424a3f6bcbbca8cdfe1f50971..307a5a8cc5754e4f77948687519f72e79a1f049b 100644 (file)
@@ -1 +1 @@
-  <li>%EQSPEC% (%NUM% bilder) <span class="filter">(<a href="%FILTERURL%">filtrer</a>)</span></li>
+  <li>%EQSPEC% (%NUM% bilder) <span class="filter">(<a href="%FILTERURL%">%ACTION%</a>)</span></li>
index 3911531aea6b840039b5a308b7a5d3acc3845328..747bc9ffac792acdfd428386c5912361b4eeffd0 100644 (file)
@@ -1 +1 @@
-  <li>%EQSPEC% (ett bilde) <span class="filter">(<a href="%FILTERURL%">filtrer</a>)</span></li>
+  <li>%EQSPEC% (ett bilde) <span class="filter">(<a href="%FILTERURL%">%ACTION%</a>)</span></li>
diff --git a/templates/itk-bilder.samfundet.no/filter b/templates/itk-bilder.samfundet.no/filter
new file mode 100644 (file)
index 0000000..eb92ea7
--- /dev/null
@@ -0,0 +1 @@
+filtrer
diff --git a/templates/itk-bilder.samfundet.no/unfilter b/templates/itk-bilder.samfundet.no/unfilter
new file mode 100644 (file)
index 0000000..ea84948
--- /dev/null
@@ -0,0 +1 @@
+avfiltrer
index 1ffac4bad015769424a3f6bcbbca8cdfe1f50971..307a5a8cc5754e4f77948687519f72e79a1f049b 100644 (file)
@@ -1 +1 @@
-  <li>%EQSPEC% (%NUM% bilder) <span class="filter">(<a href="%FILTERURL%">filtrer</a>)</span></li>
+  <li>%EQSPEC% (%NUM% bilder) <span class="filter">(<a href="%FILTERURL%">%ACTION%</a>)</span></li>
index 3911531aea6b840039b5a308b7a5d3acc3845328..747bc9ffac792acdfd428386c5912361b4eeffd0 100644 (file)
@@ -1 +1 @@
-  <li>%EQSPEC% (ett bilde) <span class="filter">(<a href="%FILTERURL%">filtrer</a>)</span></li>
+  <li>%EQSPEC% (ett bilde) <span class="filter">(<a href="%FILTERURL%">%ACTION%</a>)</span></li>
diff --git a/templates/skoyen.bilder.knatten.com/filter b/templates/skoyen.bilder.knatten.com/filter
new file mode 100644 (file)
index 0000000..eb92ea7
--- /dev/null
@@ -0,0 +1 @@
+filtrer
diff --git a/templates/skoyen.bilder.knatten.com/unfilter b/templates/skoyen.bilder.knatten.com/unfilter
new file mode 100644 (file)
index 0000000..ea84948
--- /dev/null
@@ -0,0 +1 @@
+avfiltrer
index 1ffac4bad015769424a3f6bcbbca8cdfe1f50971..307a5a8cc5754e4f77948687519f72e79a1f049b 100644 (file)
@@ -1 +1 @@
-  <li>%EQSPEC% (%NUM% bilder) <span class="filter">(<a href="%FILTERURL%">filtrer</a>)</span></li>
+  <li>%EQSPEC% (%NUM% bilder) <span class="filter">(<a href="%FILTERURL%">%ACTION%</a>)</span></li>
index 3911531aea6b840039b5a308b7a5d3acc3845328..747bc9ffac792acdfd428386c5912361b4eeffd0 100644 (file)
@@ -1 +1 @@
-  <li>%EQSPEC% (ett bilde) <span class="filter">(<a href="%FILTERURL%">filtrer</a>)</span></li>
+  <li>%EQSPEC% (ett bilde) <span class="filter">(<a href="%FILTERURL%">%ACTION%</a>)</span></li>
diff --git a/templates/skoyen.bildereks.knatten.com/filter b/templates/skoyen.bildereks.knatten.com/filter
new file mode 100644 (file)
index 0000000..eb92ea7
--- /dev/null
@@ -0,0 +1 @@
+filtrer
diff --git a/templates/skoyen.bildereks.knatten.com/unfilter b/templates/skoyen.bildereks.knatten.com/unfilter
new file mode 100644 (file)
index 0000000..ea84948
--- /dev/null
@@ -0,0 +1 @@
+avfiltrer