Project

General

Profile

Actions

Patch #6440

open

Support for wiki page rendering in my page

Patch #6440: Support for wiki page rendering in my page

Added by Sergei Danilov about 16 years ago. Updated about 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
My page
Target version:
-

Description

Added from #6437.

"I think it would be useful to have a wiki block in "my page". This allows customise "my page" in many ways. I can add to my wiki page todo list, hot links and etc."


Files

_wiki.rhtml (591 Bytes) _wiki.rhtml Sergei Danilov, 2010-09-20 15:11
my_controller.diff (589 Bytes) my_controller.diff Sergei Danilov, 2010-09-20 15:12
_wiki.rhtml (420 Bytes) _wiki.rhtml Sergei Danilov, 2010-09-20 15:35

Related issues 1 (0 open — 1 closed)

Has duplicate Redmine - Feature #6437: Support for wiki page rendering in my pageClosedActions

Updated by Sergei Danilov about 16 years ago Actions #1

See #6437

Updated by Sergei Danilov about 16 years ago Actions #4

Installation
  1. Goto "Administration/Custom Fields", select "Users" tab, create new text field name it "wiki"
  2. Copy file "_wiki.rhtml" to "redmine\app\views\my\blocks\" folder
  3. Apply patch for "my_controller.rb"
  4. For desired user fill custom field "wiki" in format "project:wiki_page"
  5. Goto "My Page", click "Personalize this page", add block "wiki"

That's all!

Now you can see wiki page in "My page".

Updated by Sergei Danilov about 16 years ago Actions #6

  • Status changed from New to Resolved

Updated by Felix Schäfer about 16 years ago Actions #7

  • Status changed from Resolved to New

The status "resolved" is reserved for stuff committed to trunk but not in stable yet, thank you.

Updated by Michael Jean about 14 years ago Actions #8

This solution did not work for me. After I try to add the wiki block it displays 500 inside the block. Then when I try to click the "my page" link again I get 500. My "my page" link will no longer display. My redmine version is 1.3.2, here is the log:

Processing MyController#page (for 132.156.30.171 at 2012-09-06 14:35:43) [GET]
  Parameters: {"action"=>"page", "controller"=>"my"}
