Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
Manson Wang | 095157c0ae | |
Spen | ee6dcf238f | |
Spen | bfebed7cb8 | |
Manson Wang | e903bd0c39 | |
Spen | 3cd196e2a3 | |
Manson Wang | 1eaa0f1801 | |
Manson Wang | 822c23e841 | |
Harry Bomrah | ab94c79fdb |
|
@ -1,4 +1,6 @@
|
||||||
var ListCheck = function(element) {
|
$(function() {
|
||||||
|
var ListCheckData = {},
|
||||||
|
ListCheck = function(element) {
|
||||||
this.element = $(element);
|
this.element = $(element);
|
||||||
this.element.data('exists', true);
|
this.element.data('exists', true);
|
||||||
if(this.element.context.parentNode.tagName == "TD") {
|
if(this.element.context.parentNode.tagName == "TD") {
|
||||||
|
@ -11,47 +13,70 @@ var ListCheck = function(element) {
|
||||||
this.element.before('<i class="icon-check-empty" />');
|
this.element.before('<i class="icon-check-empty" />');
|
||||||
};
|
};
|
||||||
|
|
||||||
$.fn.listCheck = function (callback) {
|
$.fn.listCheck = function () {
|
||||||
this.each(function (i) {
|
$(this).each(function() {
|
||||||
|
var $this = $(this),
|
||||||
|
$el = $this.find('input[type="checkbox"]');
|
||||||
|
$el.each(function (i) {
|
||||||
if(!$(this).data('exists')) {
|
if(!$(this).data('exists')) {
|
||||||
new ListCheck(this);
|
new ListCheck(this);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
this.on(clickEvent, function(e) {
|
$this.on(clickEvent, $el, function(e) {
|
||||||
if($(this).prop('checked')) {
|
if($(e.target).prop('checked')) {
|
||||||
$(this).siblings('i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
|
$(e.target).siblings('i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
|
||||||
} else {
|
} else {
|
||||||
$(this).siblings('i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
|
$(e.target).siblings('i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
|
||||||
};
|
};
|
||||||
if ($(this).closest('.listCheckHead').length) {
|
if($(e.target).closest('th').hasClass('listCheckHead')) {
|
||||||
$('.listCheck .list-check').prop('checked', $(this).prop('checked'));
|
$this.find('.listCheck input[type="checkbox"]').prop('checked', $(e.target).prop('checked'));
|
||||||
if($(this).prop('checked')) {
|
if($(e.target).prop('checked')) {
|
||||||
$('.listCheck i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
|
$this.find('.listCheck i').addClass('icon-check').removeClass('icon-check-empty').closest('tr').addClass('checkHit');
|
||||||
} else {
|
} else {
|
||||||
$('.listCheck i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
|
$this.find('.listCheck i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var _isCheck = $('tbody .list-check').filter(':checked').length,
|
var _isCheck = $this.find('tbody').find($el).filter(':checked').length,
|
||||||
_defaultLength = $('tbody .list-check').length;
|
_defaultLength = $this.find('tbody').find($el).length;
|
||||||
|
|
||||||
if(_isCheck > 0 && _isCheck < _defaultLength) {
|
if(_isCheck > 0 && _isCheck < _defaultLength) {
|
||||||
$('.listCheckHead i').removeClass('icon-check-empty icon-check').addClass('icon-minus');
|
$this.find('.listCheckHead i').removeClass('icon-check-empty icon-check').addClass('icon-minus');
|
||||||
} else if(!_isCheck) {
|
} else if(!_isCheck) {
|
||||||
$('.listCheckHead i').removeClass('icon-minus icon-check').addClass('icon-check-empty');
|
$this.find('.listCheckHead i').removeClass('icon-minus icon-check').addClass('icon-check-empty');
|
||||||
} else {
|
} else {
|
||||||
$('.listCheckHead i').removeClass('icon-check-empty icon-minus').addClass('icon-check');
|
$this.find('.listCheckHead i').removeClass('icon-check-empty icon-minus').addClass('icon-check');
|
||||||
}
|
}
|
||||||
_isCheck ? $('.list-active-btn').removeClass('disabled').data('actionable', true) : $('.list-active-btn').addClass('disabled').data('actionable', false);
|
_isCheck ? $this.find('.list-active-btn').removeClass('disabled').data('actionable', true) : $this.find('.list-active-btn').addClass('disabled').data('actionable', false);
|
||||||
});
|
});
|
||||||
};
|
$this.on(clickEvent, '.list-active-btn', function(e) {
|
||||||
function clearCheck() {
|
if(!$(this).hasClass('disabled')) {
|
||||||
$('.list-check').each(function() {
|
ListCheckData.url = $(this).attr('rel');
|
||||||
$(this).prop('checked', false);
|
ListCheckData.name = $this.find('tbody').find('input[type="checkbox"]').attr('name');
|
||||||
})
|
ListCheckData.action = $(this).data('checkAction');
|
||||||
|
ListCheckData.values = [];
|
||||||
|
ListCheckData.element = $this
|
||||||
|
$this.find('tbody').find('input[type="checkbox"]').each(function (i) {
|
||||||
|
this.checked && ListCheckData.values.push("ids[]=" + this.value);
|
||||||
|
});
|
||||||
|
console.log(ListCheckData.values.join("&"));
|
||||||
|
$('#dialog').modal('show');
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
clearCheck($(this));
|
||||||
|
};
|
||||||
|
|
||||||
|
function clearCheck(element) {
|
||||||
|
element.find('input[type="checkbox"]').each(function() {
|
||||||
|
$(this).prop('checked', false).siblings('i').addClass('icon-check-empty').removeClass('icon-check').closest('tr').removeClass('checkHit');
|
||||||
|
});
|
||||||
|
element.find('.list-active-btn').addClass('disabled');
|
||||||
|
};
|
||||||
|
|
||||||
function actionSuccess(e) {
|
function actionSuccess(e) {
|
||||||
$("tbody .list-check").each(function() {
|
ListCheckData.element.find('tbody').find('input[type="checkbox"]').each(function() {
|
||||||
switch(e) {
|
switch(e) {
|
||||||
case 'list-be-hide':
|
case 'list-be-hide':
|
||||||
$(this).filter(':checked').closest('tr').addClass('checkHide');
|
$(this).filter(':checked').closest('tr').addClass('checkHide');
|
||||||
|
@ -67,32 +92,17 @@ function actionSuccess(e) {
|
||||||
};
|
};
|
||||||
$('.list-check').siblings('i').removeAttr('class').addClass('icon-check-empty').closest('tr').removeClass('checkHit');
|
$('.list-check').siblings('i').removeAttr('class').addClass('icon-check-empty').closest('tr').removeClass('checkHit');
|
||||||
});
|
});
|
||||||
clearCheck();
|
clearCheck(ListCheckData.element);
|
||||||
}
|
}
|
||||||
$(function() {
|
|
||||||
var $t = null,
|
|
||||||
_data = null;
|
|
||||||
clearCheck();
|
|
||||||
$('.list-check').listCheck();
|
$('.list-check').listCheck();
|
||||||
$('.list-active-btn').data('actionable', false).on(clickEvent, function(e) {
|
|
||||||
$t = $(this)
|
|
||||||
_data = $(this).data()
|
|
||||||
_data.actionable ? $('#dialog').modal('show') : "";
|
|
||||||
e.preventDefault();
|
|
||||||
});
|
|
||||||
$('.delete-item').on(clickEvent, function() {
|
$('.delete-item').on(clickEvent, function() {
|
||||||
var _v = [];
|
if(ListCheckData.url.indexOf("?") > -1) {
|
||||||
$("tbody .list-check").each(function() {
|
$.ajax(ListCheckData.url + "&" + ListCheckData.values.join("&")).done(function() {
|
||||||
this.checked && _v.push("ids[]="+this.value)
|
actionSuccess(ListCheckData.action);
|
||||||
});
|
|
||||||
var _t = $t.attr("rel");
|
|
||||||
if(_t.indexOf("?") > -1) {
|
|
||||||
$.ajax(_t + "&" + _v.join("&")).done(function() {
|
|
||||||
actionSuccess(_data.checkAction)
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$.ajax(_t + "?" + _v.join("&")).done(function() {
|
$.ajax(ListCheckData.url + "?" + ListCheckData.values.join("&")).done(function() {
|
||||||
actionSuccess(_data.checkAction)
|
actionSuccess(ListCheckData.action);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$('#dialog').modal('hide');
|
$('#dialog').modal('hide');
|
||||||
|
|
|
@ -2,12 +2,19 @@ $(function() {
|
||||||
$(".post_preview").click(function(){
|
$(".post_preview").click(function(){
|
||||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||||
|
|
||||||
$.post($(this).attr('url'), $(".previewable").serialize() ,function(data){
|
var preview_url = $(this).attr('url');
|
||||||
$('#show_preview .modal').modal();
|
|
||||||
|
$("form.previewable").ajaxSubmit({
|
||||||
|
beforeSubmit: function(a,f,o){
|
||||||
|
o.dataType = 'script';
|
||||||
|
o.url = preview_url;
|
||||||
|
o.type = 'post';
|
||||||
|
},success: function(msg) {
|
||||||
|
$('#show_preview .modal').modal()
|
||||||
$('#show_preview .modal').height(function() {
|
$('#show_preview .modal').height(function() {
|
||||||
return $(window).height() * 0.7;
|
return $(window).height() * 0.7;
|
||||||
});
|
});
|
||||||
},'script');
|
}});
|
||||||
});
|
});
|
||||||
$(".preview_trigger").click(function(){
|
$(".preview_trigger").click(function(){
|
||||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
padding: 0 0 0 10px!important;
|
padding: 0 0 0 10px!important;
|
||||||
}
|
}
|
||||||
.listCheckHead .list-check,
|
.listCheckHead input[type="checkbox"],
|
||||||
.listCheck .list-check {
|
.listCheck input[type="checkbox"] {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin: -12px 0 0 -1px;
|
margin: -12px 0 0 -1px;
|
||||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
||||||
|
|
|
@ -36,6 +36,26 @@ class Admin::PagesController < Admin::ItemsController
|
||||||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||||
end
|
end
|
||||||
if @item.update_attributes(params[:page])
|
if @item.update_attributes(params[:page])
|
||||||
|
unless params[:page]['frontend_field'].nil?
|
||||||
|
frontend_class = []
|
||||||
|
frontend_field_name = []
|
||||||
|
frontend_sat_to_link = []
|
||||||
|
|
||||||
|
params[:page]['frontend_field'].each do |field|
|
||||||
|
frontend_class << field['class']
|
||||||
|
frontend_field_name << field['field_name']
|
||||||
|
frontend_sat_to_link << field['sat_to_link']
|
||||||
|
end
|
||||||
|
|
||||||
|
@item['frontend_class'] = frontend_class
|
||||||
|
@item['frontend_field_name'] = frontend_field_name
|
||||||
|
@item['frontend_sat_to_link'] = frontend_sat_to_link
|
||||||
|
end
|
||||||
|
|
||||||
|
@item['tag'] = params[:page]['tag'] == nil ? [] : params[:page]['tag']
|
||||||
|
|
||||||
|
@item.save
|
||||||
|
|
||||||
render 'admin/items/reload_items'
|
render 'admin/items/reload_items'
|
||||||
else
|
else
|
||||||
@error = error_messages_for(@item)
|
@error = error_messages_for(@item)
|
||||||
|
|
|
@ -72,7 +72,10 @@ class Admin::SitesController < OrbitBackendController
|
||||||
end
|
end
|
||||||
|
|
||||||
def system_info
|
def system_info
|
||||||
|
@disk_free = `df -h /`.gsub("\n","<br/>").html_safe
|
||||||
|
@nginx_version = %x[/opt/nginx/sbin/nginx -v 2>&1].gsub("\n","<br/> ").html_safe
|
||||||
|
@mongo_version = `mongod --version`.split("\n")[0].html_safe
|
||||||
|
@linux_version = `lsb_release -d`.split(":")[1].html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
def search_engine
|
def search_engine
|
||||||
|
|
|
@ -1,22 +1,95 @@
|
||||||
|
require 'net/http'
|
||||||
|
require 'uri'
|
||||||
|
require 'fileutils'
|
||||||
|
require 'zip/zip'
|
||||||
class Admin::TemplateStoreController < OrbitBackendController
|
class Admin::TemplateStoreController < OrbitBackendController
|
||||||
|
|
||||||
|
|
||||||
@@store_domain = STORE_CONFIG[:store_settings]["url"]
|
@@store_domain = STORE_CONFIG[:store_settings]["url"]
|
||||||
def index
|
def index
|
||||||
@store = @@store_domain
|
@store = @@store_domain
|
||||||
|
@design_ids = Design.all.map{|d| d.template_store_id}
|
||||||
@templates = JSON.parse(get_templates)
|
@templates = JSON.parse(get_templates)
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@store = @@store_domain
|
@store = @@store_domain
|
||||||
|
@design_ids = Design.all.map{|d| d.template_store_id}
|
||||||
@template = JSON.parse(get_template(params[:id])) rescue nil
|
@template = JSON.parse(get_template(params[:id])) rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def download_theme
|
def download_theme
|
||||||
render :json => {"success"=>true}.to_json
|
url = @@store_domain + params["url"]
|
||||||
|
url_base = url.split('/')[2]
|
||||||
|
url_path = '/'+url.split('/')[3..-1].join('/')
|
||||||
|
Net::HTTP.start(url_base) do |http|
|
||||||
|
open("public/#{params['slug']}.zip", "wb") do |file|
|
||||||
|
http.get(url_path) do |str|
|
||||||
|
file.write(str)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
upload_package("#{params['slug']}.zip", params["id"])
|
||||||
|
File.delete("public/#{params['slug']}.zip")
|
||||||
|
render :json => {"success"=>true,"url"=>@@store_domain + params["url"]}.to_json
|
||||||
end
|
end
|
||||||
protected
|
protected
|
||||||
|
|
||||||
|
def upload_package(package_name,template_store_id)
|
||||||
|
|
||||||
|
temp_file = Tempfile.new("temp_file")
|
||||||
|
original_file = File.open("#{Rails.root}/public/#{package_name}")
|
||||||
|
temp_file.write(original_file.read.force_encoding('UTF-8'))
|
||||||
|
temp_file.rewind
|
||||||
|
filename = File.basename(original_file,".zip")
|
||||||
|
unzip_design(temp_file, filename, template_store_id)
|
||||||
|
temp_file.close
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def unzip_design(file, zip_name, template_store_id)
|
||||||
|
Zip::ZipFile.open(file) { |zip_file|
|
||||||
|
design = Design.new.from_json(zip_file.read("#{zip_name}/info.json"))
|
||||||
|
design.template_store_id = template_store_id
|
||||||
|
Dir.mktmpdir('f_path') { |dir|
|
||||||
|
themes_entries = []
|
||||||
|
javascripts_entries = []
|
||||||
|
images_entries = []
|
||||||
|
|
||||||
|
zip_file.entries.each do |entry|
|
||||||
|
case (path = entry.to_s)
|
||||||
|
when /\A(#{zip_name})\/(default\.css)\z/ #for default css
|
||||||
|
design.build_css_default(:file => get_temp_file(zip_file, dir, entry))
|
||||||
|
when /\A(#{zip_name})\/(reset\.css)\z/ #for reset css
|
||||||
|
design.build_css_reset(:file => get_temp_file(zip_file, dir, entry))
|
||||||
|
when /\A(#{zip_name})\/(layout\.html)\z/ #for layout html
|
||||||
|
design.build_layout(:file => get_temp_file(zip_file, dir, entry))
|
||||||
|
when /\A(#{zip_name})\/(themes)\/.*(\.css)\z/ #for themes css
|
||||||
|
themes_entries << entry
|
||||||
|
when /\A(#{zip_name})\/(javascripts)\/.*(\.js)\z/ #for js
|
||||||
|
javascripts_entries << entry
|
||||||
|
when /\A(#{zip_name})\/(images)\/.*((\.jpg)|(\.png)|(\.gif))\z/ #for img
|
||||||
|
images_entries << entry
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
['themes', 'javascripts', 'images'].each do |type|
|
||||||
|
eval("#{type}_entries").each do |entry|
|
||||||
|
eval("design.#{type}").build(:file => get_temp_file(zip_file, dir, entry))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
design.save
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_temp_file(zip_file, dir, entry)
|
||||||
|
filename = File.basename(entry.to_s)
|
||||||
|
temp_file = File.new(dir + '/' + filename, 'w+')
|
||||||
|
temp_file.write (zip_file.read entry ).force_encoding('UTF-8')
|
||||||
|
temp_file
|
||||||
|
end
|
||||||
|
|
||||||
def get_template(id)
|
def get_template(id)
|
||||||
uri = URI.parse("#{@@store_domain}/api/templates/#{id}")
|
uri = URI.parse("#{@@store_domain}/api/templates/#{id}")
|
||||||
http = Net::HTTP.new(uri.host, uri.port)
|
http = Net::HTTP.new(uri.host, uri.port)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
class OrbitBackendController < ApplicationController
|
class OrbitBackendController < ApplicationController
|
||||||
include OrbitCategory::Categorizing
|
include OrbitCategory::Categorizing
|
||||||
include OrbitCoreLib::Authorization
|
include OrbitCoreLib::Authorization
|
||||||
|
include OrbitCoreLib::PermissionUtility
|
||||||
include OrbitTag::Tagging
|
include OrbitTag::Tagging
|
||||||
include AdminHelper
|
include AdminHelper
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
|
|
|
@ -12,13 +12,13 @@ module OrbitBackendHelper
|
||||||
|
|
||||||
def show_form_status_field(object)
|
def show_form_status_field(object)
|
||||||
#by_object = (!object.is_expired? and object.is_pending?)
|
#by_object = (!object.is_expired? and object.is_pending?)
|
||||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
|
by_user = ((object.category.user_is_authorized_by_title?(current_user,"category_approval_#{@module_app.key}") rescue nil) or is_manager? or is_admin?)
|
||||||
by_user
|
by_user
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_approval_link(object)
|
def show_approval_link(object)
|
||||||
by_object = (!object.is_expired? and object.is_pending?)
|
by_object = (!object.is_expired? and object.is_pending?)
|
||||||
by_user = ((object.category.authed_users("approval_#{@module_app.key}").include?(current_user) rescue nil) or is_manager? or is_admin? or is_sub_manager?)
|
by_user = ((object.category.user_is_authorized_by_title?(current_user,"category_approval_#{@module_app.key}") rescue nil) or is_manager? or is_admin?)
|
||||||
by_object and by_user
|
by_object and by_user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ module OrbitBackendHelper
|
||||||
content_tag :li, link_to(t(quick[:translation] || :authorization_), eval("#{quick[:link]}"), class: "preview_trigger #{quick[:class]}")
|
content_tag :li, link_to(t(quick[:translation] || :authorization_), eval("#{quick[:link]}"), class: "preview_trigger #{quick[:class]}")
|
||||||
end
|
end
|
||||||
when 'edit'
|
when 'edit'
|
||||||
if authorization && approvable
|
if authorization && approvable || is_manager?
|
||||||
content_tag :li, link_to(t(quick[:translation] || :edit), quick[:link].nil? ? '#' : eval("#{quick[:link]}('#{object.id}'#{link_option})"), class: quick[:class], data: eval("#{quick[:data]}"))
|
content_tag :li, link_to(t(quick[:translation] || :edit), quick[:link].nil? ? '#' : eval("#{quick[:link]}('#{object.id}'#{link_option})"), class: quick[:class], data: eval("#{quick[:data]}"))
|
||||||
end
|
end
|
||||||
when 'delete'
|
when 'delete'
|
||||||
|
@ -320,10 +320,20 @@ module OrbitBackendHelper
|
||||||
if show_reject_reason(object)
|
if show_reject_reason(object)
|
||||||
content_tag :li, link_to(t(quick[:translation] || :rejected_reason) + ' ' + truncate(object.not_checked_reason, :length => 10), '#', rel: "tooltip", 'data-original-title' => (wrap_string_with(object.not_checked_reason, :line_width => 24)), class: "reject_info #{quick[:class]}")
|
content_tag :li, link_to(t(quick[:translation] || :rejected_reason) + ' ' + truncate(object.not_checked_reason, :length => 10), '#', rel: "tooltip", 'data-original-title' => (wrap_string_with(object.not_checked_reason, :line_width => 24)), class: "reject_info #{quick[:class]}")
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
if quick[:define_link]
|
||||||
|
if quick[:condition_option]
|
||||||
|
if eval("#{quick[:condition_option]}")
|
||||||
|
content_tag :li, link_to(t(quick[:translation]), eval("#{quick[:define_link]}"), class: quick[:class])
|
||||||
|
end
|
||||||
|
else
|
||||||
|
content_tag :li, link_to(t(quick[:translation]), eval("#{quick[:define_link]}"), class: quick[:class])
|
||||||
|
end
|
||||||
else
|
else
|
||||||
content_tag :li, link_to(t(quick[:translation]), eval("#{quick[:link]}('#{object.id}')"), class: quick[:class])
|
content_tag :li, link_to(t(quick[:translation]), eval("#{quick[:link]}('#{object.id}')"), class: quick[:class])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def get_sorted_objects(objects, field)
|
def get_sorted_objects(objects, field)
|
||||||
if field
|
if field
|
||||||
|
@ -433,6 +443,10 @@ module OrbitBackendHelper
|
||||||
res << "<li class='active'>#{t(:search_engine)}</li>"
|
res << "<li class='active'>#{t(:search_engine)}</li>"
|
||||||
when 'site_info'
|
when 'site_info'
|
||||||
res << "<li class='active'>#{t(:site_info)}</li>"
|
res << "<li class='active'>#{t(:site_info)}</li>"
|
||||||
|
when 'update_manager'
|
||||||
|
res << "<li class='active'>#{t(:update_manager)}</li>"
|
||||||
|
when 'system_info'
|
||||||
|
res << "<li class='active'>#{t("site.system_preference")}</li>"
|
||||||
end
|
end
|
||||||
when 'items'
|
when 'items'
|
||||||
res << "<li class='active'>#{t(:structure)}</li>"
|
res << "<li class='active'>#{t(:structure)}</li>"
|
||||||
|
|
|
@ -2,28 +2,30 @@ class CronMail < ActionMailer::Base
|
||||||
default :from => "orbit_test@rulingcom.com"
|
default :from => "orbit_test@rulingcom.com"
|
||||||
|
|
||||||
def get_settings
|
def get_settings
|
||||||
# @@smtp_settings = {
|
@site = Site.first
|
||||||
# :address => "smtp.gmail.com",
|
|
||||||
# :port => '587',
|
|
||||||
# :domain => "smtp.gmail.com",
|
|
||||||
# :authentication => "plain",
|
|
||||||
# :user_name => "redmine@rulingcom.com",
|
|
||||||
# :password => "rulingredmine",
|
|
||||||
# :tls => true,
|
|
||||||
# :enable_starttls_auto => true
|
|
||||||
# }
|
|
||||||
@@smtp_settings = {
|
@@smtp_settings = {
|
||||||
:address => @site['mail_settings']['address'],
|
:enable_starttls_auto => @site['site_settings']['enable_starttls_auto'],
|
||||||
:port => @site['mail_settings']['port'],
|
:address => @site['site_settings']['address'],
|
||||||
:domain => @site['mail_settings']['domain'],
|
:port => @site['site_settings']['port'],
|
||||||
:authentication => @site['mail_settings']['authentication'],
|
:domain => @site['site_settings']['domain'],
|
||||||
:user_name => @site['mail_settings']['user_name'],
|
:authentication => @site['site_settings']['authentication'],
|
||||||
:password => @site['mail_settings']['password'],
|
:user_name => @site['site_settings']['user_name'],
|
||||||
:tls => @site['mail_settings']['tls'],
|
:password => @site['site_settings']['password']
|
||||||
:enable_starttls_auto => @site['mail_settings']['enable_starttls_auto']
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.smtp_settings
|
||||||
|
@site = Site.first
|
||||||
|
@@smtp_settings = {
|
||||||
|
:enable_starttls_auto => @site['site_settings']['enable_starttls_auto'],
|
||||||
|
:address => @site['site_settings']['address'],
|
||||||
|
:port => @site['site_settings']['port'],
|
||||||
|
:domain => @site['site_settings']['domain'],
|
||||||
|
:authentication => @site['site_settings']['authentication'],
|
||||||
|
:user_name => @site['site_settings']['user_name'],
|
||||||
|
:password => @site['site_settings']['password']
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def time_check(msg)
|
def time_check(msg)
|
||||||
get_settings
|
get_settings
|
||||||
|
|
|
@ -7,6 +7,7 @@ class Design
|
||||||
field :intro, :type => String
|
field :intro, :type => String
|
||||||
field :title, :type => String
|
field :title, :type => String
|
||||||
field :version, :type => String
|
field :version, :type => String
|
||||||
|
field :template_store_id, :type => String
|
||||||
|
|
||||||
mount_uploader :zip_file, AssetUploader
|
mount_uploader :zip_file, AssetUploader
|
||||||
|
|
||||||
|
|
|
@ -194,6 +194,7 @@ class ModuleApp
|
||||||
# authorization
|
# authorization
|
||||||
def update_auth_approval_users
|
def update_auth_approval_users
|
||||||
user_ids = self.auth_approvals.inject([]) do |users, auth|
|
user_ids = self.auth_approvals.inject([]) do |users, auth|
|
||||||
|
auth = auth.class.find(auth.id)
|
||||||
users += auth.authorized_users.map{|user| user.id}
|
users += auth.authorized_users.map{|user| user.id}
|
||||||
end
|
end
|
||||||
self.update_attribute(:auth_approval_users, user_ids.uniq)
|
self.update_attribute(:auth_approval_users, user_ids.uniq)
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
|
|
||||||
<li title="<%= t('update_manager') %>"><%= link_to admin_site_update_manager_path(@site), :class => active_for_action('sites', 'update_manager') do %><span><i class="icon-refresh"></i></span><%end%></li>
|
<li title="<%= t('update_manager') %>"><%= link_to admin_site_update_manager_path(@site), :class => active_for_action('sites', 'update_manager') do %><span><i class="icon-refresh"></i></span><%end%></li>
|
||||||
|
|
||||||
<!-- <li title="System Info"><a href="/orbit_4.0.1/admin/system_info/index.shtml?sidebarNavList=8&subNavBlockList=0"><span><i class="icons-info-2"></i></span></a></li>
|
<li title="<%= t("site.system_preference") %>"><%= link_to admin_site_system_info_path(@site), :class => active_for_action('sites', 'system_info') do %><span><i class="icons-info-2"></i></span><%end%></li>
|
||||||
--> </ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="sub-nav-arrow"></div>
|
<div class="sub-nav-arrow"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
|
|
||||||
<li title="<%= t('update_manager') %>"><%= link_to admin_site_update_manager_path(@site), :class => active_for_action('sites', 'update_manager') do %><span><i class="icon-refresh"></i></span><%end%></li>
|
<li title="<%= t('update_manager') %>"><%= link_to admin_site_update_manager_path(@site), :class => active_for_action('sites', 'update_manager') do %><span><i class="icon-refresh"></i></span><%end%></li>
|
||||||
|
|
||||||
<!-- <li title="System Info"><a href="/orbit_4.0.1/admin/system_info/index.shtml?sidebarNavList=8&subNavBlockList=0"><span><i class="icons-info-2"></i></span></a></li>
|
<li title="<%= t("site.system_preference") %>"><%= link_to admin_site_system_info_path(@site), :class => active_for_action('sites', 'system_info') do %><span><i class="icons-info-2"></i></span><%end%></li>
|
||||||
--> </ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="sub-nav-arrow"></div>
|
<div class="sub-nav-arrow"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t 'mail.domain' %></label>
|
<label class="control-label muted"><%= t 'mail.domain' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.text_field :port, :value => (@site['site_settings']['port'] rescue nil), :class=>"input-large", :placeholder=>"Domain" %>
|
<%= f.text_field :domain, :value => (@site['site_settings']['domain'] rescue nil), :class=>"input-large", :placeholder=>"Domain" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label muted"><%= t 'mail.password' %></label>
|
<label class="control-label muted"><%= t 'mail.password' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.text_field :password, :value => (@site['site_settings']['password'] rescue nil), :class=>"input-large", :placeholder=>"Password" %>
|
<%= f.password_field :password, :value => (@site['site_settings']['password'] rescue nil), :class=>"input-large", :placeholder=>"Password" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
<h1><%= I18n.t("site.system_preference") %></h1>
|
|
||||||
<ul class="nav nav-tabs" id="myTab">
|
|
||||||
<li class="active"><a href="#summary" data-toggle="tab"><%= I18n.t("site.system_preference_.tab_summary") %></a></li>
|
|
||||||
<li><a href="#commits" data-toggle="tab"><%= I18n.t("site.system_preference_.tab_commits") %></a></li>
|
|
||||||
<li><a href="#backups" data-toggle="tab"><%= I18n.t("site.system_preference_.tab_backups") %></a></li>
|
|
||||||
<li><a href="#resque_logs" data-toggle="tab"><%= I18n.t("site.system_preference_.tab_logs") %></a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="tab-content">
|
|
||||||
<div class="tab-pane active in" id="summary">
|
|
||||||
<h2><%= I18n.t("site.system_preference_.summary.disk_space") %>:</h2>
|
|
||||||
<%= content_tag :p,@site.disk_space.gsub(/\n/,"<br />").html_safe if @site.disk_space %>
|
|
||||||
<h2><%= I18n.t("site.system_preference_.summary.code_update_at") %>: </h2>
|
|
||||||
<% @site.system_package_info.each do |index,value| %>
|
|
||||||
<h2><%= index.titleize %> <%= I18n.t("site.system_preference_.summary.version") %>:</h2>
|
|
||||||
<%= content_tag :p,value %>
|
|
||||||
<% end %>
|
|
||||||
<h2><%= I18n.t("site.system_preference_.summary.weekness_report") %>:<%= '' %></h2>
|
|
||||||
</div>
|
|
||||||
<div class="tab-pane" id="commits">
|
|
||||||
<% if @git_commit_list_file %>
|
|
||||||
<% @git_commit_list_file.lines do |line|%>
|
|
||||||
<%= line %><br/>
|
|
||||||
<% end%>
|
|
||||||
<% else %>
|
|
||||||
<div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<div class="tab-pane" id="backups">
|
|
||||||
<%if @db_backup_list_file %>
|
|
||||||
<% @db_backup_list_file.lines do |line|%>
|
|
||||||
<%=line %><br/>
|
|
||||||
<% end %>
|
|
||||||
<% else %>
|
|
||||||
<div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<div class="tab-pane" id="resque_logs">
|
|
||||||
<%if @db_backup_list_file %>
|
|
||||||
<% @resque_logs_file.lines do |line|%>
|
|
||||||
<%=line %><br/>
|
|
||||||
<% end if @resque_logs_file%>
|
|
||||||
<%else %>
|
|
||||||
<div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -1,5 +1,126 @@
|
||||||
|
<%= stylesheet_link_tag "lib/wrap-nav" %>
|
||||||
|
<%= stylesheet_link_tag "lib/main-list" %>
|
||||||
|
<%= stylesheet_link_tag "lib/main-forms" %>
|
||||||
|
<%= stylesheet_link_tag "lib/fileupload.css" %>
|
||||||
|
<%= stylesheet_link_tag "lib/togglebox.css" %>
|
||||||
|
<%= stylesheet_link_tag "lib/list-check.css" %>
|
||||||
|
|
||||||
|
<%= javascript_include_tag "lib/site_set" %>
|
||||||
|
<%= javascript_include_tag "lib/list-check" %>
|
||||||
|
|
||||||
<% content_for :side_bar do %>
|
<% content_for :side_bar do %>
|
||||||
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
|
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
system_info.html.erb
|
<form class="form-horizontal main-forms">
|
||||||
|
<fieldset>
|
||||||
|
<div class="input-area">
|
||||||
|
<div class="nav-name"><strong><%= t("preferences.classification") %></strong></div>
|
||||||
|
<ul class="nav nav-pills language-nav">
|
||||||
|
<li class="active"><a href="#overview" data-toggle="tab"><%= t("site.system_preference_.tab_summary") %></a></li>
|
||||||
|
<li><a href="#mail-cron-logs" data-toggle="tab"><%= t("site.system_preference_.tab_send_reminders_log") %></a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="tab-content">
|
||||||
|
<!-- Overview -->
|
||||||
|
<div id="overview" class="tab-pane fade in active">
|
||||||
|
<h3 class="muted"><%= t("site.system_preference_.summary.disk_space") %></h3>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<%= @disk_free %>
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
<h3 class="muted">Nginx <%= t("site.system_preference_.summary.version") %></h3>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<%= @nginx_version %>
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
</span>
|
||||||
|
<h3 class="muted">MongoDB <%= t("site.system_preference_.summary.version") %></h3>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<%= @mongo_version %>
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
<h3 class="muted">Linux <%= t("site.system_preference_.summary.version") %></h3>
|
||||||
|
<blockquote>
|
||||||
|
<p>
|
||||||
|
<%= @linux_version %>
|
||||||
|
</p>
|
||||||
|
</blockquote>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Email Log -->
|
||||||
|
<div id="mail-cron-logs" class="tab-pane fade">
|
||||||
|
<ul class="nav nav-pills">
|
||||||
|
<li class="active">
|
||||||
|
<a href="#send-log" data-toggle="tab"><%= t(:email_log) %></a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#waiting-sent" data-toggle="tab"><%= t(:email_queue) %></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane fade in active list-check" id="send-log">
|
||||||
|
<p class="">
|
||||||
|
<a href="#" class="btn list-active-btn disabled" data-check-action="list-be-remove" rel="/panel/announcement/back_end/bulletins/delete"><i class="icons-trash"></i></a>
|
||||||
|
</p>
|
||||||
|
<table class="table main-list table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<input type="checkbox" name="to_delete[]" value="b" />
|
||||||
|
</th>
|
||||||
|
<th><%= t(:sent_date) %></th>
|
||||||
|
<th><%= t(:subject) %></th>
|
||||||
|
<th><%= t(:mail_to) %></th>
|
||||||
|
<th><%= t(:mail_user) %></th>
|
||||||
|
<th><%= t(:mail_from_app) %></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane fade in list-check" id="waiting-sent">
|
||||||
|
<p class="">
|
||||||
|
<a href="#" class="btn list-active-btn disabled" data-check-action="list-be-remove" rel="/panel/announcement/back_end/bulletins/delete"><i class="icons-trash"></i></a>
|
||||||
|
</p>
|
||||||
|
<table class="table main-list table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<input type="checkbox" name="to_delete[]" value="b" />
|
||||||
|
</th>
|
||||||
|
<th><%= t(:sent_date) %></th>
|
||||||
|
<th><%= t(:subject) %></th>
|
||||||
|
<th><%= t(:mail_to) %></th>
|
||||||
|
<th><%= t(:mail_from_app) %></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div id="dialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="Delete item" aria-hidden="true">
|
||||||
|
<div class="modal-header">
|
||||||
|
<a class="close" data-dismiss="modal">×</a>
|
||||||
|
<h3><%= t(:sure?) %></h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<span class="text-warning text-center"><%= t(:this_action_can_not_be_restore) %></span>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t(:close) %></button>
|
||||||
|
<button class="delete-item btn btn-danger"><%= t(:delete_) %></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -60,7 +60,11 @@
|
||||||
<span class="item-price">Free</span>
|
<span class="item-price">Free</span>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<%= link_to "Download", "javascript:void(0);", "data-url" => template['template']['template']['url'], :class=> 'btn btn-primary download-link' %>
|
<% if @design_ids.include?(template["_id"]["$oid"]) %>
|
||||||
|
<%= link_to "Installed", "javascript:void(0);", "data-url" => template['template']['template']['url'], :class=> 'btn btn-success download-link', "disabled"=>"disabled", "data-name"=>template['title'], "data-slug"=>template["_slugs"][0], "data-id"=>template["_id"]["$oid"] %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to "Download", "javascript:void(0);", "data-url" => template['template']['template']['url'], :class=> 'btn btn-primary download-link', "data-name"=>template['title'], "data-slug"=>template["_slugs"][0], "data-id"=>template["_id"]["$oid"] %>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
@ -71,20 +75,20 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function(){
|
(function(){
|
||||||
$("a.download-link").on(clickEvent,function(){
|
$("a.download-link").on(clickEvent,function(){
|
||||||
var el = $(this),
|
if($(this).attr("disabled") == "disabled")return false;
|
||||||
downloadurl = $(this).data("url");
|
var el = $(this);
|
||||||
|
|
||||||
el.removeClass("btn-primary").addClass("btn-info").text("Installing").attr('disabled',"disabled");
|
el.removeClass("btn-primary").addClass("btn-info").text("Installing").attr('disabled',"disabled");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "<%= admin_template_store_download_theme_path %>",
|
url : "<%= admin_template_store_download_theme_path %>",
|
||||||
data : {"url" : downloadurl},
|
data : el.data(),
|
||||||
dataType : "json",
|
dataType : "json",
|
||||||
type : "post",
|
type : "post"
|
||||||
success : function(data){
|
}).done(function(data){
|
||||||
if(data.success){
|
if(data.success){
|
||||||
el.removeClass('btn-info').addClass('btn-success').text("Installed");
|
el.removeClass('btn-info').addClass('btn-success').text("Installed");
|
||||||
}
|
}
|
||||||
}
|
}).fail(function(){
|
||||||
|
el.removeClass('btn-info').addClass('btn-danger').text("Error, please try again.").removeAttr('disabled');
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})()
|
})()
|
||||||
|
|
|
@ -8,7 +8,11 @@
|
||||||
<div id="item-info">
|
<div id="item-info">
|
||||||
<%= image_tag "#{@store}#{@template['preview']['preview']['thumb']['url']}", :class => "item-thumb" %>
|
<%= image_tag "#{@store}#{@template['preview']['preview']['thumb']['url']}", :class => "item-thumb" %>
|
||||||
<h2 class="item-name"><%= @template['title'] %></h2>
|
<h2 class="item-name"><%= @template['title'] %></h2>
|
||||||
<%= link_to "Download", "javascript:void(0);", "data-url" => @template['template']['template']['url'], :class=> 'btn btn-primary download-link' %>
|
<% if @design_ids.include?(@template["_id"]["$oid"]) %>
|
||||||
|
<%= link_to "Installed", "javascript:void(0);", "data-url" => @template['template']['template']['url'], :class=> 'btn btn-success download-link', "disabled"=>"disabled", "data-name"=>@template['title'], "data-slug"=>@template["_slugs"][0], "data-id"=>@template["_id"]["$oid"] %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to "Download", "javascript:void(0);", "data-url" => @template['template']['template']['url'], :class=> 'btn btn-primary download-link', "data-name"=>@template['title'], "data-slug"=>@template["_slugs"][0], "data-id"=>@template["_id"]["$oid"] %>
|
||||||
|
<% end %>
|
||||||
<ul class="item-extra-info">
|
<ul class="item-extra-info">
|
||||||
<li><span class="title">views</span><span class="count"><%= Random.new.rand(10..100) %></span></li>
|
<li><span class="title">views</span><span class="count"><%= Random.new.rand(10..100) %></span></li>
|
||||||
<!-- <li><span class="title">color</span><span class="color-tag green"></span></li> -->
|
<!-- <li><span class="title">color</span><span class="color-tag green"></span></li> -->
|
||||||
|
@ -64,21 +68,22 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function(){
|
(function(){
|
||||||
$("a.download-link").on(clickEvent,function(){
|
$("a.download-link").on(clickEvent,function(){
|
||||||
var el = $(this),
|
if($(this).attr("disabled") == "disabled")return false;
|
||||||
downloadurl = $(this).data("url");
|
var el = $(this);
|
||||||
|
|
||||||
el.removeClass("btn-primary").addClass("btn-info").text("Installing").attr('disabled',"disabled");
|
el.removeClass("btn-primary").addClass("btn-info").text("Installing").attr('disabled',"disabled");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "<%= admin_template_store_download_theme_path %>",
|
url : "<%= admin_template_store_download_theme_path %>",
|
||||||
data : {"url" : downloadurl},
|
data : el.data(),
|
||||||
dataType : "json",
|
dataType : "json",
|
||||||
type : "post",
|
type : "post"
|
||||||
success : function(data){
|
}).done(function(data){
|
||||||
if(data.success){
|
if(data.success){
|
||||||
el.removeClass('btn-info').addClass('btn-success').text("Installed");
|
el.removeClass('btn-info').addClass('btn-success').text("Installed");
|
||||||
}
|
}
|
||||||
}
|
}).fail(function(){
|
||||||
|
el.removeClass('btn-info').addClass('btn-danger').text("Error, please try again.").removeAttr('disabled');
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})()
|
})()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
|
|
||||||
<div id="module-content">
|
<div id="module-content">
|
||||||
<div class="nano">
|
<div class="nano">
|
||||||
<div class="content">
|
<div class="content list-check">
|
||||||
<%=render :partial => @right_partial %>
|
<%=render :partial => @right_partial %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
function InsertPreviewImage(){
|
function InsertPreviewImage(){
|
||||||
if($("iframe").contents().find('.news_image').length){
|
if($("iframe").contents().find('.news_image').length){
|
||||||
$("iframe").contents().find('.news_image').append("<a href='' target='_blank'><img src='"+preview_img+"' width='320' height='240' /></a>");
|
$("iframe").contents().find('.news_image').append("<a href='' target='_blank'><img src='"+preview_img+"' width='320' /></a>");
|
||||||
}else{
|
}else{
|
||||||
setTimeout(InsertPreviewImage,1000);
|
setTimeout(InsertPreviewImage,1000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,15 +63,5 @@ Orbit::Application.configure do
|
||||||
config.action_mailer.delivery_method = :smtp
|
config.action_mailer.delivery_method = :smtp
|
||||||
config.action_mailer.perform_deliveries = true
|
config.action_mailer.perform_deliveries = true
|
||||||
config.action_mailer.raise_delivery_errors = true
|
config.action_mailer.raise_delivery_errors = true
|
||||||
config.action_mailer.smtp_settings = {
|
|
||||||
:enable_starttls_auto => true,
|
|
||||||
:openssl_verify_mode => 'none',
|
|
||||||
:address => 'smtp.sendgrid.net',
|
|
||||||
:port => '587',
|
|
||||||
:domain => "new.tp.rulingcom.com",
|
|
||||||
:authentication => "plain",
|
|
||||||
:user_name => "rulingcom",
|
|
||||||
:password => "bjo4xjp6"
|
|
||||||
}
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
if defined?(PhusionPassenger)
|
||||||
|
PhusionPassenger.on_event(:starting_worker_process) do |forked|
|
||||||
|
if forked
|
||||||
|
Resque.redis.client.disconnect
|
||||||
|
Resque.redis = Redis.new(:host => 'localhost', :port => 6379)
|
||||||
|
Resque.redis.namespace = Site.first.resque_namespace rescue APP_CONFIG['orbit']
|
||||||
|
else
|
||||||
|
# We're in conservative spawning mode. We don't need to do anything.
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -192,6 +192,8 @@ en:
|
||||||
link: Editing link
|
link: Editing link
|
||||||
page: Editing page
|
page: Editing page
|
||||||
email: Email
|
email: Email
|
||||||
|
email_log: Email Log
|
||||||
|
email_queue: Waiting to be sent
|
||||||
enable: Enable
|
enable: Enable
|
||||||
enabled_for: Enabled for
|
enabled_for: Enabled for
|
||||||
end: End
|
end: End
|
||||||
|
@ -223,11 +225,13 @@ en:
|
||||||
groups: Groups
|
groups: Groups
|
||||||
help: Help
|
help: Help
|
||||||
hidden: Hidden
|
hidden: Hidden
|
||||||
|
is_hidden: Hidden
|
||||||
hide: Hide
|
hide: Hide
|
||||||
hits: Hits
|
hits: Hits
|
||||||
homepage: Homepage
|
homepage: Homepage
|
||||||
horizontal: Horizontal
|
horizontal: Horizontal
|
||||||
hot: Hot
|
hot: Hot
|
||||||
|
is_hot: Hot
|
||||||
image: Image
|
image: Image
|
||||||
images: Images
|
images: Images
|
||||||
info: Information
|
info: Information
|
||||||
|
@ -274,6 +278,9 @@ en:
|
||||||
setting: Mail settings
|
setting: Mail settings
|
||||||
tls: TLS
|
tls: TLS
|
||||||
user_name: User Name
|
user_name: User Name
|
||||||
|
mail_from_app: Mail From App
|
||||||
|
mail_to: Mail To
|
||||||
|
mail_user: Mail User
|
||||||
manager: Manager
|
manager: Manager
|
||||||
markup: Markup
|
markup: Markup
|
||||||
markup_options: Markup options
|
markup_options: Markup options
|
||||||
|
@ -340,11 +347,13 @@ en:
|
||||||
public_r_tag: System Widget
|
public_r_tag: System Widget
|
||||||
text: Text Area
|
text: Text Area
|
||||||
passed: Approved
|
passed: Approved
|
||||||
|
is_checked: Approved
|
||||||
password: Password
|
password: Password
|
||||||
password_change: Change password
|
password_change: Change password
|
||||||
password_confirmation: Password confirmation
|
password_confirmation: Password confirmation
|
||||||
password_current: Current password
|
password_current: Current password
|
||||||
pending: Pending
|
pending: Pending
|
||||||
|
is_pending: Pending
|
||||||
personal_plugins:
|
personal_plugins:
|
||||||
author : "Author"
|
author : "Author"
|
||||||
edit_brief_intro : "Edit Brief Intro."
|
edit_brief_intro : "Edit Brief Intro."
|
||||||
|
@ -387,6 +396,7 @@ en:
|
||||||
register: Register
|
register: Register
|
||||||
registered: Registered
|
registered: Registered
|
||||||
rejected: Rejected
|
rejected: Rejected
|
||||||
|
is_rejected: Rejected
|
||||||
rejected_reason: 'Reason:'
|
rejected_reason: 'Reason:'
|
||||||
rejected_reason_empty: "Approval rejected, no referencable information"
|
rejected_reason_empty: "Approval rejected, no referencable information"
|
||||||
related_links: Related Links
|
related_links: Related Links
|
||||||
|
@ -424,6 +434,7 @@ en:
|
||||||
index: Index
|
index: Index
|
||||||
summary: Summary
|
summary: Summary
|
||||||
thumbnail: Thumbnail
|
thumbnail: Thumbnail
|
||||||
|
sent_date: Sent Date
|
||||||
settings: Site Setting
|
settings: Site Setting
|
||||||
site:
|
site:
|
||||||
backend_openness_on: Backend Openness
|
backend_openness_on: Backend Openness
|
||||||
|
@ -454,6 +465,7 @@ en:
|
||||||
tab_commits: Commits
|
tab_commits: Commits
|
||||||
tab_summary: Summary
|
tab_summary: Summary
|
||||||
tab_logs: Logs
|
tab_logs: Logs
|
||||||
|
tab_send_reminders_log: Send reminders log
|
||||||
summary:
|
summary:
|
||||||
code_update_at: Code Update histroy
|
code_update_at: Code Update histroy
|
||||||
disk_space: Disk Free
|
disk_space: Disk Free
|
||||||
|
@ -483,6 +495,7 @@ en:
|
||||||
sub_role: Sub Role
|
sub_role: Sub Role
|
||||||
sub_role_field: Sub Role Field
|
sub_role_field: Sub Role Field
|
||||||
sub_role_info: " Sub Role Info."
|
sub_role_info: " Sub Role Info."
|
||||||
|
subject: Subject
|
||||||
subtitle: Subtitle
|
subtitle: Subtitle
|
||||||
submit: Submit
|
submit: Submit
|
||||||
submit_approval: Submit approval
|
submit_approval: Submit approval
|
||||||
|
@ -506,10 +519,12 @@ en:
|
||||||
text: Text
|
text: Text
|
||||||
theme: Theme
|
theme: Theme
|
||||||
themes: Themes
|
themes: Themes
|
||||||
|
this_action_can_not_be_restore: This action can not be restored, are you sure you want to delete?
|
||||||
title: Title
|
title: Title
|
||||||
to_search: Set as Search Key
|
to_search: Set as Search Key
|
||||||
to_show: Display in frontend
|
to_show: Display in frontend
|
||||||
top: Top
|
top: Top
|
||||||
|
is_top: Top
|
||||||
total_visitors: Total Visitors
|
total_visitors: Total Visitors
|
||||||
traffic: Traffic
|
traffic: Traffic
|
||||||
type: Field Type
|
type: Field Type
|
||||||
|
|
|
@ -192,6 +192,8 @@ zh_tw:
|
||||||
link: 編輯連結
|
link: 編輯連結
|
||||||
page: 編輯頁面
|
page: 編輯頁面
|
||||||
email: 電子郵件
|
email: 電子郵件
|
||||||
|
email_log: 寄送紀錄
|
||||||
|
email_queue: 待寄送郵件
|
||||||
enable: 開啟
|
enable: 開啟
|
||||||
enabled_for: 啟用
|
enabled_for: 啟用
|
||||||
end: 結束
|
end: 結束
|
||||||
|
@ -276,6 +278,9 @@ zh_tw:
|
||||||
setting: 電子郵件設定
|
setting: 電子郵件設定
|
||||||
tls: 電子郵件TLS
|
tls: 電子郵件TLS
|
||||||
user_name: 電子郵件帳號
|
user_name: 電子郵件帳號
|
||||||
|
mail_from_app: 寄送模組
|
||||||
|
mail_to: 收件者
|
||||||
|
mail_user: 寄件者
|
||||||
manager: 管理者
|
manager: 管理者
|
||||||
markup: 輸入模式
|
markup: 輸入模式
|
||||||
markup_options: 標註選項
|
markup_options: 標註選項
|
||||||
|
@ -343,11 +348,13 @@ zh_tw:
|
||||||
public_r_tag: 系統模塊
|
public_r_tag: 系統模塊
|
||||||
text: 文字區域
|
text: 文字區域
|
||||||
passed: 通過審核
|
passed: 通過審核
|
||||||
|
is_checked: 通過審核
|
||||||
password: 密碼
|
password: 密碼
|
||||||
password_change: 更改密碼
|
password_change: 更改密碼
|
||||||
password_confirmation: 確認密碼
|
password_confirmation: 確認密碼
|
||||||
password_current: 目前的密碼
|
password_current: 目前的密碼
|
||||||
pending: 待審核
|
pending: 待審核
|
||||||
|
is_pending: 待審核
|
||||||
personal_plugins:
|
personal_plugins:
|
||||||
author : "著作人"
|
author : "著作人"
|
||||||
edit_brief_intro : "編輯摘要"
|
edit_brief_intro : "編輯摘要"
|
||||||
|
@ -389,6 +396,7 @@ zh_tw:
|
||||||
register: 註冊
|
register: 註冊
|
||||||
registered: 已註冊
|
registered: 已註冊
|
||||||
rejected: 拒絕
|
rejected: 拒絕
|
||||||
|
is_rejected: 拒絕
|
||||||
rejected_reason: 拒絕原因:'
|
rejected_reason: 拒絕原因:'
|
||||||
rejected_reason_empty: "拒絕核准, 沒有參考資訊"
|
rejected_reason_empty: "拒絕核准, 沒有參考資訊"
|
||||||
related_links: 相關連結
|
related_links: 相關連結
|
||||||
|
@ -426,6 +434,7 @@ zh_tw:
|
||||||
index: 檢索
|
index: 檢索
|
||||||
summary: 摘要
|
summary: 摘要
|
||||||
thumbnail: 縮圖
|
thumbnail: 縮圖
|
||||||
|
sent_date: 寄送日期
|
||||||
settings: 基本設定
|
settings: 基本設定
|
||||||
site:
|
site:
|
||||||
frontend_closed: 前台關閉?
|
frontend_closed: 前台關閉?
|
||||||
|
@ -456,6 +465,7 @@ zh_tw:
|
||||||
tab_commits: 程式版本
|
tab_commits: 程式版本
|
||||||
tab_summary: 總覽
|
tab_summary: 總覽
|
||||||
tab_logs: 排程工作日誌
|
tab_logs: 排程工作日誌
|
||||||
|
tab_send_reminders_log: 寄送提醒紀錄
|
||||||
summary:
|
summary:
|
||||||
code_update_at: 程式更新紀錄
|
code_update_at: 程式更新紀錄
|
||||||
disk_space: 硬碟空間
|
disk_space: 硬碟空間
|
||||||
|
@ -485,6 +495,7 @@ zh_tw:
|
||||||
sub_role: 子身份
|
sub_role: 子身份
|
||||||
sub_role_field: 子身份欄位
|
sub_role_field: 子身份欄位
|
||||||
sub_role_info: 子身份資料
|
sub_role_info: 子身份資料
|
||||||
|
subject: 主題
|
||||||
subtitle: 副標題
|
subtitle: 副標題
|
||||||
submit: 送出
|
submit: 送出
|
||||||
submit_approval: 送出已核准
|
submit_approval: 送出已核准
|
||||||
|
@ -508,6 +519,7 @@ zh_tw:
|
||||||
text: 內文
|
text: 內文
|
||||||
theme: 套用頁面樣式
|
theme: 套用頁面樣式
|
||||||
themes: 主題
|
themes: 主題
|
||||||
|
this_action_can_not_be_restore: 刪除後將無法還原,您確定要刪除嗎?
|
||||||
title: 標題
|
title: 標題
|
||||||
to_search: 加入搜尋條件
|
to_search: 加入搜尋條件
|
||||||
to_show: 是否顯示於前台
|
to_show: 是否顯示於前台
|
||||||
|
|
|
@ -234,7 +234,7 @@ module OrbitCoreLib
|
||||||
when :sub_manager
|
when :sub_manager
|
||||||
@open ||= check_sub_manager
|
@open ||= check_sub_manager
|
||||||
when :approver
|
when :approver
|
||||||
@open ||= check_sub_manager
|
@open ||= check_approver
|
||||||
when :user
|
when :user
|
||||||
@open ||= true
|
@open ||= true
|
||||||
when :visitor
|
when :visitor
|
||||||
|
|
BIN
orbitdefault.zip
BIN
orbitdefault.zip
Binary file not shown.
|
@ -10,6 +10,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
||||||
end
|
end
|
||||||
|
|
||||||
def preview
|
def preview
|
||||||
|
params['bulletin']['image'] = nil
|
||||||
bulletin = Bulletin.new params
|
bulletin = Bulletin.new params
|
||||||
@preview_obj = bulletin.to_preview
|
@preview_obj = bulletin.to_preview
|
||||||
@preview_obj.save
|
@preview_obj.save
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span1"><%= t('personal_book.year') %></th>
|
<th class="span1"><%= t('personal_book.year') %></th>
|
||||||
<th><%= t('personal_book.book_title') %></th>
|
<th><%= t('personal_book.book_title') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span1"><%= t('personal_conference.year') %></th>
|
<th class="span1"><%= t('personal_conference.year') %></th>
|
||||||
<th><%= t('module_name.personal_conference') %></th>
|
<th><%= t('module_name.personal_conference') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span2"><%= t('date_') %></th>
|
<th class="span2"><%= t('date_') %></th>
|
||||||
<th><%= t('personal_diploma.school_name') %></th>
|
<th><%= t('personal_diploma.school_name') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span2"><%= t('date_') %></th>
|
<th class="span2"><%= t('date_') %></th>
|
||||||
<th><%= t('personal_experience.organizationt_title') %></th>
|
<th><%= t('personal_experience.organizationt_title') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span1"><%= t('personal_honor.year') %></th>
|
<th class="span1"><%= t('personal_honor.year') %></th>
|
||||||
<th><%= t('personal_honor.award_name') %></th>
|
<th><%= t('personal_honor.award_name') %></th>
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span1"><%= t('personal_journal.year') %></th>
|
<th class="span1"><%= t('personal_journal.year') %></th>
|
||||||
<th><%= t('module_name.personal_journal') %></th>
|
<th><%= t('module_name.personal_journal') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span1"><%= t('personal_lab.year') %></th>
|
<th class="span1"><%= t('personal_lab.year') %></th>
|
||||||
<th><%= t('personal_lab.lab_title') %></th>
|
<th><%= t('personal_lab.lab_title') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span2"><%= t('personal_patent.publication_date') %></th>
|
<th class="span2"><%= t('personal_patent.publication_date') %></th>
|
||||||
<th><%= t('personal_patent.patent_title') %></th>
|
<th><%= t('personal_patent.patent_title') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span2"><%= t('personal_project.period') %></th>
|
<th class="span2"><%= t('personal_project.period') %></th>
|
||||||
<th><%= t('personal_project.project_title') %></th>
|
<th><%= t('personal_project.project_title') %></th>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<% if is_admin? %>
|
<% if is_admin? %>
|
||||||
<th><input type="checkbox" class="list-check" /></th>
|
<th><input type="checkbox" /></th>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<th class="span2"><%= t('personal_research.publication_date') %></th>
|
<th class="span2"><%= t('personal_research.publication_date') %></th>
|
||||||
<th><%= t('personal_research.research_title') %></th>
|
<th><%= t('personal_research.research_title') %></th>
|
||||||
|
|
Reference in New Issue