diff options
author | Ctibor Brančík <ctibor@brancik.cz> | 2017-03-27 20:07:15 +0200 |
---|---|---|
committer | Ctibor Brančík <ctibor@brancik.cz> | 2017-03-27 20:07:15 +0200 |
commit | 461553d549b90f00dbf6a5072dfe4ddc95aefa4d (patch) | |
tree | 0ec85e9d6bf100ba2601d5d15014fdc4aa765ec2 /cgi-bin | |
parent | 46042b87fe25becff22b5ecfb9ab34d14401acaf (diff) | |
download | hnizdo-461553d549b90f00dbf6a5072dfe4ddc95aefa4d.tar.gz hnizdo-461553d549b90f00dbf6a5072dfe4ddc95aefa4d.tar.bz2 |
Display link to nonexistent image only if it is not newer than first one
Diffstat (limited to 'cgi-bin')
-rw-r--r-- | cgi-bin/config.py | 2 | ||||
-rw-r--r-- | cgi-bin/link.py | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/cgi-bin/config.py b/cgi-bin/config.py index 945d3dc..fafb2a5 100644 --- a/cgi-bin/config.py +++ b/cgi-bin/config.py @@ -2,4 +2,4 @@ datadir='img/' root='' special = ('index', 'latest') pagination = 30 -delay = 1 +delay = 5 diff --git a/cgi-bin/link.py b/cgi-bin/link.py index 04d91a0..f9d5776 100644 --- a/cgi-bin/link.py +++ b/cgi-bin/link.py @@ -28,7 +28,12 @@ class Link: cssclass="class=\""+order+"\"" else: cssclass="" - return "<a href=\""+self.href(target)+"\"><img src=\""+self.src(target, size)+"\" "+cssclass+"/></a>" + first=datetime.datetime.strptime(self.first, "%Y%m%d%H%M") + cur=datetime.datetime.strptime(target, "%Y%m%d%H%M") + if first > cur: + return "<a href=\""+self.href(target)+"\"><img src=\""+self.src(target, size)+"\" "+cssclass+"/></a>" + else: + return "<img src=\""+self.src(target, size)+"\" "+cssclass+"/>" def timestamp(self, date): if self.detect(date): |