diff options
author | mr <mr@mrautenberg.de> | 2011-10-04 14:11:43 +0200 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2011-10-04 14:11:43 +0200 |
commit | ded1c581a4cf113448ca128b89fc4e1b6fb3e5b0 (patch) | |
tree | 3ebf0163d32a608fff63563e76205988844549d3 /helper.rb | |
parent | 3279b362947446cb35ef2ddb2406c6eee3a9b58f (diff) | |
parent | d1a61ff236cf95a7f3cba4a60e85c14e877c730d (diff) |
update to v3.0.0 and add permission to create models
Diffstat (limited to 'helper.rb')
-rw-r--r-- | helper.rb | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -9,6 +9,10 @@ helpers do return false end + def is_aluist + OpenTox::Authorization.list_user_groups(session[:username], session[:subjectid]).include?("aluist") + end + def hide_link(destination) @link_id = 0 unless @link_id @link_id += 1 @@ -91,5 +95,29 @@ helpers do haml :neighbors_navigation, :layout => false end -end + def models_navigation + @page = 0 unless @page + haml :models_navigation, :layout => false + end + def endpoint_option_list(max_time=3600) + out = "" + tmpfile = File.join(TMP_DIR, "endpoint_option_list") + if File.exists? tmpfile + if Time.now-File.mtime(tmpfile) <= max_time + f = File.open(tmpfile, 'r+') + f.each{|line| out << line} + return out + else + File.unlink(tmpfile) + end + end + result = OpenTox::Ontology::Echa.endpoint_option_list() + if result.lines.count > 3 + f = File.new(tmpfile,"w") + f.print result + f.close + end + return result + end +end |