Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/auto_copyr_year into lp:widelands-website

2018-02-20 Thread kaputtnik
I have tested it a lot. Merged and deployed.
-- 
https://code.launchpad.net/~widelands-dev/widelands-website/auto_copyr_year/+merge/337911
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/auto_copyr_year into lp:widelands-website

2018-02-20 Thread noreply
The proposal to merge lp:~widelands-dev/widelands-website/auto_copyr_year into 
lp:widelands-website has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands-website/auto_copyr_year/+merge/337911
-- 
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/auto_copyr_year into lp:widelands-website

2018-02-17 Thread GunChleoc
Review: Approve

Code LGTM, not tested.
-- 
https://code.launchpad.net/~widelands-dev/widelands-website/auto_copyr_year/+merge/337911
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/auto_copyr_year into lp:widelands-website

2018-02-17 Thread kaputtnik
kaputtnik has proposed merging 
lp:~widelands-dev/widelands-website/auto_copyr_year into lp:widelands-website.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands-website/auto_copyr_year/+merge/337911

Set the last year of copyright notice in the footer automatically to current 
year.

Some cleanups.
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands-website/auto_copyr_year into lp:widelands-website.
=== modified file 'mainpage/context_processors.py'
--- mainpage/context_processors.py	2016-12-15 12:55:44 +
+++ mainpage/context_processors.py	2018-02-17 11:33:36 +
@@ -2,6 +2,5 @@
 
 
 def settings_for_templates(request):
-context = {'USE_GOOGLE_ANALYTICS': settings.USE_GOOGLE_ANALYTICS,
-   'LOGO_FILE': settings.LOGO_FILE}
+context = {'USE_GOOGLE_ANALYTICS': settings.USE_GOOGLE_ANALYTICS,}
 return context

=== removed file 'mainpage/templatetags/all_users.py'
--- mainpage/templatetags/all_users.py	2017-11-06 17:50:17 +
+++ mainpage/templatetags/all_users.py	1970-01-01 00:00:00 +
@@ -1,12 +0,0 @@
-#!/usr/bin/env python -tt
-# encoding: utf-8
-
-from django import template
-from django.contrib.auth.models import User
-
-register = template.Library()
-
-@register.simple_tag
-def all_users():
-"""Provide a list of all users"""
-return [str(u.username) for u in User.objects.all()]

=== removed file 'mainpage/templatetags/forum_navigation.py'
--- mainpage/templatetags/forum_navigation.py	2016-12-15 12:55:44 +
+++ mainpage/templatetags/forum_navigation.py	1970-01-01 00:00:00 +
@@ -1,18 +0,0 @@
-from pybb.models import Category
-from django import template
-
-
-register = template.Library()
-
-@register.inclusion_tag('mainpage/forum_navigation.html')
-def forum_navigation():
-"""Makes the forum list available to the navigation, even
-if it is not loaded directly.
-
-Ordering:
-1.: value of 'Position' in pybb.Category
-2.: value of 'Position' of pybb.Forum.
-
-"""
-categories = Category.objects.all()
-return {'categories': categories}

=== removed file 'mainpage/templatetags/get_model_name.py'
--- mainpage/templatetags/get_model_name.py	2017-08-16 22:18:21 +
+++ mainpage/templatetags/get_model_name.py	1970-01-01 00:00:00 +
@@ -1,8 +0,0 @@
-from django import template
-
-register = template.Library()
-
-@register.filter
-def get_model_name(object):
-"""Returns the name of an objects model"""
-return object.__class__.__name__
\ No newline at end of file

=== added file 'mainpage/templatetags/wl_extras.py'
--- mainpage/templatetags/wl_extras.py	1970-01-01 00:00:00 +
+++ mainpage/templatetags/wl_extras.py	2018-02-17 11:33:36 +
@@ -0,0 +1,52 @@
+#!/usr/bin/env python -tt
+# encoding: utf-8
+
+from django import template
+
+register = template.Library()
+
+
+@register.simple_tag
+def current_year():
+"""Just return the current year."""
+
+from datetime import date
+return date.today().year
+
+
+@register.simple_tag
+def wl_logo():
+"""Just return the name of the logo."""
+
+from django.conf import settings
+return settings.LOGO_FILE
+
+
+@register.simple_tag
+def all_users():
+"""Provide a list of all users."""
+
+from django.contrib.auth.models import User
+return [str(u.username) for u in User.objects.all()]
+
+
+@register.inclusion_tag('mainpage/forum_navigation.html')
+def forum_navigation():
+"""Makes the forum list available to the navigation.
+
+Ordering:
+1.: value of 'Position' in pybb.Category
+2.: value of 'Position' of pybb.Forum.
+
+"""
+
+from pybb.models import Category
+categories = Category.objects.all()
+return {'categories': categories}
+
+
+@register.filter
+def get_model_name(object):
+"""Returns the name of an objects model."""
+
+return object.__class__.__name__

=== modified file 'mainpage/views.py'
--- mainpage/views.py	2017-10-30 11:58:00 +
+++ mainpage/views.py	2018-02-17 11:33:36 +
@@ -1,4 +1,3 @@
-from django.shortcuts import render_to_response
 from django.template import RequestContext
 from settings import WIDELANDS_SVN_DIR, INQUIRY_RECIPIENTS
 from templatetags.wl_markdown import do_wl_markdown
@@ -7,7 +6,6 @@
 from mainpage.forms import ContactForm
 from django.shortcuts import render
 from django.http import HttpResponseRedirect, HttpResponse
-from django.core.urlresolvers import reverse
 import sys
 import json
 import os
@@ -17,8 +15,7 @@
 
 
 def mainpage(request):
-return render_to_response('mainpage.html',
-  context_instance=RequestContext(request))
+return rend