Replacing the word lecturer by speaker (suggested by cascardo)
authorLincoln de Sousa <lincoln@minaslivre.org>
Sun, 13 Jul 2008 21:34:25 +0000 (18:34 -0300)
committerLincoln de Sousa <lincoln@minaslivre.org>
Sun, 13 Jul 2008 21:34:25 +0000 (18:34 -0300)
eventos/forms.py
eventos/templates/eventos/speaker-add.html [new file with mode: 0644]
eventos/templates/eventos/speaker-details.html [new file with mode: 0644]
eventos/templates/eventos/talk-list.html
eventos/urls.py
eventos/views.py
templates/base.html

index 3c8acea..c739b07 100644 (file)
@@ -20,7 +20,7 @@ from django.newforms import PasswordInput, ValidationError
 from django.contrib.auth.models import User
 
 
-class RegisterLecturer(forms.Form):
+class RegisterSpeaker(forms.Form):
     username = forms.CharField(max_length=20, label=u'Usu├írio para login')
     password1 = forms.CharField(widget=PasswordInput, label='Senha')
     password2 = forms.CharField(widget=PasswordInput, label='Confirmar Senha')
diff --git a/eventos/templates/eventos/speaker-add.html b/eventos/templates/eventos/speaker-add.html
new file mode 100644 (file)
index 0000000..8f98678
--- /dev/null
@@ -0,0 +1,11 @@
+{% extends "base.html" %}
+
+{% block content %}
+<form id="speaker-details" method="post" action="./">
+  {{ uform.as_p }}
+
+  {{ form.as_p }}
+
+  <input type="submit" value="Ok" />
+</form>
+{% endblock %}
diff --git a/eventos/templates/eventos/speaker-details.html b/eventos/templates/eventos/speaker-details.html
new file mode 100644 (file)
index 0000000..48320c4
--- /dev/null
@@ -0,0 +1,8 @@
+{% extends "base.html" %}
+
+{% block content %}
+<form id="speaker-details" method="post" action="./">
+  {{ form.as_p }}
+  <input type="submit" value="Ok" />
+</form>
+{% endblock %}
index 921e4b9..8a094e1 100644 (file)
@@ -1,7 +1,7 @@
 {% extends "base.html" %}
 
 {% block content %}
-<h2>Trabalhos do palestrante {{ lecturer }}</h2>
+<h2>Trabalhos do palestrante {{ speaker }}</h2>
 
 <table id="talks-list">
   <thead>
