Show More
@@ -1,8 +1,6 b'' | |||||
1 | from django.shortcuts import redirect |
|
1 | from django.shortcuts import redirect | |
2 | from boards import utils |
|
2 | from boards import utils | |
3 | from boards.models import Ban |
|
3 | from boards.models import Ban | |
4 | from django.utils.html import strip_spaces_between_tags |
|
|||
5 | from django.conf import settings |
|
|||
6 |
|
4 | |||
7 | RESPONSE_CONTENT_TYPE = 'Content-Type' |
|
5 | RESPONSE_CONTENT_TYPE = 'Content-Type' | |
8 |
|
6 | |||
@@ -28,18 +26,3 b' class BanMiddleware:' | |||||
28 | ban = bans[0] |
|
26 | ban = bans[0] | |
29 | if not ban.can_read: |
|
27 | if not ban.can_read: | |
30 | return redirect('banned') |
|
28 | return redirect('banned') | |
31 |
|
||||
32 |
|
||||
33 | class MinifyHTMLMiddleware(object): |
|
|||
34 | def process_response(self, request, response): |
|
|||
35 | try: |
|
|||
36 | compress_html = settings.COMPRESS_HTML |
|
|||
37 | except AttributeError: |
|
|||
38 | compress_html = False |
|
|||
39 |
|
||||
40 | if RESPONSE_CONTENT_TYPE in response\ |
|
|||
41 | and TYPE_HTML in response[RESPONSE_CONTENT_TYPE]\ |
|
|||
42 | and compress_html: |
|
|||
43 | response.content = strip_spaces_between_tags( |
|
|||
44 | response.content.strip()) |
|
|||
45 | return response No newline at end of file |
|
@@ -2,16 +2,13 b'' | |||||
2 | {% load i18n %} |
|
2 | {% load i18n %} | |
3 | {% load l10n %} |
|
3 | {% load l10n %} | |
4 | {% load static from staticfiles %} |
|
4 | {% load static from staticfiles %} | |
5 | {% load compress %} |
|
|||
6 |
|
5 | |||
7 | <!DOCTYPE html> |
|
6 | <!DOCTYPE html> | |
8 | <html> |
|
7 | <html> | |
9 | <head> |
|
8 | <head> | |
10 | {% compress css %} |
|
9 | <link rel="stylesheet" type="text/css" href="{% static 'css/base.css' %}" media="all"/> | |
11 |
|
|
10 | <link rel="stylesheet" type="text/css" href="{% static 'css/3party/highlight.css' %}" media="all"/> | |
12 |
|
|
11 | <link rel="stylesheet" type="text/css" href="{% static theme_css %}" media="all"/> | |
13 | <link rel="stylesheet" type="text/css" href="{% static theme_css %}" media="all"/> |
|
|||
14 | {% endcompress %} |
|
|||
15 |
|
12 | |||
16 | <link rel="alternate" type="application/rss+xml" href="rss/" title="{% trans 'Feed' %}"/> |
|
13 | <link rel="alternate" type="application/rss+xml" href="rss/" title="{% trans 'Feed' %}"/> | |
17 |
|
14 | |||
@@ -44,12 +41,10 b'' | |||||
44 | {% block content %}{% endblock %} |
|
41 | {% block content %}{% endblock %} | |
45 |
|
42 | |||
46 | <script src="{% static 'js/3party/highlight.min.js' %}"></script> |
|
43 | <script src="{% static 'js/3party/highlight.min.js' %}"></script> | |
47 | {% compress js %} |
|
44 | <script src="{% static 'js/popup.js' %}"></script> | |
48 |
|
|
45 | <script src="{% static 'js/image.js' %}"></script> | |
49 |
|
|
46 | <script src="{% static 'js/refpopup.js' %}"></script> | |
50 |
|
|
47 | <script src="{% static 'js/main.js' %}"></script> | |
51 | <script src="{% static 'js/main.js' %}"></script> |
|
|||
52 | {% endcompress %} |
|
|||
53 |
|
48 | |||
54 | <div class="navigation_panel footer"> |
|
49 | <div class="navigation_panel footer"> | |
55 | {% block metapanel %}{% endblock %} |
|
50 | {% block metapanel %}{% endblock %} |
@@ -116,7 +116,6 b' MIDDLEWARE_CLASSES = (' | |||||
116 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
116 | 'django.contrib.auth.middleware.AuthenticationMiddleware', | |
117 | 'django.contrib.messages.middleware.MessageMiddleware', |
|
117 | 'django.contrib.messages.middleware.MessageMiddleware', | |
118 | 'boards.middlewares.BanMiddleware', |
|
118 | 'boards.middlewares.BanMiddleware', | |
119 | 'boards.middlewares.MinifyHTMLMiddleware', |
|
|||
120 | ) |
|
119 | ) | |
121 |
|
120 | |||
122 | ROOT_URLCONF = 'neboard.urls' |
|
121 | ROOT_URLCONF = 'neboard.urls' | |
@@ -150,9 +149,6 b' INSTALLED_APPS = (' | |||||
150 | # Search |
|
149 | # Search | |
151 | 'haystack', |
|
150 | 'haystack', | |
152 |
|
151 | |||
153 | # Static files compressor |
|
|||
154 | 'compressor', |
|
|||
155 |
|
||||
156 | 'boards', |
|
152 | 'boards', | |
157 | ) |
|
153 | ) | |
158 |
|
154 | |||
@@ -208,8 +204,6 b' THEMES = [' | |||||
208 |
|
204 | |||
209 | POSTING_DELAY = 20 # seconds |
|
205 | POSTING_DELAY = 20 # seconds | |
210 |
|
206 | |||
211 | COMPRESS_HTML = False |
|
|||
212 |
|
||||
213 | # Websocket settins |
|
207 | # Websocket settins | |
214 | CENTRIFUGE_HOST = 'localhost' |
|
208 | CENTRIFUGE_HOST = 'localhost' | |
215 | CENTRIFUGE_PORT = '9090' |
|
209 | CENTRIFUGE_PORT = '9090' |
General Comments 0
You need to be logged in to leave comments.
Login now