Sha256: 305a602225142cc872f6f311d4d98d332e9d08bf4b8cc46582c21f1d7ddd1bf0

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

<%# displays the pencil and trash can icons used by the bootstrap index page. %>
<def tag="bootstrap-table-actions">
  <a with="&this_parent" action="edit">
    <i class="icon icon-edit"></i>
  </a>
  <%= link_to '<i class=\'icon-trash\'></i>'.html_safe, this_parent, :confirm => t('hobo.messages.confirm', :default=>'Are you sure?'), method: :delete %>
</def>

<extend tag="index-page">
  <old-index-page: merge>

    <new-link: class="btn pull-right"/>

    <collection: replace>
      <%
        if this.first
          klass = this.first.class
          columns = standard_fields(klass)
          field_names = columns.select {|f| can_view?(this.first, f)}
          if can_edit?(this.first, field_names[0])
            field_names << "actions"
          end
          field_names[0] = "this"
          field_names = field_names.join(', ')
        end
      %>
      <table class="table table-striped" without-header
        fields="&field_names" param="collection">
        <actions-label:>
          <t key="hobo.messages.actions">Actions</t>
        </actions-label:>
        <actions-view:>
          <bootstrap-table-actions/>
        </actions-view:>
      </table>
    </collection>
  </old-index-page:>
</extend>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hobo_bootstrap-2.0.0.pre1 taglibs/index_page.dryml