功能 #629

ezFAQ:加入到活动

Added by 邹 超群 about 1 year ago. Updated about 1 year ago.

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

It would be great if the plugin could be changed to use the acts_as_activity_provider API in Redmine. Then added FAQ’s show up in the Activity-view of Redmine. The following two changes needs to be made to full-fill the request:
  • 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:
    1. Faqs are added to the activity view
      activity_provider :faqs

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

  • Subject changed from ezFTP:加入到活动 to ezFAQ:加入到活动

Updated by 邹 超群 about 1 year ago

  • Status changed from 新建 to 已关闭
  • % Done changed from 0 to 100

已加入此功能并升级至 0.0.4

Also available in: Atom PDF