+++ /dev/null
-{% extends "catalogue/base.html" %}
-
-{% load i18n %}
-{% load catalogue book_list %}
-{% load compressed %}
-
-
-{% block add_js %}
-{% compressed_js 'book_list' %}
-{% endblock %}
-
-{% block add_css %}
-{% compressed_css 'book_list' %}
-{% endblock %}
-
-{% block content %}
- {% book_list %}
-{% endblock content %}
# -*- coding: utf-8
-from django.conf.urls import patterns, url
+from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from catalogue.views import GalleryView
+from catalogue import views
-urlpatterns = patterns(
- 'catalogue.views',
+urlpatterns = (
# url(r'^$', RedirectView.as_view(url='catalogue/')),
- url(r'^upcoming/$', 'upcoming', name='catalogue_upcoming'),
- url(r'^finished/$', 'finished', name='catalogue_finished'),
+ url(r'^upcoming/$', views.upcoming, name='catalogue_upcoming'),
+ url(r'^finished/$', views.finished, name='catalogue_finished'),
- url(r'^user/$', 'my', name='catalogue_user'),
- url(r'^user/(?P<username>[^/]+)/$', 'user', name='catalogue_user'),
+ url(r'^user/$', views.my, name='catalogue_user'),
+ url(r'^user/(?P<username>[^/]+)/$', views.user, name='catalogue_user'),
url(r'^create/',
- 'create_missing', name='catalogue_create_missing'),
+ views.create_missing, name='catalogue_create_missing'),
url(r'^fork/(?P<pk>\d+)/',
- 'fork', name='catalogue_fork'),
+ views.fork, name='catalogue_fork'),
- url(r'^doc/(?P<pk>\d+)/publish$', 'publish', name="catalogue_publish"),
- url(r'^doc/(?P<pk>\d+)/unpublish$', 'unpublish', name="catalogue_unpublish"),
+ url(r'^doc/(?P<pk>\d+)/publish$', views.publish, name="catalogue_publish"),
+ url(r'^doc/(?P<pk>\d+)/unpublish$', views.unpublish, name="catalogue_unpublish"),
- url(r'^(?P<pk>[^/]+)/schedule/$', 'book_schedule', name="catalogue_book_schedule"),
- url(r'^(?P<pk>[^/]+)/owner/$', 'book_owner', name="catalogue_book_owner"),
- url(r'^(?P<pk>[^/]+)/delete/$', 'book_delete', name="catalogue_book_delete"),
+ url(r'^(?P<pk>[^/]+)/schedule/$', views.book_schedule, name="catalogue_book_schedule"),
+ url(r'^(?P<pk>[^/]+)/owner/$', views.book_owner, name="catalogue_book_owner"),
+ url(r'^(?P<pk>[^/]+)/delete/$', views.book_delete, name="catalogue_book_delete"),
url(r'^(?P<pk>[^/]+)/attachments/$',
login_required()(GalleryView.as_view()),
name="catalogue_book_gallery"),
- url(r'^(?P<pk>\d+)/$', 'book_html', name="catalogue_html"),
- url(r'^(?P<pk>\d+)/preview/$', 'book_html', {'preview': True}, name="catalogue_preview"),
- url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/preview/$', 'book_html', {'preview': True}, name="catalogue_preview_rev"),
- url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/pdf/$', 'book_pdf', name="catalogue_pdf"),
- url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/epub/$', 'book_epub', name="catalogue_epub"),
- url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/mobi/$', 'book_mobi', name="catalogue_mobi"),
+ url(r'^(?P<pk>\d+)/$', views.book_html, name="catalogue_html"),
+ url(r'^(?P<pk>\d+)/preview/$', views.book_html, {'preview': True}, name="catalogue_preview"),
+ url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/preview/$', views.book_html, {'preview': True}, name="catalogue_preview_rev"),
+ url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/pdf/$', views.book_pdf, name="catalogue_pdf"),
+ url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/epub/$', views.book_epub, name="catalogue_epub"),
+ url(r'^(?P<pk>\d+)/rev(?P<rev_pk>\d+)/mobi/$', views.book_mobi, name="catalogue_mobi"),
)
logger = logging.getLogger("fnp.catalogue")
-@active_tab('all')
-@never_cache
-def document_list(request):
- return render(request, 'catalogue/document_list.html')
-
-
@never_cache
def user(request, username):
user = get_object_or_404(User, username=username)
Add the entries view to urls.
"""
urls = super(FormAdmin, self).get_urls()
- extra_urls = patterns("",
- url("^(?P<form_id>\d+)/entries/$",
+ extra_urls = [
+ url(r"^(?P<form_id>\d+)/entries/$",
self.admin_site.admin_view(self.entries_view),
name="form_entries"),
- url("^(?P<form_id>\d+)/entries/show/$",
+ url(r"^(?P<form_id>\d+)/entries/show/$",
self.admin_site.admin_view(self.entries_view),
{"show": True}, name="form_entries_show"),
- url("^(?P<form_id>\d+)/entries/export/$",
+ url(r"^(?P<form_id>\d+)/entries/export/$",
self.admin_site.admin_view(self.entries_view),
{"export": True}, name="form_entries_export"),
- url("^file/(?P<field_entry_id>\d+)/$",
+ url(r"^file/(?P<field_entry_id>\d+)/$",
self.admin_site.admin_view(self.file_view),
name="form_file"),
- )
+ ]
return extra_urls + urls
def entries_view(self, request, form_id, show=False, export=False,
+# -*- coding: utf-8 -*-
from __future__ import unicode_literals
-from django.conf.urls import patterns, url
+from django.conf.urls import url
+from forms_builder.forms import views
-urlpatterns = patterns("forms_builder.forms.views",
- url(r"(?P<slug>.*)/sent/$", "form_sent", name="form_sent"),
- url(r"(?P<slug>.*)/$", "form_detail", name="form_detail"),
+
+urlpatterns = (
+ url(r"(?P<slug>.*)/sent/$", views.form_sent, name="form_sent"),
+ url(r"(?P<slug>.*)/$", views.form_detail, name="form_detail"),
)
# -*- coding: utf-8
-from django.conf.urls import patterns, url
+from django.conf.urls import url
from organizations import views
-urlpatterns = patterns(
- '',
+urlpatterns = (
url(r'^$', views.organizations, name="organizations"),
url(r'^new/$', views.org_new, name="organizations_new"),
url(r'^(?P<pk>\d+)/$', views.main, name="organizations_main"),
# -*- coding: utf-8
-from django.conf.urls import patterns, url
+from django.conf.urls import url
+from wiki import views
+urlpatterns = (
+ url(r'^edit/(?P<pk>[^/]+)/$', views.editor, name="wiki_editor"),
-urlpatterns = patterns(
- 'wiki.views',
- url(r'^edit/(?P<pk>[^/]+)/$',
- 'editor', name="wiki_editor"),
+ url(r'^gallery/(?P<directory>[^/]+)/$', views.gallery, name="wiki_gallery"),
- url(r'^gallery/(?P<directory>[^/]+)/$',
- 'gallery', name="wiki_gallery"),
+ url(r'^history/(?P<doc_id>\d+)/$', views.history, name="wiki_history"),
- url(r'^history/(?P<doc_id>\d+)/$',
- 'history', name="wiki_history"),
+ url(r'^text/(?P<doc_id>\d+)/$', views.text, name="wiki_text"),
- url(r'^text/(?P<doc_id>\d+)/$',
- 'text', name="wiki_text"),
+ url(r'^revert/(?P<doc_id>\d+)/$', views.revert, name='wiki_revert'),
- url(r'^revert/(?P<doc_id>\d+)/$',
- 'revert', name='wiki_revert'),
-
- url(r'^diff/(?P<doc_id>\d+)/$', 'diff', name="wiki_diff"),
+ url(r'^diff/(?P<doc_id>\d+)/$', views.diff, name="wiki_diff"),
)
PROJECT_ROOT = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
DEBUG = False
-TEMPLATE_DEBUG = DEBUG
MAINTENANCE_MODE = False
SESSION_COOKIE_NAME = "redakcja_sessionid"
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.Loader',
- 'django.template.loaders.app_directories.Loader',
-)
-
-TEMPLATE_CONTEXT_PROCESSORS = (
- "django.contrib.auth.context_processors.auth",
- "django.core.context_processors.debug",
- "django.core.context_processors.i18n",
- "redakcja.context_processors.settings", # this is instead of media
- 'django.core.context_processors.csrf',
- "django.core.context_processors.request",
-)
-
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'DIRS': [
+ os.path.join(PROJECT_ROOT, 'templates'),
+ ],
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'context_processors': [
+ "django.contrib.auth.context_processors.auth",
+ "django.template.context_processors.debug",
+ "django.template.context_processors.i18n",
+ "redakcja.context_processors.settings", # this is instead of media
+ 'django.template.context_processors.csrf',
+ "django.template.context_processors.request",
+ ],
+ },
+ },
+]
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
ROOT_URLCONF = 'redakcja.urls'
-TEMPLATE_DIRS = (
- PROJECT_ROOT + '/templates',
-)
-
FIREPYTHON_LOGGER_NAME = "fnp"
INSTALLED_APPS = (
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
-
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
-PIPELINE_CSS_COMPRESSOR = None
-PIPELINE_JS_COMPRESSOR = None
-PIPELINE_STORAGE = 'pipeline.storage.PipelineFinderStorage'
-
-# CSS and JS files to compress
-PIPELINE_CSS = {
- 'detail': {
- 'source_filenames': (
- 'css/master.css',
- 'css/toolbar.css',
- 'css/gallery.css',
- 'css/history.css',
- 'css/summary.css',
- 'css/html.css',
- 'css/jquery.autocomplete.css',
- 'css/dialogs.css',
- ),
- 'output_filename': 'compressed/detail_styles.css',
- },
- 'catalogue': {
- 'source_filenames': (
- # 'css/filelist.css',
- 'css/base.css',
- 'datepicker/css/datepicker.css',
- ),
- 'output_filename': 'compressed/catalogue_styles.css',
- },
- 'book': {
- 'source_filenames': (
- 'css/book.css',
- ),
- 'output_filename': 'compressed/book.css',
+PIPELINE = {
+ 'PIPELINE_ENABLED': True,
+ 'CSS_COMPRESSOR': None,
+ 'JS_COMPRESSOR': None,
+ 'STYLESHEETS': {
+ 'detail': {
+ 'source_filenames': (
+ 'css/master.css',
+ 'css/toolbar.css',
+ 'css/gallery.css',
+ 'css/history.css',
+ 'css/summary.css',
+ 'css/html.css',
+ 'css/jquery.autocomplete.css',
+ 'css/dialogs.css',
+ ),
+ 'output_filename': 'compressed/detail_styles.css',
+ },
+ 'catalogue': {
+ 'source_filenames': (
+ # 'css/filelist.css',
+ 'css/base.css',
+ 'datepicker/css/datepicker.css',
+ ),
+ 'output_filename': 'compressed/catalogue_styles.css',
+ },
+ 'book': {
+ 'source_filenames': (
+ 'css/book.css',
+ ),
+ 'output_filename': 'compressed/book.css',
+ },
+ 'book_list': {
+ 'source_filenames': (
+ 'contextmenu/jquery.contextMenu.css',
+ 'css/book_list.css',
+ ),
+ 'output_filename': 'compressed/book_list.css',
+ },
},
- 'book_list': {
- 'source_filenames': (
- 'contextmenu/jquery.contextMenu.css',
- 'css/book_list.css',
- ),
- 'output_filename': 'compressed/book_list.css',
- },
-}
+ 'JAVASCRIPT': {
+ # everything except codemirror
+ 'detail': {
+ 'source_filenames': (
+ # libraries
+ 'js/lib/jquery/jquery.autocomplete.js',
+ 'js/lib/jquery/jquery.blockui.js',
+ 'js/lib/jquery/jquery.elastic.js',
+ 'js/lib/jquery/jquery.xmlns.js',
+ 'js/button_scripts.js',
+ 'js/slugify.js',
-PIPELINE_JS = {
- # everything except codemirror
- 'detail': {
- 'source_filenames': (
- # libraries
- 'js/lib/jquery/jquery.autocomplete.js',
- 'js/lib/jquery/jquery.blockui.js',
- 'js/lib/jquery/jquery.elastic.js',
- 'js/lib/jquery/jquery.xmlns.js',
- 'js/button_scripts.js',
- 'js/slugify.js',
+ # wiki scripts
+ 'js/wiki/wikiapi.js',
+ 'js/wiki/xslt.js',
- # wiki scripts
- 'js/wiki/wikiapi.js',
- 'js/wiki/xslt.js',
+ # base UI
+ 'js/wiki/base.js',
+ 'js/wiki/toolbar.js',
- # base UI
- 'js/wiki/base.js',
- 'js/wiki/toolbar.js',
+ # dialogs
+ 'js/wiki/dialog_save.js',
+ 'js/wiki/dialog_revert.js',
+ 'js/wiki/dialog_pubmark.js',
- # dialogs
- 'js/wiki/dialog_save.js',
- 'js/wiki/dialog_revert.js',
- 'js/wiki/dialog_pubmark.js',
-
- # views
- 'js/wiki/view_history.js',
- 'js/wiki/view_summary.js',
- 'js/wiki/view_editor_source.js',
- 'js/wiki/view_editor_wysiwyg.js',
- 'js/wiki/view_gallery.js',
- 'js/wiki/view_annotations.js',
- 'js/wiki/view_search.js',
- 'js/wiki/view_column_diff.js',
- ),
- 'output_filename': 'compressed/detail_scripts.js',
- },
- 'catalogue': {
- 'source_filenames': (
- 'js/catalogue/catalogue.js',
- 'js/slugify.js',
- 'email_mangler/email_mangler.js',
- 'datepicker/js/bootstrap-datepicker.js',
- ),
- 'output_filename': 'compressed/catalogue_scripts.js',
- },
- 'book': {
- 'source_filenames': (
- 'js/book_text/jquery.eventdelegation.js',
- 'js/book_text/jquery.scrollto.js',
- 'js/book_text/jquery.highlightfade.js',
- 'js/book_text/book.js',
- ),
- 'output_filename': 'compressed/book.js',
+ # views
+ 'js/wiki/view_history.js',
+ 'js/wiki/view_summary.js',
+ 'js/wiki/view_editor_source.js',
+ 'js/wiki/view_editor_wysiwyg.js',
+ 'js/wiki/view_gallery.js',
+ 'js/wiki/view_annotations.js',
+ 'js/wiki/view_search.js',
+ 'js/wiki/view_column_diff.js',
+ ),
+ 'output_filename': 'compressed/detail_scripts.js',
},
- 'book_list': {
- 'source_filenames': (
- 'contextmenu/jquery.ui.position.js',
- 'contextmenu/jquery.contextMenu.js',
- 'js/catalogue/book_list.js',
- ),
- 'output_filename': 'compressed/book_list.js',
+ 'catalogue': {
+ 'source_filenames': (
+ 'js/catalogue/catalogue.js',
+ 'js/slugify.js',
+ 'email_mangler/email_mangler.js',
+ 'datepicker/js/bootstrap-datepicker.js',
+ ),
+ 'output_filename': 'compressed/catalogue_scripts.js',
+ },
+ 'book': {
+ 'source_filenames': (
+ 'js/book_text/jquery.eventdelegation.js',
+ 'js/book_text/jquery.scrollto.js',
+ 'js/book_text/jquery.highlightfade.js',
+ 'js/book_text/book.js',
+ ),
+ 'output_filename': 'compressed/book.js',
+ },
+ 'book_list': {
+ 'source_filenames': (
+ 'contextmenu/jquery.ui.position.js',
+ 'contextmenu/jquery.contextMenu.js',
+ 'js/catalogue/book_list.js',
+ ),
+ 'output_filename': 'compressed/book_list.js',
+ }
}
}
# -*- coding: utf-8 -*-
-from django.conf.urls import include, patterns, url
+from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
+from django.views.i18n import javascript_catalog
import forms_builder.forms.urls
+import redakcja.views
admin.autodiscover()
-urlpatterns = patterns(
- '',
+urlpatterns = (
# Auth
- # url(r'^accounts/login/$', 'django_cas.views.login', name='login'),
- # url(r'^accounts/logout/$', 'django_cas.views.logout', name='logout'),
- # url(r'^accounts/login/$', 'django.contrib.auth.views.login', name='login'),
- # url(r'^accounts/logout/$', 'django.contrib.auth.views.login', name='logout'),
- # url(r'^admin/login/$', 'django_cas.views.login', name='login'),
- # url(r'^admin/logout/$', 'django_cas.views.logout', name='logout'),
url('^accounts/', include('django.contrib.auth.urls')),
# Admin panel
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
- (r'^admin/', include(admin.site.urls)),
+ url(r'^admin/', admin.site.urls),
- url(r'^$', 'redakcja.views.main'),
- url(r'^register$', 'redakcja.views.register', name='register'),
+ url(r'^$', redakcja.views.main),
+ url(r'^register$', redakcja.views.register, name='register'),
url(r'^documents/', include('catalogue.urls')),
url(r'^editor/', include('wiki.urls')),
url(r'^organizations/', include('organizations.urls')),
url(r'^forms/', include(forms_builder.forms.urls)),
url(r'^i18n/', include('django.conf.urls.i18n')),
- (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', dict(packages=['wiki'])),
-
+ url(r'^jsi18n/$', javascript_catalog, {'packages': ['wiki']}, name='javascript_catalog'),
)
if settings.DEBUG:
- urlpatterns += staticfiles_urlpatterns()
- urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
+ urlpatterns += tuple(staticfiles_urlpatterns())
+ urlpatterns += tuple(static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT))
if getattr(settings, 'SERVE_FILES_WITH_DEBUG_FALSE', False):
- urlpatterns += patterns(
- '',
- (r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:],
- 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
- (r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:],
- 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
+ from django.views.static import serve
+ urlpatterns += (
+ (r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:], serve, {'document_root': settings.STATIC_ROOT}),
+ (r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:], serve, {'document_root': settings.MEDIA_ROOT}),
)
# git+git://github.com/fnp/librarian.git@master#egg=librarian
## Django
-Django>=1.8,<1.9
+Django>=1.9,<1.10
fnpdjango>=0.2,<0.3
-django-pipeline>=1.4.7,<1.5
+django-pipeline>=1.6,<1.7
sorl-thumbnail>=12.2,<13
#django-maintenancemode>=0.9
django-pagination
celery>=3.1.12,<3.2
kombu>3.0,<3.1
-South>=1.0.2
-
Embeder
future