= render partial: "shared/flash_messages", flash: flash
- trim = question.trim_link
- if trim
  .dashboard_trim_link id="trim_links_#{trim.id}"
    = link_to('Open trim link', trim_link_path(trim), {title: 'Open trim link', rel: 'external'})
- else
  .trim-links-form id="trim-links-form-#{question.id}"
    button.button.button-choose Choose Trim file
    .tr5-message
      i.fa
      span.message
    .inline.tr5-actions.toggle-content style="overflow:hidden;"
      = form_for TrimLink.new(:pq_id => question.id),
        remote: true,
        authenticity_token: true,
        html: { multipart: true, id: "new_trim_link_form_#{question.id}", class: 'pq-inline-form form-add-trim-link', data: {pqid: question.id }} do |f|
        = f.file_field :file_data, :class=>'pq-inline-form trim-file-chooser', :id=>"file_data-#{question.id}"
        = f.hidden_field(:pq_id , :value => question.id , :id=>"pq_id-trimlink-#{question.id}")
        = f.submit 'Upload', :class=>'button button-upload'
        button.button.button-cancel.button-secondary Cancel

= render partial: "shared/flash_messages", flash: flash
- trim = question.trim_link
- if trim
  .dashboard_trim_link id="trim_links_#{trim.id}"
    = link_to('Open trim link', trim_link_path(trim), {title: 'Open trim link', rel: 'external'})
- else
  .trim-links-form id="trim-links-form-#{question.id}"
    button.button-secondary.button-choose Choose Trim file
    .tr5-message
      i.fa
      span.message
    .inline.tr5-actions.toggle-content style="overflow:hidden;"
      = form_for TrimLink.new(:pq_id => question.id),
        remote: true,
        authenticity_token: true,
        html: { multipart: true, id: "new_trim_link_form_#{question.id}", class: 'pq-inline-form form-add-trim-link', data: {pqid: question.id }} do |f|
        = f.file_field :file_data, :class=>'pq-inline-form trim-file-chooser', :id=>"file_data-#{question.id}"
        = f.hidden_field(:pq_id , :value => question.id , :id=>"pq_id-trimlink-#{question.id}")
        = f.submit 'Upload', :class=>'button button-upload'
        button.button.button-cancel.button-secondary Cancel

Trim selection should be a secondary file
Trim selection should be a secondary file

ministryofjustice/parliamentary-questions,ministryofjustice/parliamentary-questions,ministryofjustice/parliamentary-questions,ministryofjustice/parliamentary-questions,ministryofjustice/parliamentary-questions