Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cosmetic ameliorations

  • Loading branch information...
commit 887956bf32b927ce6dff476fe3280d4ede311a02 1 parent 5d613fb
Benoit Bénézech bbenezech authored
2  app/helpers/rails_admin/main_helper.rb
View
@@ -12,7 +12,7 @@ def get_indicator(percent)
return "info" if percent < 34 # < 1/100 of max
return "success" if percent < 67 # < 1/10 of max
return "warning" if percent < 84 # < 1/3 of max
- return "important" # > 1/3 of max
+ return "danger" # > 1/3 of max
end
def get_column_sets(properties)
11 app/views/rails_admin/main/dashboard.html.haml
View
@@ -11,18 +11,21 @@
- 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 = @most_recent_changes[abstract_model.pretty_name])
+ - if last_used
= time_ago_in_words last_used
= t "admin.misc.ago"
%td
- count = @count[abstract_model.pretty_name]
- - percent = count > 0 ? (@max < 2.0 ? count : ((Math.log(count) * 100.0) / Math.log(@max))) : -1
- .label.animate-width-to{:class => 'label-'+get_indicator(percent), :'data-animate-length' => ([1.0, percent].max.to_i * 20), :'data-animate-width-to' => "#{[2.0, percent - 1].max.to_i}%", :style => "width:2%"}= @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)
10 app/views/rails_admin/main/show.html.haml
View
@@ -8,7 +8,9 @@
%p= fieldset.help
%dl
- fields.each_with_index do |field, index|
- - if !values[index].nil? || !RailsAdmin::config.compact_show_view
- %dt.label{:class => "#{field.type_css_class} #{field.css_class}"}= field.label
- %dd
- %pre.prettyprint= field.pretty_value
+ - unless values[index].nil? && RailsAdmin::config.compact_show_view
+ %dt
+ %span.label.label-info{:class => "#{field.type_css_class} #{field.css_class}"}
+ = field.label
+ %dd.well
+ = field.pretty_value
11 lib/rails_admin/config/fields/types/boolean.rb
View
@@ -13,11 +13,18 @@ class Boolean < RailsAdmin::Config::Fields::Base
end
register_instance_option :formatted_value do
- bindings[:view].image_tag("rails_admin/#{value ? 'bullet_black' : 'bullet_white'}.png", :alt => value.to_s)
+ case value
+ when nil
+ %{<span class="badge">-</span>}
+ when false
+ %{<span class="badge badge-important">&#x2718;</span>}
+ when true
+ %{<span class="badge badge-success">&#x2713;</span>}
+ end.html_safe
end
register_instance_option :export_value do
- value.to_s
+ value.inspect
end
# Accessor for field's help text displayed below input field.
2  lib/rails_admin/config/fields/types/file_upload.rb
View
@@ -33,7 +33,7 @@ class FileUpload < RailsAdmin::Config::Fields::Base
url = resource_url
if self.image
thumb_url = resource_url(thumb_method)
- (url != thumb_url) ? v.link_to(v.image_tag(thumb_url), url, :class => 'thumbnail', :target => 'blank') : v.image_tag(thumb_url)
+ (url != thumb_url) ? v.link_to(v.image_tag(thumb_url, :class => 'img-polaroid'), url, :target => 'blank') : v.image_tag(thumb_url)
else
v.link_to(nil, url, :target => 'blank')
end
Please sign in to comment.
Something went wrong with that request. Please try again.