File: _dashboard_history.html.haml

package info (click to toggle)
ruby-rails-admin 0.8.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,492 kB
  • ctags: 1,292
  • sloc: ruby: 5,341; makefile: 3
file content (21 lines) | stat: -rw-r--r-- 898 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
%table.table.table-condensed.table-striped
  %thead
    %tr
      %th.shrink.user= t("admin.table_headers.username")
      %th.shrink.items= t("admin.table_headers.item")
      %th.changes= t("admin.table_headers.changes")
  %tbody
    - @history.each do |t|
      - abstract_model = RailsAdmin.config(t.table).abstract_model
      %tr
        %td= t.try :username
        - if o = abstract_model.try(:get, t.item)
          - label = o.send(abstract_model.config.object_label_method)
          - if show_action = action(:show, abstract_model, o)
            %td= link_to(label, url_for(action: show_action.action_name, model_name: abstract_model.to_param, id: o.id), class: 'pjax')
          - else
            %td= label
        - else
          - label = Object.const_defined?(t.table) ? t.table.constantize.model_name.human : t.table
          %td= "#{label} ##{t.item}"
        %td= t.message