.row
  .col-md-12
    %h3
      = @event.title
      %br
      %small
        = @event.subtitle
      = link_to "Edit", edit_admin_conference_event_path(@conference.short_title, @event), :class => "btn btn-mini btn-default pull-right"

.row
  .col-md-12
    %table.table
      %tr
        %td{:style => "width:15%"}
          %b Type
        %td
          .dropdown
            = link_to "#", :class => "dropdown-toggle", :id => "type-dropdown" do
              - if @event.event_type.nil?
                Event Type
              - else
                = @event.event_type.title
              <b class="caret"></b>
            %ul.dropdown-menu
              - @event_types.each do |type|
                %li= link_to type.title, admin_conference_event_path(@conference.short_title, @event, :event_type_id => type.id) ,
                  :method => :put, :event_type_id => type.id
      %tr
        %td
          %b State
        %td
          .dropdown
            = link_to "#", :class => "dropdown-toggle" do
              = @event.state.humanize
              <b class="caret"></b>
            %ul.dropdown-menu
              = render 'change_state_dropdown', event: @event
      %tr
        %td
          %b Track
        %td
          .dropdown
            = link_to "#", :class => "dropdown-toggle", :id => "track-dropdown" do
              - if @event.track.nil?
                Track
              - else
                = @event.track.name
              <b class="caret"></b>
            %ul.dropdown-menu
              - @tracks.each do |track|
                %li= link_to track.name, admin_conference_event_path(@conference.short_title, @event, :track_id => track.id) ,
                  :method => :put, :track_id => track.id
      %tr
        %td
          %b Difficulty
        %td
          .dropdown
            = link_to "#", :class => "dropdown-toggle", :id => "difficulty-dropdown" do
              - if @event.difficulty_level.nil?
                Difficulty Level
              - else
                = @event.difficulty_level.title
              <b class="caret"></b>
            %ul.dropdown-menu
              - @difficulty_levels.each do |difficulty|
                %li= link_to difficulty.title, admin_conference_event_path(@conference.short_title, @event, :difficulty_level_id => difficulty.id) ,
                  :method => :put, :difficulty_level_id => difficulty.id
      - if !@event.room.nil?
        %tr
          %td
            %b Room
          %td
            = @event.room.name
      - if !@event.start_time.nil?
        %tr
          %td
            %b Scheduled time
          %td
            = @event.start_time
      %tr
        %td
          %b Submitter
        %td
          = link_to @event.submitter.name, admin_user_path(@event.submitter)
          (
          = link_to @event.submitter.email, "mailto: #{@event.submitter.email}"
          )
      %tr
        %td
          %b Biography
        %td
          = simple_format(@event.submitter.biography)
      %tr
        %td
          %b Submitted on
        %td= @event.created_at
      %tr
        %td
          %b Last updated on
        %td= @event.updated_at
      %tr
        %td
          %b Abstract
        %td= simple_format(@event.abstract)
      %tr
        %td
          %b Description
        %td= simple_format(@event.description)

      - if @conference.call_for_paper && @conference.call_for_paper.rating && @conference.call_for_paper.rating > 0
        = render :partial => "voting"

.row
  = link_to "Comments (#{@comment_count})", "#", :id => "event-comment-link"
  #comments-div
    %hr
    %ul.media
      %div
        .row-fluid
          = form_tag(comment_admin_conference_event_path(@conference.short_title, @event.id), :method => :post) do
            = text_area_tag(:comment, "")
            = submit_tag "Add Comment", :class => "btn btn-primary pull-right"
        %br
        - @comments.each do |comment|
          %div
            = raw format_comments(comment)
