This commit is contained in:
BOHUNG 2020-02-06 15:50:25 +08:00
parent db59135626
commit e116f69577
3 changed files with 60 additions and 23 deletions

View File

@ -1,6 +1,40 @@
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
# stub: cancerpredict 0.0.1 ruby lib # stub: cancerpredict 0.0.1 ruby lib
insert_flag = 0
app_path = File.expand_path(__dir__)
template_path = ENV['PWD'] + '/app/templates'
all_template = Dir.glob(template_path+'/*/')
puts 'copying module'
check_texts = '<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.min.js"%>'
edit_texts = '<%= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"%>'
all_template.each do |folder|
if !folder.include?('mobile')
begin
if folder.split('/')[-1] != 'mobile'
begin
system ('cp -r '+ app_path + '/modules/. ' + folder+'/modules/.')
puts "finish copy module cancerpredict to #{folder}"
rescue
puts 'error copy'
end
end
texts = File.read(folder+'partial/_head.html.erb')
insert_flag = 0
if texts.include?(check_texts)
texts = texts.gsub(check_texts,edit_texts)
insert_flag = 1
end
if insert_flag == 1
puts 'editing _head.html.erb'
f = File.open(folder+'partial/_head.html.erb','w')
f.write(texts)
f.close
end
rescue
puts "not found _head.html.erb in #{folder}"
end
end
end
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = "cancerpredict" s.name = "cancerpredict"
s.version = "0.0.1" s.version = "0.0.1"

View File

@ -12,5 +12,7 @@ Rails.application.routes.draw do
get 'cancerpredicts/export_cancer_tool_record' , to: 'cancerpredicts#export_cancer_tool_record' get 'cancerpredicts/export_cancer_tool_record' , to: 'cancerpredicts#export_cancer_tool_record'
resources :cancerpredicts resources :cancerpredicts
end end
get "cancerpredictResult", to: "cancerpredicts#calculate"
post "cancerpredictResult", to: "cancerpredicts#calculate"
end end
end end

View File

@ -9,29 +9,30 @@ module Cancerpredict
authorizable authorizable
widget_methods ["widget"] widget_methods ["widget"]
widget_settings [{"data_count"=>1}] widget_settings [{"data_count"=>1}]
frontend_enabled set_keyword_contstraints ['cancerpredictResult']
side_bar do frontend_enabled
head_label_i18n 'cancerpredict.cancerpredict', icon_class: "icons-megaphone" side_bar do
available_for "users" head_label_i18n 'cancerpredict.cancerpredict', icon_class: "icons-megaphone"
active_for_controllers (['admin/cancerpredicts']) available_for "users"
head_link_path "admin_cancerpredicts_path" active_for_controllers (['admin/cancerpredicts'])
head_link_path "admin_cancerpredicts_path"
context_link 'cancerpredict.cancerpredict', context_link 'cancerpredict.cancerpredict',
:link_path=>"admin_cancerpredicts_path" , :link_path=>"admin_cancerpredicts_path" ,
:priority=>1, :priority=>1,
:active_for_action=>{'admin/cancerpredicts'=>'index'}, :active_for_action=>{'admin/cancerpredicts'=>'index'},
:available_for => 'users' :available_for => 'users'
context_link 'cancerpredict.submitResult', context_link 'cancerpredict.submitResult',
:link_path=>"admin_cancerpredicts_showSubmit_path" , :link_path=>"admin_cancerpredicts_showSubmit_path" ,
:priority=>1, :priority=>1,
:active_for_action=>{'admin/cancerpredicts'=>'show_submit'}, :active_for_action=>{'admin/cancerpredicts'=>'show_submit'},
:available_for => 'users' :available_for => 'users'
context_link 'cancerpredict.export_cancer_predict_tool_records', context_link 'cancerpredict.export_cancer_predict_tool_records',
:link_path=>"admin_cancerpredicts_export_cancer_tool_record_path" , :link_path=>"admin_cancerpredicts_export_cancer_tool_record_path" ,
:priority=>1, :priority=>1,
:active_for_action=>{'admin/cancerpredicts'=>'export_cancer_tool_record'}, :active_for_action=>{'admin/cancerpredicts'=>'export_cancer_tool_record'},
:available_for => 'users' :available_for => 'users'
end end
end end
end end
end end