Feature #2840

Allow My Page blocks to be added to from a plugin

Added by Eric Davis over 8 years ago. Updated about 8 years ago.

Status:ClosedStart date:2009-02-25
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Plugin API
Target version:0.9.0
Resolution:Fixed

Description

It would be great if a plugin could add a new My Page block. Right now the blocks are frozen constants. Maybe they could be refactored into a Database backed Model?

patch.txt Magnifier (703 Bytes) Brad Beattie, 2009-03-04 03:02

Associated revisions

Revision 2528
Added by Jean-Philippe Lang over 8 years ago

Allow underscore in block partial name (#2840).

Revision 2529
Added by Jean-Philippe Lang over 8 years ago

Allow My Page blocks to be added to from a plugin (#2840).

Partials must be placed under the app/views/my/blocks directory of the plugin.
An example can be found in the sample plugin.

History

#1 Updated by Brad Beattie over 8 years ago

I'm definitely on board with this one. I'm finding that few people in my Redmine instance are using My page. If it could be augmented via plugins to suit their needs, that'd be sweet. :)

#2 Updated by Mischa The Evil over 8 years ago

+1 ;)

#3 Updated by Jean-Philippe Lang over 8 years ago

  • Category set to Plugin API
  • Status changed from New to Resolved
  • Target version set to 0.9.0
  • Resolution set to Fixed

Feature added in r2529. Let me know what you think.

#4 Updated by Brad Beattie over 8 years ago

Mm. I like. Ran into one issue though. I wrote a plugin that requires custom CSS.

<% content_for :header_tags do %>
    <%= stylesheet_link_tag 'schedules', :plugin => 'redmine_schedules' %>
<% end %>

This code is fine when the page loads and the widget is there, but the CSS isn't included when the widget has been just added (before you hit save). I've attached a patch that would allow style and script additions to the page.

Does this work for you?

#5 Updated by Brad Beattie over 8 years ago

Also, there seems to be an issue with this implementation. I can't place any custom my page blocks in either the left or right content containers. If I do and hit save, it just appears in the top container.

#6 Updated by Jean-Philippe Lang about 8 years ago

  • Status changed from Resolved to Closed

Brad Beattie wrote:

This code is fine when the page loads and the widget is there, but the CSS isn't included when the widget has been just added (before you hit save). I've attached a patch that would allow style and script additions to the page.

Shouldn't you patch app/views/my/page_layout.rhtml instead of page.rhtml ?

Also, there seems to be an issue with this implementation. I can't place any custom my page blocks in either the left or right content containers. If I do and hit save, it just appears in the top container.

I'm able to move custom blocks to the right or left after they have been added.

I'm closing this ticket since the feature is added.
Please open a new ticket if I missed anything.

Also available in: Atom PDF