djangorestframework==3.9.1
djangorestframework-xml
django-admin-ordering==0.10.0
+django-machina==0.7.1
oauthlib>=3.0.1,<3.1
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-#
-# These are the ones we should test.
+
+from machina import get_apps as get_machina_apps
+
INSTALLED_APPS_OUR = [
'wolnelektury',
# our
'allauth.socialaccount.providers.facebook',
'allauth.socialaccount.providers.google',
# 'allauth.socialaccount.providers.twitter',
-]
+
+ # Machina related apps:
+ 'mptt',
+ 'haystack',
+ 'widget_tweaks',
+] + get_machina_apps()
INSTALLED_APPS = INSTALLED_APPS_OUR + INSTALLED_APPS_CONTRIB
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from os import path
+from machina import MACHINA_MAIN_TEMPLATE_DIR
from .paths import PROJECT_DIR
DEBUG = False
MANAGERS = ADMINS
+CONTACT_EMAIL = 'fundacja@nowoczesnapolska.org.pl'
+
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # 'postgresql_psycopg2'
TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'DIRS': (
+ path.join(PROJECT_DIR, 'templates'), # Duplicate, because of Machina<1 weird configuration.
+ MACHINA_MAIN_TEMPLATE_DIR,
+ ),
'OPTIONS': {
'loaders': (
('django.template.loaders.cached.Loader', (
'django.template.context_processors.request',
'wolnelektury.context_processors.extra_settings',
'search.context_processors.search_form',
+ 'machina.core.context_processors.metadata',
),
},
}]
'django.contrib.messages.middleware.MessageMiddleware',
'fnpdjango.middleware.SetRemoteAddrFromXRealIP',
'django.middleware.cache.FetchFromCacheMiddleware',
+ 'machina.apps.forum_permission.middleware.ForumPermissionMiddleware',
]
ROOT_URLCONF = 'wolnelektury.urls'
-# -*- coding: utf-8 -*-
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
'127.0.0.1:11211',
],
},
+ 'machina_attachments': {
+ 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
+ 'LOCATION': '/tmp',
+ },
}
CACHE_MIDDLEWARE_SECONDS = 24 * 60 * 60
DEBUG_TOOLBAR_CONFIG = {
'RESULTS_CACHE_SIZE': 100,
}
+
+
+HAYSTACK_CONNECTIONS = {
+ 'default': {
+ 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
+ },
+}
'pipeline.finders.CachedFileFinder',
'pipeline.finders.PipelineFinder',
]
+
+
+from machina import MACHINA_MAIN_STATIC_DIR
+STATICFILES_DIRS = (
+ MACHINA_MAIN_STATIC_DIR,
+)
--- /dev/null
+{% extends "board_base.html" %}
+{% load i18n %}
+
+{% block header %}
+
+<div class="navbar-fixed-top-spacing"> </div>
+<div class="navbar navbar-default navbar-fixed-top machina-navbar" role="navigation" style="background:black; color: white;">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="" href="/"><img src="https://static.wolnelektury.pl/img/logo-neon.71fa40570160.png" alt="Towarzystwo Przyjaciół Wolnych Lektur" style="height:50px"></a>
+ </div>
+ <div class="collapse navbar-collapse">
+ {% block header_collapse %}
+ <div class="col-sm-7 col-md-8 col-lg-7">
+ <form class="navbar-form form-inline" role="search" action="{% url 'forum_search:search' %}">
+ <div class="form-group col-sm-6 col-md-7">
+ <div class="input-group">
+ <input type="text" class="form-control" placeholder="{% trans 'Search...' %}" name="q">
+ <div class="input-group-btn">
+ <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
+ </div>
+ </div>
+ </div>
+ <div class="form-group col-sm-5">
+ <a href="{% url 'forum_search:search' %}" class="btn btn-link">{% trans "Advanced search" %}</a>
+ </div>
+ </form>
+ </div>
+
+ <div class="col-sm-3 col-md-2 col-lg-2 navbar-right">
+ <div style="padding: 1em">
+ {{ user }}
+ </div>
+ </div>
+ {% endblock header_collapse %}
+ </div>
+ </div>
+</div>
+
+
+
+{% endblock header %}
-# -*- coding: utf-8 -*-
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.contrib import admin
from django.views.generic import RedirectView
import django.views.static
+from machina.app import board
import catalogue.views
import picture.views
from . import views
url(r'^szukaj/', include('search.urls')),
url(r'^i18n/', include('django.conf.urls.i18n')),
+ url(r'^forum/', include(board.urls)),
]
urlpatterns += [