diff options
-rw-r--r-- | forum/admin.py | 4 | ||||
-rw-r--r-- | forum/forms.py | 5 | ||||
-rw-r--r-- | forum/managers.py | 4 | ||||
-rw-r--r-- | forum/models.py | 11 | ||||
-rw-r--r-- | forum/views.py | 48 | ||||
-rw-r--r-- | locale/es/LC_MESSAGES/django.mo | bin | 49819 -> 49749 bytes | |||
-rw-r--r-- | locale/es/LC_MESSAGES/django.po | 131 | ||||
-rw-r--r-- | templates/ask.html | 7 | ||||
-rw-r--r-- | templates/categories.html | 56 | ||||
-rw-r--r-- | templates/footer.html | 6 | ||||
-rw-r--r-- | templates/header.html | 1 | ||||
-rw-r--r-- | templates/question.html | 1 | ||||
-rw-r--r-- | templates/question_edit.html | 6 | ||||
-rw-r--r-- | templates/questions.html | 1 | ||||
-rw-r--r-- | urls.py | 4 |
15 files changed, 215 insertions, 70 deletions
diff --git a/forum/admin.py b/forum/admin.py index 482da048..c326a034 100644 --- a/forum/admin.py +++ b/forum/admin.py @@ -13,6 +13,9 @@ class QuestionAdmin(admin.ModelAdmin): class TagAdmin(admin.ModelAdmin): """Tag admin class""" +class CategoryAdmin(admin.ModelAdmin): + """Category admin class""" + class Answerdmin(admin.ModelAdmin): """Answer admin class""" @@ -58,6 +61,7 @@ class BookAuthorRssAdmin(admin.ModelAdmin): admin.site.register(Question, QuestionAdmin) admin.site.register(Tag, TagAdmin) +admin.site.register(Category, CategoryAdmin) admin.site.register(Answer, Answerdmin) admin.site.register(Comment, CommentAdmin) admin.site.register(Vote, VoteAdmin) diff --git a/forum/forms.py b/forum/forms.py index 59d0d620..127210c5 100644 --- a/forum/forms.py +++ b/forum/forms.py @@ -95,6 +95,8 @@ class AskForm(forms.Form): tags = TagNamesField() wiki = WikiField() + categories = forms.ModelChoiceField(help_text=_('please choice a category'), + queryset=Category.objects.all(), label=_('Category')) openid = forms.CharField(required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 40, 'class':'openid-input'})) user = forms.CharField(required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35})) email = forms.CharField(required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35})) @@ -154,6 +156,9 @@ class EditQuestionForm(forms.Form): tags = TagNamesField() summary = SummaryField() + categories = forms.ModelChoiceField(help_text=_('please choice a category'), + queryset=Category.objects.all(), label=_('Category')) + def __init__(self, question, revision, *args, **kwargs): super(EditQuestionForm, self).__init__(*args, **kwargs) self.fields['title'].initial = revision.title diff --git a/forum/managers.py b/forum/managers.py index 6ae0ed99..2c05bc5f 100644 --- a/forum/managers.py +++ b/forum/managers.py @@ -18,6 +18,10 @@ class QuestionManager(models.Manager): def get_questions_by_tag(self, tagname, orderby): questions = self.filter(deleted=False, tags__name = unquote(tagname)).order_by(orderby) return questions + + def get_questions_by_category(self, categoryname, orderby): + questions = self.filter(category__name = categoryname).order_by(orderby) + return questions def get_unanswered_questions(self, orderby): questions = self.filter(deleted=False, answer_accepted=False).order_by(orderby) diff --git a/forum/models.py b/forum/models.py index f647ba12..04745a4a 100644 --- a/forum/models.py +++ b/forum/models.py @@ -17,6 +17,12 @@ import settings from forum.managers import * from const import * +class Category(models.Model): + name = models.CharField(max_length=50, unique = True) + + def __unicode__(self): + return self.name + class EmailFeed(models.Model): #subscription key for unsubscribe by visiting emailed link key = models.CharField(max_length=32) @@ -122,6 +128,7 @@ class Question(models.Model): author = models.ForeignKey(User, related_name='questions') added_at = models.DateTimeField(default=datetime.datetime.now) tags = models.ManyToManyField(Tag, related_name='questions') + category = models.ForeignKey(Category, related_name='questions') # Status wiki = models.BooleanField(default=False) wikified_at = models.DateTimeField(null=True, blank=True) @@ -655,10 +662,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 - if (instance.content_type_id == question_type_id): + if (instance.content_type_id == question_type_id): type = TYPE_ACTIVITY_COMMENT_QUESTION else: - type = TYPE_ACTIVITY_COMMENT_ANSWER + 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/views.py b/forum/views.py index d663a4cb..10438982 100644 --- a/forum/views.py +++ b/forum/views.py @@ -106,7 +106,7 @@ def privacy(request): def unanswered(request): return questions(request, unanswered=True) -def questions(request, tagname=None, unanswered=False): +def questions(request, tagname=None, categoryname=None, unanswered=False): """ List of Questions, Tagged questions, and Unanswered questions. """ @@ -137,6 +137,8 @@ def questions(request, tagname=None, unanswered=False): #check if request is from unanswered questions template_file = "unanswered.html" objects = Question.objects.get_unanswered_questions(orderby) + elif categoryname: + objects = Question.objects.get_questions_by_category(categoryname, orderby) else: objects = Question.objects.get_questions(orderby) @@ -223,7 +225,7 @@ def create_new_answer( question=None, author=None,\ def create_new_question(title=None,author=None,added_at=None, wiki=False,tagnames=None,summary=None, - text=None): + text=None, category=None): """this is not a view and maybe should become one of the methods on Question object? """ @@ -237,7 +239,8 @@ def create_new_question(title=None,author=None,added_at=None, wiki = wiki, tagnames = tagnames, html = html, - summary = summary + summary = summary, + category = category ) if question.wiki: question.last_edited_by = question.author @@ -273,6 +276,7 @@ def ask(request): text = form.cleaned_data['text'] html = sanitize_html(markdowner.convert(text)) summary = strip_tags(html)[:120] + category = form.cleaned_data['categories'] if request.user.is_authenticated(): author = request.user @@ -284,7 +288,8 @@ def ask(request): wiki = wiki, tagnames = tagnames, summary = summary, - text = text + text = text, + category = category ) return HttpResponseRedirect(question.get_absolute_url()) @@ -513,6 +518,7 @@ def _edit_question(request, question): 'tagnames': form.cleaned_data['tags'], 'summary': strip_tags(html)[:120], 'html': html, + 'category': form.cleaned_data['categories'] } # only save when it's checked @@ -746,6 +752,40 @@ def tags(request): def tag(request, tag): return questions(request, tagname=tag) +def categories(request): + is_paginated = True + sortby = request.GET.get('sort', 'used') + try: + page = int(request.GET.get('page', '1')) + except ValueError: + page = 1 + + if request.method == "GET": + objects_list = Paginator(Category.objects.all(), DEFAULT_PAGE_SIZE) + + try: + categories = objects_list.page(page) + except (EmptyPage, InvalidPage): + categories = objects_list.page(objects_list.num_pages) + + return render_to_response('categories.html', { + "categories" : categories, + "context" : { + 'is_paginated' : is_paginated, + 'pages': objects_list.num_pages, + 'page': page, + 'has_previous': categories.has_previous(), + 'has_next': categories.has_next(), + 'previous': categories.previous_page_number(), + 'next': categories.next_page_number(), + 'base_url': '/categorias/' + } + + }, context_instance=RequestContext(request)) + +def category(request, category): + return questions(request, categoryname=category) + def vote(request, id): """ vote_type: diff --git a/locale/es/LC_MESSAGES/django.mo b/locale/es/LC_MESSAGES/django.mo Binary files differindex 91639ba1..d25949ed 100644 --- a/locale/es/LC_MESSAGES/django.mo +++ b/locale/es/LC_MESSAGES/django.mo diff --git a/locale/es/LC_MESSAGES/django.po b/locale/es/LC_MESSAGES/django.po index d7655dd7..fe73330c 100644 --- a/locale/es/LC_MESSAGES/django.po +++ b/locale/es/LC_MESSAGES/django.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-17 16:44+0000\n" -"PO-Revision-Date: 2009-08-17 10:04-0600\n" +"POT-Creation-Date: 2009-08-21 17:28+0000\n" +"PO-Revision-Date: 2009-08-21 11:29-0600\n" "Last-Translator: Bruno Sarlo <bsarlo@gmail.com>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "MIME-Version: 1.0\n" @@ -28,8 +28,8 @@ msgstr "archivossubidos/" msgid "signup/" msgstr "registrarse/" -#: urls.py:28 urls.py:29 urls.py:30 django_authopenid/urls.py:26 -#: django_authopenid/urls.py:27 +#: urls.py:28 urls.py:29 urls.py:30 django_authopenid/urls.py:24 +#: django_authopenid/urls.py:25 msgid "email/" msgstr "email/" @@ -79,8 +79,8 @@ msgstr "revisiones/" #: urls.py:38 urls.py:39 urls.py:40 urls.py:41 urls.py:42 urls.py:43 #: urls.py:44 urls.py:45 urls.py:46 urls.py:47 urls.py:48 forum/feed.py:19 -#: forum/models.py:313 forum/views.py:1232 forum/views.py:1234 -#: forum/views.py:1474 +#: forum/models.py:313 forum/views.py:1228 forum/views.py:1230 +#: forum/views.py:1470 msgid "questions/" msgstr "preguntas/" @@ -108,7 +108,7 @@ msgstr "respuesta/" msgid "vote/" msgstr "votar/" -#: urls.py:48 urls.py:49 django_authopenid/urls.py:29 +#: urls.py:48 urls.py:49 django_authopenid/urls.py:27 msgid "delete/" msgstr "borrar/" @@ -116,12 +116,12 @@ msgstr "borrar/" msgid "question/" msgstr "pregunta/" -#: urls.py:52 urls.py:53 forum/views.py:747 forum/views.py:2071 +#: urls.py:52 urls.py:53 forum/views.py:747 forum/views.py:2067 msgid "tags/" msgstr "etiquetas/" #: urls.py:54 urls.py:55 urls.py:56 forum/views.py:1034 forum/views.py:1038 -#: forum/views.py:1476 forum/views.py:1809 forum/views.py:2073 +#: forum/views.py:1472 forum/views.py:1805 forum/views.py:2069 msgid "users/" msgstr "usuarios/" @@ -260,24 +260,25 @@ msgstr "salir/" msgid "complete/" msgstr "completado/" -#: django_authopenid/urls.py:15 -msgid "register/" -msgstr "registrarse/" - -#: django_authopenid/urls.py:19 +#: django_authopenid/urls.py:18 msgid "sendpw/" msgstr "enviarcontrasena/" -#: django_authopenid/urls.py:20 +#: django_authopenid/urls.py:19 django_authopenid/urls.py:23 #, fuzzy msgid "password/" msgstr "contraseña" -#: django_authopenid/urls.py:20 +#: django_authopenid/urls.py:19 msgid "confirm/" msgstr "" -#: django_authopenid/urls.py:27 +#: django_authopenid/urls.py:22 +#, fuzzy +msgid "account_settings" +msgstr "preferencias" + +#: django_authopenid/urls.py:25 msgid "validate/" msgstr "" @@ -286,54 +287,54 @@ msgstr "" msgid "OpenID %(openid_url)s is invalid" msgstr "El OpenID %(openid_url)s no es valido" -#: django_authopenid/views.py:418 django_authopenid/views.py:545 +#: django_authopenid/views.py:419 django_authopenid/views.py:546 msgid "Welcome" msgstr "Bienvenido" -#: django_authopenid/views.py:508 +#: django_authopenid/views.py:509 msgid "Password changed." msgstr "Contraseña modificada" -#: django_authopenid/views.py:520 django_authopenid/views.py:525 +#: django_authopenid/views.py:521 django_authopenid/views.py:526 msgid "your email needs to be validated" msgstr "su correo electrónico necesita ser validado" -#: django_authopenid/views.py:682 django_authopenid/views.py:834 +#: django_authopenid/views.py:683 django_authopenid/views.py:835 #, python-format msgid "No OpenID %s found associated in our database" msgstr "El OpenID %s no esta asociada en nuestra base de datos" -#: django_authopenid/views.py:686 django_authopenid/views.py:841 +#: django_authopenid/views.py:687 django_authopenid/views.py:842 #, python-format msgid "The OpenID %s isn't associated to current user logged in" msgstr "El OpenID %s no esta asociada al usuario actualmente autenticado" -#: django_authopenid/views.py:694 +#: django_authopenid/views.py:695 msgid "Email Changed." msgstr "Email modificado" -#: django_authopenid/views.py:769 +#: django_authopenid/views.py:770 msgid "This OpenID is already associated with another account." msgstr "Este OpenID ya está asociada a otra cuenta." -#: django_authopenid/views.py:774 +#: django_authopenid/views.py:775 #, python-format msgid "OpenID %s is now associated with your account." msgstr "El OpenID %s está ahora asociada con tu cuenta." -#: django_authopenid/views.py:844 +#: django_authopenid/views.py:845 msgid "Account deleted." msgstr "Cuenta borrada." -#: django_authopenid/views.py:884 +#: django_authopenid/views.py:885 msgid "Request for new password" msgstr "Pedir nueva contraseña" -#: django_authopenid/views.py:897 +#: django_authopenid/views.py:898 msgid "A new password has been sent to your email address." msgstr "Una nueva contraseña ha sido enviada a tu cuenta de Email." -#: django_authopenid/views.py:927 +#: django_authopenid/views.py:928 #, python-format msgid "" "Could not change password. Confirmation key '%s' is not " @@ -342,7 +343,7 @@ msgstr "" "No se ha podido modificar la contraseña. La clave de confirmación '%s' no " "está registrada" -#: django_authopenid/views.py:936 +#: django_authopenid/views.py:937 msgid "" "Can not change password. User don't exist anymore in our " "database." @@ -350,7 +351,7 @@ msgstr "" "No se puede cambiar la contraseña. El usuario no existe más en nuestra base " "de datos." -#: django_authopenid/views.py:945 +#: django_authopenid/views.py:946 #, python-format msgid "Password changed for %s. You may now sign in." msgstr "Contraseña cambiada por %s. Ahora puedes ingresar." @@ -729,22 +730,22 @@ msgstr "perfil - preferencia de " msgid "subscription saved, %(email)s needs validation" msgstr "subscripción guardada, %(email)s necesita validación" -#: forum/views.py:1918 +#: forum/views.py:1914 msgid "uploading images is limited to users with >60 reputation points" msgstr "para subir imagenes debes tener más de 60 puntos de reputación" -#: forum/views.py:1920 +#: forum/views.py:1916 msgid "allowed file types are 'jpg', 'jpeg', 'gif', 'bmp', 'png', 'tiff'" msgstr "" "los tipos de archivos permitidos son 'jpg', 'jpeg', 'gif', 'bmp', 'png', " "'tiff'" -#: forum/views.py:1922 +#: forum/views.py:1918 #, python-format msgid "maximum upload file size is %sK" msgstr "tamaño máximo permitido es archivo %sK" -#: forum/views.py:1924 +#: forum/views.py:1920 #, python-format msgid "" "Error uploading file. Please contact the site administrator. Thank you. %s" @@ -2296,7 +2297,7 @@ msgid "Your new Email" msgstr "Tu nuevo Email" #: templates/authopenid/changeemail.html:31 -#: templates/authopenid/signin.html:137 +#: templates/authopenid/signin.html:143 msgid "Password" msgstr "Contraseña" @@ -2359,6 +2360,7 @@ msgid "OpenID URL:" msgstr "URL de OpenID:" #: templates/authopenid/changeopenid.html:30 +#: templates/authopenid/settings.html:34 msgid "Change OpenID" msgstr "Cambiar OpenID" @@ -2404,7 +2406,7 @@ msgid "This account already exists, please use another." msgstr "Esta cuenta ya existe, por favor usar otra." #: templates/authopenid/complete.html:19 templates/authopenid/complete.html:32 -#: templates/authopenid/sendpw.html:16 templates/authopenid/signin.html:121 +#: templates/authopenid/sendpw.html:16 templates/authopenid/signin.html:130 msgid "Sorry, looks like we have some errors:" msgstr "Ups, parece que hay errores:" @@ -2436,7 +2438,7 @@ msgstr "contraseña" msgid "Register" msgstr "Registrarse" -#: templates/authopenid/complete.html:62 templates/authopenid/signin.html:139 +#: templates/authopenid/complete.html:62 msgid "Forgot your password?" msgstr "¿Olvidaste tu contraseña?" @@ -2564,15 +2566,15 @@ msgstr "" " %(title)s %(summary)s será publicada una vez que ingreses\n" " " -#: templates/authopenid/signin.html:40 +#: templates/authopenid/signin.html:42 msgid "Click to sign in through any of these services." msgstr "Clickea para entrar por cualquiera de estos servicios." -#: templates/authopenid/signin.html:103 +#: templates/authopenid/signin.html:115 msgid "Enter your <span id=\"enter_your_what\">Provider user name</span>" msgstr "Ingresa tu <span id=\"enter_your_what\">nombre de usuario</span>" -#: templates/authopenid/signin.html:110 +#: templates/authopenid/signin.html:122 msgid "" "Enter your <a class=\"openid_logo\" href=\"http://openid.net\">OpenID</a> " "web address" @@ -2580,56 +2582,56 @@ msgstr "" "Ingresa tu dirección (URL) de <a class=\"openid_logo\" href=\"http://openid." "net\">OpenID</a>" -#: templates/authopenid/signin.html:112 templates/authopenid/signin.html:138 +#: templates/authopenid/signin.html:124 templates/authopenid/signin.html:146 msgid "Login" msgstr "Ingresar" -#: templates/authopenid/signin.html:116 -msgid "we support two login modes" -msgstr "soportamos dos tipos de ingreso" - -#: templates/authopenid/signin.html:135 -msgid "Use login name and password" -msgstr "Nombre de usuario y contraseña" +#: templates/authopenid/signin.html:127 +msgid "Enter your login name and password" +msgstr "Introdusca su nombre de usuario y contraseña" -#: templates/authopenid/signin.html:136 +#: templates/authopenid/signin.html:141 msgid "Login name" msgstr "Nombre de usuario" -#: templates/authopenid/signin.html:140 -msgid "Create new account" -msgstr "Crear cuenta nueva" +#: templates/authopenid/signin.html:147 +msgid "Create account" +msgstr "Crear cuenta" -#: templates/authopenid/signin.html:149 +#: templates/authopenid/signin.html:148 +msgid "I forgot my password" +msgstr "¿Olvidaste tu contraseña?" + +#: templates/authopenid/signin.html:157 msgid "Why use OpenID?" msgstr "¿Porqué usar OpenID?" -#: templates/authopenid/signin.html:152 +#: templates/authopenid/signin.html:160 msgid "with openid it is easier" msgstr "Con OpenID no necesitas crear un nuevo nombre de usuario y contraseña." -#: templates/authopenid/signin.html:155 +#: templates/authopenid/signin.html:163 msgid "reuse openid" msgstr "" "Puedes de forma segura re-usar el mismo nombre de usuario para todos los " "sitios que acepten OpenID." -#: templates/authopenid/signin.html:158 +#: templates/authopenid/signin.html:166 msgid "openid is widely adopted" msgstr "" "OpenID es extensamente usado. Hay más de 160,000,000 cuentas de OpenID en " "uso en el mundo. Mas de 10,000 sitios aceptan OpenID." -#: templates/authopenid/signin.html:161 +#: templates/authopenid/signin.html:169 msgid "openid is supported open standard" msgstr "" "OpenID es basado en un standard abierto, apoyado por muchas organizaciones." -#: templates/authopenid/signin.html:166 +#: templates/authopenid/signin.html:174 msgid "Find out more" msgstr "Averigua más" -#: templates/authopenid/signin.html:167 +#: templates/authopenid/signin.html:175 msgid "Get OpenID" msgstr "Adquiere una OpenID" @@ -2673,6 +2675,15 @@ msgstr "Registrate con tu OpenID" msgid "Login with your OpenID" msgstr "Ingresar con tu OpenID" +#~ msgid "register/" +#~ msgstr "registrarse/" + +#~ msgid "we support two login modes" +#~ msgstr "soportamos dos tipos de ingreso" + +#~ msgid "Create new account" +#~ msgstr "Crear cuenta nueva" + #, fuzzy #~ msgid "complete list of quesionts" #~ msgstr "lista completa de preguntas" diff --git a/templates/ask.html b/templates/ask.html index 9e86a5a0..447ee749 100644 --- a/templates/ask.html +++ b/templates/ask.html @@ -110,6 +110,13 @@ <p class="title-desc"> {{ form.tags.help_text }} </p> + <p class="form-item"> + <strong>{{ form.categories.label_tag }}:</strong> {% trans "(required)" %} <span class="form-error"></span><br> + {{ form.categories }} {{ form.categories.errors }} + </p> + <p class="title-desc"> + {{ form.categories.help_text }} + </p> {% if not request.user.is_authenticated %} <input type="submit" value="{% trans "Login/signup to post your question" %}" class="submit" /> {% else %} diff --git a/templates/categories.html b/templates/categories.html new file mode 100644 index 00000000..c617f22d --- /dev/null +++ b/templates/categories.html @@ -0,0 +1,56 @@ +{% extends "base_content.html" %} +<!-- tags.html --> +{% load i18n %} +{% load extra_tags %} +{% load humanize %} +{% block title %}{% spaceless %}{% trans "Category list" %}{% endspaceless %}{% endblock %} +{% block forejs %} + <script type="text/javascript"> + $().ready(function(){ + $("#nav_tags").attr('className',"on"); + $("#ipSearchTag").focus(); + + var orderby = "{{ tab_id }}"; + if(orderby != "used" && orderby != "name") + orderby = "used"; + $("#sort_" + orderby).attr('className',"on"); + $("#type-tag").attr('checked',true); + + Hilite.exact = false; + Hilite.elementid = "searchtags"; + Hilite.debug_referrer = location.href; + }); + + </script> +{% endblock %} +{% block content %} +<!-- Tabs --> +<div class="tabBar"> + <div class="headQuestions">{% trans "Category list" %}</div> +</div> +<div id="searchtags"> +<p> +{% if not categories.object_list %} + <span>{% trans "Nothing found" %}</span> +{% endif %} +</p> +<ul class="tagsList tags"> +{% for category in categories.object_list %} + <li> + <a href="{% url forum.views.category category|urlencode %}" title="{% trans "see questions that matches" %}'{{ category }}'{% trans "category " %}" rel="tag"> + {{ category }} + </a> + <br> + + </li> +{% endfor %} +</ul> +</div> + +{% endblock %} +{% block tail %} +<div class="pager"> + {% cnprog_paginator context %} +</div> +{% endblock %} +<!-- end tags.html --> diff --git a/templates/footer.html b/templates/footer.html index 7eb0205e..34064fd5 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -11,12 +11,12 @@ <a href="{% url privacy %}">{% trans "privacy policy" %}</a><span class="link-separator"> |</span> <a href="{{ feedback_url }}" target="_blank">{% trans "give feedback" %}</a> </div> - <p style="margin-top:10px;"> + <!--<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." /> </a> - <!--<div style="font-size:90%;color:#333">{% trans "current revision" %}: R-0120-20090406</div>--> - </p> + <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> <!-- 页面底部结束: --> diff --git a/templates/header.html b/templates/header.html index e1097802..c9b01a20 100644 --- a/templates/header.html +++ b/templates/header.html @@ -71,3 +71,4 @@ </div> </div> <!-- end template header.html --> + diff --git a/templates/question.html b/templates/question.html index c9446076..f94ea202 100644 --- a/templates/question.html +++ b/templates/question.html @@ -125,6 +125,7 @@ title="{% blocktrans with tag as tagname %}see questions tagged '{{ tagname }}'{% endblocktrans %}" rel="tag">{{ tag }}</a> {% endfor %} </div> + {% trans "Category: " %} <a href="{% url forum.views.category question.category|urlencode %}">{{question.category}}</a> <div id="question-controls" style="clear:both;"> <table width="100%"> <tr> diff --git a/templates/question_edit.html b/templates/question_edit.html index db090ca3..a7460b65 100644 --- a/templates/question_edit.html +++ b/templates/question_edit.html @@ -111,6 +111,12 @@ <div class="title-desc"> {{ form.summary.help_text }} </div> + <br> + + <p class="form-item"> + <strong>{{ form.categories.label_tag }}:</strong> {% trans "(required)" %} <span class="form-error"></span><br> + {{ form.categories }} {{ form.categories.errors }} + </p> <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);" /> diff --git a/templates/questions.html b/templates/questions.html index 985b4921..6121d876 100644 --- a/templates/questions.html +++ b/templates/questions.html @@ -84,6 +84,7 @@ <a href="{% url forum.views.tag tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a> {% endfor %} </div> + {%trans "Category: "%}<a href="{% url forum.views.category question.category|urlencode %}">{{ question.category}}</a> </div> {% endfor %} </div> @@ -24,6 +24,7 @@ urlpatterns = patterns('', ), (r'^%s' % _('account/'), include('django_authopenid.urls')), (r'^%s/$' % _('signin/'), 'django_authopenid.views.signin'), + (r'^%s$' % _('signup/'), 'django_authopenid.views.signup'), url(r'^%s%s$' % (_('email/'), _('change/')), 'django_authopenid.views.changeemail', name='user_changeemail'), url(r'^%s%s$' % (_('email/'), _('sendkey/')), 'django_authopenid.views.send_email_key'), url(r'^%s%s(?P<id>\d+)/(?P<key>[\dabcdef]{32})/$' % (_('email/'), _('verify/')), 'django_authopenid.views.verifyemail', name='user_verifyemail'), @@ -64,5 +65,6 @@ urlpatterns = patterns('', url(r'^%s%s(?P<short_name>[^/]+)/$' % (_('books/'), _('ask/')), app.ask_book, name='ask_book'), url(r'^%s(?P<short_name>[^/]+)/$' % _('books/'), app.book, name='book'), url(r'^%s$' % _('search/'), app.search, name='search'), - (r'^i18n/', include('django.conf.urls.i18n')), + (r'^categorias/$', app.categories), + (r'^categorias/(?P<category>[^/]+)/$', app.category), ) |