From 9f3d87d51b1a8847eb409b6caee558ae6ab90164 Mon Sep 17 00:00:00 2001 From: gebele Date: Wed, 4 May 2016 15:56:02 +0000 Subject: added license to GUI --- Gemfile | 1 + application.rb | 6 ++++++ nano-lazar-gui.gemspec | 1 + views/layout.haml | 2 ++ views/license.haml | 1 + 5 files changed, 11 insertions(+) create mode 100644 views/license.haml diff --git a/Gemfile b/Gemfile index 9193d08..9ceb553 100644 --- a/Gemfile +++ b/Gemfile @@ -3,3 +3,4 @@ gemspec gem "sinatra" gem "haml" gem "rserve-client" +gem "rdiscount" diff --git a/application.rb b/application.rb index 5bb201c..225776d 100644 --- a/application.rb +++ b/application.rb @@ -1,4 +1,5 @@ require 'json' +require 'rdiscount' require_relative './nanoparticles.rb' $ambit_search = "http://data.enanomapper.net/substance?type=name&search=" @@ -19,6 +20,11 @@ get '/predict/?' do haml :predict end +get '/license' do + @license = RDiscount.new(File.read("LICENSE.md")).to_html + haml :license, :layout => false +end + post '/predict/?' do size = params[:size].to_i @input = [] diff --git a/nano-lazar-gui.gemspec b/nano-lazar-gui.gemspec index 4ff5322..923e88b 100644 --- a/nano-lazar-gui.gemspec +++ b/nano-lazar-gui.gemspec @@ -16,6 +16,7 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 2.0.0' s.add_runtime_dependency "sinatra" + s.add_runtime_dependency "rdiscount" s.add_runtime_dependency "haml" s.add_runtime_dependency "unicorn" end diff --git a/views/layout.haml b/views/layout.haml index c9a6264..acdef62 100644 --- a/views/layout.haml +++ b/views/layout.haml @@ -52,6 +52,8 @@ %p.text-muted © %a{:href => 'http://www.in-silico.ch', :rel => "external"} in silico toxicology gmbh 2014 - #{Time.now.year.to_s} + | + %a{:href => to("/license"), :rel => "external"} GPL3 License #back-top{:style => "z-index:100;position:fixed;bottom:1%;right:1%;"} %a{:href => "", :style=>"text:decoration:none;color:#ccc;"} diff --git a/views/license.haml b/views/license.haml new file mode 100644 index 0000000..2813220 --- /dev/null +++ b/views/license.haml @@ -0,0 +1 @@ += @license -- cgit v1.2.3