Commit 8df7c79dfd08060f4a9dd0670926750debb0d091
1 parent
ab998a29
Exists in
master
and in
29 other branches
ActionItem114: fixed a test in the person and another in the profile models
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@807 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
6 changed files
with
54 additions
and
34 deletions
Show diff stats
app/controllers/profile_admin/membership_editor_controller.rb
| ... | ... | @@ -7,7 +7,7 @@ class MembershipEditorController < ProfileAdminController |
| 7 | 7 | protect [:index, :new_enterprise, :create_enterprise ], 'edit_profile', :profile |
| 8 | 8 | |
| 9 | 9 | def index |
| 10 | - @memberships = current_user.person.memberships | |
| 10 | + @memberships = current_user.person.enterprises_memberships | |
| 11 | 11 | end |
| 12 | 12 | |
| 13 | 13 | def new_enterprise | ... | ... |
app/helpers/application_helper.rb
| ... | ... | @@ -123,7 +123,7 @@ module ApplicationHelper |
| 123 | 123 | end |
| 124 | 124 | |
| 125 | 125 | def about_document |
| 126 | - Article.find_all_by_title(_('About')).select do |a| | |
| 126 | + Article.find_all_by_slug(_('about')).select do |a| | |
| 127 | 127 | a.full_path.split(/\//).shift == 'noosfero' |
| 128 | 128 | end[0] |
| 129 | 129 | end |
| ... | ... | @@ -249,7 +249,7 @@ module ApplicationHelper |
| 249 | 249 | # end |
| 250 | 250 | |
| 251 | 251 | def accessibility_link |
| 252 | - doc = Article.find_all_by_title(_('Accessibility')).select do |a| | |
| 252 | + doc = Article.find_all_by_slug(_('accessibility')).select do |a| | |
| 253 | 253 | a.full_path.split(/\//).shift == 'noosfero' |
| 254 | 254 | end[0] |
| 255 | 255 | link_to_document doc, _('Accessibility') if doc | ... | ... |
app/models/person.rb
| ... | ... | @@ -26,8 +26,13 @@ class Person < Profile |
| 26 | 26 | :all, |
| 27 | 27 | :conditions => self.class.conditions_for_profiles(conditions, self), |
| 28 | 28 | :joins => "LEFT JOIN role_assignments ON profiles.id = role_assignments.resource_id AND role_assignments.resource_type = \'#{Profile.base_class.name}\'", |
| 29 | - :select => 'profiles.*').uniq.select{|p|p.class == Enterprise} | |
| 29 | + :select => 'profiles.*').uniq | |
| 30 | 30 | end |
| 31 | + | |
| 32 | + def enterprises_memberships | |
| 33 | + memberships.select{|p|p.class == Enterprise} | |
| 34 | + end | |
| 35 | + | |
| 31 | 36 | |
| 32 | 37 | def info |
| 33 | 38 | person_info | ... | ... |
po/noosfero.pot
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | msgid "" |
| 8 | 8 | msgstr "" |
| 9 | 9 | "Project-Id-Version: noosfero 0.3.0\n" |
| 10 | -"POT-Creation-Date: 2007-10-20 03:04-0300\n" | |
| 10 | +"POT-Creation-Date: 2007-10-22 14:20-0300\n" | |
| 11 | 11 | "PO-Revision-Date: 2007-08-30 18:47-0300\n" |
| 12 | 12 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
| 13 | 13 | "Language-Team: LANGUAGE <LL@li.org>\n" |
| ... | ... | @@ -82,15 +82,15 @@ msgstr "" |
| 82 | 82 | msgid "Could not update the enterprise" |
| 83 | 83 | msgstr "" |
| 84 | 84 | |
| 85 | -#: app/controllers/profile_admin/enterprise_editor_controller.rb:34 | |
| 85 | +#: app/controllers/profile_admin/enterprise_editor_controller.rb:35 | |
| 86 | 86 | msgid "Enterprise sucessfully erased from the system" |
| 87 | 87 | msgstr "" |
| 88 | 88 | |
| 89 | -#: app/controllers/profile_admin/enterprise_editor_controller.rb:44 | |
| 89 | +#: app/controllers/profile_admin/enterprise_editor_controller.rb:45 | |
| 90 | 90 | msgid "Enterprise successfuly activacted" |
| 91 | 91 | msgstr "" |
| 92 | 92 | |
| 93 | -#: app/controllers/profile_admin/enterprise_editor_controller.rb:46 | |
| 93 | +#: app/controllers/profile_admin/enterprise_editor_controller.rb:47 | |
| 94 | 94 | msgid "Failed to activate the enterprise" |
| 95 | 95 | msgstr "" |
| 96 | 96 | |
| ... | ... | @@ -331,19 +331,19 @@ msgstr "" |
| 331 | 331 | msgid "Task|Code" |
| 332 | 332 | msgstr "" |
| 333 | 333 | |
| 334 | -#: app/models/task.rb:81 | |
| 334 | +#: app/models/task.rb:86 | |
| 335 | 335 | msgid "Generic task" |
| 336 | 336 | msgstr "" |
| 337 | 337 | |
| 338 | -#: app/models/task.rb:88 | |
| 338 | +#: app/models/task.rb:93 | |
| 339 | 339 | msgid "The task was created at %s" |
| 340 | 340 | msgstr "" |
| 341 | 341 | |
| 342 | -#: app/models/task.rb:94 | |
| 342 | +#: app/models/task.rb:99 | |
| 343 | 343 | msgid "The task was finished at %s" |
| 344 | 344 | msgstr "" |
| 345 | 345 | |
| 346 | -#: app/models/task.rb:100 | |
| 346 | +#: app/models/task.rb:105 | |
| 347 | 347 | msgid "The task was cancelled at %s" |
| 348 | 348 | msgstr "" |
| 349 | 349 | |
| ... | ... | @@ -720,10 +720,14 @@ msgstr "" |
| 720 | 720 | msgid "Admin" |
| 721 | 721 | msgstr "" |
| 722 | 722 | |
| 723 | -#: app/helpers/application_helper.rb:120 app/helpers/application_helper.rb:126 | |
| 723 | +#: app/helpers/application_helper.rb:120 | |
| 724 | 724 | msgid "About" |
| 725 | 725 | msgstr "" |
| 726 | 726 | |
| 727 | +#: app/helpers/application_helper.rb:126 | |
| 728 | +msgid "about" | |
| 729 | +msgstr "" | |
| 730 | + | |
| 727 | 731 | #: app/helpers/application_helper.rb:144 app/views/account/login.rhtml:1 |
| 728 | 732 | msgid "Login" |
| 729 | 733 | msgstr "" |
| ... | ... | @@ -773,10 +777,6 @@ msgstr "" |
| 773 | 777 | msgid "Edit informations" |
| 774 | 778 | msgstr "" |
| 775 | 779 | |
| 776 | -#: app/helpers/application_helper.rb:194 | |
| 777 | -msgid "Exclude" | |
| 778 | -msgstr "" | |
| 779 | - | |
| 780 | 780 | #: app/helpers/application_helper.rb:200 |
| 781 | 781 | #: app/views/account/new_password.rhtml:13 |
| 782 | 782 | #: app/views/account/change_password.rhtml:1 |
| ... | ... | @@ -800,7 +800,11 @@ msgstr "" |
| 800 | 800 | msgid "Change icon theme" |
| 801 | 801 | msgstr "" |
| 802 | 802 | |
| 803 | -#: app/helpers/application_helper.rb:252 app/helpers/application_helper.rb:255 | |
| 803 | +#: app/helpers/application_helper.rb:252 | |
| 804 | +msgid "accessibility" | |
| 805 | +msgstr "" | |
| 806 | + | |
| 807 | +#: app/helpers/application_helper.rb:255 | |
| 804 | 808 | msgid "Accessibility" |
| 805 | 809 | msgstr "" |
| 806 | 810 | |
| ... | ... | @@ -1156,6 +1160,7 @@ msgid "Dear %s," |
| 1156 | 1160 | msgstr "" |
| 1157 | 1161 | |
| 1158 | 1162 | #: app/views/task_mailer/task_created.text.plain.rhtml:6 |
| 1163 | +#: app/views/task_mailer/target_notification.rhtml:6 | |
| 1159 | 1164 | #: app/views/task_mailer/task_finished.text.plain.rhtml:6 |
| 1160 | 1165 | #: app/views/task_mailer/task_cancelled.text.plain.rhtml:6 |
| 1161 | 1166 | msgid "%s environment system" | ... | ... |
po/pt_BR/noosfero.po
| ... | ... | @@ -9,8 +9,8 @@ |
| 9 | 9 | msgid "" |
| 10 | 10 | msgstr "" |
| 11 | 11 | "Project-Id-Version: noosfero 0.3.0\n" |
| 12 | -"POT-Creation-Date: 2007-10-20 03:04-0300\n" | |
| 13 | -"PO-Revision-Date: 2007-10-19 21:25-0300\n" | |
| 12 | +"POT-Creation-Date: 2007-10-22 14:20-0300\n" | |
| 13 | +"PO-Revision-Date: 2007-10-22 14:23-0300\n" | |
| 14 | 14 | "Last-Translator: Rafael Tavares Bomfim <rafael@colivre.coop.br>\n" |
| 15 | 15 | "Language-Team: \n" |
| 16 | 16 | "MIME-Version: 1.0\n" |
| ... | ... | @@ -85,15 +85,15 @@ msgstr "Esta ação não está disponível para \"%s\"." |
| 85 | 85 | msgid "Could not update the enterprise" |
| 86 | 86 | msgstr "Não pôde modificar o empreendimento" |
| 87 | 87 | |
| 88 | -#: app/controllers/profile_admin/enterprise_editor_controller.rb:34 | |
| 88 | +#: app/controllers/profile_admin/enterprise_editor_controller.rb:35 | |
| 89 | 89 | msgid "Enterprise sucessfully erased from the system" |
| 90 | 90 | msgstr "Empreendimento ativado com sucesso" |
| 91 | 91 | |
| 92 | -#: app/controllers/profile_admin/enterprise_editor_controller.rb:44 | |
| 92 | +#: app/controllers/profile_admin/enterprise_editor_controller.rb:45 | |
| 93 | 93 | msgid "Enterprise successfuly activacted" |
| 94 | 94 | msgstr "Empreendimento ativado com sucesso" |
| 95 | 95 | |
| 96 | -#: app/controllers/profile_admin/enterprise_editor_controller.rb:46 | |
| 96 | +#: app/controllers/profile_admin/enterprise_editor_controller.rb:47 | |
| 97 | 97 | msgid "Failed to activate the enterprise" |
| 98 | 98 | msgstr "Falhou em ativar o empreendimento" |
| 99 | 99 | |
| ... | ... | @@ -340,19 +340,19 @@ msgstr "Alvo" |
| 340 | 340 | msgid "Task|Code" |
| 341 | 341 | msgstr "Código" |
| 342 | 342 | |
| 343 | -#: app/models/task.rb:81 | |
| 343 | +#: app/models/task.rb:86 | |
| 344 | 344 | msgid "Generic task" |
| 345 | 345 | msgstr "Tarefa genérica" |
| 346 | 346 | |
| 347 | -#: app/models/task.rb:88 | |
| 347 | +#: app/models/task.rb:93 | |
| 348 | 348 | msgid "The task was created at %s" |
| 349 | 349 | msgstr "A tarefa foi criada em %s" |
| 350 | 350 | |
| 351 | -#: app/models/task.rb:94 | |
| 351 | +#: app/models/task.rb:99 | |
| 352 | 352 | msgid "The task was finished at %s" |
| 353 | 353 | msgstr "A tarefa foi finalizada em %s" |
| 354 | 354 | |
| 355 | -#: app/models/task.rb:100 | |
| 355 | +#: app/models/task.rb:105 | |
| 356 | 356 | msgid "The task was cancelled at %s" |
| 357 | 357 | msgstr "A tarefa foi cancelada em %s" |
| 358 | 358 | |
| ... | ... | @@ -741,10 +741,15 @@ msgstr "Meus Empreendimentos" |
| 741 | 741 | msgid "Admin" |
| 742 | 742 | msgstr "Administrador" |
| 743 | 743 | |
| 744 | -#: app/helpers/application_helper.rb:120 app/helpers/application_helper.rb:126 | |
| 744 | +#: app/helpers/application_helper.rb:120 | |
| 745 | 745 | msgid "About" |
| 746 | 746 | msgstr "Sobre" |
| 747 | 747 | |
| 748 | +#: app/helpers/application_helper.rb:126 | |
| 749 | +#, fuzzy | |
| 750 | +msgid "about" | |
| 751 | +msgstr "sobre" | |
| 752 | + | |
| 748 | 753 | #: app/helpers/application_helper.rb:144 app/views/account/login.rhtml:1 |
| 749 | 754 | msgid "Login" |
| 750 | 755 | msgstr "Entrar" |
| ... | ... | @@ -794,10 +799,6 @@ msgstr "Gerenciar conteúdo" |
| 794 | 799 | msgid "Edit informations" |
| 795 | 800 | msgstr "Editar informações" |
| 796 | 801 | |
| 797 | -#: app/helpers/application_helper.rb:194 | |
| 798 | -msgid "Exclude" | |
| 799 | -msgstr "Excluir" | |
| 800 | - | |
| 801 | 802 | #: app/helpers/application_helper.rb:200 |
| 802 | 803 | #: app/views/account/new_password.rhtml:13 |
| 803 | 804 | #: app/views/account/change_password.rhtml:1 |
| ... | ... | @@ -821,7 +822,12 @@ msgstr "Mude o tema de bloco" |
| 821 | 822 | msgid "Change icon theme" |
| 822 | 823 | msgstr "Mudar tema do ícone" |
| 823 | 824 | |
| 824 | -#: app/helpers/application_helper.rb:252 app/helpers/application_helper.rb:255 | |
| 825 | +#: app/helpers/application_helper.rb:252 | |
| 826 | +#, fuzzy | |
| 827 | +msgid "accessibility" | |
| 828 | +msgstr "acessibilidade" | |
| 829 | + | |
| 830 | +#: app/helpers/application_helper.rb:255 | |
| 825 | 831 | msgid "Accessibility" |
| 826 | 832 | msgstr "Acessibilidade" |
| 827 | 833 | |
| ... | ... | @@ -1179,6 +1185,7 @@ msgid "Dear %s," |
| 1179 | 1185 | msgstr "Caro %s," |
| 1180 | 1186 | |
| 1181 | 1187 | #: app/views/task_mailer/task_created.text.plain.rhtml:6 |
| 1188 | +#: app/views/task_mailer/target_notification.rhtml:6 | |
| 1182 | 1189 | #: app/views/task_mailer/task_finished.text.plain.rhtml:6 |
| 1183 | 1190 | #: app/views/task_mailer/task_cancelled.text.plain.rhtml:6 |
| 1184 | 1191 | msgid "%s environment system" |
| ... | ... | @@ -1865,6 +1872,9 @@ msgstr "Editando %s" |
| 1865 | 1872 | msgid "Categories" |
| 1866 | 1873 | msgstr "Categorias" |
| 1867 | 1874 | |
| 1875 | +#~ msgid "Exclude" | |
| 1876 | +#~ msgstr "Excluir" | |
| 1877 | + | |
| 1868 | 1878 | #~ msgid "Main content block" |
| 1869 | 1879 | #~ msgstr "Bloco de conteúdo principal" |
| 1870 | 1880 | ... | ... |
test/unit/profile_test.rb
| ... | ... | @@ -80,7 +80,7 @@ class ProfileTest < Test::Unit::TestCase |
| 80 | 80 | pr = Profile.create(:name => 'composite_profile', :identifier => 'composite') |
| 81 | 81 | pe = User.create(:login => 'aff', :email => 'aff@pr.coop', :password => 'blih', :password_confirmation => 'blih').person |
| 82 | 82 | |
| 83 | - member_role = Role.new(:name => 'member') | |
| 83 | + member_role = Role.new(:name => 'new_member_role') | |
| 84 | 84 | assert member_role.save |
| 85 | 85 | assert pr.affiliate(pe, member_role) |
| 86 | 86 | ... | ... |