- if @organization.events.future.empty?
  .alert.alert-info
    There are no upcoming events.  You should #{link_to 'add an event', '/events/new?event[organization_id]=' + @organization.id.to_s} or #{link_to 'import event(s)', new_organization_source_path(@organization)}.

%h1= @organization.name

%p
  %b URL:
  = source_url_link @organization

- unless @organization.topics.blank?  
  %p
    %b Topics:
    = render :partial => 'shared/topics', :locals => {:topics => @organization.topics} 

%p
  %b Events:
  = render :partial => 'events/list', :locals => { :events =>  @organization.events }

- content_for :sidebar do
  .box
    %ul
      %li= link_to 'Add an event', '/events/new?event[organization_id]=' + @organization.id.to_s 
      -# XXX TODO - last line is a hack.  Should use something like new_event_url after updating routes.rb,
      -#              or figure out how to set params to pass org id. 
      %li= link_to 'Import event or calendar', new_organization_source_path(@organization)
      %li= link_to 'Edit this organization', edit_organization_url
  -# link_to 'Destroy', @organization, :confirm => 'Are you sure?', :method => :delete 
- if @organization.events.future.empty?
  .alert.alert-info
    There are no upcoming events.  You should #{link_to 'add an event', '/events/new?event[organization_id]=' + @organization.id.to_s} or #{link_to 'import event(s)', new_organization_source_path(@organization)}.

%h1= @organization.name

%p
  %b URL:
  = source_url_link @organization

- unless @organization.topics.blank?  
  %p
    %b Topics:
    = render :partial => 'shared/topics', :locals => {:topics => @organization.topics} 

%p
  %b Events:
  = render :partial => 'events/list', :locals => { :events =>  @organization.events.sort_by(&:start_time) }

- content_for :sidebar do
  .box
    %ul
      %li= link_to 'Add an event', '/events/new?event[organization_id]=' + @organization.id.to_s 
      -# XXX TODO - last line is a hack.  Should use something like new_event_url after updating routes.rb,
      -#              or figure out how to set params to pass org id. 
      %li= link_to 'Import event or calendar', new_organization_source_path(@organization)
      %li= link_to 'Edit this organization', edit_organization_url
  -# link_to 'Destroy', @organization, :confirm => 'Are you sure?', :method => :delete 
Sort events by date when viewing Organization.
Sort events by date when viewing Organization.

[Fixes #22207297]
