openSUSE/osem

View on GitHub
app/views/admin/events/_proposal.html.haml

Summary

Maintainability
Test Coverage
- cache ['admin/event', @conference, @program, @event, current_user] do
  .row
    .col-md-12
      %h3
        = @event.title
        %br
        %small
          = @event.subtitle
        .btn-group.pull-right
          = link_to 'Registrations', registrations_admin_conference_program_event_path(@conference.short_title, @event), class: 'btn btn-success'
          = link_to 'Edit', edit_admin_conference_program_event_path(@conference.short_title, @event), class: 'btn btn-mini btn-primary'

  .row
    .col-md-12
      %table.table
        %tr
          %td.col-md-2
            %b Type
          %td
            = event_type_dropdown(@event, @event_types, @conference.short_title)
        %tr
          %td
            %b Highlight
          %td
            = event_switch_checkbox(@event, :is_highlight, @conference.short_title)
        %tr
          %td
            %b State
          %td
            = state_dropdown(@event, @conference.short_title, @conference.email_settings)
        %tr
          %td
            %b Track
          %td
            = track_dropdown(@event, @tracks, @conference.short_title)
        %tr
          %td
            %b Difficulty
          %td
            = difficulty_dropdown(@event, @difficulty_levels, @conference.short_title)
        %tr
          %td
            %b Requires Registration
          %td
            = event_switch_checkbox(@event, :require_registration, @conference.short_title)
            - if @event.require_registration
              = registered_text(@event)

        - if @program.languages.present?
          %tr
            %td
              %b Language
            %td
              = @event.language

        - unless @event.room.nil?
          %tr
            %td
              %b Room
            %td
              = @event.room.name
        - unless @event.time.nil?
          %tr
            %td
              %b Scheduled time
            %td
              = time_with_timezone(@event.time)
        %tr
          %td
            %b Submitter
          %td
            = link_to @event.submitter.name, admin_user_path(@event.submitter)
            - if @event.submitter.email_public
              (
              = link_to @event.submitter.email, "mailto: #{@event.submitter.email}"
              )
        %tr
          %td
            %b Speakers
          %td
            - @event.speakers.each do |speaker|
              %div
                = link_to speaker.name, admin_user_path(speaker)
                - if speaker.email_public
                  (
                  = link_to speaker.email, "mailto: #{speaker.email}"
                  )
        %tr
          %td
            %b Biographies
          %td
            - @event.speakers.each do |speaker|
              - unless speaker.biography.blank?
                %b
                  = speaker.name
                = markdown(speaker.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= markdown(@event.abstract)
        %tr
          %td
            %b Requirements
          %td= simple_format(@event.description)

        - if @conference.program.rating_enabled?
          = render 'voting',
            event:         @event,
            show_votes:    @program.show_voting?,
            max_rating:    @program.rating,
            voting_period: @program.voting_period?,
            votes:         @votes,
            conference_id: @conference.short_title

- cache [@conference, @event, @comments] do
  .row
    .col-md-12
      %h4
        Comments
        = "(#{@comment_count})"
        = link_to('#comment-collapse', class: 'btn btn-link', role: 'button', data: {toggle: "collapse" }) do
          Show
      %hr
      .collapse#comment-collapse
        - @comments.each do |comment|
          = render partial: 'nested_comments', locals: { comment: comment, padding: 0}
        = form_for(:comment, url: comment_admin_conference_program_event_path(@conference.short_title, @event.id), method: :post) do |f|
          .form-group
            = f.text_area :body, class: 'form-control'
          .text-right
            = f.submit nil, class: 'btn btn-primary'