Commit 3afe02b7f2305a6fb9b9ba43d592a0d085692999

  • Tree SHA1: 4c802f2
  • Parent SHA1: 8f01557 (The event rendering helper is now aware of the fact that it is some times being displayed without commits_in_event_xxx, e.g. on the home page scroller.)
  • raw diff | raw patch
Resurect the ajax calls that was removed in 8f01557a1
  
228228 [action, body, category]
229229 end
230230
231 def link_to_remote_if(condition, name, options)
231 def link_to_remote_if(condition, name, options, html_options = {})
232232 if condition
233 link_to_remote(name, options)
233 link_to_remote(name, options, html_options)
234234 else
235235 content_tag(:span, name)
236236 end
  
289289
290290 def render_event_push(event)
291291 project = event.target.project
292 commit_link = link_to_if(event.has_commits?, pluralize(event.events.size, 'commit'),
293 repo_owner_path(event.target, :project_repository_commits_in_ref_path, project, event.target, ensplat_path(event.data)),
294 :onclick => "if ($('commits_in_event_#{event.to_param}')) {$('commits_in_event_#{event.to_param}').toggle(); return false;}"
295 )
296
292 commit_link = link_to_remote_if(event.has_commits?, pluralize(event.events.size, 'commit'), {
293 :url => commits_event_path(event.to_param),
294 :method => :get,
295 :update => "commits_in_event_#{event.to_param}",
296 :before => "$('commits_in_event_#{event.to_param}').toggle();",
297 :condition => "$('commits_in_event_#{event.to_param}')",
298 },{
299 :href => repo_owner_path(event.target, :project_repository_commits_in_ref_path, project, event.target, ensplat_path(event.data))
300 })
297301 action = action_for_event(:event_pushed_n, :commit_link => commit_link) do
298302 title = repo_title(event.target, project)
299 " to " + link_to(h(title+':'+event.data), repo_owner_path(event.target, :project_repository_path, event.target.project, event.target))
303 " to " + link_to(h(title+':'+event.data), repo_owner_path(event.target,
304 :project_repository_commits_in_ref_path, project, event.target, ensplat_path(event.data)))
300305 end
301306 body = h(event.body)
302307 category = 'push'