Rendering template within layouts/base
Rendering my/page
Completed in 187ms (View: 62, DB: 109) | 200 OK [http://nrgcolla-test/my/page]

Processing MyController#page_layout (for 132.156.30.171 at 2012-09-06 14:35:47) [GET]
  Parameters: {"action"=>"page_layout", "controller"=>"my"}
Rendering template within layouts/base
Rendering my/page_layout
Completed in 218ms (View: 187, DB: 31) | 200 OK [http://nrgcolla-test/my/page_layout]

Processing MyController#add_block (for 132.156.30.171 at 2012-09-06 14:36:09) [POST]
  Parameters: {"block"=>"wiki", "action"=>"add_block", "authenticity_token"=>"y+APo6xutvYjPfX4QC4SVYWdFPi4AOberlfjVLuhh1A=", "controller"=>"my"}

ActionView::TemplateError (undefined method `title' for nil:NilClass) on line #6 of app/views/my/blocks/_wiki.rhtml:
3:         <% page = Wiki.find_page(custom_value) %>      
4: 
5: <div class="contextual">
6: <%= link_to(l(:button_edit), {:action => 'edit', :page => page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %>
7: </div>
8: 
9:         <%= render(:partial => "wiki/content", :locals => {:content => page.content}) %>

    app/views/my/blocks/_wiki.rhtml:6:in `_run_rhtml_app47views47my47blocks47_wiki46rhtml_locals_object_user_wiki'
    app/views/my/blocks/_wiki.rhtml:1:in `_run_rhtml_app47views47my47blocks47_wiki46rhtml_locals_object_user_wiki'
    app/views/my/_block.html.erb:12
    app/controllers/my_controller.rb:141:in `add_block'
    config/initializers/mongrel_cluster_with_rails_211_fix.rb:62:in `dispatch_cgi'

Rendering D:/BitNamiRedmineStack1.3.2/apps/redmine/public/500.html (500 Internal Server Error)

Updated by Michael Jean about 14 years ago Actions #9

Using the other _wiki.rhtml file attached to this issue I get a similar error:

Processing MyController#page (for 132.156.30.171 at 2012-09-06 15:14:00) [GET]
  Parameters: {"action"=>"page", "controller"=>"my"}
Rendering template within layouts/base
Rendering my/page
Completed in 437ms (View: 140, DB: 250) | 200 OK [http://nrgcolla-test/my/page]

Processing MyController#page_layout (for 132.156.30.171 at 2012-09-06 15:14:02) [GET]
  Parameters: {"action"=>"page_layout", "controller"=>"my"}
Rendering template within layouts/base
Rendering my/page_layout
Completed in 94ms (View: 47, DB: 31) | 200 OK [http://nrgcolla-test/my/page_layout]

Processing MyController#add_block (for 132.156.30.171 at 2012-09-06 15:14:07) [POST]
  Parameters: {"block"=>"wiki", "action"=>"add_block", "controller"=>"my", "authenticity_token"=>"y+APo6xutvYjPfX4QC4SVYWdFPi4AOberlfjVLuhh1A="}

ActionView::TemplateError (undefined method `content' for nil:NilClass) on line #5 of app/views/my/blocks/_wiki.rhtml:
2:     <% if !custom_value.value.blank? && custom_value.custom_field.name=="wiki" %>
3:         <% page = Wiki.find_page(custom_value) %>      
4: 
5:         <%= render(:partial => "wiki/content", :locals => {:content => page.content}) %>
6:         <p><%= link_to 'Edit', url_for(:controller => 'wiki', :action => 'index', :id => page.project, :page => page.title) %></p>
7:     <% end %>
8: <% end %>

    app/views/my/blocks/_wiki.rhtml:5:in `_run_rhtml_app47views47my47blocks47_wiki46rhtml_locals_object_user_wiki'
    app/views/my/blocks/_wiki.rhtml:1:in `_run_rhtml_app47views47my47blocks47_wiki46rhtml_locals_object_user_wiki'
    app/views/my/_block.html.erb:12
    app/controllers/my_controller.rb:141:in `add_block'
    config/initializers/mongrel_cluster_with_rails_211_fix.rb:62:in `dispatch_cgi'

Rendering D:/BitNamiRedmineStack1.3.2/apps/redmine/public/500.html (500 Internal Server Error)

Updated by Michael Jean about 14 years ago Actions #10

I set up and tested the patch with Redmine 1.4.3 to compare and I found the same result. What version of Redmine is this patch compatible with?

NoMethodError in My#add_block 
Showing app/views/my/blocks/_wiki.rhtml where line #5 raised: 

undefined method `content' for nil:NilClass
Extracted source (around line #5): 

2:     <% if !custom_value.value.blank? && custom_value.custom_field.name=="wiki" %>
3:         <% page = Wiki.find_page(custom_value) %>      
4: 
5:         <%= render(:partial => "wiki/content", :locals => {:content => page.content}) %>
6:         <p><%= link_to 'Edit', url_for(:controller => 'wiki', :action => 'index', :id => page.project, :page => page.title) %></p>
7:     <% end %>
8: <% end %>

Updated by Sergei Danilov about 14 years ago Actions #11

Michael Jean wrote:

I set up and tested the patch with Redmine 1.4.3 to compare and I found the same result. What version of Redmine is this patch compatible with?
[...]

Redmine 1.0.1.devel.4083

Updated by Marius BĂLTEANU about 8 years ago Actions #12

  • Description updated (diff)
  • Category changed from Wiki to My page

Updated by Marius BĂLTEANU about 8 years ago Actions #13

  • Related to deleted (Feature #6437: Support for wiki page rendering in my page)

Updated by Marius BĂLTEANU about 8 years ago Actions #14

  • Has duplicate Feature #6437: Support for wiki page rendering in my page added
Actions

Also available in: PDF Atom