Downloaded Modules now use tags. mobile/app always active
This commit is contained in:
parent
af1676c69f
commit
941833e4d2
|
@ -26,11 +26,11 @@ class Admin::ModuleStoreController < OrbitBackendController
|
||||||
extension = get_extension(params[:id]) rescue nil
|
extension = get_extension(params[:id]) rescue nil
|
||||||
extension_name = extension["key"].to_s
|
extension_name = extension["key"].to_s
|
||||||
git_repository_url = extension["git_url"]
|
git_repository_url = extension["git_url"]
|
||||||
version = extension["version"]
|
tag = extension["tag"]
|
||||||
module_installed = File.read("downloaded_extensions.rb").include?(extension["key"])
|
module_installed = File.read("downloaded_extensions.rb").include?(extension["key"])
|
||||||
|
|
||||||
if module_installed.eql?(false)
|
if module_installed.eql?(false)
|
||||||
@download_link = "gem '#{extension_name}', '#{version}', :git => '#{git_repository_url}'"
|
@download_link = "gem '#{extension_name}', :git => '#{git_repository_url}', :tag => '#{tag}'"
|
||||||
File.open("downloaded_extensions.rb", 'a') do |file|
|
File.open("downloaded_extensions.rb", 'a') do |file|
|
||||||
file.puts @download_link
|
file.puts @download_link
|
||||||
end
|
end
|
||||||
|
@ -107,8 +107,8 @@ class Admin::ModuleStoreController < OrbitBackendController
|
||||||
if !extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}.blank?
|
if !extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}.blank?
|
||||||
extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}[0]['installed']=true
|
extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}[0]['installed']=true
|
||||||
extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}[0]['enabled']=status
|
extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}[0]['enabled']=status
|
||||||
extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}[0]['installed_version']=exist_ext[1].split(/[\'\"]/)[1]
|
extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}[0]['installed_version']=exist_ext[2].split(/[\'\"]/)[1]
|
||||||
if extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}[0]['version'] != exist_ext[1].split(/[\'\"]/)[1]
|
if extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}[0]['tag'] != exist_ext[2].split(/[\'\"]/)[1]
|
||||||
extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}[0]['updated'] = false
|
extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}[0]['updated'] = false
|
||||||
else
|
else
|
||||||
extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}[0]['updated'] = true
|
extensions.select{|ext| ext['key']==exist_ext[0].split(/[\'\"]/)[1]}[0]['updated'] = true
|
||||||
|
@ -134,7 +134,7 @@ class Admin::ModuleStoreController < OrbitBackendController
|
||||||
status = !extension.start_with?("# ")
|
status = !extension.start_with?("# ")
|
||||||
extension = extension.split(',')
|
extension = extension.split(',')
|
||||||
|
|
||||||
downloaded_extensions << {'name' => extension[0].split(/[\'\"]/)[1], 'version' => extension[1].split(/[\'\"]/)[1], 'repo' => extension[2].split(/[\'\"]/)[1], 'status' => status}
|
downloaded_extensions << {'name' => extension[0].split(/[\'\"]/)[1], 'repo' => extension[1].split(/[\'\"]/)[1], 'tag' => extension[2].split(/[\'\"]/)[1], 'status' => status}
|
||||||
end
|
end
|
||||||
|
|
||||||
extensions.close
|
extensions.close
|
||||||
|
|
|
@ -476,6 +476,15 @@ class ApplicationController < ActionController::Base
|
||||||
session[:mobile_param]
|
session[:mobile_param]
|
||||||
end
|
end
|
||||||
request.format = :mobile if mobile_device?
|
request.format = :mobile if mobile_device?
|
||||||
|
else
|
||||||
|
session[:mobile_param] = if request.path =~ /app/
|
||||||
|
'1'
|
||||||
|
elsif params[:mobile]
|
||||||
|
params[:mobile]
|
||||||
|
else
|
||||||
|
session[:mobile_param]
|
||||||
|
end
|
||||||
|
request.format = :mobile if mobile_device?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue