From 324d694cfba785ef9e0f5d6546fd7d59b068af5b Mon Sep 17 00:00:00 2001 From: ccinti Date: Wed, 19 Feb 2025 10:39:56 +0100 Subject: [PATCH 1/2] Uses deface instead of overriding core view --- Gemfile | 1 + ...w_issues_index_header_hook.html.erb.deface | 1 + ...w_issues_index_header_hook.html.erb.deface | 2 + ...sues_index_contextual_hook.html.erb.deface | 1 + ...sues_index_contextual_hook.html.erb.deface | 2 + app/views/issues/index.html.erb | 100 ------------------ .../_issues_index_header_tags.html.haml | 3 - .../_link_to_plain_view.html.haml | 1 - .../issues_trees/_link_to_tree_view.html.haml | 1 - app/views/issues_trees/_query_form.html.erb | 82 -------------- app/views/issues_trees/_tree_list.html.erb | 33 ------ app/views/issues_trees/_tree_node.html.erb | 27 ----- .../issues_trees/tree_children.html.haml | 5 - app/views/issues_trees/tree_index.html.erb | 64 ----------- .../settings/_redmine_issues_tree.html.haml | 10 -- init.rb | 4 + 16 files changed, 11 insertions(+), 326 deletions(-) create mode 100644 app/overrides/issues/index/0-remove_view_issues_index_header_hook.html.erb.deface create mode 100644 app/overrides/issues/index/1-add_view_issues_index_header_hook.html.erb.deface create mode 100644 app/overrides/issues/index/2-remove_view_issues_index_contextual_hook.html.erb.deface create mode 100644 app/overrides/issues/index/3-add_view_issues_index_contextual_hook.html.erb.deface delete mode 100644 app/views/issues/index.html.erb delete mode 100644 app/views/issues_trees/_issues_index_header_tags.html.haml delete mode 100644 app/views/issues_trees/_link_to_plain_view.html.haml delete mode 100644 app/views/issues_trees/_link_to_tree_view.html.haml delete mode 100644 app/views/issues_trees/_query_form.html.erb delete mode 100644 app/views/issues_trees/_tree_list.html.erb delete mode 100644 app/views/issues_trees/_tree_node.html.erb delete mode 100644 app/views/issues_trees/tree_children.html.haml delete mode 100644 app/views/issues_trees/tree_index.html.erb delete mode 100644 app/views/settings/_redmine_issues_tree.html.haml diff --git a/Gemfile b/Gemfile index 1c9337f..01f7dc9 100644 --- a/Gemfile +++ b/Gemfile @@ -1 +1,2 @@ gem 'haml-rails' +gem 'deface' diff --git a/app/overrides/issues/index/0-remove_view_issues_index_header_hook.html.erb.deface b/app/overrides/issues/index/0-remove_view_issues_index_header_hook.html.erb.deface new file mode 100644 index 0000000..ee4c3a4 --- /dev/null +++ b/app/overrides/issues/index/0-remove_view_issues_index_header_hook.html.erb.deface @@ -0,0 +1 @@ + diff --git a/app/overrides/issues/index/1-add_view_issues_index_header_hook.html.erb.deface b/app/overrides/issues/index/1-add_view_issues_index_header_hook.html.erb.deface new file mode 100644 index 0000000..edcb305 --- /dev/null +++ b/app/overrides/issues/index/1-add_view_issues_index_header_hook.html.erb.deface @@ -0,0 +1,2 @@ + +<%= call_hook(:view_issues_index_header, {issues: @issues, project: @project, query: @query}) %> diff --git a/app/overrides/issues/index/2-remove_view_issues_index_contextual_hook.html.erb.deface b/app/overrides/issues/index/2-remove_view_issues_index_contextual_hook.html.erb.deface new file mode 100644 index 0000000..38c38a3 --- /dev/null +++ b/app/overrides/issues/index/2-remove_view_issues_index_contextual_hook.html.erb.deface @@ -0,0 +1 @@ + diff --git a/app/overrides/issues/index/3-add_view_issues_index_contextual_hook.html.erb.deface b/app/overrides/issues/index/3-add_view_issues_index_contextual_hook.html.erb.deface new file mode 100644 index 0000000..48d4f1c --- /dev/null +++ b/app/overrides/issues/index/3-add_view_issues_index_contextual_hook.html.erb.deface @@ -0,0 +1,2 @@ + +<%= call_hook(:view_issues_index_contextual, {issues: @issues, project: @project, query: @query}) %> \ No newline at end of file diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb deleted file mode 100644 index c2c11ca..0000000 --- a/app/views/issues/index.html.erb +++ /dev/null @@ -1,100 +0,0 @@ -<%# issues_tree patch %> -<%= call_hook(:view_issues_index_header, {issues: @issues, project: @project, query: @query}) %> -<%# end patch %> - -
- <% if User.current.allowed_to?(:add_issues, @project, :global => true) && (@project.nil? || Issue.allowed_target_trackers(@project).any?) %> - <%= link_to l(:label_issue_new), _new_project_issue_path(@project), :class => 'icon icon-add new-issue' %> - <% end %> - <%= actions_dropdown do %> - <% if @project %> - <%= link_to l(:field_summary), project_issues_report_path(@project), :class => 'icon icon-stats' %> - <% end %> - - <% if User.current.allowed_to?(:import_issues, @project, :global => true) %> - <%= link_to l(:button_import), new_issues_import_path(:project_id => @project), :class => 'icon icon-import' %> - <% end %> - - <%= link_to_if_authorized l(:label_settings), - {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'issues'}, - :class => 'icon icon-settings' if User.current.allowed_to?(:edit_project, @project) %> - <% end %> - - <%# issues_tree patch %> - <%= call_hook(:view_issues_index_contextual, {issues: @issues, project: @project, query: @query}) %> - <%# end patch %> -
- -

