gradient for the current week
This commit is contained in:
parent
b433230191
commit
f02023b079
3 changed files with 18 additions and 3 deletions
|
|
@ -68,6 +68,7 @@ def index(request):
|
|||
now = get_now()
|
||||
else:
|
||||
now = None
|
||||
monday = get_monday(now)
|
||||
week, archive = models.Item.public(now)
|
||||
if archive and archive.exists():
|
||||
context['archive'] = '/_%s/' % get_monday(get_now() - timedelta(days=7))
|
||||
|
|
@ -75,6 +76,9 @@ def index(request):
|
|||
context["break"] = week
|
||||
else:
|
||||
context['items'] = week
|
||||
extra = models.Week.objects.filter(monday=monday, is_break=False).first()
|
||||
if extra:
|
||||
context['week_background'] = extra.background(now)
|
||||
if now:
|
||||
context['now'] = now
|
||||
context['previous_week'] = (now - timedelta(days=7)).strftime(TS_FORMAT)
|
||||
|
|
@ -109,7 +113,7 @@ def archive(request, year=None, month=None, day=None, week=None):
|
|||
if extra:
|
||||
context['week_title'] = extra.title
|
||||
context['week_byline'] = extra.byline
|
||||
context['week_background'] = extra.background
|
||||
context['week_background'] = extra.background()
|
||||
elif week:
|
||||
week = int(week)
|
||||
year = int(year)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue