diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-18 08:36:52 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-18 08:36:52 +0000 |
commit | ea26846b81babd4ee9cda1c2baf1cedc77439161 (patch) | |
tree | e134a7dab01f1cee6ceeccfd42c1c4fcef1dfd34 /app | |
parent | e7400dfbba3eb0ea2b0483852939bf7c7f9920d6 (diff) | |
download | redmine-ea26846b81babd4ee9cda1c2baf1cedc77439161.tar.gz redmine-ea26846b81babd4ee9cda1c2baf1cedc77439161.zip |
Load queries from the helper.
git-svn-id: http://svn.redmine.org/redmine/trunk@16416 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/my_helper.rb | 3 | ||||
-rw-r--r-- | app/views/my/blocks/_issue_query_selection.html.erb | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/app/helpers/my_helper.rb b/app/helpers/my_helper.rb index e49afc21b..c16fe09f9 100644 --- a/app/helpers/my_helper.rb +++ b/app/helpers/my_helper.rb @@ -132,7 +132,8 @@ module MyHelper issues = query.issues(:limit => 10) render :partial => 'my/blocks/issues', :locals => {:query => query, :issues => issues, :block => block, :settings => settings} else - render :partial => 'my/blocks/issue_query_selection', :locals => {:block => block, :settings => settings} + queries = IssueQuery.visible.sorted + render :partial => 'my/blocks/issue_query_selection', :locals => {:queries => queries, :block => block, :settings => settings} end end diff --git a/app/views/my/blocks/_issue_query_selection.html.erb b/app/views/my/blocks/_issue_query_selection.html.erb index 64a3f32af..640f049b0 100644 --- a/app/views/my/blocks/_issue_query_selection.html.erb +++ b/app/views/my/blocks/_issue_query_selection.html.erb @@ -1,5 +1,3 @@ -<% visible_queries = IssueQuery.visible.sorted %> - <h3> <%= l(:label_issue_plural) %> </h3> @@ -10,7 +8,7 @@ <p> <label> <%= l(:label_query) %> - <%= select_tag "settings[#{block}][query_id]", content_tag("option") + options_from_collection_for_select(visible_queries, :id, :name, settings[:query_id]) %> + <%= select_tag "settings[#{block}][query_id]", content_tag("option") + options_from_collection_for_select(queries, :id, :name, settings[:query_id]) %> </label> </p> </div> |