<%= @query.new_record? ? l(:label_issue_plural) : @query.name %>

-<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> - -<%= form_tag(_project_issues_path(@project), :method => :get, :id => 'query_form') do %> - <%= render :partial => 'queries/query_form' %> -<% end %> - -<% if @query.valid? %> -<% if @issues.empty? %> -

<%= l(:label_no_data) %>

-<% else %> -<%= render_query_totals(@query) %> -<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %> -<%= pagination_links_full @issue_pages, @issue_count %> -<% end %> - -<% other_formats_links do |f| %> - <%= f.link_to_with_query_parameters 'Atom', :key => User.current.atom_key %> - <%= f.link_to_with_query_parameters 'CSV', {}, :onclick => "showModal('csv-export-options', '350px'); return false;" %> - <%= f.link_to_with_query_parameters 'PDF' %> -<% end %> - - - -<% end %> -<%= call_hook(:view_issues_index_bottom, { :issues => @issues, :project => @project, :query => @query }) %> - -<% content_for :sidebar do %> - <%= render :partial => 'issues/sidebar' %> -<% end %> - -<% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, - {:query_id => @query, :format => 'atom', - :page => nil, :key => User.current.atom_key}, - :title => l(:label_issue_plural)) %> - <%= auto_discovery_link_tag(:atom, - {:controller => 'journals', :action => 'index', - :query_id => @query, :format => 'atom', - :page => nil, :key => User.current.atom_key}, - :title => l(:label_changes_details)) %> -<% end %> - -<%= context_menu %> diff --git a/app/views/issues_trees/_issues_index_header_tags.html.haml b/app/views/issues_trees/_issues_index_header_tags.html.haml deleted file mode 100644 index a3601fc..0000000 --- a/app/views/issues_trees/_issues_index_header_tags.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- content_for :header_tags do - = stylesheet_link_tag 'custom_issues.css', plugin: :redmine_issues_tree - = javascript_include_tag 'tree.helper.js', plugin: :redmine_issues_tree \ No newline at end of file diff --git a/app/views/issues_trees/_link_to_plain_view.html.haml b/app/views/issues_trees/_link_to_plain_view.html.haml deleted file mode 100644 index 16ddf9f..0000000 --- a/app/views/issues_trees/_link_to_plain_view.html.haml +++ /dev/null @@ -1 +0,0 @@ -= link_to_plain_view \ No newline at end of file diff --git a/app/views/issues_trees/_link_to_tree_view.html.haml b/app/views/issues_trees/_link_to_tree_view.html.haml deleted file mode 100644 index d21d764..0000000 --- a/app/views/issues_trees/_link_to_tree_view.html.haml +++ /dev/null @@ -1 +0,0 @@ -= link_to_tree_view \ No newline at end of file diff --git a/app/views/issues_trees/_query_form.html.erb b/app/views/issues_trees/_query_form.html.erb deleted file mode 100644 index 0416290..0000000 --- a/app/views/issues_trees/_query_form.html.erb +++ /dev/null @@ -1,82 +0,0 @@ -<%= hidden_field_tag 'set_filter', '1' %> -<%= hidden_field_tag 'type', @query.type, :disabled => true, :id => 'query_type' %> -<%= query_hidden_sort_tag(@query) %> - -
-
-
"> - "><%= l(:label_filter_plural) %> -
"> - <%= render :partial => 'queries/filters', :locals => {:query => @query} %> -
-
- - <% if @query.available_columns.any? %> - - <% end %> -
- -

