Sha256: 17ba6ae38fe92c84b4fcdfc1de975268a24e4a00a64483830a8f8142134a4636

Contents?: true

Size: 1.53 KB

Versions: 2

Compression:

Stored size: 1.53 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>
  <% if can_delete?(this_parent) %>
  <%= link_to '<i class=\'icon-trash\'></i>'.html_safe, this_parent, :'data-confirm' => t('hobo.messages.confirm', :default=>'Are you sure?'), :method => :delete %>
  <% end %>
</def>

<extend tag="index-page">
  <old-index-page: without-count without-top-page-nav merge>

    <new-link: replace/>    
    <content-header: class="well"/>
    <before-heading:>
      <a action="new" to="&model" param="new-link" class="btn pull-right btn-primary">
        <ht key="#{model.to_s}.actions.new">New <%= model %></ht>
      </a>
    </before-heading:>

    <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 table-bordered" 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

2 entries across 2 versions & 1 rubygems

Version Path
hobo_bootstrap-2.0.0.pre5 taglibs/index_page.dryml
hobo_bootstrap-2.0.0.pre4 taglibs/index_page.dryml