Lines Matching refs:resource
12 def fancy_link(resource)
13 return nil unless resource
15 data_type, value = determine_image_type(resource)
17 name = block_given? ? yield(resource) : resource
19 title_target = resource.respond_to?(:last) ? resource.last : resource
23 if resource.respond_to?(:locid)
24 url_for(resource)
25 elsif resource.is_a?(Ontology)
26 repository_ontology_path(resource.repository, resource)
28 resource
52 def determine_image_type(resource)
53 if resource.is_a?(Repository) && resource.is_private
54 return ['data-type', "Private#{resource.class.to_s}"]
57 if resource.is_a?(Repository) && resource.mirror?
58 return ['data-type', "Remote#{resource.class.to_s}"]
61 unless resource.is_a?(Ontology)
62 return ['data-type', resource.class.to_s]
75 value = if resource.is_a?(DistributedOntology)
76 distributed_type[resource]
78 if resource.parent
79 "single_in_#{distributed_type[resource.parent]}"
88 def ontology_link_to(resource)
89 data_type, value = determine_image_type(resource)
91 link_to resource, url_for(resource), data_type => value