プロジェクト

全般

プロフィール

Vote #68171

未完了

Support for wiki page rendering in my page

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
My page_42
対象バージョン:
-
開始日:
2010/09/20
期日:
進捗率:

0%

予定工数:
category_id:
42
version_id:
0
issue_org_id:
6440
author_id:
20592
assigned_to_id:
0
comments:
14
status_id:
1
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

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


journals

See #6437
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

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

That's all!

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

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
The status "resolved" is reserved for stuff committed to trunk but not in stable yet, thank you.
--------------------------------------------------------------------------------
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:
<pre>

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)
</pre>
--------------------------------------------------------------------------------
Using the other _wiki.rhtml file attached to this issue I get a similar error:
<pre>

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)

</pre>
--------------------------------------------------------------------------------
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?
<pre>

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

</pre>
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

duplicates,Closed,6437,Support for wiki page rendering in my page

Admin Redmine さんが約4年前に更新

  • カテゴリMy page_42 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0