Cross Reference: axioms_controller.rb
xref
: /
ontohub
/
app
/
controllers
/
axioms_controller.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
axioms_controller.rb revision bb90b28cdc65a2e18bda6ae833d16fc0bd48a823
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
#
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
# Lists axioms of an ontology
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
#
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
class
AxiomsController
<
InheritedResources
::
Base
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
belongs_to
:
ontology
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
actions
:
index
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
has_pagination
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
respond_to
:
html
,
only
: %i
(
index
)
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
before_filter
:
check_read_permissions
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
protected
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
def
check_read_permissions
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
authorize
! :
show
,
parent.repository
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
end
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
def
collection
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
@
collection
||=
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
if
display_all
?
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
axioms
=
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
if
logically_translated
?
a45d3d730a4a0428b96460e0484513fc4219662b
Eugen Kuksa
parent.all
_axioms
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
else
bb90b28cdc65a2e18bda6ae833d16fc0bd48a823
Eugen Kuksa
parent.translated
_axioms
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
end
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
Kaminari.paginate
_array
(
axioms
)
.
page
(
params
[:
page
])
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
else
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
super
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
end
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
end
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
def
logically_translated
?
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
parent.contains
_logic_translations
?
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
end
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
helper_method
:
logically_translated
?
9682ce7cd0be309474550ba9d8fb97585d3facc3
Eugen Kuksa
end