index b0637a2..399d1c9 100644 (file)
@@ -3,9 +3,9 @@ from django.conf.urls.defaults import *
 urlpatterns = patterns('',
     (r'^login/', 'eventos.views.login'),
     (r'^logout/', 'eventos.views.logout'),
-    (r'^lecturer/add/$', 'eventos.views.lecturer_add'),
-    (r'^lecturer/(\d+)/$', 'eventos.views.lecturer_details'),
-    (r'^lecturer/(\d+)/talks/$', 'eventos.views.lecturer_talks'),
+    (r'^speaker/add/$', 'eventos.views.speaker_add'),
+    (r'^speaker/(\d+)/$', 'eventos.views.speaker_details'),
+    (r'^speaker/(\d+)/talks/$', 'eventos.views.speaker_talks'),
     (r'^talks/(\d+)/$', 'eventos.views.talk_details'),
     (r'^talks/(\d+)/delete/$', 'eventos.views.talk_delete'),
     (r'^talks/add/$', 'eventos.views.talk_add'),
index d222c16..42c40a7 100644 (file)
@@ -23,7 +23,7 @@ from django.newforms import form_for_instance, form_for_model, HiddenInput
 from django.shortcuts import render_to_response, get_object_or_404
 from django.template import RequestContext, Context, loader
 from eventos.models import Palestrante, Trabalho
-from eventos.forms import RegisterLecturer
+from eventos.forms import RegisterSpeaker
 
 forbidden = \
     HttpResponseForbidden('<h2>You are not allowed to do this action.<h2>')
@@ -61,10 +61,10 @@ def logout(request):
     auth.logout(request)
     return HttpResponseRedirect('/')
 
-def lecturer_add(request):
-    """Adds a new lecturer to the system.
+def speaker_add(request):
+    """Adds a new speaker to the system.
     """
-    uform = RegisterLecturer(request.POST or None)
+    uform = RegisterSpeaker(request.POST or None)
 
     FormKlass = form_for_model(Palestrante)
     form = FormKlass(request.POST or None)
@@ -75,7 +75,7 @@ def lecturer_add(request):
         group = Group.objects.get_or_create(name='palestrantes')[0]
 
         # creating the user that will be set as the user of the
-        # lecturer.
+        # speaker.
         user = User(username=cd['username'])
         user.set_password(cd['password1'])
         user.is_active = True
@@ -83,7 +83,7 @@ def lecturer_add(request):
         user.groups.add(group)
 
         # this commit=False is to avoid IntegritErrors, because at
-        # this point, the lecturer doesn't have an user associated
+        # this point, the speaker doesn't have an user associated
         # with it.
         instance = form.save(commit=False)
         instance.usuario = user
@@ -91,12 +91,12 @@ def lecturer_add(request):
         return HttpResponseRedirect('/')
 
     c = {'form': form, 'uform': uform}
-    return render_to_response('eventos/lecturer-add.html', Context(c),
+    return render_to_response('eventos/speaker-add.html', Context(c),
                               context_instance=RequestContext(request))
 
-def lecturer_details(request, lid):
+def speaker_details(request, lid):
     """Shows a simple form containing all editable fields of a
-    lecturer and gives the lecturer the possibility to save them =)
+    speaker and gives the speaker the possibility to save them =)
     """
     if not hasattr(request.user, 'palestrante_set'):
         return forbidden
@@ -113,11 +113,11 @@ def lecturer_details(request, lid):
         form.save()
 
     c = {'form': form}
-    return render_to_response('eventos/lecturer-details.html', Context(c),
+    return render_to_response('eventos/speaker-details.html', Context(c),
                               context_instance=RequestContext(request))
 
-def lecturer_talks(request, lid):
-    """Lists all talks of a lecturer (based on lecturer id -- lid
+def speaker_talks(request, lid):
+    """Lists all talks of a speaker (based on speaker id -- lid
     parameter).
     """
     if not hasattr(request.user, 'palestrante_set'):
@@ -128,7 +128,7 @@ def lecturer_talks(request, lid):
         return forbidden
 
     talks = Trabalho.objects.filter(palestrante=entity)
-    c = {'lecturer': entity, 'talks': talks}
+    c = {'speaker': entity, 'talks': talks}
     return render_to_response('eventos/talk-list.html', Context(c),
                               context_instance=RequestContext(request))
 
@@ -157,10 +157,10 @@ def talk_delete(request, tid):
         return forbidden
 
     talk.delete()
-    return HttpResponseRedirect('/lecturer/%d/talks/' % entity.id)
+    return HttpResponseRedirect('/speaker/%d/talks/' % entity.id)
 
 def talk_add(request):
-    """Shows a form to the lecturer send a talk
+    """Shows a form to the speaker send a talk
     """
     if not hasattr(request.user, 'palestrante_set'):
         return forbidden
@@ -173,13 +173,13 @@ def talk_add(request):
     # This field should not be shown to the user.
     form.fields['palestrante'].widget = HiddenInput()
 
-    # hidding the owner in the other lecturers list
+    # hidding the owner in the other speakers list
     other = Palestrante.objects.exclude(pk=entity.id)
     form.fields['outros_palestrantes']._set_queryset(other)
 
     if request.POST and form.is_valid():
         instance = form.save()
-        return HttpResponseRedirect('/lecturer/%d/talks/' % entity.id)
+        return HttpResponseRedirect('/speaker/%d/talks/' % entity.id)
 
     c = {'form': form}
     return render_to_response('eventos/talk-add.html', Context(c),
index 952d9c5..f043e3f 100644 (file)
@@ -52,9 +52,9 @@
       {% if user.is_authenticated %}
 
       {% if user.palestrante_set.all %}
-      <li><a href="/lecturer/{{ user.palestrante_set.get.id }}/">Editar dados pessoais</a></li>
+      <li><a href="/speaker/{{ user.palestrante_set.get.id }}/">Editar dados pessoais</a></li>
       <li><a href="/talks/add/">Enviar trabalho</a></li>
-      <li><a href="/lecturer/{{ user.palestrante_set.get.id }}/talks/">Ver trabalhos cadastrados</a></li>
+      <li><a href="/speaker/{{ user.palestrante_set.get.id }}/talks/">Ver trabalhos cadastrados</a></li>
       {% endif %}
 
       {% if user.participante_set.all %}
@@ -68,7 +68,7 @@
       <li><a href="/logout">Sair</a></li>
 
       {% else %}
-      <li><a href="/lecturer/add/">Cadastre-se para enviar trabalhos</a></li>
+      <li><a href="/speaker/add/">Cadastre-se para enviar trabalhos</a></li>
       <!--<li><a href="/cadastro-participante">Cadastre-se para participar</a></li>-->
       {% endif %}
     </ul>