osem-fcy/app/views/admin/sponsors/index.html.haml
Rishabh Singh ada178d62c Added check for image_tag occurences.
Checking for presence of a image before using image_tag
Fixes #1909
2018-01-03 23:12:31 +02:00

40 lines
1.4 KiB
Text

.row
.col-md-12
.page-header
%h1 Sponsors
%p.text-muted
People supporting your conference
- if @conference.sponsors.any?
.row
.col-md-12
%table.table.table-hover#sponsors
%thead
%th Logo
%th Name
%th Description
%th URL
%th Level
%th Actions
%tbody
- @conference.sponsors.each do |sponsor|
%tr
%td
- if sponsor.picture?
= image_tag(sponsor.picture.thumb.url, width: '20%')
%td
= sponsor.name
%td
= truncate(sponsor.description)
%td
= sponsor.website_url
%td
= sponsor.sponsorship_level.title
%td
.btn-group
= link_to 'Edit', edit_admin_conference_sponsor_path(@conference.short_title, sponsor),
method: :get, class: 'btn btn-primary'
= link_to 'Delete', admin_conference_sponsor_path(@conference.short_title, sponsor),
method: :delete, class: 'btn btn-danger', data: { confirm: "Do you really want to delete the sponsor #{sponsor.name}?" }
.row
.col-md-12
= link_to 'Add Sponsor', new_admin_conference_sponsor_path(@conference.short_title), class: 'btn btn-primary pull-right'