Sha256: e47b397818152081d4f76d024f15842514fba9151e7532f5d1aa4b9350c9427d

Contents?: true

Size: 1.56 KB

Versions: 12

Compression:

Stored size: 1.56 KB

Contents

- displayable_parameters = exclude_keys(@expected_variables,@reserved_variables_used)

%section
	=fullwidth do
		=section_title("#{ @sparql_query ? 'Edit' : 'Enter' } query")
	=fullwidth do
		= form_tag sparql_endpoint_path, method: :get do
			= text_area_tag :query, @query_text || "SELECT * WHERE { ?s ?p ?o } LIMIT 20"
			- # interpolated variables - ie anything in %{} in the query
			- # example query to generate interpolations:
			- #		SELECT * WHERE { ?%{foo}  ?p ?o}
			- # example query to generate interpolations with reserved words:
			- # 	SELECT * WHERE { ?%{controller}  ?p ?o}
			- if @expected_variables && @expected_variables.any?
				%fieldset#sparql_parameters
					%h4 Special parameters
					%p
						:markdown
							Values supplied will be substituted into the query in place of the <code>%{tokens}</code>. See the [developer docs](/docs) for more details.
					- @expected_variables.each do |v|
						:ruby
							field_options = {:class => 'field'}
							if @missing_variables && @missing_variables.include?(v)
								field_options.merge!(:class => 'pmd_field_error')
							end
						= content_tag :div, field_options do
							- if @missing_variables && @missing_variables.include?(v)
								%label="#{v}: can't be blank"
							- else
								%label="#{v}: "
							= text_field_tag v, @interpolations[v]

			= submit_tag "Run Query", id: 'run-sparql-query'

/
	:javascript
		$(function(){
			var editor = CodeMirror.fromTextArea(document.getElementById("query"), {
				mode: "application/x-sparql-query",
				tabMode: "indent",
				matchBrackets: true
			});
		});

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
publish_my_data-1.3.6 app/views/publish_my_data/stripes/_sparql_console.html.haml
publish_my_data-1.3.5 app/views/publish_my_data/stripes/_sparql_console.html.haml
publish_my_data-1.3.4 app/views/publish_my_data/stripes/_sparql_console.html.haml
publish_my_data-1.3.3 app/views/publish_my_data/stripes/_sparql_console.html.haml
publish_my_data-1.3.2 app/views/publish_my_data/stripes/_sparql_console.html.haml
publish_my_data-1.3.1 app/views/publish_my_data/stripes/_sparql_console.html.haml
publish_my_data-1.3.0 app/views/publish_my_data/stripes/_sparql_console.html.haml
publish_my_data-1.2.4 app/views/publish_my_data/stripes/_sparql_console.html.haml
publish_my_data-1.2.3 app/views/publish_my_data/stripes/_sparql_console.html.haml
publish_my_data-1.2.2 app/views/publish_my_data/stripes/_sparql_console.html.haml
publish_my_data-1.2.1 app/views/publish_my_data/stripes/_sparql_console.html.haml
publish_my_data-1.2.0 app/views/publish_my_data/stripes/_sparql_console.html.haml