diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-02-15 17:21:38 -0500 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-02-15 17:21:38 -0500 |
commit | 5b14d70ed60e63d2745b9d9edafbc694fd2f3f9d (patch) | |
tree | 1947a84208b1663053950fca47b6802e95db1e33 | |
parent | 555de7f911f34268e0e008eff653bcd342a929b6 (diff) | |
parent | 996a1a8f222bbb474bfe7aba95e8bac015d52c77 (diff) | |
download | askbot-5b14d70ed60e63d2745b9d9edafbc694fd2f3f9d.tar.gz askbot-5b14d70ed60e63d2745b9d9edafbc694fd2f3f9d.tar.bz2 askbot-5b14d70ed60e63d2745b9d9edafbc694fd2f3f9d.zip |
Merge branch 'hernani'
-rw-r--r-- | forum/skins/default/templates/book.html | 2 | ||||
-rw-r--r-- | forum/skins/default/templates/index.html | 4 | ||||
-rw-r--r-- | forum/skins/default/templates/question.html | 4 | ||||
-rw-r--r-- | forum/skins/default/templates/question_summary_list_roll.html | 2 | ||||
-rw-r--r-- | forum/skins/default/templates/questions.html | 4 | ||||
-rw-r--r-- | forum/skins/default/templates/tags.html | 2 | ||||
-rw-r--r-- | forum/skins/default/templates/user_stats.html | 2 | ||||
-rw-r--r-- | forum/skins/default/templates/users_questions.html | 2 | ||||
-rw-r--r-- | forum/urls.py | 80 | ||||
-rw-r--r-- | forum/views/__init__.py | 8 | ||||
-rw-r--r-- | forum/views/users.py | 161 | ||||
-rwxr-xr-x | osqa.iml | 10 | ||||
-rwxr-xr-x | settings_local.py.dist | 110 |
13 files changed, 144 insertions, 247 deletions
diff --git a/forum/skins/default/templates/book.html b/forum/skins/default/templates/book.html index 683f13cf..8574fa73 100644 --- a/forum/skins/default/templates/book.html +++ b/forum/skins/default/templates/book.html @@ -122,7 +122,7 @@ </h3> <div class="tags"> {% for tag in question.tagname_list %} - <a href="{% url forum.views.tag tag|urlencode %}" title="{% "see questions tagged with" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a> + <a href="{% url tag_questions tag|urlencode %}" title="{% "see questions tagged with" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a> {% endfor %} </div> <div class="started"> diff --git a/forum/skins/default/templates/index.html b/forum/skins/default/templates/index.html index df2814d6..7fa189ae 100644 --- a/forum/skins/default/templates/index.html +++ b/forum/skins/default/templates/index.html @@ -102,7 +102,7 @@ <div class="tags"> {% for tag in question.tagname_list %} - <a href="{% url forum.views.tag tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a> + <a href="{% url tag_questions tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a> {% endfor %} </div> </div> @@ -129,7 +129,7 @@ <div class="tags"> {% for tag in tags %} <a rel="tag" - title="{% blocktrans with tag.name as tagname %}see questions tagged '{{tagname}}'{% endblocktrans %}" href="{% url forum.views.tag tag.name|urlencode %}">{{ tag.name }}</a> + title="{% blocktrans with tag.name as tagname %}see questions tagged '{{tagname}}'{% endblocktrans %}" href="{% url tag_questions tag.name|urlencode %}">{{ tag.name }}</a> {% endfor %} </div> <div class="more"><a href="{% url tags %}">{% trans "popular tags" %} ยป</a> </div> diff --git a/forum/skins/default/templates/question.html b/forum/skins/default/templates/question.html index 34f8fd1d..fe9f5cde 100644 --- a/forum/skins/default/templates/question.html +++ b/forum/skins/default/templates/question.html @@ -129,7 +129,7 @@ <div id="question-controls" class="post-controls">
<div id="question-tags" class="tags">
{% for tag in question.tagname_list %}
- <a href="{% url forum.views.tag tag|urlencode %}" class="post-tag"
+ <a href="{% url tag_questions tag|urlencode %}" class="post-tag"
title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a>
{% endfor %}
</div>
@@ -474,7 +474,7 @@ </p>
<p class="tags" >
{% for tag in tags %}
- <a href="{% url forum.views.tag tag.name|urlencode %}"
+ <a href="{% url tag_questions tag.name|urlencode %}"
title="{% trans "see questions tagged"%}'{{tag.name}}'{% trans "using tags" %}"
rel="tag">{{ tag.name }}</a> <span class="tag-number">×{{ tag.used_count|intcomma }}</span><br/>
{% endfor %}
diff --git a/forum/skins/default/templates/question_summary_list_roll.html b/forum/skins/default/templates/question_summary_list_roll.html index 7312dca9..57685d6d 100644 --- a/forum/skins/default/templates/question_summary_list_roll.html +++ b/forum/skins/default/templates/question_summary_list_roll.html @@ -49,7 +49,7 @@ <div class="tags"> {% for tag in question.tagname_list %} - <a href="{% url forum.views.tag tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a> + <a href="{% url tag_questions tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a> {% endfor %} </div> </div> diff --git a/forum/skins/default/templates/questions.html b/forum/skins/default/templates/questions.html index 77802efc..4c3b96d2 100644 --- a/forum/skins/default/templates/questions.html +++ b/forum/skins/default/templates/questions.html @@ -133,7 +133,7 @@ <div class="tags">
{% for tag in question.tagname_list %}
- <a href="{% url forum.views.tag tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a>
+ <a href="{% url tag_questions tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a>
{% endfor %}
</div>
</div>
@@ -224,7 +224,7 @@ <h3 class="subtitle">{% trans "Related tags" %}</h3>
<div class="tags">
{% for tag in tags %}
- <a rel="tag" title="{% blocktrans with tag.name as tag_name %}see questions tagged '{{ tag_name }}'{% endblocktrans %}" href="{% url forum.views.tag tag.name|urlencode %}">{{ tag.name }}</a>
+ <a rel="tag" title="{% blocktrans with tag.name as tag_name %}see questions tagged '{{ tag_name }}'{% endblocktrans %}" href="{% url tag_questions tag.name|urlencode %}">{{ tag.name }}</a>
<span class="tag-number">× {{ tag.used_count|intcomma }}</span>
<br />
{% endfor %}
diff --git a/forum/skins/default/templates/tags.html b/forum/skins/default/templates/tags.html index 1bde187f..50f90fb1 100644 --- a/forum/skins/default/templates/tags.html +++ b/forum/skins/default/templates/tags.html @@ -46,7 +46,7 @@ <ul class="tagsList tags"> {% for tag in tags.object_list %} <li> - <a href="{% url forum.views.tag tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag"> + <a href="{% url tag_questions tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag"> {{ tag }} </a> <span class="tag-number">× {{ tag.used_count|intcomma }}</span> diff --git a/forum/skins/default/templates/user_stats.html b/forum/skins/default/templates/user_stats.html index 933764d9..a3f88131 100644 --- a/forum/skins/default/templates/user_stats.html +++ b/forum/skins/default/templates/user_stats.html @@ -98,7 +98,7 @@ {% for tag in user_tags%} <a rel="tag" title="{% blocktrans with tag.name as tag_name %}see other questions with {{view_user}}'s contributions tagged '{{ tag_name }}' {% endblocktrans %}" - href="{% url forum.views.tag tag|urlencode %}?user={{view_user.username}}">{{tag.name}}</a> + href="{% url tag_questions tag|urlencode %}?user={{view_user.username}}">{{tag.name}}</a> <span class="tag-number">× {{ tag.user_tag_usage_count|intcomma }}</span><br/> {% if forloop.counter|divisibleby:"10" %} </td> diff --git a/forum/skins/default/templates/users_questions.html b/forum/skins/default/templates/users_questions.html index eb1be4ee..8049d832 100644 --- a/forum/skins/default/templates/users_questions.html +++ b/forum/skins/default/templates/users_questions.html @@ -49,7 +49,7 @@ {% convert2tagname_list question %} {% for tag in question.tagnames %} <!--todo - move trans below to blocktrans --> - <a href="{% url forum.views.tag tag|urlencode %}" title="{% trans "see questions tagged" %} '{{ tag }}' {% trans "using tags" %}" rel="tag">{{ tag }}</a> + <a href="{% url tag_questions tag|urlencode %}" title="{% trans "see questions tagged" %} '{{ tag }}' {% trans "using tags" %}" rel="tag">{{ tag }}</a> {% endfor %} </div> <div class="started"> diff --git a/forum/urls.py b/forum/urls.py index f93d5151..fe335538 100644 --- a/forum/urls.py +++ b/forum/urls.py @@ -17,7 +17,7 @@ sitemaps = { APP_PATH = os.path.dirname(__file__) urlpatterns = patterns('', - url(r'^$', app.index, name='index'), + url(r'^$', app.content.index, name='index'), url(r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}), #(r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': '/media/images/favicon.ico'}), #(r'^favicon\.gif$', 'django.views.generic.simple.redirect_to', {'url': '/media/images/favicon.gif'}), @@ -28,65 +28,65 @@ urlpatterns = patterns('', {'document_root': os.path.join(APP_PATH,'upfiles').replace('\\','/')} ), (r'^%s/$' % _('signin/'), 'django_authopenid.views.signin'), - url(r'^%s$' % _('about/'), app.about, name='about'), - url(r'^%s$' % _('faq/'), app.faq, name='faq'), - url(r'^%s$' % _('privacy/'), app.privacy, name='privacy'), - url(r'^%s$' % _('logout/'), app.logout, name='logout'), - url(r'^%s(?P<id>\d+)/%s$' % (_('answers/'), _('comments/')), app.answer_comments, name='answer_comments'), - url(r'^%s(?P<id>\d+)/%s$' % (_('answers/'), _('edit/')), app.edit_answer, name='edit_answer'), - url(r'^%s(?P<id>\d+)/%s$' % (_('answers/'), _('revisions/')), app.answer_revisions, name='answer_revisions'), - url(r'^%s$' % _('questions/'), app.questions, name='questions'), - url(r'^%s%s$' % (_('questions/'), _('ask/')), app.ask, name='ask'), - url(r'^%s%s$' % (_('questions/'), _('unanswered/')), app.unanswered, name='unanswered'), - url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('edit/')), app.edit_question, name='edit_question'), - url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('close/')), app.close, name='close'), - url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('reopen/')), app.reopen, name='reopen'), - url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('answer/')), app.answer, name='answer'), - url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('vote/')), app.vote, name='vote'), - url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('revisions/')), app.question_revisions, name='question_revisions'), - url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('comments/')), app.question_comments, name='question_comments'), - url(r'^%s$' % _('command/'), app.ajax_command, name='call_ajax'), + url(r'^%s$' % _('about/'), app.meta.about, name='about'), + url(r'^%s$' % _('faq/'), app.meta.faq, name='faq'), + url(r'^%s$' % _('privacy/'), app.meta.privacy, name='privacy'), + url(r'^%s$' % _('logout/'), app.meta.logout, name='logout'), + url(r'^%s(?P<id>\d+)/%s$' % (_('answers/'), _('comments/')), app.content.answer_comments, name='answer_comments'), + url(r'^%s(?P<id>\d+)/%s$' % (_('answers/'), _('edit/')), app.content.edit_answer, name='edit_answer'), + url(r'^%s(?P<id>\d+)/%s$' % (_('answers/'), _('revisions/')), app.content.answer_revisions, name='answer_revisions'), + url(r'^%s$' % _('questions/'), app.content.questions, name='questions'), + url(r'^%s%s$' % (_('questions/'), _('ask/')), app.content.ask, name='ask'), + url(r'^%s%s$' % (_('questions/'), _('unanswered/')), app.content.unanswered, name='unanswered'), + url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('edit/')), app.content.edit_question, name='edit_question'), + url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('close/')), app.content.close, name='close'), + url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('reopen/')), app.content.reopen, name='reopen'), + url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('answer/')), app.content.answer, name='answer'), + url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('vote/')), app.content.vote, name='vote'), + url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('revisions/')), app.content.question_revisions, name='question_revisions'), + url(r'^%s(?P<id>\d+)/%s$' % (_('questions/'), _('comments/')), app.content.question_comments, name='question_comments'), + url(r'^%s$' % _('command/'), app.content.ajax_command, name='call_ajax'), url(r'^%s(?P<object_id>\d+)/%s(?P<comment_id>\d+)/%s$' % (_('questions/'), _('comments/'),_('delete/')), \ - app.delete_comment, kwargs={'commented_object_type':'question'},\ + app.content.delete_comment, kwargs={'commented_object_type':'question'},\ name='delete_question_comment'), url(r'^%s(?P<object_id>\d+)/%s(?P<comment_id>\d+)/%s$' % (_('answers/'), _('comments/'),_('delete/')), \ - app.delete_comment, kwargs={'commented_object_type':'answer'}, \ + app.content.delete_comment, kwargs={'commented_object_type':'answer'}, \ name='delete_answer_comment'), \ #place general question item in the end of other operations - url(r'^%s(?P<id>\d+)/' % _('question/'), app.question, name='question'), - url(r'^%s$' % _('tags/'), app.tags, name='tags'), - url(r'^%s(?P<tag>[^/]+)/$' % _('tags/'), app.tag, name='tag_questions'), + url(r'^%s(?P<id>\d+)/' % _('question/'), app.content.question, name='question'), + url(r'^%s$' % _('tags/'), app.content.tags, name='tags'), + url(r'^%s(?P<tag>[^/]+)/$' % _('tags/'), app.content.tag, name='tag_questions'), - url(r'^%s%s(?P<tag>[^/]+)/$' % (_('mark-tag/'),_('interesting/')), app.mark_tag, \ + url(r'^%s%s(?P<tag>[^/]+)/$' % (_('mark-tag/'),_('interesting/')), app.content.mark_tag, \ kwargs={'reason':'good','action':'add'}, \ name='mark_interesting_tag'), - url(r'^%s%s(?P<tag>[^/]+)/$' % (_('mark-tag/'),_('ignored/')), app.mark_tag, \ + url(r'^%s%s(?P<tag>[^/]+)/$' % (_('mark-tag/'),_('ignored/')), app.content.mark_tag, \ kwargs={'reason':'bad','action':'add'}, \ name='mark_ignored_tag'), - url(r'^%s(?P<tag>[^/]+)/$' % _('unmark-tag/'), app.mark_tag, \ + url(r'^%s(?P<tag>[^/]+)/$' % _('unmark-tag/'), app.content.mark_tag, \ kwargs={'action':'remove'}, \ name='mark_ignored_tag'), - url(r'^%s$' % _('users/'),app.users, name='users'), - url(r'^%s(?P<id>\d+)/$' % _('moderate-user/'), app.moderate_user, name='moderate_user'), - url(r'^%s(?P<id>\d+)/%s$' % (_('users/'), _('edit/')), app.edit_user, name='edit_user'), - url(r'^%s(?P<id>\d+)//*' % _('users/'), app.user, name='user'), - url(r'^%s$' % _('badges/'),app.badges, name='badges'), - url(r'^%s(?P<id>\d+)//*' % _('badges/'), app.badge, name='badge'), - url(r'^%s%s$' % (_('messages/'), _('markread/')),app.read_message, name='read_message'), + url(r'^%s$' % _('users/'),app.users.users, name='users'), + url(r'^%s(?P<id>\d+)/$' % _('moderate-user/'), app.users.moderate_user, name='moderate_user'), + url(r'^%s(?P<id>\d+)/%s$' % (_('users/'), _('edit/')), app.users.edit_user, name='edit_user'), + url(r'^%s(?P<id>\d+)//*' % _('users/'), app.users.user, name='user'), + url(r'^%s$' % _('badges/'),app.meta.badges, name='badges'), + url(r'^%s(?P<id>\d+)//*' % _('badges/'), app.meta.badge, name='badge'), + url(r'^%s%s$' % (_('messages/'), _('markread/')),app.meta.read_message, name='read_message'), # (r'^admin/doc/' % _('admin/doc'), include('django.contrib.admindocs.urls')), (r'^%s(.*)' % _('nimda/'), admin.site.root), url(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}), - (r'^%s$' % _('upload/'), app.upload), - url(r'^%s$' % _('books/'), app.books, name='books'), - url(r'^%s%s(?P<short_name>[^/]+)/$' % (_('books/'), _('ask/')), app.ask_book, name='ask_book'), - url(r'^%s(?P<short_name>[^/]+)/$' % _('books/'), app.book, name='book'), - url(r'^%s$' % _('search/'), app.search, name='search'), - url(r'^%s$' % _('feedback/'), app.feedback, name='feedback'), + (r'^%s$' % _('upload/'), app.content.upload), + url(r'^%s$' % _('books/'), app.books.books, name='books'), + url(r'^%s%s(?P<short_name>[^/]+)/$' % (_('books/'), _('ask/')), app.books.ask_book, name='ask_book'), + url(r'^%s(?P<short_name>[^/]+)/$' % _('books/'), app.books.book, name='book'), + url(r'^%s$' % _('search/'), app.content.search, name='search'), + url(r'^%s$' % _('feedback/'), app.meta.feedback, name='feedback'), (r'^%sfb/' % _('account/'), include('fbconnect.urls')), (r'^%s' % _('account/'), include('django_authopenid.urls')), (r'^i18n/', include('django.conf.urls.i18n')), diff --git a/forum/views/__init__.py b/forum/views/__init__.py index 0bd91fe6..7fdb6f61 100644 --- a/forum/views/__init__.py +++ b/forum/views/__init__.py @@ -1,4 +1,4 @@ -from forum.views.content import * -from forum.views.users import * -from forum.views.meta import * -from forum.views.books import * +import content +import users +import meta +import books diff --git a/forum/views/users.py b/forum/views/users.py index 03d38834..2c7f5c34 100644 --- a/forum/views/users.py +++ b/forum/views/users.py @@ -22,88 +22,6 @@ question_revision_type_id = question_revision_type.id answer_revision_type_id = answer_revision_type.id repute_type_id = repute_type.id -# used in users -class UserView: - def __init__(self, id, tab_title, tab_description, page_title, view_name, template_file, data_size=0): - self.id = id - self.tab_title = tab_title - self.tab_description = tab_description - self.page_title = page_title - self.view_name = view_name - self.template_file = template_file - self.data_size = data_size - -USER_TEMPLATE_VIEWS = ( - UserView( - id = 'stats', - tab_title = _('overview'), - tab_description = _('user profile'), - page_title = _('user profile overview'), - view_name = 'user_stats', - template_file = 'user_stats.html' - ), - UserView( - id = 'recent', - tab_title = _('recent activity'), - tab_description = _('recent user activity'), - page_title = _('profile - recent activity'), - view_name = 'user_recent', - template_file = 'user_recent.html', - data_size = 50 - ), - UserView( - id = 'responses', - tab_title = _('responses'), - tab_description = _('comments and answers to others questions'), - page_title = _('profile - responses'), - view_name = 'user_responses', - template_file = 'user_responses.html', - data_size = 50 - ), - UserView( - id = 'reputation', - tab_title = _('reputation'), - tab_description = _('user reputation in the community'), - page_title = _('profile - user reputation'), - view_name = 'user_reputation', - template_file = 'user_reputation.html' - ), - UserView( - id = 'favorites', - tab_title = _('favorite questions'), - tab_description = _('users favorite questions'), - page_title = _('profile - favorite questions'), - view_name = 'user_favorites', - template_file = 'user_favorites.html', - data_size = 50 - ), - UserView( - id = 'votes', - tab_title = _('casted votes'), - tab_description = _('user vote record'), - page_title = _('profile - votes'), - view_name = 'user_votes', - template_file = 'user_votes.html', - data_size = 50 - ), - UserView( - id = 'email_subscriptions', - tab_title = _('email subscriptions'), - tab_description = _('email subscription settings'), - page_title = _('profile - email subscriptions'), - view_name = 'user_email_subscriptions', - template_file = 'user_email_subscriptions.html' - ) -) - -def user(request, id): - sort = request.GET.get('sort', 'stats') - user_view = dict((v.id, v) for v in USER_TEMPLATE_VIEWS).get(sort, USER_TEMPLATE_VIEWS[0]) - from forum import views - func = getattr(views, user_view.view_name) - return func(request, id, user_view) - - USERS_PAGE_SIZE = 35# refactor - move to some constants file def users(request): @@ -941,3 +859,82 @@ def user_email_subscriptions(request, user_id, user_view): 'action_status':action_status, }, context_instance=RequestContext(request)) +class UserView: + def __init__(self, id, tab_title, tab_description, page_title, view_func, template_file, data_size=0): + self.id = id + self.tab_title = tab_title + self.tab_description = tab_description + self.page_title = page_title + self.view_func = view_func + self.template_file = template_file + self.data_size = data_size + +USER_TEMPLATE_VIEWS = ( + UserView( + id = 'stats', + tab_title = _('overview'), + tab_description = _('user profile'), + page_title = _('user profile overview'), + view_func = user_stats, + template_file = 'user_stats.html' + ), + UserView( + id = 'recent', + tab_title = _('recent activity'), + tab_description = _('recent user activity'), + page_title = _('profile - recent activity'), + view_func = user_recent, + template_file = 'user_recent.html', + data_size = 50 + ), + UserView( + id = 'responses', + tab_title = _('responses'), + tab_description = _('comments and answers to others questions'), + page_title = _('profile - responses'), + view_func = user_responses, + template_file = 'user_responses.html', + data_size = 50 + ), + UserView( + id = 'reputation', + tab_title = _('reputation'), + tab_description = _('user reputation in the community'), + page_title = _('profile - user reputation'), + view_func = user_reputation, + template_file = 'user_reputation.html' + ), + UserView( + id = 'favorites', + tab_title = _('favorite questions'), + tab_description = _('users favorite questions'), + page_title = _('profile - favorite questions'), + view_func = user_favorites, + template_file = 'user_favorites.html', + data_size = 50 + ), + UserView( + id = 'votes', + tab_title = _('casted votes'), + tab_description = _('user vote record'), + page_title = _('profile - votes'), + view_func = user_votes, + template_file = 'user_votes.html', + data_size = 50 + ), + UserView( + id = 'email_subscriptions', + tab_title = _('email subscriptions'), + tab_description = _('email subscription settings'), + page_title = _('profile - email subscriptions'), + view_func = user_email_subscriptions, + template_file = 'user_email_subscriptions.html' + ) +) + +def user(request, id): + sort = request.GET.get('sort', 'stats') + user_view = dict((v.id, v) for v in USER_TEMPLATE_VIEWS).get(sort, USER_TEMPLATE_VIEWS[0]) + from forum.views import users + func = user_view.view_func + return func(request, id, user_view) diff --git a/osqa.iml b/osqa.iml new file mode 100755 index 00000000..4e760f0a --- /dev/null +++ b/osqa.iml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$" />
+ <orderEntry type="jdk" jdkName="Python 2.6.4" jdkType="Python SDK" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module>
+
diff --git a/settings_local.py.dist b/settings_local.py.dist deleted file mode 100755 index 09865857..00000000 --- a/settings_local.py.dist +++ /dev/null @@ -1,110 +0,0 @@ -# encoding:utf-8 -import os.path -from django.utils.translation import ugettext as _ - -def check_local_setting(name, value): - local_vars = locals() - if name in local_vars and local_var[name] == value: - return True - else: - return False - -SITE_SRC_ROOT = os.path.dirname(__file__) -LOG_FILENAME = 'django.osqa.log' - -#for logging -import logging -logging.basicConfig( - filename=os.path.join(SITE_SRC_ROOT, 'log', LOG_FILENAME), - level=logging.DEBUG, - format='%(pathname)s TIME: %(asctime)s MSG: %(filename)s:%(funcName)s:%(lineno)d %(message)s', -) - -#ADMINS and MANAGERS -ADMINS = (('Forum Admin', 'forum@example.com'),) -MANAGERS = ADMINS - -#DEBUG SETTINGS -DEBUG = False -TEMPLATE_DEBUG = DEBUG -INTERNAL_IPS = ('127.0.0.1',) - -DATABASE_NAME = 'osqa' # Or path to database file if using sqlite3. -DATABASE_USER = '' # Not used with sqlite3. -DATABASE_PASSWORD = '' # Not used with sqlite3. -DATABASE_ENGINE = 'mysql' #mysql, etc -DATABASE_HOST = '' -DATABASE_PORT = '' - -#Moved from settings.py for better organization. (please check it up to clean up settings.py) - -#email server settings -SERVER_EMAIL = '' -DEFAULT_FROM_EMAIL = '' -EMAIL_HOST_USER = '' -EMAIL_HOST_PASSWORD = '' -EMAIL_SUBJECT_PREFIX = '[OSQA] ' -EMAIL_HOST='osqa.net' -EMAIL_PORT='25' -EMAIL_USE_TLS=False - -#LOCALIZATIONS -TIME_ZONE = 'America/New_York' - -########################### -# -# this will allow running your forum with url like http://site.com/forum -# -# FORUM_SCRIPT_ALIAS = 'forum/' -# -FORUM_SCRIPT_ALIAS = '' #no leading slash, default = '' empty string - - -#OTHER SETTINGS -APP_TITLE = u'OSQA: Open Source Q&A Forum' -APP_SHORT_NAME = u'OSQA' -APP_KEYWORDS = u'OSQA,CNPROG,forum,community' -APP_DESCRIPTION = u'Ask and answer questions.' -APP_INTRO = u'<p>Ask and answer questions, make the world better!</p>' -APP_COPYRIGHT = 'Copyright OSQA, 2009. Some rights reserved under creative commons license.' -LOGIN_URL = '/%s%s%s' % (FORUM_SCRIPT_ALIAS,'account/','signin/') -GREETING_URL = LOGIN_URL #may be url of "faq" page or "about", etc - -USE_I18N = True -LANGUAGE_CODE = 'en' -EMAIL_VALIDATION = 'off' #string - on|off -MIN_USERNAME_LENGTH = 1 -EMAIL_UNIQUE = False -APP_URL = 'http://osqa.net' #used by email notif system and RSS -GOOGLE_SITEMAP_CODE = '' -GOOGLE_ANALYTICS_KEY = '' -BOOKS_ON = False -WIKI_ON = True -USE_EXTERNAL_LEGACY_LOGIN = False -EXTERNAL_LEGACY_LOGIN_HOST = 'login.osqa.net' -EXTERNAL_LEGACY_LOGIN_PORT = 80 -EXTERNAL_LEGACY_LOGIN_PROVIDER_NAME = '<span class="orange">OSQA</span>' -FEEDBACK_SITE_URL = None #None or url -EDITABLE_SCREEN_NAME = False #True or False - can user change screen name? - -DJANGO_VERSION = 1.1 -RESOURCE_REVISION=4 - -USE_SPHINX_SEARCH = False #if True all SPHINX_* settings are required -#also sphinx search engine and djangosphinxs app must be installed -#sample sphinx configuration file is /sphinx/sphinx.conf -SPHINX_API_VERSION = 0x113 #refer to djangosphinx documentation -SPHINX_SEARCH_INDICES=('osqa',) #a tuple of index names remember about a comma after the -#last item, especially if you have just one :) -SPHINX_SERVER='localhost' -SPHINX_PORT=3312 - -#please get these at recaptcha.net -RECAPTCHA_PRIVATE_KEY='...' -RECAPTCHA_PUBLIC_KEY='...' -OSQA_DEFAULT_SKIN = 'default' - -#Facebook settings -USE_FB_CONNECT=True -FB_API_KEY='' #your api key from facebook -FB_SECRET='' #your application secret |