##// END OF EJS Templates
Added a centered MD theme (with maximum thread width).
neko259 -
r254:2b1879ad default
parent child Browse files
Show More
@@ -0,0 +1,12 b''
1 @import url("../md/base_page.css");
2
3 .thread, .post-form-w, .image-mode-tab {
4 max-width: 1000px;
5 margin-left: auto;
6 margin-right: auto;
7 }
8
9 .thread {
10 border-left: solid 2px #888;
11 border-right: solid 2px #888;
12 }
@@ -1,142 +1,142 b''
1 1 {% extends "boards/base.html" %}
2 2
3 3 {% load i18n %}
4 4 {% load markup %}
5 5 {% load cache %}
6 6
7 7 {% block head %}
8 8 <title>Neboard - {{ posts.0.get_title }}</title>
9 9 {% endblock %}
10 10
11 11 {% block content %}
12 12 {% get_current_language as LANGUAGE_CODE %}
13 13
14 14 <script src="{{ STATIC_URL }}js/thread.js"></script>
15 15
16 16 {% if posts %}
17 17 {% cache 600 thread_view posts.0.last_edit_time moderator LANGUAGE_CODE %}
18 <div id="posts">
19 {% for post in posts %}
18 <div class="thread" id="posts">
19 {% for post in posts %}
20 20 {% if bumpable %}
21 21 <div class="post" id="{{ post.id }}">
22 22 {% else %}
23 23 <div class="post dead_post" id="{{ post.id }}">
24 24 {% endif %}
25 25 {% if post.image %}
26 26 <div class="image">
27 27 <a
28 28 class="thumb"
29 29 href="{{ post.image.url }}"><img
30 30 src="{{ post.image.url_200x150 }}"
31 31 alt="{{ post.id }}"
32 32 data-width="{{ post.image_width }}"
33 33 data-height="{{ post.image_height }}"/>
34 34 </a>
35 35 </div>
36 36 {% endif %}
37 37 <div class="message">
38 38 <div class="post-info">
39 39 <span class="title">{{ post.title }}</span>
40 40 <a class="post_id" href="#{{ post.id }}">
41 41 (#{{ post.id }})</a>
42 42 [{{ post.pub_time }}]
43 43 [<a href="#" onclick="javascript:addQuickReply('{{ post.id }}')
44 44 ; return false;">&gt;&gt;</a>]
45 45
46 46 {% if moderator %}
47 47 <span class="moderator_info">
48 48 [<a href="{% url 'delete' post_id=post.id %}"
49 49 >{% trans 'Delete' %}</a>]
50 50 ({{ post.poster_ip }})
51 51 [<a href="{% url 'ban' post_id=post.id %}?next={{ request.path }}"
52 52 >{% trans 'Ban IP' %}</a>]
53 53 </span>
54 54 {% endif %}
55 55 </div>
56 56 {% autoescape off %}
57 57 {{ post.text.rendered }}
58 58 {% endautoescape %}
59 59 </div>
60 60 {% if post.id == posts.0.id %}
61 61 <div class="metadata">
62 62 <span class="tags">{% trans 'Tags' %}:
63 63 {% for tag in post.tags.all %}
64 64 <a class="tag" href="{% url 'tag' tag.name %}">
65 65 {{ tag.name }}</a>
66 66 {% endfor %}
67 67 </span>
68 68 </div>
69 69 {% endif %}
70 70 </div>
71 71 {% endfor %}
72 72 </div>
73 73 {% endcache %}
74 74 {% endif %}
75 75
76 76 <form id="form" enctype="multipart/form-data" method="post"
77 77 >{% csrf_token %}
78 78 <div class="post-form-w">
79 79 <div class="form-title">{% trans "Reply to thread" %} #{{ posts.0.id }}</div>
80 80 <div class="post-form">
81 81 <div class="form-row">
82 82 <div class="form-label">{% trans 'Title' %}</div>
83 83 <div class="form-input">{{ form.title }}</div>
84 84 <div class="form-errors">{{ form.title.errors }}</div>
85 85 </div>
86 86 <div class="form-row">
87 87 <div class="form-label">{% trans 'Formatting' %}</div>
88 88 <div class="form-input" id="mark_panel">
89 89 <span class="mark_btn" id="quote"><span class="quote">&gt;{% trans 'quote' %}</span></span>
90 90 <span class="mark_btn" id="italic"><i>{% trans 'italic' %}</i></span>
91 91 <span class="mark_btn" id="bold"><b>{% trans 'bold' %}</b></span>
92 92 <span class="mark_btn" id="spoiler"><span class="spoiler">{% trans 'spoiler' %}</span></span>
93 93 <span class="mark_btn" id="comment"><span class="comment">// {% trans 'comment' %}</span></span>
94 94 </div>
95 95 </div>
96 96 <div class="form-row">
97 97 <div class="form-label">{% trans 'Text' %}</div>
98 98 <div class="form-input">{{ form.text }}</div>
99 99 <div class="form-errors">{{ form.text.errors }}</div>
100 100 </div>
101 101 <div class="form-row">
102 102 <div class="form-label">{% trans 'Image' %}</div>
103 103 <div class="form-input">{{ form.image }}</div>
104 104 <div class="form-errors">{{ form.image.errors }}</div>
105 105 </div>
106 106 <div class="form-row form-email">
107 107 <div class="form-label">{% trans 'e-mail' %}</div>
108 108 <div class="form-input">{{ form.email }}</div>
109 109 <div class="form-errors">{{ form.email.errors }}</div>
110 110 </div>
111 111 <div class="form-row">
112 112 {{ form.captcha }}
113 113 <div class="form-errors">{{ form.captcha.errors }}</div>
114 114 </div>
115 115 <div class="form-row">
116 116 <div class="form-errors">{{ form.other.errors }}</div>
117 117 </div>
118 118 </div>
119 119
120 120 <div class="form-submit"><input type="submit"
121 121 value="{% trans "Post" %}"/></div>
122 122 <div><a href="{% url "staticpage" name="help" %}">
123 123 {% trans 'Text syntax' %}</a></div>
124 124 </div>
125 125 </form>
126 126
127 127 {% endblock %}
128 128
129 129 {% block metapanel %}
130 130
131 131 {% get_current_language as LANGUAGE_CODE %}
132 132
133 133 <span class="metapanel">
134 134 {% cache 600 thread_meta posts.0.last_edit_time moderator LANGUAGE_CODE %}
135 135 {{ posts.0.get_reply_count }} {% trans 'replies' %},
136 136 {{ posts.0.get_images_count }} {% trans 'images' %}.
137 137 {% trans 'Last update: ' %}{{ posts.0.last_edit_time }}
138 138 [<a href="rss/">RSS</a>]
139 139 {% endcache %}
140 140 </span>
141 141
142 142 {% endblock %}
@@ -1,215 +1,209 b''
1 1 # Django settings for neboard project.
2 2 import os
3 3 import markdown
4 4 from boards.mdx_neboard import markdown_extended
5 5
6 6 DEBUG = True
7 7 TEMPLATE_DEBUG = DEBUG
8 8
9 9 ADMINS = (
10 10 # ('Your Name', 'your_email@example.com'),
11 11 ('admin', 'admin@example.com')
12 12 )
13 13
14 14 MANAGERS = ADMINS
15 15
16 16 DATABASES = {
17 17 'default': {
18 18 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
19 19 'NAME': 'database.db', # Or path to database file if using sqlite3.
20 20 'USER': '', # Not used with sqlite3.
21 21 'PASSWORD': '', # Not used with sqlite3.
22 22 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
23 23 'PORT': '', # Set to empty string for default. Not used with sqlite3.
24 24 }
25 25 }
26 26
27 CACHES = {
28 'default': {
29 'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
30 'LOCATION': 'neboard_cache',
31 }
32 }
33
34 27 # Local time zone for this installation. Choices can be found here:
35 28 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
36 29 # although not all choices may be available on all operating systems.
37 30 # In a Windows environment this must be set to your system time zone.
38 31 TIME_ZONE = 'Europe/Kiev'
39 32
40 33 # Language code for this installation. All choices can be found here:
41 34 # http://www.i18nguy.com/unicode/language-identifiers.html
42 35 LANGUAGE_CODE = 'en'
43 36
44 37 SITE_ID = 1
45 38
46 39 # If you set this to False, Django will make some optimizations so as not
47 40 # to load the internationalization machinery.
48 41 USE_I18N = True
49 42
50 43 # If you set this to False, Django will not format dates, numbers and
51 44 # calendars according to the current locale.
52 45 USE_L10N = True
53 46
54 47 # If you set this to False, Django will not use timezone-aware datetimes.
55 48 USE_TZ = True
56 49
57 50 # Absolute filesystem path to the directory that will hold user-uploaded files.
58 51 # Example: "/home/media/media.lawrence.com/media/"
59 52 MEDIA_ROOT = './media/'
60 53
61 54 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
62 55 # trailing slash.
63 56 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
64 57 MEDIA_URL = '/media/'
65 58
66 59 # Absolute path to the directory static files should be collected to.
67 60 # Don't put anything in this directory yourself; store your static files
68 61 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
69 62 # Example: "/home/media/media.lawrence.com/static/"
70 63 STATIC_ROOT = ''
71 64
72 65 # URL prefix for static files.
73 66 # Example: "http://media.lawrence.com/static/"
74 67 STATIC_URL = '/static/'
75 68
76 69 # Additional locations of static files
77 70 # It is really a hack, put real paths, not related
78 71 STATICFILES_DIRS = (
79 72 os.path.dirname(__file__) + '/boards/static',
80 73
81 74 # '/d/work/python/django/neboard/neboard/boards/static',
82 75 # Put strings here, like "/home/html/static" or "C:/www/django/static".
83 76 # Always use forward slashes, even on Windows.
84 77 # Don't forget to use absolute paths, not relative paths.
85 78 )
86 79
87 80 # List of finder classes that know how to find static files in
88 81 # various locations.
89 82 STATICFILES_FINDERS = (
90 83 'django.contrib.staticfiles.finders.FileSystemFinder',
91 84 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
92 85 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
93 86 )
94 87
95 88 # Make this unique, and don't share it with anybody.
96 89 SECRET_KEY = '@1rc$o(7=tt#kd+4s$u6wchm**z^)4x90)7f6z(i&amp;55@o11*8o'
97 90
98 91 # List of callables that know how to import templates from various sources.
99 92 TEMPLATE_LOADERS = (
100 93 'django.template.loaders.filesystem.Loader',
101 94 'django.template.loaders.app_directories.Loader',
102 95 # 'django.template.loaders.eggs.Loader',
103 96 )
104 97
105 98 TEMPLATE_CONTEXT_PROCESSORS = (
106 99 'django.core.context_processors.media',
107 100 'django.core.context_processors.static',
108 101 'django.core.context_processors.request',
109 102 'django.contrib.auth.context_processors.auth',
110 103 )
111 104
112 105 MIDDLEWARE_CLASSES = (
113 106 'django.contrib.sessions.middleware.SessionMiddleware',
114 107 'django.middleware.locale.LocaleMiddleware',
115 108 'django.middleware.common.CommonMiddleware',
116 109 # 'django.middleware.csrf.CsrfViewMiddleware',
117 110 'django.contrib.auth.middleware.AuthenticationMiddleware',
118 111 'django.contrib.messages.middleware.MessageMiddleware',
119 112 # Uncomment the next line for simple clickjacking protection:
120 113 # 'django.middleware.clickjacking.XFrameOptionsMiddleware'
121 114 'boards.middlewares.BanMiddleware',
122 115 )
123 116
124 117 ROOT_URLCONF = 'neboard.urls'
125 118
126 119 # Python dotted path to the WSGI application used by Django's runserver.
127 120 WSGI_APPLICATION = 'neboard.wsgi.application'
128 121
129 122 TEMPLATE_DIRS = (
130 123 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
131 124 # Always use forward slashes, even on Windows.
132 125 # Don't forget to use absolute paths, not relative paths.
133 126 'templates',
134 127 )
135 128
136 129 INSTALLED_APPS = (
137 130 'django.contrib.auth',
138 131 'django.contrib.contenttypes',
139 132 'django.contrib.sessions',
140 133 # 'django.contrib.sites',
141 134 'django.contrib.messages',
142 135 'django.contrib.staticfiles',
143 136 # Uncomment the next line to enable the admin:
144 137 'django.contrib.admin',
145 138 # Uncomment the next line to enable admin documentation:
146 139 # 'django.contrib.admindocs',
147 140 'django.contrib.markup',
148 141 'django_cleanup',
149 142 'boards',
150 143 'captcha',
151 144 'south',
152 145 )
153 146
154 147 # TODO: NEED DESIGN FIXES
155 148 CAPTCHA_OUTPUT_FORMAT = (u' %(hidden_field)s '
156 149 u'<div class="form-label">%(image)s</div>'
157 150 u'<div class="form-text">%(text_field)s</div>')
158 151
159 152 # A sample logging configuration. The only tangible logging
160 153 # performed by this configuration is to send an email to
161 154 # the site admins on every HTTP 500 error when DEBUG=False.
162 155 # See http://docs.djangoproject.com/en/dev/topics/logging for
163 156 # more details on how to customize your logging configuration.
164 157 LOGGING = {
165 158 'version': 1,
166 159 'disable_existing_loggers': False,
167 160 'filters': {
168 161 'require_debug_false': {
169 162 '()': 'django.utils.log.RequireDebugFalse'
170 163 }
171 164 },
172 165 'handlers': {
173 166 'mail_admins': {
174 167 'level': 'ERROR',
175 168 'filters': ['require_debug_false'],
176 169 'class': 'django.utils.log.AdminEmailHandler'
177 170 }
178 171 },
179 172 'loggers': {
180 173 'django.request': {
181 174 'handlers': ['mail_admins'],
182 175 'level': 'ERROR',
183 176 'propagate': True,
184 177 },
185 178 }
186 179 }
187 180
188 181 MARKUP_FIELD_TYPES = (
189 182 ('markdown', markdown_extended),
190 183 )
191 184 # Custom imageboard settings
192 185 MAX_POSTS_PER_THREAD = 10 # Thread bumplimit
193 186 MAX_THREAD_COUNT = 500 # Old threads will be deleted to preserve this count
194 187 THREADS_PER_PAGE = 10
195 188 SITE_NAME = 'Neboard'
196 189
197 190 THEMES = [
198 191 ('md', 'Mystic Dark'),
192 ('md_centered', 'Mystic Dark (centered)'),
199 193 ('sw', 'Snow White'),
200 194 ('pg', 'Photon Gray'),
201 195 ]
202 196
203 197 DEFAULT_THEME = 'md'
204 198
205 199 POPULAR_TAGS = 10
206 200 LAST_REPLIES_COUNT = 3
207 201
208 202 ENABLE_CAPTCHA = False
209 203 # if user tries to post before CAPTCHA_DEFAULT_SAFE_TIME. Captcha will be shown
210 204 CAPTCHA_DEFAULT_SAFE_TIME = 30 # seconds
211 205 POSTING_DELAY = 30 # seconds
212 206
213 207 # Debug mode middlewares
214 208 if DEBUG:
215 209 MIDDLEWARE_CLASSES += ('boards.profiler.ProfilerMiddleware',)
General Comments 0
You need to be logged in to leave comments. Login now