- <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %> - <%= link_to l(:button_clear), { :set_filter => 1, :sort => '', :project_id => @project }, :class => 'icon icon-reload' %> - <% if @query.new_record? %> - <% if User.current.allowed_to?(:save_queries, @project, :global => true) %> - <%= link_to_function l(:button_save_object, object_name: l(:label_query).downcase), - "$('#query_type').prop('disabled',false);$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit()", - :class => 'icon icon-save' %> - <% end %> - <% else %> - <% if @query.editable_by?(User.current) %> - <%= link_to l(:button_edit_object, object_name: l(:label_query).downcase), edit_query_path(@query), :class => 'icon icon-edit' %> - <%= delete_link query_path(@query), {}, l(:button_delete_object, object_name: l(:label_query).downcase) %> - <% end %> - <% end %> -

-
- -<%= error_messages_for @query %> - -<%= javascript_tag do %> -$(function ($) { - $('input[name=display_type]').change(function (e) { - if ($("#display_type_list").is(':checked')) { - $('table#list-definition').show(); - } else { - $('table#list-definition').hide(); - } - - }) -}); - -<% end %> diff --git a/app/views/issues_trees/_tree_list.html.erb b/app/views/issues_trees/_tree_list.html.erb deleted file mode 100644 index 4e92a07..0000000 --- a/app/views/issues_trees/_tree_list.html.erb +++ /dev/null @@ -1,33 +0,0 @@ -<% tree_id = 'issues-tree' %> -<% query_options = nil unless defined?(query_options) %> -<% query_options ||= {} %> - -
- "> - "> -
- -<%= form_tag({}, :data => {:cm_url => issues_context_menu_path}) do -%> -<%= hidden_field_tag 'back_url', url_for(:params => request.query_parameters), :id => nil %> -
- - - - - <% query.inline_columns.each do |column| %> - <%= column_header(query, column, query_options) %> - <% end %> - - - - - <% issues.each do |issue| %> - <%= render partial: 'tree_node', :locals => {:issue => issue, :query => query, :issues_ids => issues_ids} %> - <% end %> - -
- <%= check_box_tag 'check_all', '', false, :class => 'toggle-selection', - :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %> -
-
-<% end -%> diff --git a/app/views/issues_trees/_tree_node.html.erb b/app/views/issues_trees/_tree_node.html.erb deleted file mode 100644 index b410a77..0000000 --- a/app/views/issues_trees/_tree_node.html.erb +++ /dev/null @@ -1,27 +0,0 @@ - - <%= check_box_tag("ids[]", issue.id, false, :id => nil) %> - <%= link_to issue.to_param, controller: 'issues', action: 'show', id: issue %> - <% # @note: exclude :issue_id column for compatibility with 'issue_id' plugin %> - <% query.inline_columns.reject { |c| %i(id issue_id).include?(c.name) }.each do |column| %> - <%= content_tag('td', column_content(column, issue), :class => column.css_classes) %> - <% end %> - <%= link_to_context_menu %> - -<% query.block_columns.each do |column| - if (text = column_content(column, issue)) && text.present? -%> - - - <% if query.block_columns.count > 1 %> - <%= column.caption %> - <% end %> - <%= text %> - - - <% end -%> -<% end -%> diff --git a/app/views/issues_trees/tree_children.html.haml b/app/views/issues_trees/tree_children.html.haml deleted file mode 100644 index 28d9c8b..0000000 --- a/app/views/issues_trees/tree_children.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -- @issues.each do |issue| - = render partial: 'tree_node', - locals: {issue: issue, - query: @query, - issues_ids: @issues_ids} \ No newline at end of file diff --git a/app/views/issues_trees/tree_index.html.erb b/app/views/issues_trees/tree_index.html.erb deleted file mode 100644 index 19991ce..0000000 --- a/app/views/issues_trees/tree_index.html.erb +++ /dev/null @@ -1,64 +0,0 @@ -<% content_for :header_tags do %> - <%= stylesheet_link_tag 'jquery.treetable.theme.default.css', plugin: :redmine_issues_tree %> - <%= stylesheet_link_tag 'jquery.treetable.css', plugin: :redmine_issues_tree %> - <%= stylesheet_link_tag 'custom_issues.css', plugin: :redmine_issues_tree %> - - <%= javascript_include_tag 'custom.jquery.treetable.js', plugin: :redmine_issues_tree %> - <%= javascript_include_tag 'tree.issues.initializer.js', plugin: :redmine_issues_tree %> -<% end %> - -
- <% if User.current.allowed_to?(:add_issues, @project, :global => true) && (@project.nil? || Issue.allowed_target_trackers(@project).any?) %> - <%= link_to l(:label_issue_new), _new_project_issue_path(@project), :class => 'icon icon-add new-issue' %> - <% end %> - <%= actions_dropdown do %> - <% if @project %> - <%= link_to l(:field_summary), project_issues_report_path(@project), :class => 'icon icon-stats' %> - <% end %> - - <% if User.current.allowed_to?(:import_issues, @project, :global => true) %> - <%= link_to l(:button_import), new_issues_import_path(:project_id => @project), :class => 'icon icon-import' %> - <% end %> - - <%= link_to_if_authorized l(:label_settings), - {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'issues'}, - :class => 'icon icon-settings' if User.current.allowed_to?(:manage_categories, @project) %> - <% end %> - - <%# issues_tree patch %> - <%= call_hook(:view_issues_tree_index_contextual, {issues: @issues, project: @project, query: @query}) %> - <%# end patch %> -
- -

