Project

General

Profile

Patch #5556 » all_visible_projects_in_project_jump_box.diff

Holger Just, 2010-05-19 16:30

View differences:

config/settings.yml (working copy)
182 182
  default: ''
183 183
rest_api_enabled:
184 184
  default: 0
185
display_member_projects_only:
186
  default: 1
app/views/settings/_projects.rhtml (working copy)
1 1
<% form_tag({:action => 'edit', :tab => 'projects'}) do %>
2 2

  
3 3
<div class="box tabular settings">
4
<p><%= setting_check_box :display_member_projects_only %></p>
5

  
4 6
<p><%= setting_check_box :default_projects_public %></p>
5 7

  
6 8
<p><%= setting_multiselect(:default_projects_modules, 
app/helpers/application_helper.rb (working copy)
186 191
  # Renders the project quick-jump box
187 192
  def render_project_jump_box
188 193
    # Retrieve them now to avoid a COUNT query
189
    projects = User.current.projects.all
194
    projects = []
195
    if Setting.display_member_projects_only?
196
      projects = User.current.projects.all
197
    else
198
      unless Setting.login_required? && User.current.anonymous?
199
        projects = Project.visible(User.current)
200
      end
201
    end
190 202
    if projects.any?
191 203
      s = '<select onchange="if (this.value != \'\') { window.location = this.value; }">' +
192 204
            "<option value=''>#{ l(:label_jump_to_a_project) }</option>" +
test/functional/welcome_controller_test.rb (working copy)
67 67
   assert_equal 'text/plain', @response.content_type
68 68
   assert @response.body.match(%r{^Disallow: /projects/ecookbook/issues\r?$})
69 69
 end
70
  
71
  def test_jump_box_anonymous
72
    Setting.display_member_projects_only = 0
73
    get :index
74
    assert_tag :div, :attributes => { :id => 'quick-search' }, :child => { :tag => 'select',
75
      :child => { :tag => 'option', :content => 'eCookbook' }
76
    }
77
    
78
    Setting.display_member_projects_only = 1
79
    get :index
80
    assert_no_tag :div, :attributes => { :id => 'quick-search' },
81
      :child => { :tag => 'select' }
82
  end
83
  
84
  def test_jump_box_logged
85
    @request.session[:user_id] = 2
86
    
87
    Setting.display_member_projects_only = 0
88
    get :index
89
    assert_tag :div, :attributes => { :id => 'quick-search' }, :child => { :tag => 'select',
90
      :child => { :tag => 'option', :content => '&nbsp;&nbsp;&#187; Private child of eCookbook' }
91
    }
92
    assert_tag :div, :attributes => { :id => 'quick-search' }, :child => { :tag => 'select',
93
      :child => { :tag => 'option', :content => '&nbsp;&nbsp;&nbsp;&nbsp;&#187; Child of private child' }
94
    }
95
    
96
    Setting.display_member_projects_only = 1
97
    get :index
98
    assert_tag :div, :attributes => { :id => 'quick-search' }, :child => { :tag => 'select',
99
      :child => { :tag => 'option', :content => '&nbsp;&nbsp;&#187; Private child of eCookbook' }
100
    }
101
    assert_no_tag :div, :attributes => { :id => 'quick-search' }, :child => { :tag => 'select',
102
      :child => { :tag => 'option', :content => '&nbsp;&nbsp;&nbsp;&nbsp;&#187; Child of private child' }
103
    }
104
  end
70 105
end
config/locales/lt.yml (working copy)
965 965
  error_unable_to_connect: Unable to connect ({{value}})
966 966
  error_can_not_remove_role: This role is in use and can not be deleted.
967 967
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
968
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/ro.yml (working copy)
894 894
  error_unable_to_connect: Unable to connect ({{value}})
895 895
  error_can_not_remove_role: This role is in use and can not be deleted.
896 896
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
897
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/zh.yml (working copy)
919 919
  error_unable_to_connect: 不能连接到 ({{value}})
920 920
  error_can_not_remove_role: 该角色正在使用中, 不能删除.
921 921
  error_can_not_delete_tracker: 该跟踪标签包含问题, 不能删除.
922
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/lv.yml (working copy)
892 892
  label_subtask_plural: Subtasks
893 893
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
894 894
  label_project_copy_notifications: Send email notifications during the project copy
895
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/pt.yml (working copy)
909 909
  error_unable_to_connect: Unable to connect ({{value}})
910 910
  error_can_not_remove_role: This role is in use and can not be deleted.
911 911
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
912
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/ca.yml (working copy)
894 894
  error_unable_to_connect: Unable to connect ({{value}})
895 895
  error_can_not_remove_role: This role is in use and can not be deleted.
896 896
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
897
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/pt-BR.yml (working copy)
925 925
  error_unable_to_connect: Não foi possível conectar ({{value}})
926 926
  error_can_not_remove_role: Este papel está em uso e não pode ser excluído.
927 927
  error_can_not_delete_tracker: Este tipo de tarefa está atribuído a alguma(s) tarefa(s) e não pode ser excluído.
928
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/tr.yml (working copy)
924 924
  error_unable_to_connect: Unable to connect ({{value}})
925 925
  error_can_not_remove_role: This role is in use and can not be deleted.
926 926
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
927
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/ru.yml (working copy)
1017 1017
  label_close_versions: Закрыть завершенные версии
1018 1018
  label_board_sticky: Прикреплена
1019 1019
  label_board_locked: Заблокирована
1020
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/id.yml (working copy)
909 909
  error_unable_to_connect: Unable to connect ({{value}})
910 910
  error_can_not_remove_role: This role is in use and can not be deleted.
911 911
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
912
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/el.yml (working copy)
897 897
  error_unable_to_connect: Unable to connect ({{value}})
898 898
  error_can_not_remove_role: This role is in use and can not be deleted.
899 899
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
900
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/en.yml (working copy)
336 336
  setting_start_of_week: Start calendars on
337 337
  setting_rest_api_enabled: Enable REST web service
338 338
  setting_cache_formatted_text: Cache formatted text
339
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
339 340
 permission_add_project: Create project
340 341
 permission_add_subprojects: Create subprojects
config/locales/gl.yml (working copy)
917 917
  error_unable_to_connect: Unable to connect ({{value}})
918 918
  error_can_not_remove_role: This role is in use and can not be deleted.
919 919
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
920
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/cs.yml (working copy)
897 897
  error_unable_to_connect: Unable to connect ({{value}})
898 898
  error_can_not_remove_role: This role is in use and can not be deleted.
899 899
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
900
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/es.yml (working copy)
941 941
  error_unable_to_connect: Unable to connect ({{value}})
942 942
  error_can_not_remove_role: This role is in use and can not be deleted.
943 943
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
944
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/eu.yml (working copy)
901 901
  error_unable_to_connect: Ezin da konektatu ({{value}})
902 902
  error_can_not_remove_role: Rol hau erabiltzen hari da eta ezin da ezabatu.
903 903
  error_can_not_delete_tracker: Aztarnari honek zereginak ditu eta ezin da ezabatu.
904
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/ko.yml (working copy)
957 957
  error_unable_to_connect: 연결할 수 없습니다(({{value}})
958 958
  error_can_not_remove_role: 이 역할은 현재 사용 중이이서 삭제할 수 없습니다.
959 959
  error_can_not_delete_tracker: 이 유형의 일감들이 있에서 삭제할 수 없습니다.
960
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/zh-TW.yml (working copy)
987 987
  enumeration_doc_categories: 文件分類
988 988
  enumeration_activities: 活動 (時間追蹤)
989 989
  enumeration_system_activity: 系統活動
990
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/mn.yml (working copy)
898 898
  error_unable_to_connect: Unable to connect ({{value}})
899 899
  error_can_not_remove_role: This role is in use and can not be deleted.
900 900
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
901
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/it.yml (working copy)
904 904
  error_unable_to_connect: Unable to connect ({{value}})
905 905
  error_can_not_remove_role: This role is in use and can not be deleted.
906 906
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
907
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/sk.yml (working copy)
896 896
  error_unable_to_connect: Nieje možné vymazať ({{value}})
897 897
  error_can_not_remove_role: Táto roľa sa používa a nemôže byť vymazaná.
898 898
  error_can_not_delete_tracker: Táto fronta obsahuje úlohy a nemôže byť vymazaná.
899
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/sl.yml (working copy)
896 896
  error_unable_to_connect: Unable to connect ({{value}})
897 897
  error_can_not_remove_role: This role is in use and can not be deleted.
898 898
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
899
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/uk.yml (working copy)
893 893
  error_unable_to_connect: Unable to connect ({{value}})
894 894
  error_can_not_remove_role: This role is in use and can not be deleted.
895 895
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
896
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/da.yml (working copy)
917 917
  error_unable_to_connect: Unable to connect ({{value}})
918 918
  error_can_not_remove_role: This role is in use and can not be deleted.
919 919
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
920
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/sr.yml (working copy)
898 898
  error_unable_delete_issue_status: Unable to delete issue status
899 899
  label_subtask_plural: Subtasks
900 900
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
901
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/de.yml (working copy)
914 914
  error_unable_to_connect: Unable to connect ({{value}})
915 915
  error_can_not_remove_role: This role is in use and can not be deleted.
916 916
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
917
  setting_display_member_projects_only: "Zeige in der Projektsprungbox nur Projekte, in denen ich Mitglied bin."
config/locales/bg.yml (working copy)
891 891
  error_unable_to_connect: Unable to connect ({{value}})
892 892
  error_can_not_remove_role: This role is in use and can not be deleted.
893 893
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
894
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/sv.yml (working copy)
946 946
  enumeration_doc_categories: Dokumentkategorier
947 947
  enumeration_activities: Aktiviteter (tidsuppföljning)
948 948
  enumeration_system_activity: Systemaktivitet
949
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/ja.yml (working copy)
926 926
  enumeration_doc_categories: 文書カテゴリ
927 927
  enumeration_activities: 作業分類 (時間トラッキング)
928 928
  enumeration_system_activity: システム作業分類
929
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/he.yml (working copy)
901 901
  label_subtask_plural: Subtasks
902 902
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
903 903
  label_project_copy_notifications: Send email notifications during the project copy
904
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/sr-CY.yml (working copy)
898 898
  error_unable_delete_issue_status: Unable to delete issue status
899 899
  label_subtask_plural: Subtasks
900 900
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
901
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/fi.yml (working copy)
927 927
  error_unable_to_connect: Unable to connect ({{value}})
928 928
  error_can_not_remove_role: This role is in use and can not be deleted.
929 929
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
930
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/bs.yml (working copy)
915 915
  error_unable_to_connect: Unable to connect ({{value}})
916 916
  error_can_not_remove_role: This role is in use and can not be deleted.
917 917
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
918
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/fr.yml (working copy)
920 920
  error_unable_to_connect: Unable to connect ({{value}})
921 921
  error_can_not_remove_role: This role is in use and can not be deleted.
922 922
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
923
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/nl.yml (working copy)
879 879
  error_unable_to_connect: Unable to connect ({{value}})
880 880
  error_can_not_remove_role: This role is in use and can not be deleted.
881 881
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
882
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/hr.yml (working copy)
904 904
  error_unable_to_connect: Unable to connect ({{value}})
905 905
  error_can_not_remove_role: This role is in use and can not be deleted.
906 906
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
907
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/pl.yml (working copy)
922 922
  error_unable_to_connect: Unable to connect ({{value}})
923 923
  error_can_not_remove_role: This role is in use and can not be deleted.
924 924
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
925
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/th.yml (working copy)
894 894
  error_unable_to_connect: Unable to connect ({{value}})
895 895
  error_can_not_remove_role: This role is in use and can not be deleted.
896 896
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
897
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/no.yml (working copy)
892 892
  error_unable_to_connect: Unable to connect ({{value}})
893 893
  error_can_not_remove_role: This role is in use and can not be deleted.
894 894
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
895
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/hu.yml (working copy)
924 924
  label_subtask_plural: Subtasks
925 925
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
926 926
  label_project_copy_notifications: Send email notifications during the project copy
927
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
config/locales/vi.yml (working copy)
956 956
  error_unable_to_connect: Unable to connect ({{value}})
957 957
  error_can_not_remove_role: This role is in use and can not be deleted.
958 958
  error_can_not_delete_tracker: This tracker contains issues and can't be deleted.
959
  setting_display_member_projects_only: Display only projects I'm member of in the project jump box.
(1-1/2)