Project

General

Profile

Actions

Feature #12324

closed

Add hooks to Activity page

Added by Duane Hughes about 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
UI
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Wont fix

Description

I have a plugin that makes use of the activity page - and I'd like to add custom icons for the acts_as_event :type that is defined in my plugin. I understand this would be best done with view hooks, but the activity page does not have any that I can see.

Would this be a possibility? Or is there another way I could add icons for the event types I want to implement?


Files

activity.png (6.97 KB) activity.png Duane Hughes, 2012-11-07 15:17
noOverride.png (9.39 KB) noOverride.png Duane Hughes, 2012-11-08 08:07
Actions #1

Updated by Jean-Philippe Lang about 12 years ago

  • Status changed from New to Closed
  • Resolution set to Wont fix

Icons for each event type are defined in the stylesheet. See: source:/tags/2.1.2/public/stylesheets/application.css#L380. So you just need to add your custom styles to a stylesheet in your plugin.

Actions #2

Updated by Duane Hughes about 12 years ago

Thanks, but I'm afraid it doesn't seem to work for me. So I add the following to the top of my plugin stylesheet:

dt.articles { background-image: url(../images/page_edit.png); }

That should pull the image file from my plugin_asset/pluginname/images/ directory. However, tracing the styles using Developer tools in Chrome or IE shows that it is not even pulling in the plugin's stylesheet (knowledgebase.css) anywhere:

This makes sense to me as nothing on the activity page is calling my plugin's CSS file, surely? Or have I done something wrong?

Your help and comments are much appreciated.

Actions #3

Updated by Duane Hughes about 12 years ago

I should also mention that the acts_as_event line in the plugin model looks as follows (note the "type" line):

  acts_as_event :title => Proc.new {blah blah },
                :description => :summary,
                :datetime => :updated_at,
                :type => 'articles',
                :url => Proc.new { |o| {:controller => 'articles', :action => 'show', :id => o.id, :project_id => o.project} }
  acts_as_activity_provider :find_options => {:include => :project},
                            :author_key => :author_id,
                            :type => 'articles',
                            :timestamp => :updated_at,
                            :permission => :view_articles
Actions #4

Updated by Duane Hughes about 12 years ago

  • Status changed from Closed to Reopened
Actions #5

Updated by Jean-Philippe Lang about 12 years ago

  • Status changed from Reopened to Closed

If you want your plugin stylesheet to be loaded with the activity view, you have to use the view_layouts_base_html_head hook in the base layout to include it if controller_name == 'activity'.

I'm closing it, please use the forums for plugin development help requests.

Actions

Also available in: Atom PDF