<%= @query.new_record? ? l(:label_issue_plural) : @query.name %>

-<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> - -<%= form_tag({controller: :issues_trees, - action: :tree_index, - project_id: @project}, - method: :get, - id: 'query_form', - class: 'issues-tree-index-form', - data: @tree_data) do %> - <%= render :partial => 'issues_trees/query_form' %> -<% end %> - -<% if @query.valid? %> -<% if @issues.empty? %> -

<%= l(:label_no_data) %>

-<% else %> -<%= render_query_totals(@query) %> -<%= render :partial => 'issues_trees/tree_list', :locals => {:issues => @issues, :query => @query, :issues_ids => @issues_ids} %> -<%# No pagination for tree %> -<% end %> - -<% end %> -<%= call_hook(:view_issues_index_bottom, { :issues => @issues, :project => @project, :query => @query }) %> - -<%# No export links (ATOM, csv, etc) for tree %> - -<% content_for :sidebar do %> - <%= render :partial => 'issues/sidebar' %> -<% end %> - -<%= context_menu %> diff --git a/app/views/settings/_redmine_issues_tree.html.haml b/app/views/settings/_redmine_issues_tree.html.haml deleted file mode 100644 index 044639c..0000000 --- a/app/views/settings/_redmine_issues_tree.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -%p - %label - = l(:'issues_tree.settings.default_redirect_to_tree_view') - = hidden_field_tag 'settings[default_redirect_to_tree_view]', false - = check_box_tag 'settings[default_redirect_to_tree_view]', true, @settings['default_redirect_to_tree_view'] == 'true' -%p - %label - = l(:'issues_tree.settings.default_redirect_to_tree_view_without_project') - = hidden_field_tag 'settings[default_redirect_to_tree_view_without_project]', false - = check_box_tag 'settings[default_redirect_to_tree_view_without_project]', true, @settings['default_redirect_to_tree_view_without_project'] == 'true' diff --git a/init.rb b/init.rb index 4129a33..bbb7c66 100644 --- a/init.rb +++ b/init.rb @@ -26,3 +26,7 @@ push('issues_trees/tree_index'). push('issues_trees/redirect_with_params'). push('issues_trees/tree_children') + +# Add deface overrides files path. +Rails.application.paths["app/overrides"] ||= [] +Rails.application.paths["app/overrides"] << File.expand_path("../app/overrides", __FILE__) From 28ca5adb2a04b6b8adee248aacb7a2167ef0deef Mon Sep 17 00:00:00 2001 From: ccinti Date: Wed, 19 Feb 2025 10:44:56 +0100 Subject: [PATCH 2/2] Added incorrectly removed files --- .../_issues_index_header_tags.html.haml | 3 + .../_link_to_plain_view.html.haml | 1 + .../issues_trees/_link_to_tree_view.html.haml | 1 + app/views/issues_trees/_query_form.html.erb | 82 +++++++++++++++++++ app/views/issues_trees/_tree_list.html.erb | 33 ++++++++ app/views/issues_trees/_tree_node.html.erb | 27 ++++++ .../issues_trees/tree_children.html.haml | 5 ++ app/views/issues_trees/tree_index.html.erb | 64 +++++++++++++++ .../settings/_redmine_issues_tree.html.haml | 10 +++ 9 files changed, 226 insertions(+) create mode 100644 app/views/issues_trees/_issues_index_header_tags.html.haml create mode 100644 app/views/issues_trees/_link_to_plain_view.html.haml create mode 100644 app/views/issues_trees/_link_to_tree_view.html.haml create mode 100644 app/views/issues_trees/_query_form.html.erb create mode 100644 app/views/issues_trees/_tree_list.html.erb create mode 100644 app/views/issues_trees/_tree_node.html.erb create mode 100644 app/views/issues_trees/tree_children.html.haml create mode 100644 app/views/issues_trees/tree_index.html.erb create mode 100644 app/views/settings/_redmine_issues_tree.html.haml diff --git a/app/views/issues_trees/_issues_index_header_tags.html.haml b/app/views/issues_trees/_issues_index_header_tags.html.haml new file mode 100644 index 0000000..a3601fc --- /dev/null +++ b/app/views/issues_trees/_issues_index_header_tags.html.haml @@ -0,0 +1,3 @@ +- content_for :header_tags do + = stylesheet_link_tag 'custom_issues.css', plugin: :redmine_issues_tree + = javascript_include_tag 'tree.helper.js', plugin: :redmine_issues_tree \ No newline at end of file diff --git a/app/views/issues_trees/_link_to_plain_view.html.haml b/app/views/issues_trees/_link_to_plain_view.html.haml new file mode 100644 index 0000000..16ddf9f --- /dev/null +++ b/app/views/issues_trees/_link_to_plain_view.html.haml @@ -0,0 +1 @@ += link_to_plain_view \ No newline at end of file diff --git a/app/views/issues_trees/_link_to_tree_view.html.haml b/app/views/issues_trees/_link_to_tree_view.html.haml new file mode 100644 index 0000000..d21d764 --- /dev/null +++ b/app/views/issues_trees/_link_to_tree_view.html.haml @@ -0,0 +1 @@ += link_to_tree_view \ No newline at end of file diff --git a/app/views/issues_trees/_query_form.html.erb b/app/views/issues_trees/_query_form.html.erb new file mode 100644 index 0000000..0416290 --- /dev/null +++ b/app/views/issues_trees/_query_form.html.erb @@ -0,0 +1,82 @@ +<%= hidden_field_tag 'set_filter', '1' %> +<%= hidden_field_tag 'type', @query.type, :disabled => true, :id => 'query_type' %> +<%= query_hidden_sort_tag(@query) %> + +
+
+
"> + "><%= l(:label_filter_plural) %> +
"> + <%= render :partial => 'queries/filters', :locals => {:query => @query} %> +
+
+ + <% if @query.available_columns.any? %> + + <% end %> +
+ +

