This commit is contained in:
BoHung Chiu 2021-10-20 11:33:40 +08:00
parent 8ff3540744
commit 6b2930860e
1 changed files with 6 additions and 2 deletions

View File

@ -23,12 +23,16 @@ end
@file_text = File.read(dir_pwd+'/app/views/shared/_side_bar.html.erb').force_encoding('UTF-8') @file_text = File.read(dir_pwd+'/app/views/shared/_side_bar.html.erb').force_encoding('UTF-8')
if !@file_text.include?('<div class="patchfile sub-nav-block icons-megaphone">') if !@file_text.include?('<div class="patchfile sub-nav-block icons-megaphone">')
@indert_index = @file_text.index('</nav>') @indert_index = @file_text.index('</nav>')
unless @indert_index.nil?
@file_text.insert(@indert_index , @patchfile_li_choices) @file_text.insert(@indert_index , @patchfile_li_choices)
end end
end
if !@file_text.include?('patchfile_li') if !@file_text.include?('patchfile_li')
@indert_index = @file_text.index('<li title="<%= t(\'site_info\') %>">') @indert_index = @file_text.index('<li title="<%= t(\'site_info\') %>">')
unless @indert_index.nil?
@file_text.insert(@indert_index , @patchfile_li) @file_text.insert(@indert_index , @patchfile_li)
end end
end
begin begin
f = File.open(dir_pwd+'/app/views/shared/_side_bar.html.erb','w') f = File.open(dir_pwd+'/app/views/shared/_side_bar.html.erb','w')
f.write(@file_text) f.write(@file_text)