From: Jean-Philippe Lang Date: Mon, 21 Feb 2011 13:34:33 +0000 (+0000) Subject: Splits private/public issue queries in the sidebar (#1067). X-Git-Tag: 1.2.0~915 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0efc783a7e4be71447da94b149e1b8a5196f001f;p=redmine.git Splits private/public issue queries in the sidebar (#1067). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4908 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index ce23668ef..38cc52fee 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -106,13 +106,29 @@ module IssuesHelper # Project specific queries and global queries visible << (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id]) @sidebar_queries = Query.find(:all, - :select => 'id, name', + :select => 'id, name, is_public', :order => "name ASC", :conditions => visible.conditions) end @sidebar_queries end + def query_links(title, queries) + content_tag('h3', title) + + queries.collect {|query| + link_to(h(query.name), :controller => 'issues', :action => 'index', :project_id => @project, :query_id => query) + }.join('
') + end + + def render_sidebar_queries + out = '' + queries = sidebar_queries.select {|q| !q.is_public?} + out << query_links(l(:label_my_queries), queries) if queries.any? + queries = sidebar_queries.select {|q| q.is_public?} + out << query_links(l(:label_query_plural), queries) if queries.any? + out + end + def show_detail(detail, no_html=false) case detail.property when 'attr' diff --git a/app/views/issues/_sidebar.rhtml b/app/views/issues/_sidebar.rhtml index db85f97b9..6de1c2d67 100644 --- a/app/views/issues/_sidebar.rhtml +++ b/app/views/issues/_sidebar.rhtml @@ -13,11 +13,5 @@ <% end %> <%= call_hook(:view_issues_sidebar_planning_bottom) %> -<% unless sidebar_queries.empty? -%> -

<%= l(:label_query_plural) %>

- -<% sidebar_queries.each do |query| -%> -<%= link_to(h(query.name), :controller => 'issues', :action => 'index', :project_id => @project, :query_id => query) %>
-<% end -%> +<%= render_sidebar_queries %> <%= call_hook(:view_issues_sidebar_queries_bottom) %> -<% end -%> diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 32463d1f5..2d235a1ef 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -938,3 +938,4 @@ bg: field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/bs.yml b/config/locales/bs.yml index 8baeacc67..0578d7e1b 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -952,3 +952,4 @@ bs: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 6dd79277a..f23b2f915 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -941,3 +941,4 @@ ca: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/cs.yml b/config/locales/cs.yml index c414b973c..c1ab4353d 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -942,3 +942,4 @@ cs: field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/da.yml b/config/locales/da.yml index 7767366b9..f7b432017 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -954,3 +954,4 @@ da: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/de.yml b/config/locales/de.yml index 7919f2e89..239ed6e35 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -955,3 +955,4 @@ de: setting_gantt_items_limit: Maximale Anzahl von Aufgaben die im Gantt-Chart angezeigt werden. field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/el.yml b/config/locales/el.yml index d0529c0e6..8517d8c18 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -938,3 +938,4 @@ el: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index 58a00eb39..eca63257f 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -942,3 +942,4 @@ en-GB: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/en.yml b/config/locales/en.yml index 1757c1517..40ecbeed5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -595,6 +595,7 @@ en: label_query: Custom query label_query_plural: Custom queries label_query_new: New query + label_my_queries: My custom queries label_filter_add: Add filter label_filter_plural: Filters label_equals: is diff --git a/config/locales/es.yml b/config/locales/es.yml index fac244c1a..748885198 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -975,3 +975,4 @@ es: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/eu.yml b/config/locales/eu.yml index f84bb83cc..d19b5bb92 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -942,3 +942,4 @@ eu: setting_gantt_items_limit: "Gantt grafikoan bistara daitekeen elementu kopuru maximoa" field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/fa.yml b/config/locales/fa.yml index f46358751..03186b779 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -941,3 +941,4 @@ fa: text_tip_issue_begin_end_day: issue beginning and ending this day text_tip_issue_end_day: issue ending this day text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 826794e26..1d991de4f 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -959,3 +959,4 @@ fi: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/fr.yml b/config/locales/fr.yml index aa5815a2f..112fe5a44 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -597,6 +597,7 @@ fr: label_query: Rapport personnalisé label_query_plural: Rapports personnalisés label_query_new: Nouveau rapport + label_my_queries: Mes rapports personnalisés label_filter_add: "Ajouter le filtre " label_filter_plural: Filtres label_equals: égal diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 205f8e56b..22a26bc4b 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -950,3 +950,4 @@ gl: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/he.yml b/config/locales/he.yml index 7a94cc903..35d1839fc 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -943,3 +943,4 @@ he: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/hr.yml b/config/locales/hr.yml index d733b038f..a90ab8d30 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -945,3 +945,4 @@ hr: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/hu.yml b/config/locales/hu.yml index eb518165d..2fbf903ba 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -957,3 +957,4 @@ setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/id.yml b/config/locales/id.yml index 0cd9407ff..2e7caafd1 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -946,3 +946,4 @@ id: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/it.yml b/config/locales/it.yml index f3ab5dd9a..ae3701886 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -939,3 +939,4 @@ it: setting_gantt_items_limit: Massimo numero di oggetti da visualizzare sul diagramma di gantt field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 53eacb54d..054425ca3 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -959,3 +959,4 @@ ja: enumeration_system_activity: システム作業分類 field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 56edb5b26..7a3424981 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -990,3 +990,4 @@ ko: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/lt.yml b/config/locales/lt.yml index c5b2c6f2c..434b245f2 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -998,3 +998,4 @@ lt: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/lv.yml b/config/locales/lv.yml index 6830f4470..a87ed2995 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -933,3 +933,4 @@ lv: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/mk.yml b/config/locales/mk.yml index 0d7d6f7af..8ed595a97 100644 --- a/config/locales/mk.yml +++ b/config/locales/mk.yml @@ -938,3 +938,4 @@ mk: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/mn.yml b/config/locales/mn.yml index 761d377dc..39c026dc7 100644 --- a/config/locales/mn.yml +++ b/config/locales/mn.yml @@ -939,3 +939,4 @@ mn: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 9cf61d96d..7f3187943 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -920,3 +920,4 @@ nl: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/no.yml b/config/locales/no.yml index a6d1abf29..469d35ce5 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -925,3 +925,4 @@ setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/pl.yml b/config/locales/pl.yml index ffc845416..3f5ad5443 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -955,3 +955,4 @@ pl: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index c05a200b3..380fda7c6 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -958,3 +958,4 @@ pt-BR: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/pt.yml b/config/locales/pt.yml index fc9eea93b..4fb8c4c82 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -942,3 +942,4 @@ pt: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/ro.yml b/config/locales/ro.yml index f20560744..1fe23b685 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -931,3 +931,4 @@ ro: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 723ed15b3..ef6f7a987 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1051,3 +1051,4 @@ ru: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 20c1c2c60..501a126d4 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -933,3 +933,4 @@ sk: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/sl.yml b/config/locales/sl.yml index f44955a4d..f2e5ae499 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -934,3 +934,4 @@ sl: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/sr-YU.yml b/config/locales/sr-YU.yml index 90e103c15..dcbed4733 100644 --- a/config/locales/sr-YU.yml +++ b/config/locales/sr-YU.yml @@ -938,3 +938,4 @@ sr-YU: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/sr.yml b/config/locales/sr.yml index dc77f570d..b0168d7e3 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -939,3 +939,4 @@ sr: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 253e6197d..a51816fa7 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -979,3 +979,4 @@ sv: enumeration_system_activity: Systemaktivitet field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/th.yml b/config/locales/th.yml index bf22d43fe..6e38631a4 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -935,3 +935,4 @@ th: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 5cc0d475f..5a0b040b8 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -957,3 +957,4 @@ tr: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 443efc8da..f81d58fa1 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -934,3 +934,4 @@ uk: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/vi.yml b/config/locales/vi.yml index eec1e192d..bd6e78a09 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -989,3 +989,4 @@ vi: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index bcb1b6295..04aa72e2e 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1019,3 +1019,4 @@ enumeration_system_activity: 系統活動 field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries diff --git a/config/locales/zh.yml b/config/locales/zh.yml index b0c3dc01f..a677d5590 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -952,3 +952,4 @@ zh: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart field_warn_on_leaving_unsaved: Warn me when leaving a page with unsaved text text_warn_on_leaving_unsaved: The current page contains unsaved text that will be lost if you leave this page. + label_my_queries: My custom queries