Show More
@@ -15,3 +15,4 b' f5cca33d29c673b67d43f310bebc4e3a21c6d04c' | |||||
15 | 7f7c33ba6e3f3797ca866c5ed5d358a2393f1371 1.8 |
|
15 | 7f7c33ba6e3f3797ca866c5ed5d358a2393f1371 1.8 | |
16 | a6b9dd9547bdc17b681502efcceb17aa5c09adf4 1.8.1 |
|
16 | a6b9dd9547bdc17b681502efcceb17aa5c09adf4 1.8.1 | |
17 | 8318fa1615d1946e4519f5735ae880909521990d 2.0 |
|
17 | 8318fa1615d1946e4519f5735ae880909521990d 2.0 | |
|
18 | e23590ee7e2067a3f0fc3cbcfd66404b47127feb 2.1 |
@@ -15,6 +15,8 b" CONTEXT_PPD = 'posts_per_day'" | |||||
15 | CONTEXT_TAGS = 'tags' |
|
15 | CONTEXT_TAGS = 'tags' | |
16 | CONTEXT_USER = 'user' |
|
16 | CONTEXT_USER = 'user' | |
17 |
|
17 | |||
|
18 | PERMISSION_MODERATE = 'moderation' | |||
|
19 | ||||
18 |
|
20 | |||
19 | def user_and_ui_processor(request): |
|
21 | def user_and_ui_processor(request): | |
20 | context = {} |
|
22 | context = {} | |
@@ -28,10 +30,13 b' def user_and_ui_processor(request):' | |||||
28 | context[CONTEXT_THEME_CSS] = 'css/' + theme + '/base_page.css' |
|
30 | context[CONTEXT_THEME_CSS] = 'css/' + theme + '/base_page.css' | |
29 |
|
31 | |||
30 | # This shows the moderator panel |
|
32 | # This shows the moderator panel | |
31 | moderate = settings_manager.has_permission(PERMISSION_MODERATE) |
|
33 | try: | |
|
34 | moderate = request.user.has_perm('moderation') | |||
|
35 | except AttributeError: | |||
|
36 | moderate = False | |||
32 | context[CONTEXT_MODERATOR] = moderate |
|
37 | context[CONTEXT_MODERATOR] = moderate | |
33 |
|
38 | |||
34 | context[CONTEXT_VERSION] = settings.VERSION |
|
39 | context[CONTEXT_VERSION] = settings.VERSION | |
35 | context[CONTEXT_SITE_NAME] = settings.SITE_NAME |
|
40 | context[CONTEXT_SITE_NAME] = settings.SITE_NAME | |
36 |
|
41 | |||
37 | return context No newline at end of file |
|
42 | return context |
@@ -159,10 +159,12 b' def bbcode_extended(markup):' | |||||
159 | u'<span class="comment">//%(value)s</span>') |
|
159 | u'<span class="comment">//%(value)s</span>') | |
160 | parser.add_simple_formatter('spoiler', |
|
160 | parser.add_simple_formatter('spoiler', | |
161 | u'<span class="spoiler">%(value)s</span>') |
|
161 | u'<span class="spoiler">%(value)s</span>') | |
|
162 | # TODO Use <s> here | |||
162 | parser.add_simple_formatter('s', |
|
163 | parser.add_simple_formatter('s', | |
163 | u'<span class="strikethrough">%(value)s</span>') |
|
164 | u'<span class="strikethrough">%(value)s</span>') | |
|
165 | # TODO Why not use built-in tag? | |||
164 | parser.add_simple_formatter('code', |
|
166 | parser.add_simple_formatter('code', | |
165 | u'<pre><code>%(value)s</pre></code>') |
|
167 | u'<pre><code>%(value)s</pre></code>', render_embedded=False) | |
166 |
|
168 | |||
167 | text = preparse_text(markup) |
|
169 | text = preparse_text(markup) | |
168 | return parser.format(text) |
|
170 | return parser.format(text) |
@@ -57,3 +57,6 b' class PostImage(models.Model):' | |||||
57 | self.hash = md5.hexdigest() |
|
57 | self.hash = md5.hexdigest() | |
58 | super(PostImage, self).save(*args, **kwargs) |
|
58 | super(PostImage, self).save(*args, **kwargs) | |
59 |
|
59 | |||
|
60 | def __str__(self): | |||
|
61 | return self.image.url | |||
|
62 |
@@ -1,4 +1,4 b'' | |||||
1 |
VERSION = ' |
|
1 | VERSION = '2.1 Aya' | |
2 | SITE_NAME = 'n3b0a2d' |
|
2 | SITE_NAME = 'n3b0a2d' | |
3 |
|
3 | |||
4 | CACHE_TIMEOUT = 600 # Timeout for caching, if cache is used |
|
4 | CACHE_TIMEOUT = 600 # Timeout for caching, if cache is used |
@@ -46,12 +46,8 b'' | |||||
46 |
|
46 | |||
47 | <div class="navigation_panel"> |
|
47 | <div class="navigation_panel"> | |
48 | {% block metapanel %}{% endblock %} |
|
48 | {% block metapanel %}{% endblock %} | |
49 | {% if moderator %} |
|
49 | [<a href="{% url 'admin:index' %}">{% trans 'Admin' %}</a>] | |
50 |
|
|
50 | [<a href="{% url 'search' %}">{% trans 'Search' %}</a>] | |
51 | {% else %} |
|
|||
52 | [<a href="{% url "login" %}">{% trans 'Login' %}</a>] |
|
|||
53 | {% endif %} |
|
|||
54 | [<a href="{% url "search" %}">{% trans 'Search' %}</a>] |
|
|||
55 | {% with ppd=posts_per_day|floatformat:2 %} |
|
51 | {% with ppd=posts_per_day|floatformat:2 %} | |
56 | {% blocktrans %}Speed: {{ ppd }} posts per day{% endblocktrans %} |
|
52 | {% blocktrans %}Speed: {{ ppd }} posts per day{% endblocktrans %} | |
57 | {% endwith %} |
|
53 | {% endwith %} |
@@ -1,8 +1,9 b'' | |||||
1 | from django.conf.urls import patterns, url, include |
|
1 | from django.conf.urls import patterns, url, include | |
|
2 | from django.contrib import admin | |||
2 | from boards import views |
|
3 | from boards import views | |
3 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed |
|
4 | from boards.rss import AllThreadsFeed, TagThreadsFeed, ThreadPostsFeed | |
4 | from boards.views import api, tag_threads, all_threads, \ |
|
5 | from boards.views import api, tag_threads, all_threads, \ | |
5 |
|
|
6 | settings, all_tags | |
6 | from boards.views.authors import AuthorsView |
|
7 | from boards.views.authors import AuthorsView | |
7 | from boards.views.delete_post import DeletePostView |
|
8 | from boards.views.delete_post import DeletePostView | |
8 | from boards.views.ban import BanUserView |
|
9 | from boards.views.ban import BanUserView | |
@@ -15,17 +16,12 b' js_info_dict = {' | |||||
15 | } |
|
16 | } | |
16 |
|
17 | |||
17 | urlpatterns = patterns('', |
|
18 | urlpatterns = patterns('', | |
18 |
|
||||
19 | # /boards/ |
|
19 | # /boards/ | |
20 | url(r'^$', all_threads.AllThreadsView.as_view(), name='index'), |
|
20 | url(r'^$', all_threads.AllThreadsView.as_view(), name='index'), | |
21 | # /boards/page/ |
|
21 | # /boards/page/ | |
22 | url(r'^page/(?P<page>\w+)/$', all_threads.AllThreadsView.as_view(), |
|
22 | url(r'^page/(?P<page>\w+)/$', all_threads.AllThreadsView.as_view(), | |
23 | name='index'), |
|
23 | name='index'), | |
24 |
|
24 | |||
25 | # login page |
|
|||
26 | url(r'^login/$', login.LoginView.as_view(), name='login'), |
|
|||
27 | url(r'^logout/$', logout.LogoutView.as_view(), name='logout'), |
|
|||
28 |
|
||||
29 | # /boards/tag/tag_name/ |
|
25 | # /boards/tag/tag_name/ | |
30 | url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(), |
|
26 | url(r'^tag/(?P<tag_name>\w+)/$', tag_threads.TagView.as_view(), | |
31 | name='tag'), |
|
27 | name='tag'), |
@@ -10,15 +10,10 b' from boards.views.not_found import NotFo' | |||||
10 | admin.autodiscover() |
|
10 | admin.autodiscover() | |
11 |
|
11 | |||
12 | urlpatterns = patterns('', |
|
12 | urlpatterns = patterns('', | |
13 | # Examples: |
|
|||
14 | # url(r'^$', 'neboard.views.home', name='home'), |
|
|||
15 | # url(r'^neboard/', include('neboard.foo.urls')), |
|
|||
16 |
|
||||
17 | # Uncomment the admin/doc line below to enable admin documentation: |
|
13 | # Uncomment the admin/doc line below to enable admin documentation: | |
18 | # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), |
|
14 | # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), | |
19 |
|
15 | |||
20 | # Uncomment the next line to enable the admin: |
|
16 | url(r'^admin/', include(admin.site.urls), name='admin'), | |
21 | url(r'^admin/', include(admin.site.urls)), |
|
|||
22 | url(r'^', include('boards.urls')), |
|
17 | url(r'^', include('boards.urls')), | |
23 | ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) |
|
18 | ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) | |
24 |
|
19 |
@@ -13,12 +13,11 b'' | |||||
13 | * Post deletion confirmation page (or alert) |
|
13 | * Post deletion confirmation page (or alert) | |
14 | * Get thread graph image using pygraphviz |
|
14 | * Get thread graph image using pygraphviz | |
15 | * Subscribing to tag via AJAX |
|
15 | * Subscribing to tag via AJAX | |
16 | * Use django's native auth framework for administration |
|
|||
17 | * Add buttons to insert a named link or a named quote to the markup panel |
|
16 | * Add buttons to insert a named link or a named quote to the markup panel | |
18 | * Add support for "attention posts" that are shown in the header" |
|
17 | * Add support for "attention posts" that are shown in the header" | |
19 |
|
18 | |||
20 | = Bugs = |
|
19 | = Bugs = | |
21 |
* Search |
|
20 | * Search sort order is confusing | |
22 |
|
21 | |||
23 | = Testing = |
|
22 | = Testing = | |
24 | * Make tests for every view |
|
23 | * Make tests for every view |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now