hugogilmar/quadro

View on GitHub
app/views/quadro/assets/image/_image.html.haml

Summary

Maintainability
Test Coverage
.col-xs-6.col-sm-6.col-md-3.col-lg-2(id="image-#{asset.id}")
  .thumbnail
    = image_tag asset.url(:small), alt: asset.alt
    .caption.clearfix
      .pull-right

        = link_to (widget.present? ? edit_page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : edit_page_asset_path(id: asset.id, page_id: page.id)), remote: true, class: "btn btn-link btn-xs" do
          %i.fa.fa-pencil.text-muted
        = link_to (widget.present? ? page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : page_asset_path(id: asset.id, page_id: page.id)), method: "delete", data: { confirm: t('quadro.confirmation.image') }, remote: true, class: "btn btn-link btn-xs" do
          %i.fa.fa-trash-o.text-danger