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
This commit is contained in:
Jean-Philippe Lang 2011-02-21 13:34:33 +00:00 committed by Eric Davis
parent 0e39c0e550
commit 886c3e295b
45 changed files with 61 additions and 8 deletions

View File

@ -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('<br />')
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'

View File

@ -13,11 +13,5 @@
<% end %>
<%= call_hook(:view_issues_sidebar_planning_bottom) %>
<% unless sidebar_queries.empty? -%>
<h3><%= l(:label_query_plural) %></h3>
<% sidebar_queries.each do |query| -%>
<%= link_to(h(query.name), :controller => 'issues', :action => 'index', :project_id => @project, :query_id => query) %><br />
<% end -%>
<%= render_sidebar_queries %>
<%= call_hook(:view_issues_sidebar_queries_bottom) %>
<% end -%>

View File

@ -945,3 +945,4 @@ bg:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -959,3 +959,4 @@ bs:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -948,3 +948,4 @@ ca:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -1169,3 +1169,4 @@ cs:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -961,3 +961,4 @@ da:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -962,3 +962,4 @@ de:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -945,3 +945,4 @@ el:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -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

View File

@ -982,3 +982,4 @@ es:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -949,3 +949,4 @@ eu:
setting_commit_logtime_enabled: "Erregistrutako denbora gaitu"
notice_gantt_chart_truncated: Grafikoa moztu da bistara daitekeen elementuen kopuru maximoa gainditu delako (%{max})
setting_gantt_items_limit: "Gantt grafikoan bistara daitekeen elementu kopuru maximoa"
label_my_queries: My custom queries

View File

@ -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

View File

@ -966,3 +966,4 @@ fi:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -596,6 +596,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

View File

@ -957,3 +957,4 @@ gl:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -950,3 +950,4 @@ he:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -952,3 +952,4 @@ hr:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -964,3 +964,4 @@
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -953,3 +953,4 @@ id:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -946,3 +946,4 @@ it:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -966,3 +966,4 @@ ja:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -997,3 +997,4 @@ ko:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -1005,3 +1005,4 @@ lt:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -940,3 +940,4 @@ lv:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -945,3 +945,4 @@ mk:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -946,3 +946,4 @@ mn:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -927,3 +927,4 @@ nl:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -932,3 +932,4 @@
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -962,3 +962,4 @@ pl:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -965,3 +965,4 @@ pt-BR:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -949,3 +949,4 @@ pt:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -938,3 +938,4 @@ ro:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -1058,3 +1058,4 @@ ru:
label_cvs_path: CVSROOT
label_git_path: Путь к каталогу .git
label_mercurial_path: Каталог
label_my_queries: My custom queries

View File

@ -940,3 +940,4 @@ sk:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -941,3 +941,4 @@ sl:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -945,3 +945,4 @@ sr-YU:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -946,3 +946,4 @@ sr:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -986,3 +986,4 @@ sv:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -942,3 +942,4 @@ th:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -964,3 +964,4 @@ tr:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -941,3 +941,4 @@ uk:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -996,3 +996,4 @@ vi:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -1026,3 +1026,4 @@
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries

View File

@ -959,3 +959,4 @@ zh:
label_cvs_path: CVSROOT
label_git_path: Path to .git directory
label_mercurial_path: Root directory
label_my_queries: My custom queries