summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2016-05-04 15:56:02 +0000
committergebele <gebele@in-silico.ch>2016-05-04 15:56:02 +0000
commit9f3d87d51b1a8847eb409b6caee558ae6ab90164 (patch)
tree7bb0f16ef467da1f8bfdb288cf0e065c19e86064
parent288dc2147651dc46bf62b5dda61045dbf510a45b (diff)
added license to GUI
-rw-r--r--Gemfile1
-rw-r--r--application.rb6
-rw-r--r--nano-lazar-gui.gemspec1
-rw-r--r--views/layout.haml2
-rw-r--r--views/license.haml1
5 files changed, 11 insertions, 0 deletions
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
&copy;
%a{:href => 'http://www.in-silico.ch', :rel => "external"} <i style="font-family: serife">in silico</i> 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