# Path: weechat/about/views.py
# def screenshots(request, app='weechat', filename=''):
#     """
#     Page with one screenshot (if filename given),
#     or all screenshots as thumbnails.
#     """
#     if filename:
#         try:
#             screenshot = Screenshot.objects.get(app=app, filename=filename)
#         except ObjectDoesNotExist:
#             screenshot = None
#         return render(
#             request,
#             'about/screenshots.html',
#             {
#                 'app': app,
#                 'filename': filename,
#                 'screenshot': screenshot,
#             },
#         )
#     screenshot_list = Screenshot.objects.filter(app=app).order_by('priority')
#     return render(
#         request,
#         'about/screenshots.html',
#         {
#             'app': app,
#             'screenshot_list': screenshot_list,
#         },
#     )
# 
# def history(request):
#     """Page with WeeChat history, including key dates."""
#     release_list = (Release.objects.all().exclude(version='devel')
#                     .order_by('-date'))
#     releases = []
#     for release in release_list:
#         name = f'weechat-{release.version}.png'
#         if os.path.exists(media_path_join('images', 'story', name)):
#             releases.append((release.version, release.date))
#     return render(
#         request,
#         'about/history.html',
#         {
#             'releases': releases,
#             'keydate_list': Keydate.objects.all().order_by('date'),
#         },
#     )
# 
# def about(request, extra_info=False):
#     """About WeeChat.org."""
#     context = {}
#     if extra_info:
#         context.update({
#             'extra_info': {
#                 'django': django_version,
#                 'python': python_version,
#             },
#         })
#     return render(request, 'about/weechat.org.html', context)


from django.conf import settings
from django.urls import path, re_path
from django.views.generic.base import TemplateView
from weechat.about.views import (
    screenshots as view_screenshots,
    history as view_history,
    about as view_about,
)
#

"""URLs for "about" menu."""

# pylint: disable=invalid-name, no-value-for-parameter



URL_ABOUT_EXTRA = getattr(settings, 'URL_ABOUT_EXTRA', 'extra')

urlpatterns = [
    path('', TemplateView.as_view(template_name='about/features.html'),
         name='about'),
    path('features/',
         TemplateView.as_view(template_name='about/features.html'),
         name='about_features'),
    path('interfaces/',
         TemplateView.as_view(template_name='about/interfaces.html'),
         name='about_interfaces'),
    path('screenshots/', view_screenshots, name='about_screenshots'),
    re_path(r'^screenshots/(?P<app>weechat|relay)/$', view_screenshots,
            name='about_screenshots_app'),
    re_path(r'^screenshots/(?P<app>weechat|relay)/'
            r'(?P<filename>[a-zA-Z0-9_\-.]*)/$',
            view_screenshots, name='about_screenshot'),
    path('screenshots/<str:filename>/', view_screenshots),
    path('history/', view_history, name='about_history'),
    path('support/', TemplateView.as_view(template_name='about/support.html'),
         name='about_support'),
    path('weechat.org/', view_about, name='about_weechat.org'),

# Path: weechat/about/views.py
# def screenshots(request, app='weechat', filename=''):
#     """
#     Page with one screenshot (if filename given),
#     or all screenshots as thumbnails.
#     """
#     if filename:
#         try:
#             screenshot = Screenshot.objects.get(app=app, filename=filename)
#         except ObjectDoesNotExist:
#             screenshot = None
#         return render(
#             request,
#             'about/screenshots.html',
#             {
#                 'app': app,
#                 'filename': filename,
#                 'screenshot': screenshot,
#             },
#         )
#     screenshot_list = Screenshot.objects.filter(app=app).order_by('priority')
#     return render(
#         request,
#         'about/screenshots.html',
#         {
#             'app': app,
#             'screenshot_list': screenshot_list,
#         },
#     )
# 
# def history(request):
#     """Page with WeeChat history, including key dates."""
#     release_list = (Release.objects.all().exclude(version='devel')
#                     .order_by('-date'))
#     releases = []
#     for release in release_list:
#         name = f'weechat-{release.version}.png'
#         if os.path.exists(media_path_join('images', 'story', name)):
#             releases.append((release.version, release.date))
#     return render(
#         request,
#         'about/history.html',
#         {
#             'releases': releases,
#             'keydate_list': Keydate.objects.all().order_by('date'),
#         },
#     )
# 
# def about(request, extra_info=False):
#     """About WeeChat.org."""
#     context = {}
#     if extra_info:
#         context.update({
#             'extra_info': {
#                 'django': django_version,
#                 'python': python_version,
#             },
#         })
#     return render(request, 'about/weechat.org.html', context)


# Path: weechat/about/urls.py
from django.conf import settings
from django.urls import path, re_path
from django.views.generic.base import TemplateView
from weechat.about.views import (
    screenshots as view_screenshots,
    history as view_history,
    about as view_about,
)

#

"""URLs for "about" menu."""

# pylint: disable=invalid-name, no-value-for-parameter



URL_ABOUT_EXTRA = getattr(settings, 'URL_ABOUT_EXTRA', 'extra')

urlpatterns = [
    path('', TemplateView.as_view(template_name='about/features.html'),
         name='about'),
    path('features/',
         TemplateView.as_view(template_name='about/features.html'),
         name='about_features'),
    path('interfaces/',
         TemplateView.as_view(template_name='about/interfaces.html'),
         name='about_interfaces'),
    path('screenshots/', view_screenshots, name='about_screenshots'),
    re_path(r'^screenshots/(?P<app>weechat|relay)/$', view_screenshots,
            name='about_screenshots_app'),
    re_path(r'^screenshots/(?P<app>weechat|relay)/'
            r'(?P<filename>[a-zA-Z0-9_\-.]*)/$',
            view_screenshots, name='about_screenshot'),
    path('screenshots/<str:filename>/', view_screenshots),
    path('history/', view_history, name='about_history'),
    path('support/', TemplateView.as_view(template_name='about/support.html'),
         name='about_support'),
    path('weechat.org/', view_about, name='about_weechat.org'),

    path(f'weechat.org/{URL_ABOUT_EXTRA}/', view_about,