Sha256: 191125a76795f481db3b4a27a06288ed3f27893e20308ac48fc3bcde64b7b152

Contents?: true

Size: 1.66 KB

Versions: 4

Compression:

Stored size: 1.66 KB

Contents

- if show_sample_data?(dataset)
	%section
		= fullwidth do
			= section_title("Sample data")
			%p
				This dataset contains
				= pluralize dataset.types.length, 'type'
				of resource:
			- dataset.example_resources.each do |resource|
				%table
					%thead
						%tr
							%td(colspan="2")
								=label resource.read_predicate(RDF.type).many? ? 'Types' : 'Type'
								%h4{style:"line-height:1.2em;"}= resource.read_predicate(RDF.type).map { |t| resource_uri_or_label(resource, t) }.join("<br>").html_safe
								%h5
									Subject:
									= link_to (resource.label || resource.uri), resource_path_from_uri(resource.uri)
						%tr
							%th{style:"width:50%;"} Predicate
							%th{style:"width:50%;"} Object
					- resource.predicates.each do |pred|
						%tr
							%td{style:"width:50%;"}
								= resource_uri_or_label(resource, pred)
								= maybe_link_to_vocabulary(dataset,pred)
							%td{style:"width:50%;"}
								- resource.read_predicate(pred).each do |obj|
									%div
										= resource_uri_or_label(resource, obj)
										= maybe_link_to_vocabulary(dataset,obj)
					%tfoot
						%tr
							%th(colspan="2")
								%div
									= link_to show_resource_path(uri: resource.uri, format: 'ttl'), target: 'blank' do
										Raw data for this resource (.ttl)
										%i.icon-popup
								%ul.resource_links_list
									- types_for_example_resource(dataset, resource).each do |type|
										%li
											View 
											= link_to list_resources_path(dataset: dataset, type_uri: type) do
												all
												= dataset.type_count(type.uri)
												resources of type
												%strong
													= type.label.nil? ? type.uri : type.label

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
publish_my_data-1.3.20 app/views/publish_my_data/stripes/_dataset_sample_data.html.haml
publish_my_data-1.3.19 app/views/publish_my_data/stripes/_dataset_sample_data.html.haml
publish_my_data-1.3.18 app/views/publish_my_data/stripes/_dataset_sample_data.html.haml
publish_my_data-1.3.17 app/views/publish_my_data/stripes/_dataset_sample_data.html.haml