fixed tags and also some store commits

This commit is contained in:
Harry Bomrah 2014-12-28 14:43:34 +08:00
parent 4575fce2a9
commit c8d395aca1
6 changed files with 34 additions and 11 deletions

View File

@ -28,7 +28,7 @@ var FormValidator = function(form){
lowercase : function(value){
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,}))$/;
return re.test(value);
}

View File

@ -334,7 +334,7 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default;
display: none;
top: 0;
margin: 0 2em;
padding: 0.3em 0;
padding: 0;
color: #FFF;
font-size: 1.4em;
text-align: center;
@ -344,6 +344,9 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default;
a {
color: #FFF;
}
.page-main & {
padding: 0.3em 0;
}
}
.orbit-bar-search-sign-language {
float: right;
@ -355,6 +358,7 @@ $orbit-bar-bgc-lighter: lighten($orbit-bar-bgc, 20%) !default;
input[type="search"] {
color: $orbit-bar-bgc-lighter;
border: none;
margin-bottom: 0;
border-radius: 1.7em;
line-height: 1.3em;
padding: 0.2em 0.8em;

View File

@ -3,7 +3,7 @@ class Admin::ModuleStoreController < OrbitAdminController
def index
@extensions = []
@downloaded_extensions = get_downloaded_extension
@downloaded_extensions = []
# if current_site.site_token?
# if current_site.store_confirmation
# @extensions = get_extensions

View File

@ -16,14 +16,31 @@ class StoreApiController < ApplicationController
end
def install_module
file = File.join(Rails.root,"downloaded_extensions.rb")
g = "gem '#{params[:module_key]}', git: '#{params[:git_path]}'"
File.open(file,"a+") { |f| f.puts(g) }
if !directory_exists?(File.join(Rails.root,"app","templates","#{Site.first.template}","modules","#{params[:module_key]}"))
download_template(params[:template],params[:template_filename])
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")
g = "gem '#{params[:module_key]}', git: '#{params[:git_path]}'"
File.open(file,"a+") { |f| f.puts(g) }
if !directory_exists?(File.join(Rails.root,"app","templates","#{Site.first.template}","modules","#{params[:module_key]}"))
download_template(params[:template],params[:template_filename])
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
render :json => {"success" => true} .to_json
render :json => {"success" => true}.to_json
end
private
@ -58,5 +75,6 @@ class StoreApiController < ApplicationController
zip_file.extract(f, f_path) unless File.exist?(f_path)
}
}
FileUtils.rm_rf(File.join(Rails.root,"public","template_cache"))
end
end

View File

@ -136,11 +136,11 @@ module OrbitHelper
end
def self.set_widget_tags(tags)
@tags = tags;
@widget_tags = tags;
end
def self.widget_tags
@tags
@widget_tags
end
def self.user_can_edit?(obj)

View File

@ -28,6 +28,7 @@ Orbit::Application.routes.draw do
get "/module/:name/show" => "home#show"
post "/store/confirmation" => "store_api#confirmation"
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.
# See how all your routes lay out with "rake routes".