-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
dashboard.html.haml
35 lines (35 loc) · 1.8 KB
/
dashboard.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
- if @abstract_models
%table.table.table-condensed.table-striped
%thead
%tr
%th.shrink.model-name= t "admin.table_headers.model_name"
%th.shrink.last-used= t "admin.table_headers.last_used"
%th.records= t "admin.table_headers.records"
%th.shrink.controls
%tbody
- @abstract_models.each do |abstract_model|
- if authorized? :index, abstract_model
- index_path = index_path(:model_name => abstract_model.to_param)
- row_class = "#{cycle("odd", "even")}#{" link" if index_path}"
%tr{:class => row_class, :"data-link" => index_path}
- last_used = @most_recent_changes[abstract_model.pretty_name]
- active = last_used.try(:today?)
%td
%span.show= link_to abstract_model.config.label_plural, index_path, :class => 'pjax'
%td
- if last_used
= time_ago_in_words last_used
= t "admin.misc.ago"
%td
- count = @count[abstract_model.pretty_name]
- percent = count > 0 ? (@max <= 1 ? count : ((Math.log(count) * 100.0) / Math.log(@max)).to_i + 1) : -1
.progress{:style => "margin-bottom:0px", :class => "progress-#{get_indicator(percent)} #{active && 'active progress-striped'}" }
.bar.animate-width-to{:'data-animate-length' => ([1.0, percent].max.to_i * 20), :'data-animate-width-to' => "#{[2.0, percent].max.to_i}%", :style => "width:2%"}
= @count[abstract_model.pretty_name]
%td.links
%ul.inline= menu_for :collection, abstract_model, nil, true
- if @auditing_adapter && authorized?(:history)
#block-tables.block
.content
%h2= t("admin.actions.history_index.menu")
= render :partial => 'rails_admin/main/dashboard_history'