diff options
36 files changed, 889 insertions, 5 deletions
diff --git a/development.log b/development.log new file mode 100644 index 00000000..abe1aac0 --- /dev/null +++ b/development.log @@ -0,0 +1,72 @@ +==Aug 5, 2009 Evgeny== +====Interface changes=== +Merged in my code that: +* allows anonymous posting of Q&A and then login +* per-question email notifications via 'send_email_alerts' command +* allows space character in username +* improves openid login +* makes notification messages sticky - have to click "x" to dismiss +* unanswered questions are now those with no accepted answer +* added following setting parameters: + +settings.MIN_USERNAME_LENGTH = 1 +settings.EMAIL_UNIQUE = True|False +settings.EMAIL_VALIDATION = 'on'|'off' #thought of maybe adding other options so type is string +settings.GOOGLE_SITEMAP_CODE = <string> +settings.GOOGLE_ANALYTICS_KEY = <string> + +===Fixes=== +* fixed incorrect answer count issue in question.html +* translated Twittwer stuff in user_preferences.html +* translated question_retag.html, except one phrase +* added Adolfo's python2.4 fix +* fixed template debugging comments so that they don't break page layout +* reorganized header template so that it takes less vertical space + +===Code changes=== +* wrapped template context settings into a single settings dictionary +* on login anonymous session is recorded so that anonymously posted questions (if any) could be found later +* added models: AnonymousQuestion, AnonymousAnswer, EmailFeed (for notifications) +* User model has two new fields email_key - 32 byte hex hash and email_isvalid - boolean + file sql_scripts/update_2009_07_05_EF.sql will make upgrade to the live database +* added auth_processor to context.py which loads notification messages without deleting them + NOTE: default django auth processor must be removed! +* added ajax actions questionSubscribeUpdates/questionUnsubscribeUpdates + +==Aug 4 2009, Evgeny== +===Changes=== +* commented out LocaleMiddleware - language can be now switched with settings.LANGUAGE_CODE +* added DATABASE_ENGINE line to settings_local +===Merges=== +* Adolfo's slugification of urls +* Added Chaitanyas changes for traditional login/signup and INSTALL file + +==July 26 2009, Evgeny== + +django_authopenid: +considerably changed user interface +[comment] - sorry - this is not done yet + +log/forum/forms.py: +* added tag input validation using regex +* fixed bug with date type mismatch near self.fields['birthday'] = + in EditUserForm.__init__() + +/forum/templatetags/extra_tags.py: +* fixed date type mismatch in get_age() + +/templates/content/js/com.cnprog.post.js: +* fixed bug with post deletion/recovery + +javascript: +* changed to use of non-minified code - better for editing +and debugging + +/templates/question.html: +* fixed display of delete/undelete links + +templates: +added comments in the beginning/end of each template +for the debugging purposes - so that you know which template outputs what html +<!-- user_favorites.html --> +<!-- end user_favorites.html --> diff --git a/forum/management/commands/send_email_alerts.py b/forum/management/commands/send_email_alerts.py index 777381ec..283d5683 100644 --- a/forum/management/commands/send_email_alerts.py +++ b/forum/management/commands/send_email_alerts.py @@ -2,14 +2,20 @@ from django.core.management.base import NoArgsCommand from django.db import connection from django.db.models import Q, F from forum.models import * +<<<<<<< HEAD:forum/management/commands/send_email_alerts.py +======= from forum import const +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/management/commands/send_email_alerts.py from django.core.mail import EmailMessage from django.utils.translation import ugettext as _ from django.utils.translation import ungettext import datetime import settings +<<<<<<< HEAD:forum/management/commands/send_email_alerts.py +======= import logging from utils.odict import OrderedDict +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/management/commands/send_email_alerts.py class Command(NoArgsCommand): def handle_noargs(self,**options): @@ -21,10 +27,17 @@ class Command(NoArgsCommand): connection.close() def get_updated_questions_for_user(self,user): +<<<<<<< HEAD:forum/management/commands/send_email_alerts.py + q_sel = [] + q_ask = [] + q_ans = [] + q_all = [] +======= q_sel = None q_ask = None q_ans = None q_all = None +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/management/commands/send_email_alerts.py now = datetime.datetime.now() Q_set1 = Question.objects.exclude( last_activity_by=user, @@ -38,17 +51,28 @@ class Command(NoArgsCommand): ).exclude( closed=True ) +<<<<<<< HEAD:forum/management/commands/send_email_alerts.py +======= +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/management/commands/send_email_alerts.py user_feeds = EmailFeedSetting.objects.filter(subscriber=user).exclude(frequency='n') for feed in user_feeds: cutoff_time = now - EmailFeedSetting.DELTA_TABLE[feed.frequency] if feed.reported_at == None or feed.reported_at <= cutoff_time: +<<<<<<< HEAD:forum/management/commands/send_email_alerts.py + Q_set = Q_set1.exclude(last_activity_at__gt=cutoff_time) +======= Q_set = Q_set1.exclude(last_activity_at__gt=cutoff_time)#report these excluded later +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/management/commands/send_email_alerts.py feed.reported_at = now feed.save()#may not actually report anything, depending on filters below if feed.feed_type == 'q_sel': q_sel = Q_set.filter(followed_by=user) +<<<<<<< HEAD:forum/management/commands/send_email_alerts.py + q_sel.cutoff_time = cutoff_time +======= q_sel.cutoff_time = cutoff_time #store cutoff time per query set +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/management/commands/send_email_alerts.py elif feed.feed_type == 'q_ask': q_ask = Q_set.filter(author=user) q_ask.cutoff_time = cutoff_time @@ -56,6 +80,53 @@ class Command(NoArgsCommand): q_ans = Q_set.filter(answers__author=user) q_ans.cutoff_time = cutoff_time elif feed.feed_type == 'q_all': +<<<<<<< HEAD:forum/management/commands/send_email_alerts.py + q_all = Q_set + q_all.cutoff_time = cutoff_time + #build list in this order + q_tbl = {} + def extend_question_list(src, dst): + if isinstance(src,list): + return + cutoff_time = src.cutoff_time + for q in src: + if q in dst: + if cutoff_time < dst[q]: + dst[q] = cutoff_time + else: + dst[q] = cutoff_time + + extend_question_list(q_sel, q_tbl) + extend_question_list(q_ask, q_tbl) + extend_question_list(q_ans, q_tbl) + extend_question_list(q_all, q_tbl) + + ctype = ContentType.objects.get_for_model(Question) + out = {} + for q, cutoff_time in q_tbl.items(): + #todo use Activity, but first start keeping more Activity records + #act = Activity.objects.filter(content_type=ctype, object_id=q.id) + #get info on question edits, answer edits, comments + out[q] = {} + q_rev = QuestionRevision.objects.filter(question=q,revised_at__lt=cutoff_time) + q_rev = q_rev.exclude(author=user) + out[q]['q_rev'] = len(q_rev) + if len(q_rev) > 0 and q.added_at == q_rev[0].revised_at: + out[q]['q_rev'] = 0 + out[q]['new_q'] = True + else: + out[q]['new_q'] = False + + new_ans = Answer.objects.filter(question=q,added_at__lt=cutoff_time) + new_ans = new_ans.exclude(author=user) + out[q]['new_ans'] = len(new_ans) + ans_rev = AnswerRevision.objects.filter(answer__question=q,revised_at__lt=cutoff_time) + ans_rev = ans_rev.exclude(author=user) + out[q]['ans_rev'] = len(ans_rev) + return out + + def __act_count(self,string,number,output): +======= if user.tag_filter_setting == 'ignored': ignored_tags = Tag.objects.filter(user_selections___reason='bad',user_selections__user=user) q_all = Q_set.exclude( tags__in=ignored_tags ) @@ -135,11 +206,17 @@ class Command(NoArgsCommand): return q_list def __action_count(self,string,number,output): +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/management/commands/send_email_alerts.py if number > 0: output.append(_(string) % {'num':number}) def send_email_alerts(self): +<<<<<<< HEAD:forum/management/commands/send_email_alerts.py + for user in User.objects.all(): + q_list = self.get_updated_questions_for_user(user) + num_q = len(q_list) +======= #todo: move this to template for user in User.objects.all(): q_list = self.get_updated_questions_for_user(user) @@ -150,6 +227,7 @@ class Command(NoArgsCommand): num_q += 1 else: num_moot += 1 +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/management/commands/send_email_alerts.py if num_q > 0: url_prefix = settings.APP_URL subject = _('email update message subject') @@ -158,6 +236,19 @@ class Command(NoArgsCommand): % {'num':num_q, 'name':user.username} text += '<ul>' +<<<<<<< HEAD:forum/management/commands/send_email_alerts.py + for q, act in q_list.items(): + act_list = [] + if act['new_q']: + act_list.append(_('new question')) + self.__act_count('%(num)d rev', act['q_rev'],act_list) + self.__act_count('%(num)d ans', act['new_ans'],act_list) + self.__act_count('%(num)d ans rev',act['ans_rev'],act_list) + act_token = ', '.join(act_list) + text += '<li><a href="%s?sort=latest">%s</a> <font color="#777777">(%s)</font></li>' \ + % (url_prefix + q.get_absolute_url(), q.title, act_token) + text += '</ul>' +======= for q, meta_data in q_list.items(): act_list = [] if meta_data['nothing_new']: @@ -182,6 +273,7 @@ class Command(NoArgsCommand): text += _('Perhaps you could look up previously sent forum reminders in your mailbox.') text += '</p>' +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/management/commands/send_email_alerts.py link = url_prefix + user.get_profile_url() + '?sort=email_subscriptions' text += _('go to %(link)s to change frequency of email updates or %(email)s administrator') \ % {'link':link, 'email':settings.ADMINS[0][1]} diff --git a/forum/managers.py b/forum/managers.py index 90437e91..06fae761 100644 --- a/forum/managers.py +++ b/forum/managers.py @@ -7,6 +7,28 @@ from forum.models import * from urllib import quote, unquote class QuestionManager(models.Manager): +<<<<<<< HEAD:forum/managers.py + def get_translation_questions(self, orderby, page_size): + questions = self.filter(deleted=False, author__id__in=[28,29]).order_by(orderby)[:page_size] + return questions + + def get_questions_by_pagesize(self, orderby, page_size): + questions = self.filter(deleted=False).order_by(orderby)[:page_size] + return questions + + def get_questions_by_tag(self, tagname, orderby): + questions = self.filter(deleted=False, tags__name = unquote(tagname)).order_by(orderby) + return questions + + def get_unanswered_questions(self, orderby): + questions = self.filter(deleted=False, answer_accepted=False).order_by(orderby) + return questions + + def get_questions(self, orderby): + questions = self.filter(deleted=False).order_by(orderby) + return questions +======= +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/managers.py def update_tags(self, question, tagnames, user): """ @@ -73,11 +95,20 @@ class QuestionManager(models.Manager): Questions with the individual tags will be added to list if above questions are not full. """ #print datetime.datetime.now() +<<<<<<< HEAD:forum/managers.py + from forum.models import Question + questions = list(Question.objects.filter(tagnames = question.tagnames, deleted=False).all()) + + tags_list = question.tags.all() + for tag in tags_list: + extend_questions = Question.objects.filter(tags__id = tag.id, deleted=False)[:50] +======= questions = list(self.filter(tagnames = question.tagnames, deleted=False).all()) tags_list = question.tags.all() for tag in tags_list: extend_questions = self.filter(tags__id = tag.id, deleted=False)[:50] +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/managers.py for item in extend_questions: if item not in questions and len(questions) < 10: questions.append(item) diff --git a/forum/models.py b/forum/models.py index bceced1a..f1876588 100644 --- a/forum/models.py +++ b/forum/models.py @@ -3,7 +3,10 @@ import datetime import hashlib from urllib import quote_plus, urlencode from django.db import models, IntegrityError +<<<<<<< HEAD:forum/models.py +======= from django.utils.http import urlquote as django_urlquote +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/models.py from django.utils.html import strip_tags from django.core.urlresolvers import reverse from django.contrib.auth.models import User @@ -13,6 +16,10 @@ from django.template.defaultfilters import slugify from django.db.models.signals import post_delete, post_save, pre_save from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe +<<<<<<< HEAD:forum/models.py +import django.dispatch +import settings +======= from django.contrib.sitemaps import ping_google import django.dispatch import settings @@ -20,6 +27,7 @@ import logging if settings.USE_SPHINX_SEARCH == True: from djangosphinx.models import SphinxSearch +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/models.py from forum.managers import * from const import * @@ -102,6 +110,8 @@ class Comment(models.Model): class Meta: ordering = ('-added_at',) db_table = u'comment' +<<<<<<< HEAD:forum/models.py +======= def save(self,**kwargs): super(Comment,self).save(**kwargs) @@ -110,6 +120,7 @@ class Comment(models.Model): except Exception: logging.debug('problem pinging google did you register you sitemap with google?') +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/models.py def __unicode__(self): return self.comment @@ -198,6 +209,10 @@ class Question(models.Model): votes = generic.GenericRelation(Vote) flagged_items = generic.GenericRelation(FlaggedItem) +<<<<<<< HEAD:forum/models.py + objects = QuestionManager() + +======= if settings.USE_SPHINX_SEARCH == True: search = SphinxSearch( index=' '.join(settings.SPHINX_SEARCH_INDICES), @@ -214,6 +229,7 @@ class Question(models.Model): except Exception: logging.debug('problem pinging google did you register you sitemap with google?') +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/models.py def save(self, **kwargs): """ Overridden to manually manage addition of tags when the object @@ -224,10 +240,13 @@ class Question(models.Model): """ initial_addition = (self.id is None) super(Question, self).save(**kwargs) +<<<<<<< HEAD:forum/models.py +======= try: ping_google() except Exception: logging.debug('problem pinging google did you register you sitemap with google?') +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/models.py if initial_addition: tags = Tag.objects.get_or_create_multiple(self.tagname_list(), self.author) @@ -242,7 +261,11 @@ class Question(models.Model): return u','.join([unicode(tag) for tag in self.tagname_list()]) def get_absolute_url(self): +<<<<<<< HEAD:forum/models.py + return '%s%s' % (reverse('question', args=[self.id]), slugify(self.title)) +======= return '%s%s' % (reverse('question', args=[self.id]), django_urlquote(slugify(self.title))) +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/models.py def has_favorite_by_user(self, user): if not user.is_authenticated(): @@ -364,12 +387,15 @@ class FavoriteQuestion(models.Model): def __unicode__(self): return '[%s] favorited at %s' %(self.user, self.added_at) +<<<<<<< HEAD:forum/models.py +======= class MarkedTag(models.Model): TAG_MARK_REASONS = (('good',_('interesting')),('bad',_('ignored'))) tag = models.ForeignKey(Tag, related_name='user_selections') user = models.ForeignKey(User, related_name='tag_selections') reason = models.CharField(max_length=16, choices=TAG_MARK_REASONS) +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/models.py class QuestionRevision(models.Model): """A revision of a Question.""" question = models.ForeignKey(Question, related_name='revisions') @@ -473,6 +499,8 @@ class Answer(models.Model): get_comments = get_object_comments get_last_update_info = post_get_last_update_info +<<<<<<< HEAD:forum/models.py +======= def save(self,**kwargs): super(Answer,self).save(**kwargs) try: @@ -480,6 +508,7 @@ class Answer(models.Model): except Exception: logging.debug('problem pinging google did you register you sitemap with google?') +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/models.py def get_user_vote(self, user): votes = self.votes.filter(user=user) if votes.count() > 0: @@ -494,7 +523,11 @@ class Answer(models.Model): return self.question.title def get_absolute_url(self): +<<<<<<< HEAD:forum/models.py + return '%s%s#%s' % (reverse('question', args=[self.question.id]), slugify(self.question.title), self.id) +======= return '%s%s#%s' % (reverse('question', args=[self.question.id]), django_urlquote(slugify(self.question.title)), self.id) +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/models.py class Meta: db_table = u'answer' @@ -635,7 +668,11 @@ class Book(models.Model): questions = models.ManyToManyField(Question, related_name='book', db_table='book_question') def get_absolute_url(self): +<<<<<<< HEAD:forum/models.py + return reverse('book', args=[self.short_name]) +======= return reverse('book', args=[django_urlquote(slugify(self.short_name))]) +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/models.py def __unicode__(self): return self.title @@ -725,6 +762,8 @@ User.add_to_class('date_of_birth', models.DateField(null=True, blank=True)) User.add_to_class('about', models.TextField(blank=True)) User.add_to_class('is_username_taken',classmethod(user_is_username_taken)) User.add_to_class('get_q_sel_email_feed_frequency',user_get_q_sel_email_feed_frequency) +<<<<<<< HEAD:forum/models.py +======= User.add_to_class('hide_ignored_questions', models.BooleanField(default=False)) User.add_to_class('tag_filter_setting', models.CharField( @@ -733,6 +772,7 @@ User.add_to_class('tag_filter_setting', default='ignored' ) ) +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/models.py # custom signal tags_updated = django.dispatch.Signal(providing_args=["question"]) diff --git a/forum/templatetags/extra_filters.py b/forum/templatetags/extra_filters.py index 22ec0109..865cd33d 100644 --- a/forum/templatetags/extra_filters.py +++ b/forum/templatetags/extra_filters.py @@ -1,5 +1,8 @@ from django import template +<<<<<<< HEAD:forum/templatetags/extra_filters.py +======= from django.core import serializers +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/templatetags/extra_filters.py from forum import auth import logging @@ -92,7 +95,10 @@ def cnprog_intword(number): return number except: return number +<<<<<<< HEAD:forum/templatetags/extra_filters.py +======= @register.filter def json_serialize(object): return serializers.serialize('json',object) +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/templatetags/extra_filters.py diff --git a/forum/templatetags/extra_tags.py b/forum/templatetags/extra_tags.py index b2199284..8ed79d3c 100644 --- a/forum/templatetags/extra_tags.py +++ b/forum/templatetags/extra_tags.py @@ -251,7 +251,11 @@ def diff_date(date, limen=2): return _('2 days ago') elif days == 1: return _('yesterday') +<<<<<<< HEAD:forum/templatetags/extra_tags.py + elif minutes > 60: +======= elif minutes >= 60: +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/templatetags/extra_tags.py return ungettext('%(hr)d hour ago','%(hr)d hours ago',hours) % {'hr':hours} else: return ungettext('%(min)d min ago','%(min)d mins ago',minutes) % {'min':minutes} @@ -332,8 +336,13 @@ class BlockResourceNode(template.Node): for item in self.items: bit = item.render(context) out += bit +<<<<<<< HEAD:forum/templatetags/extra_tags.py + out = out.replace(' ','') + return os.path.normpath(out) + '?v=%d' % settings.RESOURCE_REVISION +======= out = os.path.normpath(out) + '?v=%d' % settings.RESOURCE_REVISION return out.replace(' ','') +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:forum/templatetags/extra_tags.py @register.tag(name='blockresource') def blockresource(parser,token): diff --git a/forum/views.py b/forum/views.py index 20ca2f6a..296745f9 100644 --- a/forum/views.py +++ b/forum/views.py @@ -758,6 +758,7 @@ def edit_answer(request, id): QUESTION_REVISION_TEMPLATE = ('<h1>%(title)s</h1>\n' '<div class="text">%(html)s</div>\n' '<div class="tags">%(tags)s</div>') + def question_revisions(request, id): post = get_object_or_404(Question, id=id) revisions = list(post.revisions.all()) @@ -1692,6 +1693,7 @@ def user_responses(request, user_id, user_view): 'username', 'user_id' ) + if len(answers) > 0: answers = [(Response(TYPE_RESPONSE['QUESTION_ANSWERED'], a['title'], a['question_id'], a['answer_id'], a['added_at'], a['username'], a['user_id'], a['html'])) for a in answers] diff --git a/junk.py b/junk.py new file mode 100644 index 00000000..c6c03d27 --- /dev/null +++ b/junk.py @@ -0,0 +1,3 @@ +import os + +print os.path.normpath('/haha//haha') diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo Binary files differindex 16f3554d..502c1075 100644 --- a/locale/en/LC_MESSAGES/django.mo +++ b/locale/en/LC_MESSAGES/django.mo diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index 15385964..3f554733 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-12-09 08:54-0800\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: 2009-12-15 16:53-0600\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "MIME-Version: 1.0\n" @@ -800,6 +800,24 @@ msgstr "" #: forum/urls.py:72 forum/urls.py:73 msgid "badges/" msgstr "" +"Your subscription is saved, but email address %(email)s needs to be " +"validated, please see <a href='%(details_url)s'>more details here</a>" + +#: forum/views.py:1022 +msgid "email update frequency has been set to daily" +msgstr "" + +#: forum/views.py:1826 +msgid "changes saved" +msgstr "" + +#: forum/views.py:1832 +msgid "email updates canceled" +msgstr "" + +#: forum/views.py:1999 +msgid "uploading images is limited to users with >60 reputation points" +msgstr "sorry, file uploading requires karma >60" #: forum/urls.py:74 msgid "messages/" @@ -824,6 +842,11 @@ msgstr "" #: forum/urls.py:82 msgid "search/" msgstr "" +"<p>Please remember that you can always <a href='%(link)s'>adjust</a> frequency of the " +"email updates or turn them off entirely.<br/>If you believe that this message " +"was sent in an error, please email about it the forum administrator at %(email)" +"s.</p>" +"<p>Sincerely,</p><p>Your friendly Q&A forum server.</p>" #: forum/urls.py:83 msgid "feedback/" @@ -1096,6 +1119,11 @@ msgstr "" #: templates/404.html:43 msgid "see all tags" msgstr "" +"<span class=\"strong big\">You are welcome to start submitting your question " +"anonymously</span>. When you submit the post, you will be redirected to the " +"login/signup page. Your question will be saved in the current session and " +"will be published after you log in. Login/signup process is very simple. " +"Login takes about 30 seconds, initial signup takes a minute or less." #: templates/500.html:22 msgid "sorry, system error" @@ -1112,6 +1140,11 @@ msgstr "" #: templates/500.html:28 msgid "see latest questions" 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='%(email_validation_faq_url)s'>more details here</a>." +"<br>You can submit your question now and validate email after that. Your " +"question will saved as pending meanwhile. " #: templates/500.html:29 msgid "see tags" @@ -1168,6 +1201,8 @@ msgstr "" #: templates/question.html:48 templates/question_edit.html:28 msgid "show preview" msgstr "" +"If your questions and answers are highly voted, your contribution to this " +"Q&A community will be recognized with the variety of badges." #: templates/answer_edit.html:48 templates/question_edit.html:66 #: templates/question_retag.html:53 templates/revisions_answer.html:38 @@ -2546,6 +2581,7 @@ msgstr[0] "" "<div class=\"questions-count\">%(q_num)s</div><p>question</p>" msgstr[1] "" "\n" + "<div class=\"questions-count\">%(q_num)s</div><p>questions<p>" #: templates/questions.html:201 @@ -3150,6 +3186,13 @@ msgstr "" #: templates/authopenid/complete.html:40 msgid "This account already exists, please use another." msgstr "" +"<p><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 " +"questions and will be used to create and retrieve your unique avatar image - " +"<a href='%(gravatar_faq_url)s'><strong>gravatar</strong></a>.</p>" + #: templates/authopenid/complete.html:55 msgid "Sorry, looks like we have some errors:" @@ -3177,6 +3220,15 @@ msgstr "" #: templates/authopenid/complete.html:91 msgid "Tag filter tool will be your right panel, once you log in." msgstr "" +"<strong>Receive forum updates by email</strong> - this will help our " +"community grow and become more useful.<br/>By default " +"<span class='orange'>Q&A</span> forum sends up to <strong>one " +"email digest per week</strong> - only when there is anything new.<br/>If " +"you like, please adjust this now or any time later from your user account." + +#: templates/authopenid/complete.html:91 +msgid "create account" +msgstr "Signup" #: templates/authopenid/complete.html:92 msgid "create account" @@ -3290,6 +3342,16 @@ msgstr "" #: templates/authopenid/external_legacy_login_info.html:7 msgid "Traditional login information" msgstr "" +"<span class='big strong'>Forgot you password? No problems - just get a new " +"one!</span><br/>Please follow the following steps:<br/>• submit your " +"user name below and check your email<br/>• <strong>follow the " +"activation link</strong> for the new password - sent to you by email and " +"login with the suggested password<br/>• at this you might want to " +"change your password to something you can remember better" + +#: templates/authopenid/sendpw.html:21 +msgid "Reset password" +msgstr "Send me a new password" #: templates/authopenid/external_legacy_login_info.html:12 msgid "how to login with password through external login website" diff --git a/middleware/__init__.py~HEAD b/middleware/__init__.py~HEAD new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/middleware/__init__.py~HEAD diff --git a/session_messages/.svn/all-wcprops b/session_messages/.svn/all-wcprops new file mode 100644 index 00000000..2a15b353 --- /dev/null +++ b/session_messages/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 38 +/svn/!svn/ver/5/trunk/session_messages +END +__init__.py +K 25 +svn:wc:ra_dav:version-url +V 50 +/svn/!svn/ver/5/trunk/session_messages/__init__.py +END +models.py +K 25 +svn:wc:ra_dav:version-url +V 48 +/svn/!svn/ver/2/trunk/session_messages/models.py +END +context_processors.py +K 25 +svn:wc:ra_dav:version-url +V 60 +/svn/!svn/ver/2/trunk/session_messages/context_processors.py +END diff --git a/session_messages/.svn/dir-prop-base b/session_messages/.svn/dir-prop-base new file mode 100644 index 00000000..4cc643b7 --- /dev/null +++ b/session_messages/.svn/dir-prop-base @@ -0,0 +1,6 @@ +K 10 +svn:ignore +V 6 +*.pyc + +END diff --git a/session_messages/.svn/entries b/session_messages/.svn/entries new file mode 100644 index 00000000..67c0db8a --- /dev/null +++ b/session_messages/.svn/entries @@ -0,0 +1,64 @@ +8 + +dir +5 +http://django-session-messages.googlecode.com/svn/trunk/session_messages +http://django-session-messages.googlecode.com/svn + + + +2009-03-10T23:30:03.043791Z +5 +carl.j.meyer +has-props + +svn:special svn:externals svn:needs-lock + + + + + + + + + + + +b8288d2d-7354-0410-af5b-714f73743f4b + +__init__.py +file + + + + +2009-10-25T23:36:02.000000Z +89aa0f71c9973e4889e5fad0b4771a34 +2009-03-10T23:30:03.043791Z +5 +carl.j.meyer + +models.py +file + + + + +2009-10-25T23:36:02.000000Z +c5b4f274dbb06bc66a14f0c18c9115cd +2008-08-14T23:13:23.180432Z +2 +carl.j.meyer + +context_processors.py +file + + + + +2009-10-25T23:36:02.000000Z +24779c7e504d3f7f1918fdf3fe8096bc +2008-08-14T23:13:23.180432Z +2 +carl.j.meyer + diff --git a/session_messages/.svn/format b/session_messages/.svn/format new file mode 100644 index 00000000..45a4fb75 --- /dev/null +++ b/session_messages/.svn/format @@ -0,0 +1 @@ +8 diff --git a/session_messages/.svn/text-base/__init__.py.svn-base b/session_messages/.svn/text-base/__init__.py.svn-base new file mode 100644 index 00000000..0136c888 --- /dev/null +++ b/session_messages/.svn/text-base/__init__.py.svn-base @@ -0,0 +1,36 @@ +""" +Lightweight session-based messaging system. + +Time-stamp: <2009-03-10 19:22:29 carljm __init__.py> + +""" +VERSION = (0, 1, 'pre') + +def create_message (request, message): + """ + Create a message in the current session. + + """ + assert hasattr(request, 'session'), "django-session-messages requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'." + + try: + request.session['messages'].append(message) + except KeyError: + request.session['messages'] = [message] + +def get_and_delete_messages (request, include_auth=False): + """ + Get and delete all messages for current session. + + Optionally also fetches user messages from django.contrib.auth. + + """ + assert hasattr(request, 'session'), "django-session-messages requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'." + + messages = request.session.pop('messages', []) + + if include_auth and request.user.is_authenticated(): + messages.extend(request.user.get_and_delete_messages()) + + return messages + diff --git a/session_messages/.svn/text-base/context_processors.py.svn-base b/session_messages/.svn/text-base/context_processors.py.svn-base new file mode 100644 index 00000000..df9840fd --- /dev/null +++ b/session_messages/.svn/text-base/context_processors.py.svn-base @@ -0,0 +1,48 @@ +""" +Context processor for lightweight session messages. + +Time-stamp: <2008-07-19 23:16:19 carljm context_processors.py> + +""" +from django.utils.encoding import StrAndUnicode + +from session_messages import get_and_delete_messages + +def session_messages (request): + """ + Returns session messages for the current session. + + """ + return { 'session_messages': LazyMessages(request) } + +class LazyMessages (StrAndUnicode): + """ + Lazy message container, so messages aren't actually retrieved from + session and deleted until the template asks for them. + + """ + def __init__(self, request): + self.request = request + + def __iter__(self): + return iter(self.messages) + + def __len__(self): + return len(self.messages) + + def __nonzero__(self): + return bool(self.messages) + + def __unicode__(self): + return unicode(self.messages) + + def __getitem__(self, *args, **kwargs): + return self.messages.__getitem__(*args, **kwargs) + + def _get_messages(self): + if hasattr(self, '_messages'): + return self._messages + self._messages = get_and_delete_messages(self.request) + return self._messages + messages = property(_get_messages) + diff --git a/session_messages/.svn/text-base/models.py.svn-base b/session_messages/.svn/text-base/models.py.svn-base new file mode 100644 index 00000000..b67ead6d --- /dev/null +++ b/session_messages/.svn/text-base/models.py.svn-base @@ -0,0 +1,3 @@ +""" +blank models.py +""" diff --git a/settings.py b/settings.py index 6310ce41..45685788 100644 --- a/settings.py +++ b/settings.py @@ -2,7 +2,6 @@ # Django settings for lanai project. import os.path import sys - SITE_ID = 1 ADMIN_MEDIA_PREFIX = '/forum/admin/media/' @@ -25,7 +24,7 @@ MIDDLEWARE_CLASSES = ( 'middleware.anon_user.ConnectToSessionMessagesMiddleware', 'middleware.pagesize.QuestionsPageSizeMiddleware', 'middleware.cancel.CancelActionMiddleware', - 'debug_toolbar.middleware.DebugToolbarMiddleware', + #'debug_toolbar.middleware.DebugToolbarMiddleware', ) TEMPLATE_CONTEXT_PROCESSORS = ( @@ -63,7 +62,7 @@ INSTALLED_APPS = ( 'forum', 'django_authopenid', 'djangosphinx', - 'debug_toolbar' , + #'debug_toolbar' , 'user_messages', ) diff --git a/templates/about.html b/templates/about.html index 2ca75500..db8c764e 100644 --- a/templates/about.html +++ b/templates/about.html @@ -12,6 +12,36 @@ </div> <div class="content"> +<<<<<<< HEAD:templates/about.html + <!-- default text + <p>edit file templates/about.html. Below are just suggestions of what can go here</p> + <p>what is your site for?</p> + <p>how does it work? what are roles of members?</p> + <p>is there a place to find out more about this website?</p> + --> + <p>{% blocktrans %}<strong>CNPROG <span class="orange">Q&A</span></strong> is a collaboratively edited question + and answer site created for the <strong>CNPROG</strong> community. + {% endblocktrans %} + </p> + <p>{% blocktrans %}Here you can <strong>ask</strong> and <strong>answer</strong> questions, <strong>comment</strong> + and <strong>vote</strong> for the questions of others and their answers. Both questions and answers + <strong>can be revised</strong> and improved. Questions can be <strong>tagged</strong> with + the relevant keywords to simplify future access and organize the accumulated material.{% endblocktrans %} + </p> + + <p>{% blocktrans %}This <span class="orange">Q&A</span> site is moderated by its members, hopefully - including yourself! + Moderation rights are gradually assigned to the site users based on the accumulated <strong>"reputation"</strong> + points. These points are added to the users account when others vote for his/her questions or answers. + These points (very) roughly reflect the level of trust of the community.{% endblocktrans %} + </p> + <p>{% blocktrans %}No points are necessary to ask or answer the questions - so please - + <strong><a href="{% url user_signin %}">join us!</a></strong>{% endblocktrans %} + </p> + <p> + {% blocktrans %} + If you would like to find out more about this site - please see <strong><a href="{% url faq %}">frequently asked questions</a></strong>. + {% endblocktrans %} +======= <p><strong>NMR Wiki <span class="orange">Q&A</span></strong> is a collaboratively edited question and answer site created for the <strong>Magnetic Resonance</strong> community, i.e. those people who work in the fields of <strong>NMR</strong>, <strong>EPR</strong>, <strong>MRI</strong></strong>, etc. @@ -35,6 +65,7 @@ </p> <p> If you would like to find out more about this site - please see <strong><a href="{% url faq %}">frequently asked questions</a></strong>. +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/about.html </p> </div> {% endblock %} diff --git a/templates/authopenid/complete.html b/templates/authopenid/complete.html index ce5fb7fe..e3c12ae5 100644 --- a/templates/authopenid/complete.html +++ b/templates/authopenid/complete.html @@ -88,7 +88,10 @@ parameters: </div> <p class='nomargin'>{% trans "receive updates motivational blurb" %}</p> {% include "edit_user_email_feeds_form.html" %} +<<<<<<< HEAD:templates/authopenid/complete.html +======= <p class='nomargin'>{% trans "Tag filter tool will be your right panel, once you log in." %}</p> +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/authopenid/complete.html <div class="submit-row"><input type="submit" class="submit" name="bnewaccount" value="{% trans "create account" %}"/></div> </form> </div> diff --git a/templates/authopenid/external_legacy_login_info.html b/templates/authopenid/external_legacy_login_info.html index c200b29d..dda394c7 100644 --- a/templates/authopenid/external_legacy_login_info.html +++ b/templates/authopenid/external_legacy_login_info.html @@ -8,8 +8,14 @@ </div> {% spaceless %} <div class="message"> +<<<<<<< HEAD:templates/authopenid/external_legacy_login_info.html +fill in template templates/authopenid/external_legacy_login_info.html +and explain how to change password, recover password, etc. +<!--add info about your external login site here--> +======= <!--add info about your external login site here--> {% trans "how to login with password through external login website" %} +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/authopenid/external_legacy_login_info.html </div> {% endspaceless %} {% endblock %} diff --git a/templates/base.html b/templates/base.html index daafc3bc..b4751be1 100644 --- a/templates/base.html +++ b/templates/base.html @@ -18,8 +18,12 @@ <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"> +<<<<<<< HEAD:templates/base.html + var i18nLang = '{{settings.LANGUAGE_CODE}}'; +======= var i18nLang = '{{settings.LANGUAGE_CODE}}'; var scriptUrl = '/{{settings.FORUM_SCRIPT_ALIAS}}' +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/base.html </script> <script type='text/javascript' src='{% href "/content/js/com.cnprog.i18n.js" %}'></script> <script type='text/javascript' src='{% href "/content/js/jquery.i18n.js" %}'></script> diff --git a/templates/base_content.html b/templates/base_content.html index 78e5fe38..12297215 100644 --- a/templates/base_content.html +++ b/templates/base_content.html @@ -6,9 +6,13 @@ <head> <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE }}</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<<<<<<< HEAD:templates/base_content.html + <meta name="verify-v1" content="{{ settings.GOOGLE_SITEMAP_CODE }}" /> +======= {% if settings.GOOGLE_SITEMAP_CODE %} <meta name="verify-v1" content="{{ settings.GOOGLE_SITEMAP_CODE }}" /> {% endif %} +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/base_content.html <link rel="shortcut icon" href="{% href "/content/images/favicon.ico" %}" /> <link href="{% href "/content/style/style.css" %}" rel="stylesheet" type="text/css" /> {% spaceless %} @@ -17,8 +21,12 @@ <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"> +<<<<<<< HEAD:templates/base_content.html + var i18nLang = '{{ settings.LANGUAGE_CODE }}'; +======= var i18nLang = '{{ settings.LANGUAGE_CODE }}'; var scriptUrl = '/{{settings.FORUM_SCRIPT_ALIAS}}' +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/base_content.html </script> <script type='text/javascript' src='{% href "/content/js/com.cnprog.i18n.js" %}'></script> <script type='text/javascript' src='{% href "/content/js/jquery.i18n.js" %}'></script> diff --git a/templates/content/js/com.cnprog.admin.js b/templates/content/js/com.cnprog.admin.js index cb1c1b15..7e91af79 100644 --- a/templates/content/js/com.cnprog.admin.js +++ b/templates/content/js/com.cnprog.admin.js @@ -3,7 +3,11 @@ $().ready( function(){ success: function(a,b){$('.admin #action_status').html($.i18n._('changes saved'));}, dataType:'json', timeout:5000, +<<<<<<< HEAD:templates/content/js/com.cnprog.admin.js + url: $.i18n._('/') + $.i18n._('moderate-user/') + viewUserID + '/' +======= url: scriptUrl + $.i18n._('moderate-user/') + viewUserID + '/' +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.admin.js }; var form = $('.admin #moderate_user_form').ajaxForm(options); var box = $('.admin input#id_is_approved').click(function(){ diff --git a/templates/content/js/com.cnprog.i18n.js b/templates/content/js/com.cnprog.i18n.js index 7562628b..018927aa 100644 --- a/templates/content/js/com.cnprog.i18n.js +++ b/templates/content/js/com.cnprog.i18n.js @@ -57,6 +57,10 @@ var i18nZh = { }; var i18nEn = { +<<<<<<< HEAD:templates/content/js/com.cnprog.i18n.js + '/':'/', +======= +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.i18n.js 'need >15 points to report spam':'need >15 points to report spam ', '>15 points requried to upvote':'>15 points required to upvote ', 'tags cannot be empty':'please enter at least one tag', diff --git a/templates/content/js/com.cnprog.post.js b/templates/content/js/com.cnprog.post.js index 33df1e21..a884b571 100644 --- a/templates/content/js/com.cnprog.post.js +++ b/templates/content/js/com.cnprog.post.js @@ -53,11 +53,19 @@ var Vote = function(){ var acceptAnonymousMessage = $.i18n._('insufficient privilege'); var acceptOwnAnswerMessage = $.i18n._('cannot pick own answer as best'); +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + var pleaseLogin = "<a href='" + $.i18n._("/") + $.i18n._("account/") + $.i18n._("signin/") + + "?next=" + $.i18n._("/") + $.i18n._("questions/") + "{{QuestionID}}'>" + + $.i18n._('please login') + "</a>"; + + var pleaseSeeFAQ = $.i18n._('please see') + "<a href='" + $.i18n._("/") + $.i18n._("faq/") + "'>faq</a>"; +======= var pleaseLogin = "<a href='" + scriptUrl + $.i18n._("account/") + $.i18n._("signin/") + "?next=" + scriptUrl + $.i18n._("questions/") + "{{QuestionID}}'>" + $.i18n._('please login') + "</a>"; var pleaseSeeFAQ = $.i18n._('please see') + "<a href='" + scriptUrl + $.i18n._("faq/") + "'>faq</a>"; +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js var favoriteAnonymousMessage = $.i18n._('anonymous users cannot select favorite questions') var voteAnonymousMessage = $.i18n._('anonymous users cannot vote') + pleaseLogin; @@ -151,17 +159,30 @@ var Vote = function(){ var setVoteImage = function(voteType, undo, object){ var flag = undo ? "" : "-on"; var arrow = (voteType == VoteType.questionUpVote || voteType == VoteType.answerUpVote) ? "up" : "down"; +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + object.attr("src", $.i18n._("/") + "content/images/vote-arrow-"+ arrow + flag +".png"); +======= object.attr("src", scriptUrl + "content/images/vote-arrow-"+ arrow + flag +".png"); +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js // if undo voting, then undo the pair of arrows. if(undo){ if(voteType == VoteType.questionUpVote || voteType == VoteType.questionDownVote){ +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + $(getQuestionVoteUpButton()).attr("src", $.i18n._("/") + "content/images/vote-arrow-up.png"); + $(getQuestionVoteDownButton()).attr("src", $.i18n._("/") + "content/images/vote-arrow-down.png"); + } + else{ + $(getAnswerVoteUpButton(postId)).attr("src", $.i18n._("/") + "content/images/vote-arrow-up.png"); + $(getAnswerVoteDownButton(postId)).attr("src", $.i18n._("/") + "content/images/vote-arrow-down.png"); +======= $(getQuestionVoteUpButton()).attr("src", scriptUrl + "content/images/vote-arrow-up.png"); $(getQuestionVoteDownButton()).attr("src", scriptUrl + "content/images/vote-arrow-down.png"); } else{ $(getAnswerVoteUpButton(postId)).attr("src", scriptUrl + "content/images/vote-arrow-up.png"); $(getAnswerVoteDownButton(postId)).attr("src", scriptUrl + "content/images/vote-arrow-down.png"); +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js } } }; @@ -237,7 +258,11 @@ var Vote = function(){ type: "POST", cache: false, dataType: "json", +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + url: $.i18n._("/") + $.i18n._("questions/") + questionId + "/" + $.i18n._("vote/"), +======= url: scriptUrl + $.i18n._("questions/") + questionId + "/" + $.i18n._("vote/"), +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js data: { "type": voteType, "postId": postId }, error: handleFail, success: function(data){callback(object, voteType, data)}}); @@ -256,19 +281,31 @@ var Vote = function(){ showMessage(object, acceptOwnAnswerMessage); } else if(data.status == "1"){ +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + object.attr("src", $.i18n._("/") + "content/images/vote-accepted.png"); +======= object.attr("src", scriptUrl + "content/images/vote-accepted.png"); +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js $("#"+answerContainerIdPrefix+postId).removeClass("accepted-answer"); $("#"+commentLinkIdPrefix+postId).removeClass("comment-link-accepted"); } else if(data.success == "1"){ var acceptedButtons = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAccept +']'; +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + $(acceptedButtons).attr("src", $.i18n._("/") + "content/images/vote-accepted.png"); +======= $(acceptedButtons).attr("src", scriptUrl + "content/images/vote-accepted.png"); +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js var answers = ("div[id^="+answerContainerIdPrefix +"]"); $(answers).removeClass("accepted-answer"); var commentLinks = ("div[id^="+answerContainerIdPrefix +"] div[id^="+ commentLinkIdPrefix +"]"); $(commentLinks).removeClass("comment-link-accepted"); +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + object.attr("src", $.i18n._("/") + "content/images/vote-accepted-on.png"); +======= object.attr("src", scriptUrl + "content/images/vote-accepted-on.png"); +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js $("#"+answerContainerIdPrefix+postId).addClass("accepted-answer"); $("#"+commentLinkIdPrefix+postId).addClass("comment-link-accepted"); } @@ -282,7 +319,11 @@ var Vote = function(){ showMessage(object, favoriteAnonymousMessage.replace("{{QuestionID}}", questionId)); } else if(data.status == "1"){ +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + object.attr("src", $.i18n._("/") + "content/images/vote-favorite-off.png"); +======= object.attr("src", scriptUrl + "content/images/vote-favorite-off.png"); +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js var fav = getFavoriteNumber(); fav.removeClass("my-favorite-number"); if(data.count == 0) @@ -290,7 +331,11 @@ var Vote = function(){ fav.text(data.count); } else if(data.success == "1"){ +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + object.attr("src", $.i18n._("/") + "/content/images/vote-favorite-on.png"); +======= object.attr("src", scriptUrl + "content/images/vote-favorite-on.png"); +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js var fav = getFavoriteNumber(); fav.text(data.count); fav.addClass("my-favorite-number"); @@ -359,7 +404,11 @@ var Vote = function(){ } else if (data.success == "1"){ if (voteType == VoteType.removeQuestion){ +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + window.location.href = $.i18n._("/") + $.i18n._("questions/"); +======= window.location.href = scriptUrl + $.i18n._("questions/"); +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js } else { if (removeActionType == 'delete'){ @@ -500,7 +549,11 @@ function createComments(type) { jDiv.append('<p id="' + divId + '" class="comment">' + $.i18n._('to comment, need') + ' ' + + repNeededForComments + ' ' + $.i18n._('community karma points') +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + + '<a href="' + $.i18n._('/') + $.i18n._('faq/') + '" class="comment-user">' +======= + '<a href="' + scriptUrl + $.i18n._('faq/') + '" class="comment-user">' +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js + $.i18n._('please see') + 'faq</a></span></p>'); } } @@ -508,7 +561,11 @@ function createComments(type) { var getComments = function(id, jDiv) { //appendLoaderImg(id); +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + $.getJSON($.i18n._("/") + objectType + "s/" + id + "/" + $.i18n._("comments/") +======= $.getJSON(scriptUrl + objectType + "s/" + id + "/" + $.i18n._("comments/") +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js , function(json) { showComments(id, json); }); }; @@ -529,8 +586,13 @@ function createComments(type) { var renderDeleteCommentIcon = function(post_id, delete_url){ if (canPostComments(post_id)){ var html = ''; +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + var img = $.i18n._("/") + "content/images/close-small.png"; + var imgHover = $.i18n._("/") + "content/images/close-small-hover.png"; +======= var img = scriptUrl + "content/images/close-small.png"; var imgHover = scriptUrl + "content/images/close-small-hover.png"; +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js html += '<img class="delete-icon" onclick="' + objectType + 'Comments.deleteComment($(this), ' + post_id + ', \'' + delete_url + '\')" src="' + img; html += '" onmouseover="$(this).attr(\'src\', \'' + imgHover + '\')" onmouseout="$(this).attr(\'src\', \'' + img html += '\')" title="' + $.i18n._('delete this comment') + '" />'; @@ -569,7 +631,11 @@ function createComments(type) { //todo fix url translations!!! $.ajax({ type: "POST", +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + url: $.i18n._("/") + objectType + "s/" + id + "/" + $.i18n._("comments/"), +======= url: scriptUrl + objectType + "s/" + id + "/" + $.i18n._("comments/"), +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js dataType: "json", data: { comment: textarea.val() }, success: function(json) { @@ -601,7 +667,11 @@ function createComments(type) { $(this).children().each( function(i){ var comment_id = $(this).attr('id').replace('comment-',''); +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + var delete_url = $.i18n._('/') + objectType + 's/' + post_id + '/' +======= var delete_url = scriptUrl + objectType + 's/' + post_id + '/' +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js + $.i18n._('comments/') + comment_id + '/' + $.i18n._('delete/'); var html = $(this).html(); var CommentsClass; @@ -615,12 +685,20 @@ function createComments(type) { delete_icon.click(function(){CommentsClass.deleteComment($(this),comment_id,delete_url);}); delete_icon.unbind('mouseover').bind('mouseover', function(){ +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + $(this).attr('src',$.i18n._('/') + 'content/images/close-small-hover.png'); +======= $(this).attr('src',scriptUrl + 'content/images/close-small-hover.png'); +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js } ); delete_icon.unbind('mouseout').bind('mouseout', function(){ +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js + $(this).attr('src',$.i18n._('/') + 'content/images/close-small.png'); +======= $(this).attr('src',scriptUrl + 'content/images/close-small.png'); +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.post.js } ); } diff --git a/templates/content/js/com.cnprog.utils.js b/templates/content/js/com.cnprog.utils.js index b19b6773..5c0c4a27 100644 --- a/templates/content/js/com.cnprog.utils.js +++ b/templates/content/js/com.cnprog.utils.js @@ -23,7 +23,11 @@ var notify = function() { }, close: function(doPostback) { if (doPostback) { +<<<<<<< HEAD:templates/content/js/com.cnprog.utils.js + $.post($.i18n._("/") + $.i18n._("messages/") + +======= $.post(scriptUrl + $.i18n._("messages/") + +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.utils.js $.i18n._("markread/"), { formdata: "required" }); } $(".notify").fadeOut("fast"); @@ -36,7 +40,11 @@ var notify = function() { function appendLoader(containerSelector) { $(containerSelector).append('<img class="ajax-loader" ' +<<<<<<< HEAD:templates/content/js/com.cnprog.utils.js + +'src="' + $.i18n._('/') + 'content/images/indicator.gif" title="' +======= +'src="' + scriptUrl + 'content/images/indicator.gif" title="' +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/com.cnprog.utils.js +$.i18n._('loading...') +'" alt="' +$.i18n._('loading...') diff --git a/templates/content/js/wmd/wmd.js b/templates/content/js/wmd/wmd.js index e396d3cb..2234250b 100644 --- a/templates/content/js/wmd/wmd.js +++ b/templates/content/js/wmd/wmd.js @@ -54,7 +54,11 @@ Attacklab.wmdBase = function(){ var uploadImageHTML ="<div>" + $.i18n._('upload image') + "</div>" + "<input type=\"file\" name=\"file-upload\" id=\"file-upload\" size=\"26\" "+ "onchange=\"return ajaxFileUpload($('#image-url'));\"/><br>" + +<<<<<<< HEAD:templates/content/js/wmd/wmd.js + "<img id=\"loading\" src=\"" + $.i18n._("/") + "content/images/indicator.gif\" style=\"display:none;\"/>"; +======= "<img id=\"loading\" src=\"" + scriptUrl + "content/images/indicator.gif\" style=\"display:none;\"/>"; +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/js/wmd/wmd.js // The default text that appears in the dialog input box when entering // links. diff --git a/templates/content/style/style.css b/templates/content/style/style.css index 47b4dc00..0a928cd2 100644 --- a/templates/content/style/style.css +++ b/templates/content/style/style.css @@ -114,6 +114,10 @@ blockquote margin-left:20px;text-decoration:underline; font-size:12px; color:#333333;} #logo { padding: 5px 0px 0px 0px; +<<<<<<< HEAD:templates/content/style/style.css + margin-bottom:-3px; +======= +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css } #navBar {float:clear;position:relative;display:block;width:960px;} #navBar .nav {margin:20px 0px 0px 16px; @@ -162,7 +166,11 @@ blockquote border-right:1px solid #b4b48e; border-bottom:1px solid #b4b48e;*/ background: white;/* #f9f7ed;*/ +<<<<<<< HEAD:templates/content/style/style.css + margin:10px 0 10px 0; +======= /*margin:10px 0 10px 0;*/ +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css /*background:url(../images/quest-bg.gif) repeat-x top;*/ } #listA .qstA thumb {float:left; } @@ -204,6 +212,9 @@ blockquote /*border-bottom:1px solid #888a85;*/ } .evenMore {font-size:14px; font-weight:800;} +<<<<<<< HEAD:templates/content/style/style.css +.questions-count{font-size:32px;font-family:sans-serif;font-weight:600;padding:0 0 5px 7px;color:#a40000;} +======= .questions-count{ font-size:32px; font-family:sans-serif; @@ -212,6 +223,7 @@ blockquote color:#a40000; margin-top:3px; } +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css /*内容块*/ .boxA {background:#888a85; padding:6px; margin-bottom:8px;border 1px solid #babdb6;} @@ -223,7 +235,11 @@ blockquote .boxB .body {border:1px solid #aaaaaa; padding:8px; background:#FFF; font-size:13px; line-height:160%;} .boxB .more {padding:1px; text-align:right; font-weight:800;} .boxC { +<<<<<<< HEAD:templates/content/style/style.css + background:#babdb6;/*f9f7ed;*/ +======= background: #cacdc6;/*f9f7ed;*/ +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css padding:10px; margin-bottom:8px; border-top:1px solid #eeeeec; @@ -231,12 +247,15 @@ blockquote border-right:1px solid #a9aca5; border-bottom:1px solid #babdb6; } +<<<<<<< HEAD:templates/content/style/style.css +======= .boxC p { margin-bottom:8px; } .boxC p.nomargin { margin:0px; } +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css .boxC p.info-box-follow-up-links { text-align:right; margin:0; @@ -270,7 +289,11 @@ blockquote border:1px solid #fff; background-color:#fff; color:#777; +<<<<<<< HEAD:templates/content/style/style.css + padding:.3em; +======= padding:2px 4px 3px 4px; +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css font:bold 100% sans-serif; } @@ -321,14 +344,21 @@ blockquote /*标签*/ .tag {font-size:13px; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} .tags {font-family:sans-serif; line-height:200%; display:block; margin-top:5px;} +<<<<<<< HEAD:templates/content/style/style.css +.tags a {font-size:13px; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} +======= .tags a {white-space: nowrap; font-size:13px; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css .tags a:hover {background-color:#fFF;color:#333;} .tagsbox {line-height:200%;} .tagsbox a {font-size:13px; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} .tagsbox a:hover {background-color:#fFF;color:#333;} .tag-number {font-weight:700;font-family:sans-serif;} +<<<<<<< HEAD:templates/content/style/style.css +======= .marked-tags { margin-top: 0px;margin-bottom: 5px; } .deletable-tag { margin-right: 3px; white-space:nowrap; } +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css /*奖牌*/ a.medal { font-size:14px; line-height:250%; font-weight:800; color:#333; text-decoration:none; background:url(../images/medala.gif) no-repeat; border-left:1px solid #EEE; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:4px 12px 4px 6px;} @@ -1158,9 +1188,12 @@ ul.bulleta li {background:url(../images/bullet_green.gif) no-repeat 0px 2px; pad .message p { margin-bottom:0px; } +<<<<<<< HEAD:templates/content/style/style.css +======= .message p.space-above { margin-top:10px; } +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css .warning{color:red;} .darkred{color:darkred;} @@ -1437,6 +1470,8 @@ ul.form-horizontal-rows li input { text-align:center; font-weight:bold; } +<<<<<<< HEAD:templates/content/style/style.css +======= #tagSelector { padding-bottom: 2px; } @@ -1446,3 +1481,4 @@ ul.form-horizontal-rows li input { #hideIgnoredTagsCb { margin: 0 2px 0 1px; } +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/content/style/style.css diff --git a/templates/question.html b/templates/question.html index 9183767f..e88f7ef1 100644 --- a/templates/question.html +++ b/templates/question.html @@ -140,6 +140,13 @@ <span class="action-link"><a href="{% url edit_question question.id %}">{% trans 'edit' %}</a></span> {% endif %} {% separator %} +<<<<<<< HEAD:templates/question.html + {% if request.user|can_delete_post:question %} + <span class="action-link"><a id="question-delete-link-{{question.id}}">{% trans "delete" %}</a></span> + {% endif %} + {% separator %} +======= +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/question.html {% if question.closed %} {% if request.user|can_reopen_question:question %} <span class="action-link"><a href="{% url reopen question.id %}">{% trans "reopen" %}</a></span> @@ -159,10 +166,13 @@ {% endif %} </span> {% endif %} +<<<<<<< HEAD:templates/question.html +======= {% separator %} {% if request.user|can_delete_post:question %} <span class="action-link"><a id="question-delete-link-{{question.id}}">{% trans "delete" %}</a></span> {% endif %} +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/question.html {% endjoinitems %} </div> <div class="post-update-info-container"> @@ -294,6 +304,18 @@ <span class="action-link"><a href="{% url edit_answer answer.id %}">{% trans 'edit' %}</a></span> {% endif %} {% separator %} +<<<<<<< HEAD:templates/question.html + {% if request.user|can_delete_post:answer %} + {% spaceless %} + <span class="action-link"> + <a id="answer-delete-link-{{answer.id}}"> + {% if answer.deleted %}{% trans "undelete" %}{% else %}{% trans "delete" %}{% endif %}</a> + </span> + {% endspaceless %} + {% endif %} + {% separator %} +======= +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/question.html {% if request.user|can_flag_offensive %} <span id="answer-offensive-flag-{{ answer.id }}" class="offensive-flag" title="{% trans "report as offensive (i.e containing spam, advertising, malicious text, etc.)" %}"> @@ -303,6 +325,8 @@ {% endif %} </span> {% endif %} +<<<<<<< HEAD:templates/question.html +======= {% separator %} {% if request.user|can_delete_post:answer %} {% spaceless %} @@ -312,6 +336,7 @@ </span> {% endspaceless %} {% endif %} +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/question.html {% endjoinitems %} </div> <div class="post-update-info-container"> diff --git a/templates/questions.html b/templates/questions.html index 9387b345..7cbcbd2b 100644 --- a/templates/questions.html +++ b/templates/questions.html @@ -24,6 +24,9 @@ {% endblock %} {% block content %} <div class="tabBar"> +<<<<<<< HEAD:templates/questions.html + <div class="headQuestions">{% if searchtag %}{% trans "Found by tags" %}{% else %}{% if searchtitle %}{% trans "Found by title" %}{% else %}{% trans "All questions" %}{% endif %}{% endif %}</div> +======= <div class="headQuestions"> {% if searchtag %} {% trans "Found by tags" %} @@ -43,6 +46,7 @@ {% endif %} {% endif %} </div> +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/questions.html <div class="tabsA"> <a id="latest" href="?sort=latest" class="off" title="{% trans "most recently asked questions" %}">{% trans "newest" %}</a> <a id="active" href="?sort=active" class="off" title="{% trans "most recently updated questions" %}">{% trans "active" %}</a> @@ -160,6 +164,29 @@ {% block sidebar %} <div class="boxC"> {% if searchtag %} +<<<<<<< HEAD:templates/questions.html + {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num and searchtag as tagname %} + have total {{q_num}} questions tagged {{tagname}} + {% plural %} + have total {{q_num}} questions tagged {{tagname}} + {% endblocktrans %} + {% else %} + {% if searchtitle %} + {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %} + have total {{q_num}} questions containing {{searchtitle}} + {% plural %} + have total {{q_num}} questions containing {{searchtitle}} + {% endblocktrans %} + {% else %} + {% blocktrans count questions as cnt with questions_count|intcomma as q_num %} + have total {{q_num}} questions + {% plural %} + have total {{q_num}} questions + {% endblocktrans %} + {% endif %} + {% endif %} + <p> +======= {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num and searchtag as tagname %} have total {{q_num}} questions tagged {{tagname}} {% plural %} @@ -197,6 +224,7 @@ {% endif %} {% endif %} <p class="nomargin"> +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/questions.html {% ifequal tab_id "latest" %} {% trans "latest questions info" %} {% endifequal %} @@ -224,10 +252,18 @@ <h3 class="subtitle">{% trans "Related tags" %}</h3> <div class="tags"> {% for tag in tags %} +<<<<<<< HEAD:templates/questions.html + <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 /> + {% endfor %} + <br /> +======= <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> <span class="tag-number">× {{ tag.used_count|intcomma }}</span> <br /> {% endfor %} +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/questions.html </div> </div> diff --git a/templates/unanswered.html b/templates/unanswered.html new file mode 100644 index 00000000..80a23631 --- /dev/null +++ b/templates/unanswered.html @@ -0,0 +1,132 @@ +{% extends "base.html" %} +<!-- unanswered.html --> +{% load extra_tags %} +{% load i18n %} +{% load humanize %} +{% load extra_filters %} +{% load smart_if %} +{% block title %}{% spaceless %}{% trans "Unanswered questions" %}{% endspaceless %}{% endblock %} +{% block forejs %} + <script type="text/javascript"> + $().ready(function(){ + $("#nav_unanswered").attr('className',"on"); + }); + + </script> +{% endblock %} +{% block content %} +<div class="tabBar"> + <span class="headQuestions">{% trans "Unanswered questions" %}</span> + <div class="tabsA"> + <a id="latest" href="{% url unanswered %}?sort=latest" class="on" title="{% trans "most recently asked questions" %}">{% trans "newest" %}</a> + </div> +</div> +<div id="listA"> + {% for question in questions.object_list %} + <div class="qstA"> + <h2> + <a href="{{ question.get_absolute_url }}">{{ question.get_question_title }}</a> + </h2> + <div class="stat"> + <table> + <tr> + <td><span class="num">{{ question.answer_count|intcomma }}</span> </td> + <td><span class="num">{{ question.score|intcomma }}</span> </td> + <td><span class="num">{{ question.view_count|cnprog_intword|safe }}</span> </td> + </tr> + <tr> + <td><span class="unit">{% trans "answers" %}</span></td> + <td><span class="unit">{% trans "votes" %}</span></td> + <td><span class="unit">{% trans "views" %}</span></td> + </tr> + </table> + </div> + + <div class="summary"> + {{ question.summary }}... + </div> + + {% ifequal tab_id 'active'%} + {% if question.wiki and settings.WIKI_ON %} + <span class="from wiki">{% trans "community wiki" %}</span> + <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span> + {% else %} + <div class="from"> + {% comment %}{% gravatar question.last_activity_by 24 %}{% endcomment %} + <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span> + <span class="score">{% get_score_badge question.last_activity_by %} </span> + <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span> + </div> + {% endif %} + {% else %} + {% if question.wiki and settings.WIKI_ON %} + <span class="from wiki">{% trans "community wiki" %}</span> + <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span> + {% else %} + <div class="from"> + {% comment %}{% gravatar question.author 24 %}{% endcomment %} + {% if question.last_activity_at != question.added_at %} + {% if question.author.id != question.last_activity_by.id %} + {% trans "Posted:" %} + <span class="author"><a href="{{ question.author.get_profile_url }}">{{ question.author }}</a></span> + <span class="score">{% get_score_badge question.author %} </span> + / {% trans "Updated:" %} + <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span> + <span class="score">{% get_score_badge question.last_activity_by %} </span> + <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span> + {% else %} + {% trans "Updated:" %} + <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span> + <span class="score">{% get_score_badge question.last_activity_by %} </span> + <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span> + {% endif %} + {% else %} + {% trans "Posted:" %} + <span class="author"><a href="{{ question.author.get_profile_url }}">{{ question.author }}</a></span> + <span class="score">{% get_score_badge question.author %} </span> + <span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span> + {% endif %} + </div> + {% endif %} + {% endifequal %} + + <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> + {% endfor %} + </div> + </div> + {% endfor %} +</div> +{% endblock %} + +{% block tail %} + <div class="pager"> + {% cnprog_paginator context %} + </div> + <div class="pagesize"> + {% cnprog_pagesize context %} + </div> +{% endblock %} + +{% block sidebar %} +<div class="boxC"> + {% blocktrans with questions_count|intcomma as num_q %}have {{num_q}} unanswered questions{% endblocktrans %} + <!---<p>问题按 <strong>问题创建时间</strong> 排序。最新加入的问题将显示在最前面。</p>--> +</div> +<div class="boxC"> + <h3 class="subtitle">{% trans "Related tags" %}</h3> + <div class="body"> + <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/> + {% endfor %} + <br/> + </div> + </div> +</div> + +{% endblock %} +<!-- end unanswered.html --> diff --git a/templates/user_email_subscriptions.html b/templates/user_email_subscriptions.html index c0204cbc..10440529 100644 --- a/templates/user_email_subscriptions.html +++ b/templates/user_email_subscriptions.html @@ -13,9 +13,12 @@ {% endif %} <form method="POST"> {% include "edit_user_email_feeds_form.html" %} +<<<<<<< HEAD:templates/user_email_subscriptions.html +======= <table class='form-as-table'> {{tag_filter_selection_form}} </table> +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/user_email_subscriptions.html <div class="submit-row text-align-right"> <input type="submit" class="submit" name="save" value="{% trans "Update" %}"/> <input type="submit" class="submit" name="stop_email" value="{% trans "Stop sending email" %}"/> diff --git a/templates/user_info.html b/templates/user_info.html index c550e13f..4ebcddd6 100644 --- a/templates/user_info.html +++ b/templates/user_info.html @@ -19,7 +19,7 @@ <tr> <td align="center"> <div class="scoreNumber">{{view_user.reputation|intcomma}}</div> - <p><b style="color:#777;">{% trans "reputation" %}</b></p> + <p><b style="color:#777;">{% trans "karma" %}</b></p> </td> </tr> </table> diff --git a/templates/user_stats.html b/templates/user_stats.html index ecc39807..b72f5750 100644 --- a/templates/user_stats.html +++ b/templates/user_stats.html @@ -97,9 +97,14 @@ <td width="180" valign="top"> {% for tag in user_tags%} <a rel="tag" +<<<<<<< HEAD:templates/user_stats.html + 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/> +======= 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> <span class="tag-number">× {{ tag.user_tag_usage_count|intcomma }}</span><br/> +>>>>>>> 82d35490db90878f013523c4d1a5ec3af2df8b23:templates/user_stats.html {% if forloop.counter|divisibleby:"10" %} </td> <td width="180" valign="top"> |