[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#600200: packages.d.o: switch to API providing versioned screenshots



Package: www.debian.org
Severity: wishlist
Tags: patch
X-Debbugs-CC: Christoph Haas <haas@debian.org>

The attached (untested) patch switches packages.d.o to the API that
provides versioned screenshots. If the requested version does not exist
it goes with the closest lower version. If no lower version exists it
goes with the closest higher version. So we avoid showing features that
a newer version would have. Please apply.

-- 
bye,
pabs

http://wiki.debian.org/PaulWise
From 00f2ab8d29bcc25f764c48ea0641225bf23beed2 Mon Sep 17 00:00:00 2001
From: Paul Wise <pabs@debian.org>
Date: Thu, 14 Oct 2010 23:17:14 +0800
Subject: [PATCH] Use versioned screenshots on binary package pages

---
 templates/config.tmpl    |    2 +-
 templates/html/show.tmpl |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/templates/config.tmpl b/templates/config.tmpl
index aa1dee5..4d24e05 100644
--- a/templates/config.tmpl
+++ b/templates/config.tmpl
@@ -24,7 +24,7 @@
    cn_help_url = project_homepage _ 'intro/cn'
    patch_tracking_url = 'http://patch-tracker.debian.org/package'
    screenshots_url = 'http://screenshots.debian.net/package/'
-   screenshots_thumb_url = 'http://screenshots.debian.net/thumbnail/'
+   screenshots_thumb_url = 'http://screenshots.debian.net/thumbnail-with-version/'
    logo = {
 	url => project_homepage,
         src => '/Pics/openlogo-nd-25.png',
diff --git a/templates/html/show.tmpl b/templates/html/show.tmpl
index e86af33..ebbba77 100644
--- a/templates/html/show.tmpl
+++ b/templates/html/show.tmpl
@@ -64,7 +64,7 @@
 <div id="pmoreinfo">
 <h2>[% g('Links for %s', pkg) %]</h2>
 [% IF screenshots_url && screenshots_thumb_url && !is_source %]
-<a id="screenshot" href="[% screenshots_url _ pkg %]"><img src="[% screenshots_thumb_url _ pkg %]" alt="Screenshot" border="0"/></a>
+<a id="screenshot" href="[% screenshots_url _ pkg %]"><img src="[% "$screenshots_thumb_url/$pkg/$version" %]" alt="Screenshot" border="0"/></a>
 [% END %]
 <h3>[% g('%s Resources:', organisation) %]</h3>
 <ul>
-- 
1.7.1

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: