diff options
-rw-r--r-- | askbot/doc/source/askbot/layout.html | 23 | ||||
-rw-r--r-- | askbot/doc/source/askbot/static/facebook.png | bin | 0 -> 1453 bytes | |||
-rw-r--r-- | askbot/doc/source/askbot/static/traditional.css | 67 | ||||
-rw-r--r-- | askbot/doc/source/askbot/static/twitter.png | bin | 0 -> 1482 bytes | |||
-rw-r--r-- | askbot/doc/source/index.rst | 6 | ||||
-rw-r--r-- | askbot/management/commands/clean_session.py | 50 | ||||
-rw-r--r-- | askbot/utils/console.py | 2 |
7 files changed, 109 insertions, 39 deletions
diff --git a/askbot/doc/source/askbot/layout.html b/askbot/doc/source/askbot/layout.html index 251d8386..f1c8b509 100644 --- a/askbot/doc/source/askbot/layout.html +++ b/askbot/doc/source/askbot/layout.html @@ -1,16 +1,19 @@ {% extends "basic/layout.html" %} {% block relbar1 %} +<div class="logo"> + <a href="/doc/index.html"><h1>Askbot Project Documentation</h1></a> + <div class="topnav"> + <a href="http://twitter.com/askbot7" alt="Follow us on twitter"><img src="_static/twitter.png"/></a> + <a href="https://www.facebook.com/pages/Askbot/128297183877495" alt="like us on Facebook"><img src="_static/facebook.png"/></a> + </div> +</div> <div class="ab-proj-header"> - <ul> - <li class="first"><a href="/">Home (forum)</a> - <span class="sep">|</span> - </li> - {#<li><a href="/doc/about.html">About</a></li> - <span class="sep">|</span>#} - <li><a href="/doc/index.html">Documentation</a></li> - {#<span class="sep">|</span> - <li><a href="/doc/download.html">Download</a></li>#} - </ul> + <a href="/">Home</a> | + <a href="/en/questions/" title="Ask Questions">Ask Questions</a> | + <a href="/hire-us" alt='Hire Us'>Hire Us</a> | + <a href="/doc/index.html" alt="Documentation">Documentation</a> | + <a href="/contribute" alt='Contribute'>Contribute</a> | + <a href="/feedback/" alt='contact'>Contact</a> </div> {% endblock %} {% block relbar2 %} diff --git a/askbot/doc/source/askbot/static/facebook.png b/askbot/doc/source/askbot/static/facebook.png Binary files differnew file mode 100644 index 00000000..77ae358f --- /dev/null +++ b/askbot/doc/source/askbot/static/facebook.png diff --git a/askbot/doc/source/askbot/static/traditional.css b/askbot/doc/source/askbot/static/traditional.css index cfbdaf79..3fa381cd 100644 --- a/askbot/doc/source/askbot/static/traditional.css +++ b/askbot/doc/source/askbot/static/traditional.css @@ -8,11 +8,13 @@ * :license: BSD, see LICENSE for details. * */ +@import url(http://fonts.googleapis.com/css?family=Droid+Sans|Cabin|Cabin+Sketch:700); body { color: #000; margin: 0; padding: 0; + border-color: gray; } /* :::: LAYOUT :::: */ @@ -29,11 +31,11 @@ div.bodywrapper { div.body { background-color: white; padding: 0 20px 30px 0; - font-family: "Lucida Grande",Verdana,"Bitstream Vera Sans",Arial,sans-serif; + font-family: "Droid Sans", "Lucida Grande",Verdana,"Bitstream Vera Sans",Arial,sans-serif; } div.sphinxsidebarwrapper { - border: 1px solid #99ccff; + border: 1px solid #777; padding: 10px; margin: 55px 15px 10px 0; } @@ -42,6 +44,7 @@ div.sphinxsidebar { float: right; margin-left: -100%; width: 230px; + font-family: "Droid Sans", sans-serif; } div.clearer { @@ -59,6 +62,7 @@ div.footer { background-color: #dcdcdc; padding: 9px 0 9px 0; text-align: center; + font-family: "Droid Sans", sans-serif; } div.related { @@ -92,6 +96,11 @@ div.related li.right { } /* ::: SIDEBAR :::: */ +div.sphinxsidebar h3, +div.sphinxsidebar h4{ + font-family: 'Cabin', cursive; +} + div.sphinxsidebar h3 { margin: 0; } @@ -100,10 +109,6 @@ div.sphinxsidebar h4 { margin: 5px 0 0 0; } -div.sphinxsidebar p, -div.sphinxsidebar a { - font-family: "Lucida Grande",Verdana,"Bitstream Vera Sans",Arial,sans-serif; -} div.sphinxsidebar p.topless { margin: 5px 10px 10px 10px; @@ -332,11 +337,10 @@ a { text-decoration: none; border-bottom: 1px solid #dfdfdf; } -a:link:active { color: #ff0000; } -a:link:hover { background-color: #bbeeff; } -a:visited:hover { background-color: #bbeeff; } -a:visited { color: #3185AB; } -a:link { color: #21759B; } +a:link:active { color: #555; } +a:link:hover { color: #000; } +a:visited { color: #655; } +a:link { color: #555; } div.body h1, div.body h2, @@ -344,7 +348,7 @@ div.body h3, div.body h4, div.body h5, div.body h6 { - font-family: Georgia, Times, "Times New Roman", serif; + font-family: 'Cabin', cursive; font-weight: bold; } @@ -655,23 +659,36 @@ div.viewcode-block:target { div.ab-proj-header { width: 960px; margin: auto; - font-family: "Lucida Grande",Tahoma,"Bitstream Vera Sans",Arial,sans-serif; -} -div.ab-proj-header li { - display: inline; - padding: 0; + border-bottom: 2px solid #555; + font-family: "Droid Sans", sans-serif; } + div.ab-proj-header a, -div.ab-proj-header a:visited, +div.ab-proj-header a:visited { text-decoration: none; + color: #333; + border: none; + font-family: "Droid Sans", sans-serif; } -div.ab-proj-header ul { - margin: 0; - padding: 5px 0 0 0; - list-style: none; + +div.logo{ + font-size: 20px; + width: 960px; + margin: auto; } -div.ab-proj-header .sep { - color: #aaa; - padding: 0 10px; + +div.logo a, div.logo a:visited +{ + text-decoration: none; + color: #333; + border: none; + font-family: 'Cabin Sketch', cursive; +} + +div.topnav{ + float: right; + position: relative; + right:6px; + top:-65px; } diff --git a/askbot/doc/source/askbot/static/twitter.png b/askbot/doc/source/askbot/static/twitter.png Binary files differnew file mode 100644 index 00000000..371c9823 --- /dev/null +++ b/askbot/doc/source/askbot/static/twitter.png diff --git a/askbot/doc/source/index.rst b/askbot/doc/source/index.rst index 98dbf777..27f106be 100644 --- a/askbot/doc/source/index.rst +++ b/askbot/doc/source/index.rst @@ -1,8 +1,8 @@ .. _index: -============================= -Askbot Project Documentation -============================= +================== +Documentation Home +================== Askbot is an open source Question and Answer (Q&A) forum project inspired by StackOverflow and YahooAnswers. diff --git a/askbot/management/commands/clean_session.py b/askbot/management/commands/clean_session.py new file mode 100644 index 00000000..6ba9352c --- /dev/null +++ b/askbot/management/commands/clean_session.py @@ -0,0 +1,50 @@ +from django.core.management.base import NoArgsCommand +from django.contrib.sessions.models import Session +from django.db import transaction +from optparse import make_option +from askbot.utils.console import print_progress +from datetime import datetime + +DELETE_LIMIT = 1000 + +class Command(NoArgsCommand): + option_list = NoArgsCommand.option_list + ( + make_option('--quiet', + action='store_true', + dest='quiet', + default=False, + help="Do not print anything when called." + ), + ) + + @transaction.commit_manually + def handle_noargs(self, **options): + '''deletes old sessions''' + quiet = options.get('quiet', False) + expired_session_count = Session.objects.filter(expire_date__lt=datetime.now()).count() + expired_session_list= Session.objects.filter(expire_date__lt=datetime.now()).values_list('session_key', flat=True) + transaction.commit() + + if not quiet: + print "There are %d expired sessions" % expired_session_count + + range_limit = len(expired_session_list) - 1 + higher_limit = lower_limit = 0 + + for i in range(DELETE_LIMIT, range_limit, DELETE_LIMIT): + lower_limit = i + higher_limit = lower_limit + DELETE_LIMIT + sublist = expired_session_list[lower_limit:higher_limit] + Session.objects.filter(session_key__in = sublist).delete() + transaction.commit() + if not quiet: + print_progress(higher_limit-1, expired_session_count) + + if higher_limit < expired_session_list: + sublist = expired_session_list[higher_limit:expired_session_count] + Session.objects.filter(session_key__in = sublist).delete() + print_progress(expired_session_count, expired_session_count) + transaction.commit() + + if not quiet: + print "sessions cleared" diff --git a/askbot/utils/console.py b/askbot/utils/console.py index 470856b5..496bbd65 100644 --- a/askbot/utils/console.py +++ b/askbot/utils/console.py @@ -72,5 +72,5 @@ def print_progress(elapsed, total, nowipe = False): operation, in percent, to the console and clear the output with a backspace character to have the number increment in-place""" - output = '%6.2f%%' % 100 * float(elapsed)/float(total) + output = '%6.2f%%' % (100 * float(elapsed)/float(total)) print_action(output, nowipe) |