功能 #629
ezFAQ:加入到活动
| Status: | 已关闭 | Start: | 01/07/2009 | |
|---|---|---|---|---|
| Priority: | 普通 | Due date: | ||
| Assigned to: | % Done: | 100% |
||
| Category: | FAQ | |||
| Target version: | 1.0 |
Description
Improvement proposals
Make the plugin an activity_provider
- The following needs to be added to the faq-model:
belongs_to :project
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
acts_as_event :title => Proc.new {|o| "#{o.question}"},
:description => Proc.new {|o| "#{o.answer}"},
:datetime => :created_on,
:author => :author,
:url => Proc.new {|o| {:controller => 'ezfaq', :action => 'show', :id => o.project_id, :faq_id => o.id}}
acts_as_activity_provider :find_options => { :include => [:project, :author] },
:author_key => :updater_id
- The following needs to be added to the init.rb:
- Faqs are added to the activity view
activity_provider :faqs
- Faqs are added to the activity view
The only thing left is the styling of the activity FAQ-items through CSS (the images in front of the item using a selector like dt.faq { background-image: url(../images/question.png); }) plus an additional language-string for :label_faqs_plural which is used in the acitivty-sidebar.
Btw: I think this could be usefull for the EzLibrarian-plugin for Redmine…
HTH, Mischa The Evil
History
Updated by 邹 超群 about 1 year ago
- Status changed from 新建 to 已关闭
- % Done changed from 0 to 100
已加入此功能并升级至 0.0.4