_ontology.html.haml revision af7bc35cdf75a8ba4b1bc395f0a0153f92891f0b
// = link_to resource, resource#, 'data-type' => resource.class
%h2{'style' => 'display: inline-block'}
%span= link_to resource
%small
-if !resource.language_id.nil?
= link_to resource.language, resource.language
- else
= 'unknown'
= '/'
= link_to resource.logic.to_s, resource.logic
- if resource.state != 'done'
%small#ontology-state{ class: resource.state, 'data-uri' => url_for(resource) }
= status resource
%div.btn-group{'style' => 'display: inline-block'}
%a.btn.btn-mini.dropdown-toggle{'href' => '#', 'data-toggle' => 'dropdown'}
%span.caret
%ul.dropdown-menu
- if can? :edit, resource
%li= link_to 'Rename', [:edit, resource]
%li.divider
%li= link_to 'Show comments', [resource, :comments]
%li= link_to 'Show metadata', [resource, :metadata]
- if can? :permissions, resource
%li= link_to 'Show permissions', [resource, :permissions]
- if can? :edit, resource
%li.divider
%li= link_to 'Upload new version from my computer', new_ontology_ontology_version_path(resource, :from => 'http-client')
%li= link_to 'Import new version from other website', new_ontology_ontology_version_path(resource, :from => 'http-server')
%li= link_to 'Browse versions', [resource, :ontology_versions]
- if can? :edit, resource
%li.divider
%li= link_to 'Delete', resource, :confirm => 'Do you really want to delete this ontology?', :method => :delete
%p= link_to resource.iri, download_path(resource) if download_path(resource)
%p= resource.description
= render partial: 'ontologies/oops_state', locals: {resource: resource}
%nav
%ul.nav.nav-tabs
- @entities.each do |entity|
%li{:class => (entity.kind == @active_kind ? 'active' : nil)}
%a{:href => ontology_entities_path(resource, :kind => entity.kind)}
= entity.count == 1 ? entity.kind : entity.kind.pluralize
%span.badge{:style => entity.count == 0 && 'display:none'}= entity.count
- pages.each do |page, path, count|
%li{:class => (page==current_page ? 'active' : nil)}
%a{:href => url_for(path)}
= page.to_s.capitalize
- if count # hide counter if empty
%span.badge{:style => count==0 && 'display:none'}= count