forked from saurabh/orbit4-5
fixed tags and also some store commits
This commit is contained in:
parent
4575fce2a9
commit
c8d395aca1
|
@ -28,7 +28,7 @@ var FormValidator = function(form){
|
||||||
lowercase : function(value){
|
lowercase : function(value){
|
||||||
return (value == value.toLowerCase() ? true : false);
|
return (value == value.toLowerCase() ? true : false);
|
||||||
},
|
},
|
||||||
email : function(){
|
email : function(value){
|
||||||
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||||
return re.test(value);
|
return re.test(value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,7 +334,7 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default;
|
||||||
display: none;
|
display: none;
|
||||||
top: 0;
|
top: 0;
|
||||||
margin: 0 2em;
|
margin: 0 2em;
|
||||||
padding: 0.3em 0;
|
padding: 0;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -344,6 +344,9 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default;
|
||||||
a {
|
a {
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
}
|
}
|
||||||
|
.page-main & {
|
||||||
|
padding: 0.3em 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.orbit-bar-search-sign-language {
|
.orbit-bar-search-sign-language {
|
||||||
float: right;
|
float: right;
|
||||||
|
@ -355,6 +358,7 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default;
|
||||||
input[type="search"] {
|
input[type="search"] {
|
||||||
color: $orbit-bar-bgc-lighter;
|
color: $orbit-bar-bgc-lighter;
|
||||||
border: none;
|
border: none;
|
||||||
|
margin-bottom: 0;
|
||||||
border-radius: 1.7em;
|
border-radius: 1.7em;
|
||||||
line-height: 1.3em;
|
line-height: 1.3em;
|
||||||
padding: 0.2em 0.8em;
|
padding: 0.2em 0.8em;
|
||||||
|
|
|
@ -3,7 +3,7 @@ class Admin::ModuleStoreController < OrbitAdminController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@extensions = []
|
@extensions = []
|
||||||
@downloaded_extensions = get_downloaded_extension
|
@downloaded_extensions = []
|
||||||
# if current_site.site_token?
|
# if current_site.site_token?
|
||||||
# if current_site.store_confirmation
|
# if current_site.store_confirmation
|
||||||
# @extensions = get_extensions
|
# @extensions = get_extensions
|
||||||
|
|
|
@ -16,12 +16,29 @@ class StoreApiController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def install_module
|
def install_module
|
||||||
|
if current_site.store_token.nil?
|
||||||
|
response = {"success" => false}
|
||||||
|
elsif current_site.store_token == params[:site_token]
|
||||||
file = File.join(Rails.root,"downloaded_extensions.rb")
|
file = File.join(Rails.root,"downloaded_extensions.rb")
|
||||||
g = "gem '#{params[:module_key]}', git: '#{params[:git_path]}'"
|
g = "gem '#{params[:module_key]}', git: '#{params[:git_path]}'"
|
||||||
File.open(file,"a+") { |f| f.puts(g) }
|
File.open(file,"a+") { |f| f.puts(g) }
|
||||||
if !directory_exists?(File.join(Rails.root,"app","templates","#{Site.first.template}","modules","#{params[:module_key]}"))
|
if !directory_exists?(File.join(Rails.root,"app","templates","#{Site.first.template}","modules","#{params[:module_key]}"))
|
||||||
download_template(params[:template],params[:template_filename])
|
download_template(params[:template],params[:template_filename])
|
||||||
end
|
end
|
||||||
|
response = {"success" => true}
|
||||||
|
else
|
||||||
|
response = {"success" => false}
|
||||||
|
end
|
||||||
|
render :json => response.to_json
|
||||||
|
bundle_install if response["success"]
|
||||||
|
end
|
||||||
|
|
||||||
|
def uninstall_module
|
||||||
|
file = File.join(Rails.root,"downloaded_extensions.rb")
|
||||||
|
data = File.read(file)
|
||||||
|
g = "gem '#{params[:module_key]}', git: '#{params[:git_path]}'\n"
|
||||||
|
data = data.gsub(g,"")
|
||||||
|
File.write(file,data)
|
||||||
bundle_install
|
bundle_install
|
||||||
render :json => {"success" => true}.to_json
|
render :json => {"success" => true}.to_json
|
||||||
end
|
end
|
||||||
|
@ -58,5 +75,6 @@ class StoreApiController < ApplicationController
|
||||||
zip_file.extract(f, f_path) unless File.exist?(f_path)
|
zip_file.extract(f, f_path) unless File.exist?(f_path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FileUtils.rm_rf(File.join(Rails.root,"public","template_cache"))
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -136,11 +136,11 @@ module OrbitHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.set_widget_tags(tags)
|
def self.set_widget_tags(tags)
|
||||||
@tags = tags;
|
@widget_tags = tags;
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.widget_tags
|
def self.widget_tags
|
||||||
@tags
|
@widget_tags
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.user_can_edit?(obj)
|
def self.user_can_edit?(obj)
|
||||||
|
|
|
@ -28,6 +28,7 @@ Orbit::Application.routes.draw do
|
||||||
get "/module/:name/show" => "home#show"
|
get "/module/:name/show" => "home#show"
|
||||||
post "/store/confirmation" => "store_api#confirmation"
|
post "/store/confirmation" => "store_api#confirmation"
|
||||||
post "/store/install_module" => "store_api#install_module"
|
post "/store/install_module" => "store_api#install_module"
|
||||||
|
post "/store/uninstall_module" => "store_api#uninstall_module"
|
||||||
|
|
||||||
# The priority is based upon order of creation: first created -> highest priority.
|
# The priority is based upon order of creation: first created -> highest priority.
|
||||||
# See how all your routes lay out with "rake routes".
|
# See how all your routes lay out with "rake routes".
|
||||||
|
|
Loading…
Reference in New Issue