diff options
author | Bruno Sarlo <bruno@bruno-laptop.(none)> | 2009-08-11 02:07:44 -0300 |
---|---|---|
committer | Bruno Sarlo <bruno@bruno-laptop.(none)> | 2009-08-11 02:07:44 -0300 |
commit | 5c97d5bb7e5a3b0c481a42e3a089971a958c2b73 (patch) | |
tree | b8d7deb8f9e245f8b5f8330860f867803a0e74dd | |
parent | 74d23cb7b0b85602fa7c7122f1c356ce7b80a49c (diff) | |
parent | cc378999abd39e070dbc87b482f022201a86b7fa (diff) | |
download | askbot-5c97d5bb7e5a3b0c481a42e3a089971a958c2b73.tar.gz askbot-5c97d5bb7e5a3b0c481a42e3a089971a958c2b73.tar.bz2 askbot-5c97d5bb7e5a3b0c481a42e3a089971a958c2b73.zip |
Merge branch 'master' of git://github.com/evgenyfadeev/CNPROG
Conflicts:
forum/views.py
locale/es/LC_MESSAGES/django.mo
settings_local.py
templates/answer_edit_tips.html
templates/book.html
templates/header.html
templates/index.html
templates/question_edit_tips.html
templates/user_stats.html
templates/user_tabs.html
templates/users_questions.html
51 files changed, 314 insertions, 237 deletions
diff --git a/forum/auth.py b/forum/auth.py index 36ca54d3..776746e8 100644 --- a/forum/auth.py +++ b/forum/auth.py @@ -167,7 +167,10 @@ def can_upload_files(request_user): ########################################### def calculate_reputation(origin, offset): result = int(origin) + int(offset) - return result if result > 0 else 1 + if (result > 0): + return result + else: + return 1 @transaction.commit_on_success def onFlaggedItem(item, post, user): diff --git a/forum/models.py b/forum/models.py index 255eb21f..9510476a 100644 --- a/forum/models.py +++ b/forum/models.py @@ -179,6 +179,9 @@ class Question(models.Model): """Creates a list of Tag names from the ``tagnames`` attribute.""" return [name for name in self.tagnames.split(u' ')] + def tagname_meta_generator(self): + return ','.join([str(tag) for tag in self.tagname_list()]) + def get_absolute_url(self): return '%s%s' % (reverse('question', args=[self.id]), self.title.replace(' ', '-')) @@ -271,6 +274,16 @@ class Question(models.Model): class Meta: db_table = u'question' +class FavoriteQuestion(models.Model): + """A favorite Question of a User.""" + question = models.ForeignKey(Question) + user = models.ForeignKey(User, related_name='user_favorite_questions') + added_at = models.DateTimeField(default=datetime.datetime.now) + class Meta: + db_table = u'favorite_question' + def __unicode__(self): + return '[%s] favorited at %s' %(self.user, self.added_at) + class QuestionRevision(models.Model): """A revision of a Question.""" question = models.ForeignKey(Question, related_name='revisions') @@ -419,16 +432,6 @@ class AnswerRevision(models.Model): flat=True)[0] + 1 super(AnswerRevision, self).save(**kwargs) -class FavoriteQuestion(models.Model): - """A favorite Question of a User.""" - question = models.ForeignKey(Question) - user = models.ForeignKey(User, related_name='user_favorite_questions') - added_at = models.DateTimeField(default=datetime.datetime.now) - class Meta: - db_table = u'favorite_question' - def __unicode__(self): - return '[%s] favorited at %s' %(self.user, self.added_at) - class Badge(models.Model): """Awarded for notable actions performed on the site by Users.""" GOLD = 1 @@ -652,7 +655,10 @@ def record_comment_event(instance, created, **kwargs): from django.contrib.contenttypes.models import ContentType question_type = ContentType.objects.get_for_model(Question) question_type_id = question_type.id - type = TYPE_ACTIVITY_COMMENT_QUESTION if instance.content_type_id == question_type_id else TYPE_ACTIVITY_COMMENT_ANSWER + if (instance.content_type_id == question_type_id): + type = TYPE_ACTIVITY_COMMENT_QUESTION + else: + type = TYPE_ACTIVITY_COMMENT_ANSWER activity = Activity(user=instance.user, active_at=instance.added_at, content_object=instance, activity_type=type) activity.save() diff --git a/forum/templatetags/extra_filters.py b/forum/templatetags/extra_filters.py index cec97920..d8b8e61f 100644 --- a/forum/templatetags/extra_filters.py +++ b/forum/templatetags/extra_filters.py @@ -1,8 +1,13 @@ -from django import template +from django import template from forum import auth register = template.Library() +@template.defaultfilters.stringfilter +@register.filter +def collapse(input): + return ' '.join(input.split()) + @register.filter def can_vote_up(user): return auth.can_vote_up(user) @@ -80,4 +85,4 @@ def cnprog_intword(number): else: return number except: - return number
\ No newline at end of file + return number diff --git a/forum/templatetags/extra_tags.py b/forum/templatetags/extra_tags.py index ac4e6ca3..06a2d27c 100644 --- a/forum/templatetags/extra_tags.py +++ b/forum/templatetags/extra_tags.py @@ -14,7 +14,8 @@ register = template.Library() GRAVATAR_TEMPLATE = ('<img width="%(size)s" height="%(size)s" ' 'src="http://www.gravatar.com/avatar/%(gravatar_hash)s' - '?s=%(size)s&d=identicon&r=PG">') + '?s=%(size)s&d=identicon&r=PG" ' + 'alt="%(username)s\'s gravatar image" />') @register.simple_tag def gravatar(user, size): @@ -26,11 +27,14 @@ def gravatar(user, size): """ try: gravatar = user['gravatar'] + username = user['username'] except (TypeError, AttributeError, KeyError): gravatar = user.gravatar + username = user.username return mark_safe(GRAVATAR_TEMPLATE % { 'size': size, 'gravatar_hash': gravatar, + 'username': template.defaultfilters.urlencode(username), }) MAX_FONTSIZE = 18 diff --git a/forum/views.py b/forum/views.py index a118cc57..626c93a3 100644 --- a/forum/views.py +++ b/forum/views.py @@ -332,7 +332,10 @@ def question(request, id): answers = answers.select_related(depth=1) favorited = question.has_favorite_by_user(request.user) - question_vote = question.votes.select_related().filter(user=request.user) + if not request.user.is_anonymous(): + question_vote = question.votes.select_related().filter(user=request.user) + else: + question_vote = None #is this correct? if question_vote is not None and question_vote.count() > 0: question_vote = question_vote[0] @@ -1167,8 +1170,11 @@ def user_recent(request, user_id, user_view): self.type_id = type self.title = title self.summary = summary - self.title_link = u'/%s%s/%s#%s' %(_('questions/'),question_id, title, answer_id)\ - if int(answer_id) > 0 else u'/%s%s/%s' %(_('questions/'), question_id, title) + if int(answer_id) > 0: + self.title_link = u'/questions/%s/%s#%s' %(question_id, title, answer_id) + else: + self.title_link = u'/questions/%s/%s' %(question_id, title) + class AwardEvent: def __init__(self, time, type, id): self.time = time diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index 3dda9ce9..07532566 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -148,7 +148,7 @@ msgstr "" #: django_authopenid/views.py:417 django_authopenid/views.py:544 msgid "Welcome" -msgstr "Verification Email from Q&A forum" +msgstr "Verification Email from Q&A forum" #: django_authopenid/views.py:507 msgid "Password changed." @@ -812,7 +812,7 @@ msgid "must have valid %(email)s to post" msgstr "" "<span class='strong big'>Looks like your email address, %(email)s has not " "yet been validated.</span> To post messages you must verify your email, " -"please see <a href='/faq#validate'>more details here</a>.<br>You can submit " +"please see <a href='/faq#validate'>more details here</a>.<br/>You can submit " "your question now and validate email after that. Your question will saved as " "pending meanwhile. " @@ -1135,12 +1135,12 @@ msgstr "" "<form style='margin:0;padding:0;' action='/email/sendkey/'><p><span class=" "\"bigger strong\">How?</span> If you have just set or changed your email " "address - <strong>check your email and click the included link</strong>." -"<br>The link contains a key generated specifically for you. You can also " +"<br/>The link contains a key generated specifically for you. You can also " "<button style='display:inline' type='submit'><strong>get a new key</strong></" "button> and check your email again.</p></form><span class=\"bigger strong" "\">Why?</span> Email validation is required to make sure that <strong>only " "you can post messages</strong> on your behalf and to <strong>minimize spam</" -"strong> posts.<br>With email you can <strong>subscribe for updates</strong> " +"strong> posts.<br/>With email you can <strong>subscribe for updates</strong> " "on the most interesting questions. Also, when you sign up for the first time " "- create a unique <a href='/faq#gravatar'><strong>gravatar</strong></a> " "personal image.</p>" @@ -1716,12 +1716,12 @@ msgid_plural "" "\t\t\t" msgstr[0] "" "\n" -"<div class=\"questions-count\">%(q_num)s</div><p>question tagged</p><p><span " -"class=\"tag\">%(tagname)s</span></p>" +"<span class=\"questions-count\">%(q_num)s</span><br/>question tagged <span " +"class=\"tag\">%(tagname)s</span>" msgstr[1] "" "\n" -"<div class=\"questions-count\">%(q_num)s</div><p>questions tagged</p><div " -"class=\"tags\"><span class=\"tag\">%(tagname)s</span></div>" +"<span class=\"questions-count\">%(q_num)s</span><br/>questions tagged " +"<span class=\"tag\">%(tagname)s</span>" #: templates/questions.html:116 #, python-format @@ -1735,14 +1735,12 @@ msgid_plural "" "\t\t\t\t" msgstr[0] "" "\n" -"<div class=\"questions-count\">%(q_num)s</div><p>question with title " -"containing <strong><span class=\"darkred\">%(searchtitle)s</span></strong></" -"p>" +"<span class=\"questions-count\">%(q_num)s</span><br/>question with title " +"containing <span class=\"darkred strong\">%(searchtitle)s</span>" msgstr[1] "" "\n" -"<div class=\"questions-count\">%(q_num)s</div><p>questions with title " -"containing <strong><span class=\"darkred\">%(searchtitle)s</span></strong></" -"p>" +"<span class=\"questions-count\">%(q_num)s</span><br/>questions with title " +"containing <span class=\"darkred strong\">%(searchtitle)s</span></strong>" #: templates/questions.html:122 #, python-format @@ -1756,10 +1754,10 @@ msgid_plural "" "\t\t\t\t" msgstr[0] "" "\n" -"<div class=\"questions-count\">%(q_num)s</div><p>question</p>" +"<span class=\"questions-count\">%(q_num)s</span><br/>question" msgstr[1] "" "\n" -"<div class=\"questions-count\">%(q_num)s</div><p>questions</p>" +"<span class=\"questions-count\">%(q_num)s</span><br/>questions" #: templates/questions.html:131 msgid "latest questions info" @@ -1866,7 +1864,7 @@ msgstr "" #, python-format msgid "have %(num_q)s unanswered questions" msgstr "" -"<div class=\"questions-count\">%(num_q)s</div><strong>unanswered</strong> " +"<span class=\"questions-count\">%(num_q)s</span><br/><strong>unanswered</strong> " "questions" #: templates/unanswered.html:99 @@ -2197,7 +2195,7 @@ msgstr "New user signup" #, python-format msgid "register new %(provider)s account info" msgstr "" -"<p><span class=\"big strong\">You are here for the first time with your %" +"<span class=\"big strong\">You are here for the first time with your %" "(provider)s login.</span> Please create your <strong>screen name</strong> " "and save your <strong>email</strong> address. Saved email address will let " "you <strong>subscribe for the updates</strong> on the most interesting " @@ -2249,7 +2247,7 @@ msgstr "" #: templates/authopenid/confirm_email.txt:2 msgid "Thank you for registering at our Q&A forum!" -msgstr "" +msgstr "Thank you for registering at our Q&A forum!" #: templates/authopenid/confirm_email.txt:4 msgid "Your account details are:" @@ -2309,7 +2307,7 @@ msgstr "" #: templates/authopenid/email_validation.txt:2 msgid "Greetings from the Q&A forum" -msgstr "" +msgstr "Greetings from the Q&A forum" #: templates/authopenid/email_validation.txt:4 msgid "To make use of the Forum, please follow the link below:" @@ -2434,14 +2432,14 @@ msgid "Click to sign in through any of these services." msgstr "" "<p><span class=\"big strong\">We accept <a href=\"http://openid.net" "\">OpenID</a> login.</span> <font color=\"gray\">Instead of creating a new " -"password - log in through any of the services below.<p><span class=\"big " +"password - log in through any of the services below.</font></p><p><span class=\"big " "strong\">1. Select the login service by clicking one of the icons</span></p>" #: templates/authopenid/signin.html:103 msgid "Enter your <span id=\"enter_your_what\">Provider user name</span>" msgstr "" "<span class=\"big strong\">2. Enter your <span id=\"enter_your_what" -"\">Provider user name</span></span><br>(or select another OpenID provider " +"\">Provider user name</span></span><br/>(or select another OpenID provider " "above)" #: templates/authopenid/signin.html:110 @@ -2450,7 +2448,7 @@ msgid "" "web address" msgstr "" "<span class=\"big strong\">2. Enter your <a class=\"openid_logo\" href=" -"\"http://openid.net\">OpenID</a> web address</span><br>(or choose specific " +"\"http://openid.net\">OpenID</a> web address</span><br/>(or choose specific " "provider by clicking on one of the icons above)" #: templates/authopenid/signin.html:112 templates/authopenid/signin.html:139 diff --git a/settings.py b/settings.py index d51b3bbb..fcfdb548 100644 --- a/settings.py +++ b/settings.py @@ -17,27 +17,8 @@ ADMINS = ( ) MANAGERS = ADMINS -#email server settings -SERVER_EMAIL = '' -DEFAULT_FROM_EMAIL = 'team@cnprog.com' -EMAIL_HOST_USER = '' -EMAIL_HOST_PASSWORD = '' -EMAIL_SUBJECT_PREFIX = '[cnprog.com]' -EMAIL_HOST='smtp.gmail.com' -EMAIL_PORT='587' -EMAIL_USE_TLS=True - -#LOCALIZATIONS -TIME_ZONE = 'Asia/Chongqing Asia/Chungking' -# LANGUAGE_CODE = 'en-us' SITE_ID = 1 -#OTHER SETTINGS -APP_TITLE = u'CNProg.com 程序员问答社区' -APP_KEYWORDS = u'技术问答社区,中国程序员,编程技术社区,程序员社区,程序员论坛,程序员wiki,程序员博客' -APP_DESCRIPTION = u'中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。' -APP_INTRO = u' <p>CNProg是一个<strong>面向程序员</strong>的可协作编辑的<strong>开放源代码问答社区</strong>。</p><p> 您可以在这里提问各类<strong>程序技术问题</strong> - 问题不分语言和平台。 同时也希望您对力所能及的问题,给予您的宝贵答案。</p>' -APP_COPYRIGHT = 'Copyright CNPROG.COM 2009' ADMIN_MEDIA_PREFIX = '/admin/media/' SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' # List of callables that know how to import templates from various sources. @@ -64,6 +45,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'context.auth_processor', 'context.application_settings', #'django.core.context_processors.i18n', + 'django.core.context_processors.auth' #this is required for admin ) ROOT_URLCONF = 'urls' diff --git a/settings_local.py.dist b/settings_local.py.dist index 2c8f939d..d6273070 100644 --- a/settings_local.py.dist +++ b/settings_local.py.dist @@ -1,25 +1,47 @@ -SITE_SRC_ROOT = '/Users/sailing/Development/cnprog_beta2' +# encoding:utf-8 +import os.path + +SITE_SRC_ROOT = os.path.dirname(__file__) +LOG_FILENAME = 'django.lanai.log' #for logging import logging -LOG_FILENAME = '/Users/sailing/Development/cnprog_beta2/django.lanai.log' -logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG,) - +logging.basicConfig(filename=os.path.join(SITE_SRC_ROOT, 'log', LOG_FILENAME), level=logging.DEBUG,) -#Database configuration -DATABASE_ENGINE = 'mysql' -DATABASE_HOST = '' -DATABASE_PORT = '' -DATABASE_NAME = 'cnprog' # Or path to database file if using sqlite3. -DATABASE_USER = 'root' # Not used with sqlite3. +DATABASE_NAME = '' # Or path to database file if using sqlite3. +DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. +DATABASE_ENGINE = '' #mysql, etc + +#Moved from settings.py for better organization. (please check it up to clean up settings.py) + +#email server settings +SERVER_EMAIL = '' +DEFAULT_FROM_EMAIL = 'team@cnprog.com' +EMAIL_HOST_USER = '' +EMAIL_HOST_PASSWORD = '' +EMAIL_SUBJECT_PREFIX = '[cnprog.com]' +EMAIL_HOST='smtp.gmail.com' +EMAIL_PORT='587' +EMAIL_USE_TLS=True + +#LOCALIZATIONS +TIME_ZONE = 'Asia/Chongqing Asia/Chungking' +# LANGUAGE_CODE = 'en-us' +#OTHER SETTINGS +APP_TITLE = u'CNProg.com 程序员问答社区' +APP_KEYWORDS = u'技术问答社区,中国程序员,编程技术社区,程序员社区,程序员论坛,程序员wiki,程序员博客' +APP_DESCRIPTION = u'中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。' +APP_INTRO = u' <p>CNProg是一个<strong>面向程序员</strong>的可协作编辑的<strong>开放源代码问答社区</strong>。</p><p> 您可以在这里提问各类<strong>程序技术问题</strong> - 问题不分语言和平台。 同时也希望您对力所能及的问题,给予您的宝贵答案。</p>' +APP_COPYRIGHT = 'Copyright CNPROG.COM 2009' -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = '/Users/sailing/Development/cnprog_beta2/templates/upfiles/' +USE_I18N = True +LANGUAGE_CODE = 'en' +EMAIL_VALIDATION = 'off' +MIN_USERNAME_LENGTH = 1 +EMAIL_UNIQUE = False +APP_URL = 'http://server.com' #used by email notif system and RSS +GOOGLE_SITEMAP_CODE = '55uGNnQVJW8p1bbXeF/Xbh9I7nZBM/wLhRz6N/I1kkA=' +GOOGLE_ANALYTICS_KEY = '' -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" -MEDIA_URL = 'http://127.0.0.1:8000/upfiles/' diff --git a/templates/404.html b/templates/404.html index 6b3fc368..bfb86e7d 100644 --- a/templates/404.html +++ b/templates/404.html @@ -23,7 +23,7 @@ <div style="padding:5px 0px 10px 0;line-height:25px;"> <h3>{% trans "Sorry, could not find the page you requested." %}</h3> <div style="margin-top:5px"> - {% trans "This might have happened for the following reasons:" %}<br> + {% trans "This might have happened for the following reasons:" %}<br/> <ul> <li>{% trans "this question or answer has been deleted;" %}</li> <li>{% trans "url has error - please check it;" %}</li> diff --git a/templates/500.html b/templates/500.html index 1990edbc..51e73178 100644 --- a/templates/500.html +++ b/templates/500.html @@ -20,8 +20,8 @@ <div id="main-body" class="headNormal"> <div style="padding:5px 0px 10px 0;line-height:25px"> <h3>{% trans "sorry, system error" %}</h3> - <br> - {% trans "system error log is recorded, error will be fixed as soon as possible" %}<br> + <br/> + {% trans "system error log is recorded, error will be fixed as soon as possible" %}<br/> {% trans "please report the error to the site administrators if you wish" %} <ul> <li><a href="#" id="linkPrevious">{% trans "back to previous page" %}</li> diff --git a/templates/answer_edit.html b/templates/answer_edit.html index 9f0f1bec..8baa7c1e 100644 --- a/templates/answer_edit.html +++ b/templates/answer_edit.html @@ -49,31 +49,27 @@ <div id="main-body" class="ask-body"> <div id="askform"> <form id="fmedit" action="{% url edit_answer answer.id %}" method="post" > - <label for="id_revision" ><strong>{% trans "revision" %}:</strong></label> <br> + <label for="id_revision" ><strong>{% trans "revision" %}:</strong></label> <br/> {% if revision_form.revision.errors %}{{ revision_form.revision.errors.as_ul }}{% endif %} <div style="vertical-align:middle"> {{ revision_form.revision }} <input type="submit" style="display:none" id="select_revision" name="select_revision" value="{% trans "select revision" %}"> - </div><br> + </div> <div class="form-item"> <div id="wmd-button-bar" class="wmd-panel"></div> {{ form.text }} <span class="form-error"></span> <div class="preview-toggle"><span id="pre-collapse" - title="{% trans "Toggle the real time Markdown editor preview" %}打">{% trans "toggle preview" %}</span></div> + title="{% trans "Toggle the real time Markdown editor preview" %}">{% trans "toggle preview" %}</span></div> <div id="previewer" class="wmd-preview"></div> - <br> </div> - <strong>{{ form.summary.label_tag }}</strong> <br> + <strong>{{ form.summary.label_tag }}</strong> <br/> {{ form.summary }} {{ form.summary.errors }} <div class="title-desc"> {{ form.summary.help_text }} </div> - <br> <input type="submit" value="{% trans "Save edit" %}" class="submit" /> <input type="button" value="{% trans "Cancel" %}" class="submit" onclick="history.back(-1);" /> - <br> - <br> </form> </div> </div> diff --git a/templates/answer_edit_tips.html b/templates/answer_edit_tips.html index 98a5ab16..33e4e242 100644 --- a/templates/answer_edit_tips.html +++ b/templates/answer_edit_tips.html @@ -17,7 +17,6 @@ </li> </ul> <a href="{% url faq %}" target="_blank" title="{% trans "see frequently asked questions" %}" style="float:right;position:relative">faq »</a> - <br> </div> </div> @@ -48,6 +47,5 @@ </li> </ul> <a href="http://en.wikipedia.org/wiki/Markdown" target="_blank" style="float:right;position:relative">{% trans "learn more about Markdown" %} »</a> - <br> </div> <!-- end template answer_edit_tips.html --> diff --git a/templates/ask.html b/templates/ask.html index 4aa18dd5..9e86a5a0 100644 --- a/templates/ask.html +++ b/templates/ask.html @@ -75,15 +75,15 @@ {% endif %} {% endifequal %} {% endif %} - <p class="form-item"> - <label for="id_title" ><strong>{{ form.title.label_tag }}:</strong></label> <span class="form-error"></span><br> + <div class="form-item"> + <label for="id_title" ><strong>{{ form.title.label_tag }}:</strong></label> <span class="form-error"></span><br/> {{ form.title }} {{ form.title.errors }} <div class="title-desc"> {{ form.title.help_text }} </div> - </p> + </div> - <p class="form-item"> + <div class="form-item"> <div id="wmd-button-bar" class="wmd-panel"></div> {{ form.text }} @@ -102,12 +102,11 @@ </div> <div id="previewer" class="wmd-preview"></div> <span class="form-error"></span> - <br> - </p> - <p class="form-item"> - <strong>{{ form.tags.label_tag }}:</strong> {% trans "(required)" %} <span class="form-error"></span><br> + </div> + <div class="form-item"> + <strong>{{ form.tags.label_tag }}:</strong> {% trans "(required)" %} <span class="form-error"></span><br/> {{ form.tags }} {{ form.tags.errors }} - </p> + </div> <p class="title-desc"> {{ form.tags.help_text }} </p> diff --git a/templates/authopenid/changeemail.html b/templates/authopenid/changeemail.html index d5acb6c9..09857d17 100644 --- a/templates/authopenid/changeemail.html +++ b/templates/authopenid/changeemail.html @@ -27,7 +27,7 @@ <div class="aligned"> <form action="." method="post" accept-charset="utf-8"> - <div class="form-row"><label for="id_email">{% trans "Your new Email" %}</label><br>{{ form.email }}</div> + <div class="form-row"><label for="id_email">{% trans "Your new Email" %}</label><br/>{{ form.email }}</div> <!--<div class="form-row"><label for="id_password">{% trans "Password" %}</label>{{ form.password }}</div>--> <div class="submit-row"> <input class="submit" type="submit" name="change_email" value="{% trans "Change email" %}"> diff --git a/templates/authopenid/complete.html b/templates/authopenid/complete.html index b9a14e16..f29b7670 100644 --- a/templates/authopenid/complete.html +++ b/templates/authopenid/complete.html @@ -7,16 +7,16 @@ <div id="main-bar" class="headNormal"> {% trans "Connect your OpenID with your account on this site" %} </div> - <p id="completetxt" > + <div id="completetxt" > <div class="message"> {% blocktrans %}register new {{provider}} account info{% endblocktrans %} </div> <p style="display:none">{% trans "This account already exists, please use another." %}</p> - </p> + </div> {% if form1.errors %} - <p class="errors"> - <span class="big">{% trans "Sorry, looks like we have some errors:" %}</span><br> + <div class="errors"> + <span class="big">{% trans "Sorry, looks like we have some errors:" %}</span><br/> <ul class="error-list"> {% if form1.username.errors %} <li><span class="error">{{ form1.username.errors|join:", " }}</span></li> @@ -25,11 +25,11 @@ <li><span class="error">{{ form1.email.errors|join:", " }}</span></li> {% endif %} </ul> - </p> + </div> {% endif %} {% if form2.errors %} - <p class="errors"> - <span class="big">{% trans "Sorry, looks like we have some errors:" %}</span><br> + <div class="errors"> + <span class="big">{% trans "Sorry, looks like we have some errors:" %}</span><br/> <ul class="error-list"> {% if form2.username.errors %} <li><span class="error">{{ form2.username.errors|join:", " }}</span></li> @@ -38,15 +38,15 @@ <li><span class="error">{{ form2.password.errors|join:", " }}</span></li> {% endif %} </ul> - </p> + </div> {% endif %} <div class="login"> <form name="fregister" action="{% url user_register %}" method="POST"> {{ form.next }} - <div class="form-row"><label for="id_username">{% trans "Screen name label" %}</label><br />{{ form1.username }}</div> - <div class="form-row"><label for="id_email">{% trans "Email address label" %}</label><br />{{ form1.email }}</div> - <div class="submit-row"><input type="submit" class="submit" name="bnewaccount" value="{% trans "create account" %}"></div> + <div class="form-row"><label for="id_username">{% trans "Screen name label" %}</label><br/>{{ form1.username }}</div> + <div class="form-row"><label for="id_email">{% trans "Email address label" %}</label><br/>{{ form1.email }}</div> + <div class="submit-row"><input type="submit" class="submit" name="bnewaccount" value="{% trans "create account" %}"/></div> </form> </div> <div class="login" style="display:none"> @@ -54,11 +54,11 @@ {{ form.next }} <fieldset style="padding:10px"> <legend class="big">{% trans "Existing account" %}</legend> - <div class="form-row"><label for="id_username">{% trans "user name" %}</label><br />{{ form2.username }}</div> - <div class="form-row"><label for="id_passwordl">{% trans "password" %}</label><br />{{ form2.password }}</div> + <div class="form-row"><label for="id_username">{% trans "user name" %}</label><br/>{{ form2.username }}</div> + <div class="form-row"><label for="id_passwordl">{% trans "password" %}</label><br/>{{ form2.password }}</div> <!--todo double check translation from chinese 确认 = "Register" --> <div class="submit-row"> - <input type="submit" class="submit" name="bverify" value="{% trans "Register" %}"> + <input type="submit" class="submit" name="bverify" value="{% trans "Register" %}"/> <a href="">{% trans "Forgot your password?" %}</a> </div> </fieldset> diff --git a/templates/authopenid/sendpw.html b/templates/authopenid/sendpw.html index ba81dba4..383723ca 100644 --- a/templates/authopenid/sendpw.html +++ b/templates/authopenid/sendpw.html @@ -9,11 +9,11 @@ </div> <div class="paragraph"> -{% trans "Lost your password? No problem - here you can reset it." %}<br> +{% trans "Lost your password? No problem - here you can reset it." %}<br/> {% trans "Please enter your username below and new password will be sent to your registered e-mail" %} </div> {% if form.errors %} -<p class="errors"><span class="big">{% "Sorry, looks like we have some errors:" %}</span><br> +<p class="errors"><span class="big">{% "Sorry, looks like we have some errors:" %}</span><br/> {% if form.username.errors %} <span class="error">{{ form.username.errors|join:", " }}</span> {% endif %} diff --git a/templates/authopenid/signin.html b/templates/authopenid/signin.html index 9a1a6780..8601f6ee 100644 --- a/templates/authopenid/signin.html +++ b/templates/authopenid/signin.html @@ -62,39 +62,39 @@ </div> </li> <li class="username first_tiny_li" title="MyOpenID user name"> - <img src="/content/jquery-openid/images/myopenid.ico" alt="icon" /> + <img src="/content/jquery-openid/images/myopenid-2.png" alt="icon" /> <span>http://<strong>username</strong>.myopenid.com/</span> </li> <li class="username" title="Flickr user name"> - <img src="/content/jquery-openid/images/flickr.ico" alt="icon" /> + <img src="/content/jquery-openid/images/flickr.png" alt="icon" /> <span>http://flickr.com/<strong>username</strong>/</span> </li> <li class="username" title="Technorati user name"> - <img src="/content/jquery-openid/images/technorati.ico" alt="icon" /> + <img src="/content/jquery-openid/images/technorati-1.png" alt="icon" /> <span>http://technorati.com/people/technorati/<strong>username</strong>/</span> </li> <li class="username" title="Wordpress blog name"> - <img src="/content/jquery-openid/images/wordpress.ico" alt="icon" /> + <img src="/content/jquery-openid/images/wordpress.png" alt="icon" /> <span>http://<strong>username</strong>.wordpress.com</span> </li> <li class="username" title="Blogger blog name"> - <img src="/content/jquery-openid/images/blogger.ico" alt="icon" /> + <img src="/content/jquery-openid/images/blogger-1.png" alt="icon" /> <span>http://<strong>username</strong>.blogspot.com/</span> </li> <li class="username" title="LiveJournal blog name"> - <img src="/content/jquery-openid/images/livejournal.ico" alt="icon" /> + <img src="/content/jquery-openid/images/livejournal-1.png" alt="icon" /> <span>http://<strong>username</strong>.livejournal.com</span> </li> <li class="username" title="ClaimID user name"> - <img src="/content/jquery-openid/images/claimid.ico" alt="icon" /> + <img src="/content/jquery-openid/images/claimid-0.png" alt="icon" /> <span>http://claimid.com/<strong>username</strong></span> </li> <li class="username" title="Vidoop user name"> - <img src="/content/jquery-openid/images/vidoop.ico" alt="icon" /> + <img src="/content/jquery-openid/images/vidoop.png" alt="icon" /> <span>http://<strong>username</strong>.myvidoop.com/</span> </li> <li class="username" title="Verisign user name"> - <img src="/content/jquery-openid/images/verisign.ico" alt="icon" /> + <img src="/content/jquery-openid/images/verisign-2.png" alt="icon" /> <span>http://<strong>username</strong>.pip.verisignlabs.com/</span> </li> </ul> @@ -115,10 +115,9 @@ <div class="login"> <p style="display:none">{% trans "we support two login modes" %}</p> <div style="display:none"> - <br> {% if form1.errors %} <p class="errors"> - <span class="big">{% trans "Sorry, looks like we have some errors:" %}</span><br> + <span class="big">{% trans "Sorry, looks like we have some errors:" %}</span><br/> <ul class="error-list"> {% if form1.username.errors %} <li><span class="error">{{ form1.username.errors|join:", " }}</span></li> @@ -129,14 +128,13 @@ </ul> </p> {% endif %} - <br> <form name="fauth" action="{% url user_signin %}" method="post"> {{ form1.next }} <fieldset class="fieldset" > <legend class="big">{% trans "Use login name and password" %}</legend> <div class="form-row"><label for="id_username">{% trans "Login name" %}:</label><br />{{ form1.username }}</div> <div class="form-row"><label for="id_password">{% trans "Password" %}:</label><br />{{ form1.password }}</div> - <div class="submit-row"><input type="submit" class="submit" name="blogin" value="{% trans "Login" %}"> + <div class="submit-row"><input type="submit" class="submit" name="blogin" value="{% trans "Login" %}"/> <a href="">{% trans "Forgot your password?" %}</a> <a href="">{% trans "Create new account" %}</a></div> </fieldset> @@ -148,7 +146,6 @@ {% block sidebar %} <div class="boxC"> <h3 class="subtitle">{% trans "Why use OpenID?" %}</h3> - <p> <ul class="list-item"> <li> {% trans "with openid it is easier" %} @@ -164,10 +161,10 @@ </li> </ul> - <a href="http://openid.net/what/" target="_blank" style="float:right;position:relative">{% trans "Find out more" %} »</a><br> + <p> + <a href="http://openid.net/what/" target="_blank" style="float:right;position:relative">{% trans "Find out more" %} »</a><br/> <a href="http://openid.net/get/" target="_blank" style="float:right;position:relative">{% trans "Get OpenID" %} »</a> </p> - <br> </div> {% endblock%} diff --git a/templates/authopenid/signup.html b/templates/authopenid/signup.html index a65dafdc..5e405d3f 100644 --- a/templates/authopenid/signup.html +++ b/templates/authopenid/signup.html @@ -14,7 +14,7 @@ {% if form.errors %} <p class="errors"> - <span class="big">{% trans "Sorry, looks like we have some errors" %}</span><br> + <span class="big">{% trans "Sorry, looks like we have some errors" %}</span><br/> <ul class="error-list"> {% if form.username.errors %} <li><span class="error">{{ form.username.errors|join:", " }}</span></li> @@ -33,17 +33,15 @@ <form action="{% url user_signup %}" method="post" accept-charset="utf-8"> <fieldset class="fieldset"> <legend class="big">{% trans "Conventional registration" %}</legend> - <div class="form-row"><label for="id_username">{% trans "choose a user name" %}:</label><br>{{ form.username }}</div> + <div class="form-row"><label for="id_username">{% trans "choose a user name" %}:</label><br/>{{ form.username }}</div> - <div class="form-row"><label for="id_email">{% trans "your email address" %}:</label><br>{{ form.email }}</div> + <div class="form-row"><label for="id_email">{% trans "your email address" %}:</label><br/>{{ form.email }}</div> <div class="form-row"><label for="id_password1">{% trans "choose password" %}:</label><br />{{ form.password1 }}</div> - <div class="form-row"><label for="id_password2">{% trans "retype password" %}:</label><br>{{ form.password2 }}</div> + <div class="form-row"><label for="id_password2">{% trans "retype password" %}:</label><br/>{{ form.password2 }}</div> <div class="submit-row"><input type="submit" class="submit" value="{% trans "login" %}" > <a href="{% url user_signin %}">{% trans "back to login" %}</a></div> </fieldset> - <br > </form> - <br > <div style="display:none"> <h2 class="signup">{% trans "Register with your OpenID" %}</h2> <form name="fopenid" action="{% url user_signin %}" method="post"> diff --git a/templates/badges.html b/templates/badges.html index 69ddc39f..4a1ba091 100644 --- a/templates/badges.html +++ b/templates/badges.html @@ -18,10 +18,9 @@ </div> <div class="badges" id="main-body" style="width:100%"> <p> - {% trans "Community gives you awards for your questions, answers and votes." %}<br> + {% trans "Community gives you awards for your questions, answers and votes." %}<br/> {% trans "Below is the list of available badges and number of times each type of badge has been awarded." %} </p> - <br> <div id="medalList"> {% for badge in badges %} <div style="clear:both;line-height:30px"> @@ -33,7 +32,7 @@ {% endfor %} </div> <div style="float:left;width:180px;"> - <a href="{{badge.get_absolute_url}}" title="{{ badge.get_type_display }} : {{ badge.description }}" class="medal"><span class="badge{{ badge.type }}">●</span> {{ badge.name }}</a><strong> × {{ badge.awarded_count|intcomma }}</strong> + <a href="{{badge.get_absolute_url}}" title="{{ badge.get_type_display }} : {{ badge.description }}" class="medal"><span class="badge{{ badge.type }}">●</span> {{ badge.name }}</a><strong> ✕ {{ badge.awarded_count|intcomma }}</strong> </div> <p style="float:left;width:350px;"> {{ badge.description }} diff --git a/templates/base.html b/templates/base.html index ae389255..0f568f73 100644 --- a/templates/base.html +++ b/templates/base.html @@ -8,12 +8,14 @@ {% spaceless %} {% block meta %}{% endblock %} {% endspaceless %} - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + {% if settings.GOOGLE_SITEMAP_CODE %} <meta name="verify-v1" content="{{settings.GOOGLE_SITEMAP_CODE}}" /> - <link rel="shortcut icon" href="/content/images/favicon.ico" > + {% endif %} + <link rel="shortcut icon" href="/content/images/favicon.ico" /> <link href="/content/style/style.css" rel="stylesheet" type="text/css" /> - <script src="http://www.google.com/jsapi"></script> - <script>google.load("jquery", "1.2.6");</script> + <script src="http://www.google.com/jsapi" type="text/javascript"></script> + <script type="text/javascript">google.load("jquery", "1.2.6");</script> <script type="text/javascript"> var i18nLang = '{{settings.LANGUAGE_CODE}}'; </script> diff --git a/templates/base_content.html b/templates/base_content.html index 4ee9675f..a05198f5 100644 --- a/templates/base_content.html +++ b/templates/base_content.html @@ -1,18 +1,18 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- base_content.html --> {% load i18n %} -<html> +<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE }}</title> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="verify-v1" content="{{ settings.GOOGLE_SITEMAP_CODE }}" /> - <link rel="shortcut icon" href="/content/images/favicon.ico" > + <link rel="shortcut icon" href="/content/images/favicon.ico" /> <link href="/content/style/style.css" rel="stylesheet" type="text/css" /> {% spaceless %} {% block forestyle %}{% endblock %} {% endspaceless %} - <script src="http://www.google.com/jsapi"></script> - <script>google.load("jquery", "1.2.6");</script> + <script src="http://www.google.com/jsapi" type="text/javascript"></script> + <script type="text/javascript">google.load("jquery", "1.2.6");</script> <script type="text/javascript"> var i18nLang = '{{ settings.LANGUAGE_CODE }}'; </script> diff --git a/templates/book.html b/templates/book.html index 37bf0101..cc6fc77b 100644 --- a/templates/book.html +++ b/templates/book.html @@ -118,7 +118,7 @@ </a> <div class="bookQuestionItem"> <h3> - <a title="{{question.summary}}" href="{% url questions %}{{question.id}}/{{question.title}}">{{question.title}}</a> + <a title="{{question.summary|collapse}}" href="{% url questions %}{{question.id}}/{{question.title}}">{{question.title}}</a> </h3> <div class="tags"> {% for tag in question.tagname_list %} diff --git a/templates/content/jquery-openid/images/blogger-1.png b/templates/content/jquery-openid/images/blogger-1.png Binary files differnew file mode 100644 index 00000000..8b360ea5 --- /dev/null +++ b/templates/content/jquery-openid/images/blogger-1.png diff --git a/templates/content/jquery-openid/images/claimid-0.png b/templates/content/jquery-openid/images/claimid-0.png Binary files differnew file mode 100644 index 00000000..4a0ea1b3 --- /dev/null +++ b/templates/content/jquery-openid/images/claimid-0.png diff --git a/templates/content/jquery-openid/images/flickr.png b/templates/content/jquery-openid/images/flickr.png Binary files differnew file mode 100644 index 00000000..142405a6 --- /dev/null +++ b/templates/content/jquery-openid/images/flickr.png diff --git a/templates/content/jquery-openid/images/livejournal-1.png b/templates/content/jquery-openid/images/livejournal-1.png Binary files differnew file mode 100644 index 00000000..e6436081 --- /dev/null +++ b/templates/content/jquery-openid/images/livejournal-1.png diff --git a/templates/content/jquery-openid/images/myopenid-2.png b/templates/content/jquery-openid/images/myopenid-2.png Binary files differnew file mode 100644 index 00000000..f64fb8e8 --- /dev/null +++ b/templates/content/jquery-openid/images/myopenid-2.png diff --git a/templates/content/jquery-openid/images/technorati-1.png b/templates/content/jquery-openid/images/technorati-1.png Binary files differnew file mode 100644 index 00000000..f7195240 --- /dev/null +++ b/templates/content/jquery-openid/images/technorati-1.png diff --git a/templates/content/jquery-openid/images/verisign-2.png b/templates/content/jquery-openid/images/verisign-2.png Binary files differnew file mode 100644 index 00000000..c1467008 --- /dev/null +++ b/templates/content/jquery-openid/images/verisign-2.png diff --git a/templates/content/jquery-openid/images/vidoop.png b/templates/content/jquery-openid/images/vidoop.png Binary files differnew file mode 100644 index 00000000..032c9e98 --- /dev/null +++ b/templates/content/jquery-openid/images/vidoop.png diff --git a/templates/content/jquery-openid/images/wordpress.png b/templates/content/jquery-openid/images/wordpress.png Binary files differnew file mode 100644 index 00000000..ee29f0cf --- /dev/null +++ b/templates/content/jquery-openid/images/wordpress.png diff --git a/templates/content/jquery-openid/openid.css b/templates/content/jquery-openid/openid.css index e53c1823..6c59192f 100644 --- a/templates/content/jquery-openid/openid.css +++ b/templates/content/jquery-openid/openid.css @@ -1,7 +1,7 @@ fieldset {border-style:none;} img {border-style:none;} -.logo_box {width:90px;height:40px;background:white;border:1px solid #dddddd;} +.logo_box {display:inline-block;width:90px;height:40px;background:white;border:1px solid #dddddd;} .openid_box img {margin-top:6px;} .aol_box img {margin-top:6px;} .yahoo_box img {margin-top:13px;} diff --git a/templates/content/js/com.cnprog.i18n.js b/templates/content/js/com.cnprog.i18n.js index 90166eec..848ad59e 100644 --- a/templates/content/js/com.cnprog.i18n.js +++ b/templates/content/js/com.cnprog.i18n.js @@ -84,9 +84,68 @@ var i18nEn = { 'characters':'characters left', }; +var i18nEs = { + 'insufficient privilege':'privilegio insuficiente', + 'cannot pick own answer as best':'no puede escoger su propia respuesta como la mejor', + 'anonymous users cannot select favorite questions':'usuarios anonimos no pueden seleccionar', + 'please login':'por favor inicie sesión', + 'anonymous users cannot vote':'usuarios anónimos no pueden votar', + '>15 points requried to upvote': '>15 puntos requeridos para votar positivamente', + '>100 points required to downvote':'>100 puntos requeridos para votar negativamente', + 'please see': 'por favor vea', + 'cannot vote for own posts':'no se puede votar por sus propias publicaciones', + 'daily vote cap exhausted':'cuota de votos diarios excedida', + 'cannot revoke old vote':'no puede revocar un voto viejo', + 'please confirm offensive':"por favor confirme ofensiva", + 'anonymous users cannot flag offensive posts':'usuarios anónimos no pueden marcar publicaciones como ofensivas', + 'cannot flag message as offensive twice':'no puede marcar mensaje como ofensivo dos veces', + 'flag offensive cap exhausted':'cuota para marcar ofensivas ha sido excedida', + 'need >15 points to report spam':"necesita >15 puntos para reportar spam", + 'confirm delete':"¿Está seguro que desea borrar esto?", + 'anonymous users cannot delete/undelete':"usuarios anónimos no pueden borrar o recuperar publicaciones", + 'post recovered':"publicación recuperada", + 'post deleted':"publicación borrada。", + 'add comment':'agregar comentario', + 'community reputation points':'reputación comunitaria', + 'to comment, need':'para comentar, necesita reputación', + 'delete this comment':'borrar este comentario', + 'hide comments':"ocultar comentarios", + 'add a comment':"agregar comentarios", + 'comments':"comentarios", + 'confirm delete comment':"¿Realmente desea borrar este comentario?", + 'characters':'caracteres faltantes', + 'can write':'tiene ', + 'click to close':'haga click para cerrar', + 'loading...':'cargando...', + 'tags cannot be empty':'las etiquetas no pueden estar vacías', + 'tablimits info':"hasta 5 etiquetas de no mas de 20 caracteres cada una", + 'content cannot be empty':'el contenido no puede estar vacío', + 'content minchars': 'por favor introduzca mas de {0} caracteres', + 'please enter title':'por favor ingrese un título', + 'title minchars':"por favor introduzca al menos {0} caracteres", + 'delete':'borrar', + 'undelete': 'recuperar', + 'bold': 'negrita', + 'italic':'cursiva', + 'link':'enlace', + 'quote':'citar', + 'preformatted text':'texto preformateado', + 'image':'imagen', + 'numbered list':'lista numerada', + 'bulleted list':'lista no numerada', + 'heading':'标题', + 'horizontal bar':'barra horizontal', + 'undo':'deshacer', + 'redo':'rehacer', + 'enter image url':'introduzca la URL de la imagen, por ejemplo:<br />http://www.example.com/image.jpg \"titulo de imagen\"', + 'enter url':'introduzca direcciones web, ejemplo:<br />http://www.cnprog.com/ \"titulo del enlace\"</p>"', + 'upload image':'cargar imagen:', +}; + var i18n = { 'en':i18nEn, - 'zh_CN':i18nZh + 'zh_CN':i18nZh, + 'es':i18nEs }; var i18n_dict = i18n[i18nLang]; diff --git a/templates/content/style/style.css b/templates/content/style/style.css index 6c53eec9..1f992b7b 100644 --- a/templates/content/style/style.css +++ b/templates/content/style/style.css @@ -97,7 +97,6 @@ blockquote right:0px; height:20px; text-align:right; - color:black; padding:3px; background-color:#ffffff; width:500px; diff --git a/templates/faq.html b/templates/faq.html index 8df711ca..8adee552 100644 --- a/templates/faq.html +++ b/templates/faq.html @@ -19,7 +19,7 @@ </p> <h3 class="subtitle">{% trans "What questions should I avoid asking?" %}</h3> - <p>{% trans "Please avoid asking questions that are not relevant to this community, too subjective and argumentative." %}</p> + <p>{% trans "Please avoid asking questions that are not relevant to this community, too subjective and argumentative." %} </p> </div> diff --git a/templates/footer.html b/templates/footer.html index bac698cb..f182ca3c 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -13,13 +13,14 @@ </div> <p style="margin-top:10px;"> <a href="http://code.google.com/p/cnprog/" target="_blank"> - <img src="/content/images/djangomade124x25_grey.gif" border="0" alt="Made with Django." title="Made with Django." > + <img src="/content/images/djangomade124x25_grey.gif" border="0" alt="Made with Django." title="Made with Django." /> </a> <!--<div style="font-size:90%;color:#333">{% trans "current revision" %}: R-0120-20090406</div>--> </p> <p id="licenseLogo"><img src="/content/images/cc-wiki.png" title="Creative Commons: Attribution - Share Alike" alt="cc-wiki" width="50" height="68" /></p> </div> <!-- 页面底部结束: --> + {% if settings.GOOGLE_ANALYTICS_KEY %} <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); @@ -30,4 +31,5 @@ pageTracker._trackPageview(); } catch(err) {} </script> -<!-- end template footer.html --> + {% endif %} +<!-- end footer.html --> diff --git a/templates/header.html b/templates/header.html index 6f8657b3..077de586 100644 --- a/templates/header.html +++ b/templates/header.html @@ -20,7 +20,7 @@ <td width="23%"> <div id="logo"> <a href="/"> - <img src="/content/images/logo.png" title="{% trans "back to home page" %}" /> + <img src="/content/images/logo.png" title="{% trans "back to home page" %}" alt="{{settings.APP_TITLE}} logo"/> </a> </div> </td> @@ -49,18 +49,19 @@ </table> </div> <div id="searchBar"> - <table width="100%" height="60" border="0" cellpadding="0" cellspacing="0" class="content"> + <table width="100%" border="0" cellpadding="0" cellspacing="0" class="content"> <tr> <td align="center" valign="middle"> <form action="{% url search %}" method="GET"> <div> - <input type="text" class="searchInput" value="{{ keywords }}" name="q" id="keywords" > - <input type="submit" name="Submit" value="{% trans "search" %}" class="searchBtn" > + <input type="text" class="searchInput" value="{{ keywords }}" name="q" id="keywords" /> + <input type="submit" name="Submit" value="{% trans "search" %}" class="searchBtn" /> </div> <div class="options"> - <input id="type-question" type="radio" class="" value="question" name="t" checked >{% trans "questions" %} - <input id="type-tag" type="radio" class="" value="tag" name="t" >{% trans "tags" %} - <input id="type-user" type="radio" class="" value="user" name="t" >{% trans "users" %} + <input id="type-question" type="radio" value="question" name="t" + checked="checked" />{% trans "questions" %} + <input id="type-tag" type="radio" value="tag" name="t" />{% trans "tags" %} + <input id="type-user" type="radio" value="user" name="t" />{% trans "users" %} </div> </form> </td> diff --git a/templates/index.html b/templates/index.html index 239b0ff4..b358c384 100644 --- a/templates/index.html +++ b/templates/index.html @@ -32,7 +32,7 @@ {% for question in questions %} <div class="qstA"> <h2> - <a href="{{ question.get_absolute_url }}" title="{{ question.summary }}..."> + <a href="{{ question.get_absolute_url }}" title="{{ question.summary|collapse }}..."> {{ question.get_question_title }} </a> </h2> @@ -51,7 +51,7 @@ </table> </div> <div class="summary"> - {{ question.summary }}... + {{ question.summary}}... </div> {% if question.wiki %} <span class="from wiki">{% trans "community wiki" %}</span> @@ -88,7 +88,7 @@ <div class="boxB"> <h3>{% trans "Recent tags" %}</h3> <div class="body"> - <p class="tagsbox"> + <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> @@ -97,6 +97,7 @@ <div class="more"><a href="{% url tags %}">{% trans "popular tags" %} »</a> </div> </div> </div> +{% if awards %} <div class="boxB"> <h3>{% trans "Recent awards" %}</h3> <div class="body"> @@ -112,6 +113,7 @@ <div class="more"><a href="{% url badges %}">{% trans "all awards" %} »</a> </div> </div> </div> +{% endif %} <div id="feeds"> <a href="/feeds/rss" title="{% trans "subscribe to last 30 questions by RSS" %}">{% trans "subscribe to the questions feed" %}</a> </div> diff --git a/templates/logout.html b/templates/logout.html index e05a4328..2cd935a0 100644 --- a/templates/logout.html +++ b/templates/logout.html @@ -19,7 +19,6 @@ <div id="main-body" style="width:100%"> <p>{% trans "As a registered user you can login with your OpenID, log out of the site or permanently remove your account." %}</p> <input id="btLogout" type="button" class="submit" value="{% trans "Logout now" %}"><!-- style="width:150px">--> - <br><br> </div> {% endblock %} <!-- end logout.html --> diff --git a/templates/privacy.html b/templates/privacy.html index d5d7dd43..e66086dd 100644 --- a/templates/privacy.html +++ b/templates/privacy.html @@ -37,7 +37,6 @@ <h3 class="subtitle">{% trans "Policy Changes" %}</h3> <p>{% trans "how privacy policies can be changed" %} </p> - <br><br> </div> {% endblock %} <!-- end privacy.html --> diff --git a/templates/question.html b/templates/question.html index a0fc194d..0e1b8cb2 100644 --- a/templates/question.html +++ b/templates/question.html @@ -6,6 +6,9 @@ {% load i18n %} {% block title %}{% spaceless %}{{ question.get_question_title }}{% endspaceless %}{% endblock %} {% block forejs %} + <meta name="description" content="{{question.summary}}" /> + <meta name="keywords" content="{{question.tagname_meta_generator}}" /> + <link rel="canonical" href="{{question.get_absolute_url}}"/> {% if not question.closed and request.user.is_authenticated %} <script type='text/javascript' src='/content/js/com.cnprog.editor.js'></script> <script type='text/javascript' src='/content/js/wmd/showdown.js'></script> @@ -66,38 +69,45 @@ {% if question_vote %} <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote" src="/content/images/vote-arrow-up{% if question_vote.is_upvote %}-on{% endif %}.png" - title="{% trans "i like this post (click again to cancel)" %}" > + alt="{% trans "i like this post (click again to cancel)" %}" + title="{% trans "i like this post (click again to cancel)" %}" /> <div id="question-vote-number-{{ question.id }}" class="vote-number" title="{% trans "current number of votes" %}"> {{ question.score }} </div> <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote" src="/content/images/vote-arrow-down{% if question_vote.is_downvote %}-on{% endif %}.png" - title="{% trans "i dont like this post (click again to cancel)" %}" > + alt="{% trans "i dont like this post (click again to cancel)" %}" + title="{% trans "i dont like this post (click again to cancel)" %}" /> {% else %} <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote" + alt="{% trans "i like this post (click again to cancel)" %}" src="/content/images/vote-arrow-up.png" - title="{% trans "i like this post (click again to cancel)" %}" > + title="{% trans "i like this post (click again to cancel)" %}" /> <div id="question-vote-number-{{ question.id }}" class="vote-number" title="{% trans "current number of votes" %}"> {{ question.score }} </div> <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote" - src="/content/images/vote-arrow-down.png" title="{% trans "i dont like this post (click again to cancel)" %}" > + src="/content/images/vote-arrow-down.png" + alt="{% trans "i dont like this post (click again to cancel)" %}" + title="{% trans "i dont like this post (click again to cancel)" %}" /> {% endif %} - <br><br> {% if favorited %} <img class="question-img-favorite" src="/content/images/vote-favorite-on.png" - title="{% trans "mark this question as favorite (click again to cancel)" %}" > + alt="{% trans "mark this question as favorite (click again to cancel)" %}" + title="{% trans "mark this question as favorite (click again to cancel)" %}" /> <div id="favorite-number" class="favorite-number my-favorite-number"> {{ question.favourite_count }} </div> {% else %} <img class="question-img-favorite" src="/content/images/vote-favorite-off.png" - title="{% trans "remove favorite mark from this question (click again to restore mark)" %}" > - <div id="favorite-number" class="favorite-number">{% ifnotequal question.favourite_count 0 %}{{ question.favourite_count }}{% endifnotequal %} + alt="{% trans "remove favorite mark from this question (click again to restore mark)" %}" + title="{% trans "remove favorite mark from this question (click again to restore mark)" %}" /> + <div id="favorite-number" class="favorite-number"> + {% ifnotequal question.favourite_count 0 %}{{ question.favourite_count }}{% endifnotequal %} </div> {% endif %} @@ -272,24 +282,29 @@ <tr> <td style="width:30px;vertical-align:top"> <div class="vote-buttons"> - <img id="answer-img-upvote-{{ answer.id }}" class="answer-img-upvote" src="/content/images/vote-arrow-up{% get_user_vote_image user_answer_votes answer.id 1 %}.png" title="{% trans "i like this answer (click again to cancel)" %}"> + <img id="answer-img-upvote-{{ answer.id }}" class="answer-img-upvote" + src="/content/images/vote-arrow-up{% get_user_vote_image user_answer_votes answer.id 1 %}.png" + alt="{% trans "i like this answer (click again to cancel)" %}" + title="{% trans "i like this answer (click again to cancel)" %}"/> <div id="answer-vote-number-{{ answer.id }}" class="vote-number" title="{% trans "current number of votes" %}"> {{ answer.score }} </div> <img id="answer-img-downvote-{{ answer.id }}" class="answer-img-downvote" src="/content/images/vote-arrow-down{% get_user_vote_image user_answer_votes answer.id -1 %}.png" - title="{% trans "i dont like this answer (click again to cancel)" %}" > + alt="{% trans "i dont like this answer (click again to cancel)" %}" + title="{% trans "i dont like this answer (click again to cancel)" %}" /> - <br><br> {% ifequal request.user question.author %} <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" src="/content/images/vote-accepted{% if answer.accepted %}-on{% endif %}.png" - title="{% trans "mark this answer as favorite (click again to undo)" %}" > + alt="{% trans "mark this answer as favorite (click again to undo)" %}" + title="{% trans "mark this answer as favorite (click again to undo)" %}" /> {% else %} {% if answer.accepted %} <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept" src="/content/images/vote-accepted{% if answer.accepted %}-on{% endif %}.png" - title="{% trans "the author of the question has selected this answer as correct" %}" > + alt="{% trans "the author of the question has selected this answer as correct" %}" + title="{% trans "the author of the question has selected this answer as correct" %}" /> {% endif %} {% endifequal %} </div> @@ -461,15 +476,13 @@ <div id="previewer" class="wmd-preview"></div> {{ answer.text.errors }} </div> - <br> - <input type="submit" value="{% trans "Answer the question" %}" class="submit"><span class="form-error"></span> + <input type="submit" value="{% trans "Answer the question" %}" class="submit"/><span class="form-error"></span> {% if request.user.is_authenticated %} {{ answer.email_notify }} <label for="question-subscribe-updates">{% trans "Notify me daily if there are any new answers." %}</label> {% else %} - <input type="checkbox" disabled><label>{% trans "once you sign in you will be able to subscribe for any updates here" %}</label> + <input type="checkbox" disabled="disabled" /><label>{% trans "once you sign in you will be able to subscribe for any updates here" %}</label> {% endif %} {% endif %} - <br><br> </form> </div> </div> @@ -484,7 +497,7 @@ {% for tag in tags %} <a href="{% url forum.views.tag 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> + rel="tag">{{ tag.name }}</a> <span class="tag-number">✕{{ tag.used_count|intcomma }}</span><br/> {% endfor %} </p> <p> @@ -507,7 +520,6 @@ </p> {% endfor %} </div> - <br> </div> {% endblock %} diff --git a/templates/question_edit.html b/templates/question_edit.html index 9ad60a88..db090ca3 100644 --- a/templates/question_edit.html +++ b/templates/question_edit.html @@ -67,14 +67,14 @@ <div id="main-body" class="ask-body"> <div id="askform"> <form id="fmedit" action="{% url edit_question question.id %}" method="post" > - <label for="id_revision" ><strong>{% trans "revision" %}:</strong></label> <br> + <label for="id_revision" ><strong>{% trans "revision" %}:</strong></label> <br/> {% if revision_form.revision.errors %}{{ revision_form.revision.errors.as_ul }}{% endif %} <div style="vertical-align:middle"> {{ revision_form.revision }} <input type="submit" style="display:none" id="select_revision" name="select_revision" value="{% trans "select revision"%}"> - </div><br> + </div> <div class="form-item"> - <label for="id_title" ><strong>{{ form.title.label_tag }}:</strong></label> <span class="form-error"></span><br> + <label for="id_title" ><strong>{{ form.title.label_tag }}:</strong></label> <span class="form-error"></span><br/> {{ form.title }} {{ form.title.errors }} <div class="title-desc"> {{ form.title.help_text }} @@ -98,28 +98,22 @@ </table> </div> <div id="previewer" class="wmd-preview"></div> - <br> </div> <div class="form-item"> - <strong>{{ form.tags.label_tag }}:</strong> <span class="form-error"></span><br> + <strong>{{ form.tags.label_tag }}:</strong> <span class="form-error"></span><br/> {{ form.tags }} {{ form.tags.errors }} <div class="title-desc"> {{ form.tags.help_text }} </div> </div> - <br> - <strong>{{ form.summary.label_tag }}</strong> <br> + <strong>{{ form.summary.label_tag }}</strong> <br/> {{ form.summary }} {{ form.summary.errors }} <div class="title-desc"> {{ form.summary.help_text }} </div> - <br> - <div class="error" ></div> <input type="submit" value="{% trans "Save edit" %}" class="submit" /> <input type="button" value="{% trans "Cancel" %}" class="submit" onclick="history.back(-1);" /> - <br> - <br> </form> </div> </div> diff --git a/templates/question_edit_tips.html b/templates/question_edit_tips.html index caf292e3..85614595 100644 --- a/templates/question_edit_tips.html +++ b/templates/question_edit_tips.html @@ -46,6 +46,5 @@ </li> </ul> <a href="http://en.wikipedia.org/wiki/Markdown" target="_blank" style="float:right;position:relative">{% trans "learn more about Markdown" %} »</a> - <br> </div> <!-- end question_edit_tips.html --> diff --git a/templates/question_retag.html b/templates/question_retag.html index c7062e30..66e51c8c 100644 --- a/templates/question_retag.html +++ b/templates/question_retag.html @@ -63,19 +63,15 @@ <div class="form-item"> - <strong>{{ form.tags.label_tag }}:</strong> <span class="form-error"></span><br> + <strong>{{ form.tags.label_tag }}:</strong> <span class="form-error"></span><br/> {{ form.tags }} {{ form.tags.errors }} <div class="title-desc"> {{ form.tags.help_text }} </div> </div> - <br> - <div class="error" ></div> <input type="submit" value="{% trans "Save edit" %}" class="submit" /> <input type="button" value="{% trans "Cancel" %}" class="submit" onclick="history.back(-1);" /> - <br> - <br> </form> </div> </div> @@ -96,7 +92,6 @@ </li> </ul> <a href="{% url faq %}" style="float:right;position:relative">faq »</a> - <br> </div> {% endblock %} diff --git a/templates/questions.html b/templates/questions.html index 5dac0156..985b4921 100644 --- a/templates/questions.html +++ b/templates/questions.html @@ -126,24 +126,24 @@ {% endblocktrans %} {% endif %} {% endif %} - + <br/> {% ifequal tab_id "latest" %} - <p>{% trans "latest questions info" %}</p> + {% trans "latest questions info" %} {% endifequal %} {% ifequal tab_id "active" %} - <p>{% trans "Questions are sorted by the <strong>time of last update</strong>." %} - {% trans "Most recently answered ones are shown first." %}</p> + {% trans "Questions are sorted by the <strong>time of last update</strong>." %} + {% trans "Most recently answered ones are shown first." %} {% endifequal %} {% ifequal tab_id "hottest" %} - <p>{% trans "Questions sorted by <strong>number of responses</strong>." %} - {% trans "Most answered questions are shown first." %}</p> + {% trans "Questions sorted by <strong>number of responses</strong>." %} + {% trans "Most answered questions are shown first." %} {% endifequal %} {% ifequal tab_id "mostvoted" %} - <p>{% trans "Questions are sorted by the <strong>number of votes</strong>." %} - {% trans "Most voted questions are shown first." %}</p> + {% trans "Questions are sorted by the <strong>number of votes</strong>." %} + {% trans "Most voted questions are shown first." %} {% endifequal %} @@ -154,10 +154,10 @@ <div class="tags"> {% for tag in tags %} <a rel="tag" title="{% trans "see questions tagged" %}'{{ tag.name }}'{% trans "using tags" %}" href="{% url forum.views.tag tag.name|urlencode %}">{{ tag.name }}</a> - <span class="tag-number">× {{ tag.used_count|intcomma }}</span> - <br> + <span class="tag-number">✕ {{ tag.used_count|intcomma }}</span> + <br /> {% endfor %} - <br> + <br /> </div> </div> diff --git a/templates/tags.html b/templates/tags.html index fa2b4201..f558594a 100644 --- a/templates/tags.html +++ b/templates/tags.html @@ -6,6 +6,7 @@ {% block title %}{% spaceless %}{% trans "Tag list" %}{% endspaceless %}{% endblock %} {% block forejs %} <script type="text/javascript"> + /*<![CDATA[*/ $().ready(function(){ $("#nav_tags").attr('className',"on"); $("#ipSearchTag").focus(); @@ -20,7 +21,7 @@ Hilite.elementid = "searchtags"; Hilite.debug_referrer = location.href; }); - + /*]]>*/ </script> {% endblock %} {% block content %} @@ -41,6 +42,7 @@ <span>{% trans "Nothing found" %}</span> {% endif %} </p> +{% if tags.object_list %} <ul class="tagsList tags"> {% for tag in tags.object_list %} <li> @@ -48,11 +50,12 @@ {{ tag }} </a> <span class="tag-number">× {{ tag.used_count|intcomma }}</span> - <br> + <br/> </li> {% endfor %} </ul> +{% endif %} </div> {% endblock %} diff --git a/templates/unanswered.html b/templates/unanswered.html index 13b3a3b2..a56d3ae3 100644 --- a/templates/unanswered.html +++ b/templates/unanswered.html @@ -95,9 +95,6 @@ <div class="boxC"> <p> {% blocktrans with questions_count|intcomma as num_q %}have {{num_q}} unanswered questions{% endblocktrans %} - {% comment %} - {% trans "Have a total of" %}<br><div class="questions-count">{{ questions_count|intcomma }}</div> - {% endcomment %} <!---<p>问题按 <strong>问题创建时间</strong> 排序。最新加入的问题将显示在最前面。</p>--> </p> </div> @@ -107,14 +104,13 @@ <div class="tags"> {% for tag in tags %} <a rel="tag" title="{% trans "see questions tagged"%}'{{ tag.name }}'{% trans "using tags" %}" href="{% url forum.views.tag tag.name|urlencode %}">{{ tag.name }}</a> - <span class="tag-number">× {{ tag.used_count|intcomma }}</span> - <br> + <span class="tag-number"> ✕ {{ tag.used_count|intcomma }}</span> + <br/> {% endfor %} - <br> + <br/> </div> </div> </div> {% endblock %} - <!-- end unanswered.html --> diff --git a/templates/user_info.html b/templates/user_info.html index 2ef2dd9a..e56fb143 100644 --- a/templates/user_info.html +++ b/templates/user_info.html @@ -27,7 +27,7 @@ </td> <td width="360" style="vertical-align: top;"> <table class="user-details"> - <tr height="30px"> + <tr> <th width="130" align="left"><strong>{% trans "Registered user" %}</strong></th> <th width="230" align="right"> {% if request.user|can_view_user_edit:view_user %} diff --git a/templates/user_preferences.html b/templates/user_preferences.html index eb7c4761..00129c28 100644 --- a/templates/user_preferences.html +++ b/templates/user_preferences.html @@ -8,13 +8,14 @@ <div style="padding:5px;"> <fieldset> <legend><b>{% trans "Connect with Twitter" %}</b></legend> - <form> + <!-- todo: form action needs to be fixed --> + <form name="twittersync" action="/sdfgsdlgjkhsdfljh"> <label for="name">{% trans "Twitter account name:" %}</label> - <input id="name" /><br> + <input id="name" /><br/> <label for="password">{% trans "Twitter password:" %}</label> - <input id="password" type="password"/><br> - <input id="cbMessage" type="checkbox" />{% trans "Send my Questions to Twitter" %}<br> - <input id="cbReply" type="checkbox" />{% trans "Send my Answers to Twitter" %}<br> + <input id="password" type="password"/><br/> + <input id="cbMessage" type="checkbox" />{% trans "Send my Questions to Twitter" %}<br/> + <input id="cbReply" type="checkbox" />{% trans "Send my Answers to Twitter" %}<br/> <input type="submit" value="{% trans "Save" %}" /> </form> </fieldset> diff --git a/templates/user_responses.html b/templates/user_responses.html index d739395b..c4f4ffed 100644 --- a/templates/user_responses.html +++ b/templates/user_responses.html @@ -11,7 +11,7 @@ <div style="width:100px;float:left"><a href="{{ response.userlink }}">{{ response.username }}</a></div> <div style="float:left;overflow:hidden;width:680px"> <strong {% ifequal response.type "question_answered" %}class="user-action-2"{% endifequal %}{% ifequal response.type "answer_accepted" %}class="user-action-8"{% endifequal %}>{{ response.type }}</strong>: - <a href="{{ response.titlelink }}">{{ response.title }}</a><br> + <a href="{{ response.titlelink }}">{{ response.title }}</a><br/> {{ response.content|safe }} <div style="height:10px"></div> </div> diff --git a/templates/user_stats.html b/templates/user_stats.html index 41253494..7313fac3 100644 --- a/templates/user_stats.html +++ b/templates/user_stats.html @@ -2,6 +2,7 @@ <!-- user_stats.html --> {% load i18n %} {% load extra_tags %} +{% load extra_filters %} {% load humanize %} {% block usercontent %} @@ -40,7 +41,7 @@ </a> <div class="answer-link"> <a href="{% url questions %}{{answered_question.id}}/{{answered_question.title}}#{{answered_question.answer_id}}">{{answered_question.title}}</a> {% if answered_question.comment_count %}<span - title="{% blocktrans %}the answer has been commented {{ answered_question.comment_count }} times{% endblocktrans %}">({{answered_question.comment_count}})</span>{% endif %} + title="{% blocktrans with answered_question.comment_count as comment_count %}the answer has been commented {{ comment_count }} times{% endblocktrans %}">({{answered_question.comment_count}})</span>{% endif %} </div> </div> {% endfor %} @@ -92,7 +93,7 @@ {% for tag in tags%} <a rel="tag" title="{% blocktrans %}see other questions tagged '{{ tag }}' {% endblocktrans %}" - href="{% url forum.views.tag tag|urlencode %}">{{tag.name}}</a><span class="tag-number"> × {{ tag.used_count|intcomma }}</span><br> + href="{% url forum.views.tag tag|urlencode %}">{{tag.name}}</a><span class="tag-number"> × {{ tag.used_count|intcomma }}</span><br/> {% if forloop.counter|divisibleby:"10" %} </td> <td width="180" valign="top"> @@ -119,7 +120,7 @@ <tr> <td width="180" style="line-height:35px"> {% for award in awards %} - <a href="/badges/{{award.id}}/{{award.name}}" title="{{ award.description }}" class="medal"><span class="badge{{ award.type }}">●</span> {{ award.name }}</a><span class="tag-number"> × {{ award.count|intcomma }}</span><br> + <a href="{% url badges %}{{award.id}}/{{award.name}}" title="{{ award.description }}" class="medal"><span class="badge{{ award.type }}">●</span> {{ award.name }}</a><span class="tag-number"> × {{ award.count|intcomma }}</span><br/> {% if forloop.counter|divisibleby:"6" %} </td> <td width="180" style="line-height:35px"> |