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/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__)