module FcrepoAdmin::Helpers::ObjectsHelperBehavior

Public Instance Methods

custom_object_nav_item(item) click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 115
def custom_object_nav_item(item)
  # Override this method with your custom item behavior
end
object_date(dt) click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 29
def object_date(dt)
  Time.parse(dt).localtime
end
object_nav() click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 50
def object_nav
  render :partial => 'fcrepo_admin/shared/context_nav', :locals => {:header => object_nav_header, :items => object_nav_items}
end
object_nav_header() click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 54
def object_nav_header
      t("fcrepo_admin.object.nav.header")
end
object_nav_item(item) click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 62
def object_nav_item(item)
  case item
  when :pid         
    render_object_pid_label
  when :summary     
    link_to_object item
  when :datastreams 
    link_to_object item
  when :permissions 
    link_to_object item, @object.has_permissions? && can?(:permissions, @object)
  when :associations
    link_to_object item
  when :audit_trail 
    link_to_object item, @object.auditable? && can?(:audit_trail, @object)
  when :object_xml  
    link_to_object item
  when :solr        
    link_to_object item
  when :catalog     
    link_to_object item
  else 
    custom_object_nav_item item
  end
end
object_nav_items() click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 58
def object_nav_items
  FcrepoAdmin.object_nav_items.collect { |item| object_nav_item(item) }.reject { |item| item.nil? }
end
object_properties() click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 12
def object_properties
  FcrepoAdmin.object_properties.inject(Hash.new) { |hash, prop| hash[prop] = object_property(prop); hash }
end
object_property(prop) click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 16
def object_property(prop)
  case prop
  when :state
    object_state
  when :create_date, :modified_date
    object_date(@object.send(prop))
  when :models
    @object.models.join("<br/>").html_safe
  else 
    @object.send(prop)
  end
end
object_show_datastream_columns() click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 46
def object_show_datastream_columns
  FcrepoAdmin.object_show_datastream_columns
end
object_state() click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 33
def object_state
  state = @object.state
  value = case state
          when 'A'
            "A (Active)"
          when 'I'
            "I (Inactive)"
          when 'D'
            "D (Deleted)"
          end
  value
end
object_title() click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 4
def object_title
  "#{object_type} #{@object.pid}"
end
object_type() click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 8
def object_type
  @object.class.to_s
end
render_object_pid_label() click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 87
def render_object_pid_label
  content_tag :strong, @object.pid
end