diff --git a/.gitignore b/.gitignore index 412920612..c86ad0d31 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,8 @@ log/*.log tmp/**/* public/uploads/**/* uploads/**/* - +public/panel/**/* +public/index.html .DS_Store *.swp diff --git a/Gemfile b/Gemfile index abf87c594..906fa408b 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,7 @@ gem "brakeman" gem 'bson_ext' gem 'carrierwave' gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid' +gem "net-ldap", "~> 0.3.1" gem 'devise', '1.5.3' gem 'exception_notification' # Send error trace gem 'execjs' @@ -14,27 +15,48 @@ gem 'jquery-ui-rails' gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari.git' +# gem "memcached", "~> 1.4.3" +# gem "memcache-client" + gem 'mini_magick' gem 'mongoid' gem 'mongoid-tree', :require => 'mongoid/tree' gem "mongo_session_store-rails3" +gem 'mysql2' gem 'nokogiri' gem 'radius' gem 'rake' +# gem 'remotipart' gem 'resque' # background jobs gem 'resque-scheduler' # job scheduling gem 'resque-restriction' +#gem 'rb-readline' gem 'ruby-debug19' gem 'rubyzip' + +gem 'sunspot_mongo' +gem 'sunspot_solr' +gem 'progress_bar' + gem 'sinatra' #gem 'sinatra-contrib' gem 'sprockets' +gem 'social-share-button' + gem 'tinymce-rails' gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux") gem 'mongoid-encryptor', :require => 'mongoid/encryptor' -#gem 'contacts' +gem 'rb-readline' if RUBY_PLATFORM.downcase.include?("linux") -gem "impressionist", :require => "impressionist", :path => "vendor/impressionist" + +gem "impressionist", :git => 'git://github.com/charlotte-ruby/impressionist.git' + +gem 'redis','>= 2.1.1' +gem 'chinese_pinyin', '0.4.1' +# add rmmseg if you need search by segment words +gem 'rmmseg-cpp-huacnlee', '0.2.9' +gem 'redis-namespace','~> 1.0.2' +gem 'redis-search', '0.7.1' # Gems used only for assets and not required # in production environments by default. @@ -46,6 +68,7 @@ end group :test, :development do + gem "sunspot-rails-tester" gem 'spork' gem 'database_cleaner' #Strategies for cleaning databases. Can be used to ensure a clean state for testing. gem "rspec", "~> 2.0" diff --git a/Gemfile.lock b/Gemfile.lock index afec15c8c..4e6e42c8b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,8 +6,9 @@ GIT actionpack (>= 3.0.0) activesupport (>= 3.0.0) -PATH - remote: vendor/impressionist +GIT + remote: git://github.com/charlotte-ruby/impressionist.git + revision: 7a93fff25568cd3edcc63c1a3c4b60dc6b81d2b7 specs: impressionist (1.1.1) httpclient (~> 2.2) @@ -65,6 +66,7 @@ GEM carrierwave-mongoid (0.1.3) carrierwave (>= 0.5.6) mongoid (~> 2.1) + chinese_pinyin (0.4.1) chronic (0.6.7) coffee-rails (3.1.1) coffee-script (>= 2.2.0) @@ -95,7 +97,9 @@ GEM factory_girl (~> 2.6.0) railties (>= 3.0.0) fastercsv (1.5.4) + fattr (2.2.1) haml (3.1.4) + highline (1.6.13) hike (1.2.1) hoe (2.16.1) rake (~> 0.8) @@ -133,13 +137,22 @@ GEM mongoid-tree (0.7.0) mongoid (~> 2.0) multi_json (1.1.0) + mysql2 (0.3.11) + mysql2 (0.3.11-x86-mingw32) + net-ldap (0.3.1) nokogiri (1.5.2) nokogiri (1.5.2-x86-mingw32) + options (2.3.0) + fattr orm_adapter (0.0.6) pdf-writer (1.1.8) color (>= 1.4.0) transaction-simple (~> 1.3) polyglot (0.3.3) + pr_geohash (1.0.0) + progress_bar (0.4.0) + highline (~> 1.6.1) + options (~> 2.3.0) rack (1.3.6) rack-cache (1.2) rack (>= 0.4) @@ -173,6 +186,10 @@ GEM redis (2.2.2) redis-namespace (1.0.3) redis (< 3.0.0) + redis-search (0.7.1) + chinese_pinyin (>= 0.3.0) + redis (>= 2.1.1) + redis-namespace (~> 1.0.2) resque (1.20.0) multi_json (~> 1.0) redis-namespace (~> 1.0.2) @@ -184,6 +201,9 @@ GEM redis (>= 2.0.1) resque (>= 1.8.0) rufus-scheduler + rmmseg-cpp-huacnlee (0.2.9) + rsolr (1.0.8) + builder (>= 2.1.2) rspec (2.8.0) rspec-core (~> 2.8.0) rspec-expectations (~> 2.8.0) @@ -234,6 +254,7 @@ GEM rack (~> 1.3, >= 1.3.6) rack-protection (~> 1.2) tilt (~> 1.3, >= 1.3.3) + social-share-button (0.0.6) spork (0.9.0) spork (0.9.0-x86-mingw32) win32-process @@ -242,6 +263,17 @@ GEM rack (~> 1.0) tilt (~> 1.1, != 1.3.0) subexec (0.2.1) + sunspot (1.3.3) + pr_geohash (~> 1.0) + rsolr (~> 1.0.7) + sunspot-rails-tester (0.0.4) + sunspot_rails (~> 1.2) + sunspot_mongo (1.0.1) + sunspot_rails + sunspot_rails (1.3.3) + nokogiri + sunspot (= 1.3.3) + sunspot_solr (1.3.3) thor (0.14.6) tilt (1.3.3) tinymce-rails (3.4.8) @@ -278,6 +310,7 @@ DEPENDENCIES bson_ext carrierwave carrierwave-mongoid + chinese_pinyin (= 0.4.1) coffee-rails database_cleaner delorean @@ -294,13 +327,20 @@ DEPENDENCIES mongoid mongoid-encryptor mongoid-tree + mysql2 + net-ldap (~> 0.3.1) nokogiri + progress_bar radius rails (>= 3.1.0, < 3.2.0) rake + redis (>= 2.1.1) + redis-namespace (~> 1.0.2) + redis-search (= 0.7.1) resque resque-restriction resque-scheduler + rmmseg-cpp-huacnlee (= 0.2.9) rspec (~> 2.0) rspec-rails (~> 2.0) ruby-debug19 @@ -309,8 +349,12 @@ DEPENDENCIES shoulda-matchers simplecov sinatra + social-share-button spork sprockets + sunspot-rails-tester + sunspot_mongo + sunspot_solr tinymce-rails uglifier watchr diff --git a/app/assets/fonts/fontawesome-webfont.eot b/app/assets/fonts/fontawesome-webfont.eot new file mode 100644 index 000000000..89070c1e6 Binary files /dev/null and b/app/assets/fonts/fontawesome-webfont.eot differ diff --git a/app/assets/fonts/fontawesome-webfont.svg b/app/assets/fonts/fontawesome-webfont.svg new file mode 100644 index 000000000..1245f92c2 --- /dev/null +++ b/app/assets/fonts/fontawesome-webfont.svg @@ -0,0 +1,255 @@ + + + \ No newline at end of file diff --git a/app/assets/fonts/fontawesome-webfont.ttf b/app/assets/fonts/fontawesome-webfont.ttf new file mode 100644 index 000000000..c17e9f8d1 Binary files /dev/null and b/app/assets/fonts/fontawesome-webfont.ttf differ diff --git a/app/assets/fonts/fontawesome-webfont.woff b/app/assets/fonts/fontawesome-webfont.woff new file mode 100644 index 000000000..09f2469a1 Binary files /dev/null and b/app/assets/fonts/fontawesome-webfont.woff differ diff --git a/app/assets/images/news_alt.jpg b/app/assets/images/news_alt.jpg new file mode 100644 index 000000000..a7b1fb329 Binary files /dev/null and b/app/assets/images/news_alt.jpg differ diff --git a/app/assets/images/social-share-button.png b/app/assets/images/social-share-button.png new file mode 100644 index 000000000..3507161c7 Binary files /dev/null and b/app/assets/images/social-share-button.png differ diff --git a/app/assets/javascripts/ajax_form.js b/app/assets/javascripts/ajax_form.js deleted file mode 100644 index d9b5abfec..000000000 --- a/app/assets/javascripts/ajax_form.js +++ /dev/null @@ -1,7 +0,0 @@ -$(document).on('click', '#ajax_form_submit', function(){ - $('#ajaxForm').ajaxSubmit({ - beforeSubmit: function(a,f,o) { - o.dataType = 'script'; - } - }); -}); \ No newline at end of file diff --git a/app/assets/javascripts/ajax_form.js.erb b/app/assets/javascripts/ajax_form.js.erb new file mode 100644 index 000000000..917c352df --- /dev/null +++ b/app/assets/javascripts/ajax_form.js.erb @@ -0,0 +1,111 @@ +<%#= encoding: utf-8 %> +$(document).on('click', '#ajax_form_submit', function(){ + // $('#ajaxForm').ajaxSubmit({ + // beforeSubmit: function(a,f,o) { + // o.dataType = 'script'; + // if (o.dataType == 'script') { + // o.url = o.url.split('?'); // split on GET params + // if (o.url[0].substr(-3) != '.js') o.url[0] += '.js'; // force rails to respond to respond to the request with :format = js + // o.url = o.url.join('?'); // join on GET params + // } + // }, + // success: function(response,status,xhr){ + // alert(response); + // alert(status); + // alert(xhr); + // }, + // error:function(){ + // alert("error"); + // } + // }); + + + var o = { + // dataType: 'script', + dataType: 'html', + url:$("#ajaxForm").attr("action"), + beforeSubmit: function(){ + var sub = true; + $("span.error").remove(); + $("#dyn_error").empty(); + $("#ajaxForm input").each(function(){ + if($(this).val() == ""){ + $(" *").insertAfter($(this)); + sub = false; + } + }) + if(!sub){ + $("#dyn_error").text("Cannot be empty."); + $("#dyn_error").text("<%= I18n.t('cant_empty_star') %>"); + return false; + } + }, + success: function(response,status,xhr){ + if(typeof tinyMCEPopup != "undefined"){ + var x = response.split("#"); + var returnurl = x[0], + returntitle = x[1], + returndescription = x[2]; + var win = tinyMCEPopup.getWindowArg("window"); + win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = returnurl; + win.document.getElementById(tinyMCEPopup.getWindowArg("alt")).value = returndescription; + win.document.getElementById(tinyMCEPopup.getWindowArg("title")).value = returntitle; + if (typeof(win.ImageDialog) != "undefined") { + // we are, so update image dimensions... + if (win.ImageDialog.getImageData) + win.ImageDialog.getImageData(); + + // ... and preview if necessary + if (win.ImageDialog.showPreviewImage) + win.ImageDialog.showPreviewImage(returnurl); + } + tinyMCEPopup.close(); + }else{ + //incase if we want to do something for quick edit file upload + // var modalvalues = ""; + // var r = ""; + // if(rcom.getInternetExplorerVersion() > -1){ + // r = "