Project

General

Profile

Actions

Patch #6440

open

Support for wiki page rendering in my page

Added by Sergei Danilov about 14 years ago. Updated about 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
My page
Target version:
-
Start date:
2010-09-20
Due date:
% Done:

0%

Estimated time:

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

Has duplicate Redmine - Feature #6437: Support for wiki page rendering in my pageClosed2010-09-20

Actions
Actions #1

Updated by Sergei Danilov about 14 years ago

See #6437

Actions #4

Updated by Sergei Danilov about 14 years ago

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".

Actions #6

Updated by Sergei Danilov about 14 years ago

  • Status changed from New to Resolved
Actions #7

Updated by Felix Schäfer about 14 years ago

  • Status changed from Resolved to New

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

Actions #8

Updated by Michael Jean about 12 years ago

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)

Actions #9

Updated by Michael Jean about 12 years ago

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)

Actions #10

Updated by Michael Jean about 12 years ago

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 %>

Actions #11

Updated by Sergei Danilov about 12 years ago

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

Actions #12

Updated by Marius BĂLTEANU about 6 years ago

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

Updated by Marius BĂLTEANU about 6 years ago

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

Updated by Marius BĂLTEANU about 6 years ago

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

Also available in: Atom PDF