diff --git a/app/helpers/my_projects_overviews_helper.rb b/app/helpers/my_projects_overviews_helper.rb index ac18dd67f1..99d50de4a7 100644 --- a/app/helpers/my_projects_overviews_helper.rb +++ b/app/helpers/my_projects_overviews_helper.rb @@ -48,13 +48,22 @@ module MyProjectsOverviewsHelper :'ajax-url' => ajax_url(name), position: name } + construct_blocks(name: name, css_classes: css_classes, data: data) + end + + def rendered_field(name) + construct_blocks(name: name, css_classes: Array(name)) + end + + protected + + def construct_blocks(opts = {}) + name, css_classes, data = [:name, :css_classes, :data].map { |sym| opts.fetch sym, '' } content_tag :div, id: "list-#{name}", class: css_classes, data: data do ActiveSupport::SafeBuffer.new(blocks[name].map { |b| construct b }.join) end end - protected - def block_available?(block) controller.class.available_blocks.keys.include? block end diff --git a/app/views/my_projects_overviews/index.html.erb b/app/views/my_projects_overviews/index.html.erb index 1b7861f107..8d697b13cb 100644 --- a/app/views/my_projects_overviews/index.html.erb +++ b/app/views/my_projects_overviews/index.html.erb @@ -19,49 +19,46 @@ See doc/COPYRIGHT.md for more details. ++#%> -<% content_for :action_menu_specific do %> - <%= - context_links = [] - if User.current.allowed_to?(:add_subprojects, project) - context_links << link_to(l(:label_subproject_new), - { :controller => 'projects', - :action => 'new', - :parent_id => project }, - :class => 'icon icon-add') - end - if User.current.allowed_to?(:edit_project, project) - context_links << link_to(l(:label_personalize_page), - { :action => 'page_layout' }, - :class => 'icon icon-edit', - :accesskey => accesskey(:edit)) - end - context_links.join(" ").html_safe - %> +<% content_for :header_tags do %> + <%= javascript_include_tag "my_project_page/my_project_page" %> + <%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %> + <%= stylesheet_link_tag "my_project_page/my_projects_overview", :media => 'all' %> <% end %> +<% html_title(l(:label_overview)) -%> +