+ <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %> + <%= link_to l(:button_clear), { :set_filter => 1, :sort => '', :project_id => @project }, :class => 'icon icon-reload' %> + <% if @query.new_record? %> + <% if User.current.allowed_to?(:save_queries, @project, :global => true) %> + <%= link_to_function l(:button_save_object, object_name: l(:label_query).downcase), + "$('#query_type').prop('disabled',false);$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit()", + :class => 'icon icon-save' %> + <% end %> + <% else %> + <% if @query.editable_by?(User.current) %> + <%= link_to l(:button_edit_object, object_name: l(:label_query).downcase), edit_query_path(@query), :class => 'icon icon-edit' %> + <%= delete_link query_path(@query), {}, l(:button_delete_object, object_name: l(:label_query).downcase) %> + <% end %> + <% end %> +

+
+ +<%= error_messages_for @query %> + +<%= javascript_tag do %> +$(function ($) { + $('input[name=display_type]').change(function (e) { + if ($("#display_type_list").is(':checked')) { + $('table#list-definition').show(); + } else { + $('table#list-definition').hide(); + } + + }) +}); + +<% end %> diff --git a/app/views/issues_trees/_tree_list.html.erb b/app/views/issues_trees/_tree_list.html.erb new file mode 100644 index 0000000..4e92a07 --- /dev/null +++ b/app/views/issues_trees/_tree_list.html.erb @@ -0,0 +1,33 @@ +<% tree_id = 'issues-tree' %> +<% query_options = nil unless defined?(query_options) %> +<% query_options ||= {} %> + +
+ "> + "> +
+ +<%= form_tag({}, :data => {:cm_url => issues_context_menu_path}) do -%> +<%= hidden_field_tag 'back_url', url_for(:params => request.query_parameters), :id => nil %> +
+ + + + + <% query.inline_columns.each do |column| %> + <%= column_header(query, column, query_options) %> + <% end %> + + + + + <% issues.each do |issue| %> + <%= render partial: 'tree_node', :locals => {:issue => issue, :query => query, :issues_ids => issues_ids} %> + <% end %> + +
+ <%= check_box_tag 'check_all', '', false, :class => 'toggle-selection', + :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %> +
+
+<% end -%> diff --git a/app/views/issues_trees/_tree_node.html.erb b/app/views/issues_trees/_tree_node.html.erb new file mode 100644 index 0000000..b410a77 --- /dev/null +++ b/app/views/issues_trees/_tree_node.html.erb @@ -0,0 +1,27 @@ + + <%= check_box_tag("ids[]", issue.id, false, :id => nil) %> + <%= link_to issue.to_param, controller: 'issues', action: 'show', id: issue %> + <% # @note: exclude :issue_id column for compatibility with 'issue_id' plugin %> + <% query.inline_columns.reject { |c| %i(id issue_id).include?(c.name) }.each do |column| %> + <%= content_tag('td', column_content(column, issue), :class => column.css_classes) %> + <% end %> + <%= link_to_context_menu %> + +<% query.block_columns.each do |column| + if (text = column_content(column, issue)) && text.present? -%> + + + <% if query.block_columns.count > 1 %> + <%= column.caption %> + <% end %> + <%= text %> + + + <% end -%> +<% end -%> diff --git a/app/views/issues_trees/tree_children.html.haml b/app/views/issues_trees/tree_children.html.haml new file mode 100644 index 0000000..28d9c8b --- /dev/null +++ b/app/views/issues_trees/tree_children.html.haml @@ -0,0 +1,5 @@ +- @issues.each do |issue| + = render partial: 'tree_node', + locals: {issue: issue, + query: @query, + issues_ids: @issues_ids} \ No newline at end of file diff --git a/app/views/issues_trees/tree_index.html.erb b/app/views/issues_trees/tree_index.html.erb new file mode 100644 index 0000000..19991ce --- /dev/null +++ b/app/views/issues_trees/tree_index.html.erb @@ -0,0 +1,64 @@ +<% content_for :header_tags do %> + <%= stylesheet_link_tag 'jquery.treetable.theme.default.css', plugin: :redmine_issues_tree %> + <%= stylesheet_link_tag 'jquery.treetable.css', plugin: :redmine_issues_tree %> + <%= stylesheet_link_tag 'custom_issues.css', plugin: :redmine_issues_tree %> + + <%= javascript_include_tag 'custom.jquery.treetable.js', plugin: :redmine_issues_tree %> + <%= javascript_include_tag 'tree.issues.initializer.js', plugin: :redmine_issues_tree %> +<% end %> + +
+ <% if User.current.allowed_to?(:add_issues, @project, :global => true) && (@project.nil? || Issue.allowed_target_trackers(@project).any?) %> + <%= link_to l(:label_issue_new), _new_project_issue_path(@project), :class => 'icon icon-add new-issue' %> + <% end %> + <%= actions_dropdown do %> + <% if @project %> + <%= link_to l(:field_summary), project_issues_report_path(@project), :class => 'icon icon-stats' %> + <% end %> + + <% if User.current.allowed_to?(:import_issues, @project, :global => true) %> + <%= link_to l(:button_import), new_issues_import_path(:project_id => @project), :class => 'icon icon-import' %> + <% end %> + + <%= link_to_if_authorized l(:label_settings), + {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'issues'}, + :class => 'icon icon-settings' if User.current.allowed_to?(:manage_categories, @project) %> + <% end %> + + <%# issues_tree patch %> + <%= call_hook(:view_issues_tree_index_contextual, {issues: @issues, project: @project, query: @query}) %> + <%# end patch %> +
+ +

