return
coll = self.application.coll()
na = table['info name']
- self.render('top.htm',coll=coll,name=na,full=self.full)
+ self.render('top.htm',coll=coll,name=na,full=self.full,new=self.new)
def full(self,dbname):
if dbname in self.application.coll():
return True
return False
+ def new(self,dbname):
+ if dbname in self.application.coll():
+ table = self.application.db[dbname]
+ i = table.count()
+ if i == 0:
+ return False
+ rec = sorted(table.find(),key=lambda x:x['date'])
+ time = rec[i-1]['date']
+ delta = datetime.now()-datetime.strptime(time,'%Y/%m/%d %H:%M')
+ return delta.total_seconds() < 24*3600
+
class TitleHandler(NaviHandler):
def get(self):
rec = sorted(self.title(),key=lambda x: x['date2'])
<img src={{static_url('img/slide{0}.jpg'.format(1+d//i))}} style=float:right;height:465px>
{% end %}
{% set d += 1 %}
- {% if full(x) == True %}
- <p><a href=/{{x}} style=color:red target=_blank>{{x}}</a>
+ {% if new(x) == True %}
+ {% set s = "background-color:aqua" %}
{% else %}
- <p><a href=/{{x}} target=_blank>{{x}}</a>
+ {% set s = "" %}
+ {% end %}
+ {% if full(x) == True %}
+ {% set s = s + "color:red;" %}
{% end %}
+ <p><a href=/{{x}} style=;{{s}} target=_blank>{{x}}</a>
{% if d % i == 0 %}
</div>
{% end %}
</div>
<div class=slideshow-indicator></div>
</div>
+ <p><em style="background-color:aqua"> </em>・・・・new!
{% if name != '' %}
<p>[ <a href=/{{name}}>{{name}}</a> ] <=お知らせ
{% end %}