Skip to content

Commit

Permalink
Merge pull request #3 from joncasdam/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
joncasdam committed May 28, 2013
2 parents 549a4c9 + 24f073c commit 52be26a
Show file tree
Hide file tree
Showing 13 changed files with 777 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*.pyc
opentrials/settings_local.include
*.egg-info/
*.komodoproject
*.komodoproject
.DS_STORE
opentrials/logs/*
6 changes: 6 additions & 0 deletions opentrials/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
RewriteEngine on
RewriteCond %{http_host} !^www.ensaiosclinicos.gov.br [OR]
RewriteCond %{http_host} ^ensaiosclinicos.gov.br [OR]
RewriteCond %{http_host} ^ec.gov.br [OR]
RewriteCond %{http_host} ^www.ec.gov.br [nc]
RewriteRule ^(.*)$ http://www.ensaiosclinicos.gov.br [r=301,nc]
37 changes: 37 additions & 0 deletions opentrials/locale/pt_BR/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,13 @@ msgid "both"
msgstr "Ambos"

#: repository/choices.py:41
#: repository/choices.py:82
#: repository/templates/repository/advanced_search.html:40
msgid "male"
msgstr "masculino"

#: repository/choices.py:41
#: repository/choices.py:81
#: repository/templates/repository/advanced_search.html:39
msgid "female"
msgstr "feminino"
Expand Down Expand Up @@ -636,6 +638,31 @@ msgstr "DeCS: Descritores em Ciências da Saúde"
msgid "ICD-10: International Classification of Diseases (10th. rev.)"
msgstr "CID-10: Classificação Internacional de Doenças"

#: repository/choices.py:71
#: repository/choices.py:80
msgid "Do not inform"
msgstr "Não declarar"

#: repository/choices.py:72
msgid "Asian"
msgstr "Amarela"

#: repository/choices.py:73
msgid "White"
msgstr "Branca"

#: repository/choices.py:74
msgid "Indigene"
msgstr "Indígena"

#: repository/choices.py:75
msgid "Brown"
msgstr "Parda"

#: repository/choices.py:76
msgid "Black"
msgstr "Preta"

#: repository/feed.py:6 repository/feed.py:16
#, fuzzy
msgid "Last published trials"
Expand Down Expand Up @@ -2021,6 +2048,16 @@ msgstr "resubmeter"
msgid "Preferred language"
msgstr "Idioma preferido"

#: reviewapp/models.py:54
#: reviewapp/forms.py:144
msgid "Color/Race"
msgstr "Cor/Raça"

#: reviewapp/models.py:57
#: reviewapp/forms.py:147
msgid "Genre"
msgstr "Gênero"

#: reviewapp/models.py:80
msgid "Fields Status"
msgstr "Situação dos campos"
Expand Down
1 change: 0 additions & 1 deletion opentrials/logs/logs.txt

This file was deleted.

3 changes: 0 additions & 3 deletions opentrials/logs/logs_2013-01-22.txt

This file was deleted.

3 changes: 0 additions & 3 deletions opentrials/logs/logs_2013-01-24.txt

This file was deleted.

1 change: 0 additions & 1 deletion opentrials/logs/logs_2013-02-05.txt

This file was deleted.

15 changes: 15 additions & 0 deletions opentrials/repository/choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,18 @@
('ICD-10', _('ICD-10: International Classification of Diseases (10th. rev.)')),
#('CAS', _('Chemical Abstracts Service')),
]

COLOR_RACE = [
('0',_('Do not inform')),
('1',_('Asian')),
('2',_('White')),
('3',_('Indigene')),
('4',_('Brown')),
('5',_('Black')),
]

GENRE = [
('-',_('Do not inform')),
('F',_('Female')),
('M',_('Male')),
]
14 changes: 13 additions & 1 deletion opentrials/reviewapp/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,22 @@ class Meta:

title = _('User Profile')


from registration.forms import RegistrationFormUniqueEmail, RegistrationForm
from repository import choices

class UserRegForm(RegistrationFormUniqueEmail):
color_race = forms.ChoiceField(label=_('Color/Race'),
choices=choices.COLOR_RACE,
initial=choices.COLOR_RACE[0])
genre = forms.ChoiceField(label=_('Genre'),
choices=choices.GENRE,
initial=choices.GENRE[0])

class UserProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
fields = ['preferred_language']
fields = ['preferred_language', 'color_race', 'genre']

title = _('Aditional info for profile')

Expand Down

Large diffs are not rendered by default.

347 changes: 347 additions & 0 deletions opentrials/reviewapp/migrations/0008_add_field_UserProfile_genre.py

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion opentrials/reviewapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.utils import simplejson

from repository.models import ClinicalTrial, Institution
from repository.choices import PROCESSING_STATUS, PUBLISHED_STATUS, ARCHIVED_STATUS
from repository.choices import PROCESSING_STATUS, PUBLISHED_STATUS, ARCHIVED_STATUS, COLOR_RACE, GENRE
from repository.serializers import deserialize_trial
from tickets.models import Ticket
from utilities import safe_truncate
Expand Down Expand Up @@ -51,6 +51,12 @@ class UserProfile(models.Model):
preferred_language = models.CharField(_('Preferred language'),max_length=10,
choices=settings.MANAGED_LANGUAGES_CHOICES,
default=settings.MANAGED_LANGUAGES_CHOICES[-1][0])
color_race = models.CharField(_('Color/Race'),max_length=2,
choices=COLOR_RACE,
default=COLOR_RACE[0][0])
genre = models.CharField(_('Genre'),max_length=2,
choices=GENRE,
default=GENRE[0][0])

def amount_submissions(self):
return u"%03d" % (Submission.objects.filter(creator=self.user).count())
Expand Down
3 changes: 2 additions & 1 deletion opentrials/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from django.conf.urls.defaults import *
from registration.forms import RegistrationFormUniqueEmail
from reviewapp.forms import UserRegForm

import utilities

Expand Down Expand Up @@ -50,7 +51,7 @@
# setting django-registration to use unique email form
url(r'^accounts/register/$', 'registration.views.register',
{'backend': 'registration.backends.default.DefaultBackend',
'form_class': RegistrationFormUniqueEmail},
'form_class': UserRegForm},
name='registration_register'),

# django-registration views
Expand Down

0 comments on commit 52be26a

Please sign in to comment.