<%= @query.new_record? ? l(:label_issue_plural) : @query.name %>

+<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> + +<%= form_tag({controller: :issues_trees, + action: :tree_index, + project_id: @project}, + method: :get, + id: 'query_form', + class: 'issues-tree-index-form', + data: @tree_data) do %> + <%= render :partial => 'issues_trees/query_form' %> +<% end %> + +<% if @query.valid? %> +<% if @issues.empty? %> +

<%= l(:label_no_data) %>

+<% else %> +<%= render_query_totals(@query) %> +<%= render :partial => 'issues_trees/tree_list', :locals => {:issues => @issues, :query => @query, :issues_ids => @issues_ids} %> +<%# No pagination for tree %> +<% end %> + +<% end %> +<%= call_hook(:view_issues_index_bottom, { :issues => @issues, :project => @project, :query => @query }) %> + +<%# No export links (ATOM, csv, etc) for tree %> + +<% content_for :sidebar do %> + <%= render :partial => 'issues/sidebar' %> +<% end %> + +<%= context_menu %> diff --git a/app/views/settings/_redmine_issues_tree.html.haml b/app/views/settings/_redmine_issues_tree.html.haml new file mode 100644 index 0000000..044639c --- /dev/null +++ b/app/views/settings/_redmine_issues_tree.html.haml @@ -0,0 +1,10 @@ +%p + %label + = l(:'issues_tree.settings.default_redirect_to_tree_view') + = hidden_field_tag 'settings[default_redirect_to_tree_view]', false + = check_box_tag 'settings[default_redirect_to_tree_view]', true, @settings['default_redirect_to_tree_view'] == 'true' +%p + %label + = l(:'issues_tree.settings.default_redirect_to_tree_view_without_project') + = hidden_field_tag 'settings[default_redirect_to_tree_view_without_project]', false + = check_box_tag 'settings[default_redirect_to_tree_view_without_project]', true, @settings['default_redirect_to_tree_view_without_project'] == 'true'