module FcrepoAdmin::Helpers::ObjectsHelperBehavior
Public Instance Methods
link_to_object(view, condition=true)
click to toggle source
# File lib/fcrepo_admin/helpers/objects_helper_behavior.rb, line 91 def link_to_object(view, condition=true) return nil unless condition label = t("fcrepo_admin.object.nav.items.#{view}") path = case view when :summary fcrepo_admin.object_path(@object) when :datastreams fcrepo_admin.object_datastreams_path(@object) when :permissions fcrepo_admin.permissions_object_path(@object) when :associations fcrepo_admin.object_associations_path(@object) when :audit_trail fcrepo_admin.audit_trail_object_path(@object) when :object_xml fcrepo_admin.object_path(@object, :format => 'xml') when :solr fcrepo_admin.solr_object_path(@object) when :catalog catalog_path(@object) end link_to_unless_current label, path 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_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