From b18572f6e41633612e97861bb28925af5d844f44 Mon Sep 17 00:00:00 2001 From: BOHUNG Date: Mon, 13 Jan 2020 14:54:42 +0800 Subject: [PATCH] test --- .../admin/patchfiles_controller.rb | 1 + patchfile.gemspec | 19 +++++- patchfile_li.txt | 66 +++++++++++++++++++ patchfile_li_choices.txt | 10 +++ 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 patchfile_li.txt create mode 100644 patchfile_li_choices.txt diff --git a/app/controllers/admin/patchfiles_controller.rb b/app/controllers/admin/patchfiles_controller.rb index bd4e96a..92c9203 100644 --- a/app/controllers/admin/patchfiles_controller.rb +++ b/app/controllers/admin/patchfiles_controller.rb @@ -4,6 +4,7 @@ class Admin::PatchfilesController < OrbitAdminController include Admin::PatchfilesHelper before_action :getfont , :create_first_field #before_action :load_access_levels + layout "structure" def initialize super @app_title = "patchfile" diff --git a/patchfile.gemspec b/patchfile.gemspec index 16f99af..33dfc06 100644 --- a/patchfile.gemspec +++ b/patchfile.gemspec @@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: require "patchfile/version" app_path = File.expand_path(__dir__) -if !Dir.exist?(ENV['PWD']+"/app/assets/stylesheets/lib/jquery-ui-1.12.1/") +if !Dir.exist?("#{ENV['PWD']}"+"/app/assets/stylesheets/lib/jquery-ui-1.12.1/") puts "copying jquery-ui" begin `cp -r "#{app_path}/updatefiles/accessibility/jquery-ui-1.12.1/." "#{ENV['PWD']}/app/assets/stylesheets/lib/jquery-ui-1.12.1/"` @@ -11,6 +11,23 @@ if !Dir.exist?(ENV['PWD']+"/app/assets/stylesheets/lib/jquery-ui-1.12.1/") puts "There is an error in coppying jquery-ui" end end +#Add patchfile to Admin area +@patchfile_li = File.read(app_path+"/patchfile_li.txt") +@patchfile_li_choices = File.read(app_path+"/patchfile_li_choices.txt") +Dir.chdir(ENV['PWD']+'/app/views/shared') do + @file_text = File.read("_side_bar.html.erb") + if @file_text.include?('