diff --git a/Gemfile b/Gemfile index 9fb4c3cd6..a12f66dc8 100644 --- a/Gemfile +++ b/Gemfile @@ -26,14 +26,22 @@ 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 'sprockets' +gem 'social-share-button' + gem 'tinymce-rails' gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux") gem 'rb-readline' if RUBY_PLATFORM.downcase.include?("linux") diff --git a/Gemfile.lock b/Gemfile.lock index c7dcecaa2..463946c37 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -97,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) @@ -136,12 +138,17 @@ GEM 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) @@ -179,6 +186,7 @@ GEM chinese_pinyin (>= 0.3.0) redis (>= 2.1.1) redis-namespace (~> 1.0.2) + remotipart (1.0.2) resque (1.20.0) multi_json (~> 1.0) redis-namespace (~> 1.0.2) @@ -243,6 +251,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 @@ -256,9 +265,12 @@ GEM 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) @@ -314,12 +326,14 @@ DEPENDENCIES 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) + remotipart resque resque-restriction resque-scheduler @@ -332,9 +346,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/javascripts/application.js b/app/assets/javascripts/application.js index 13d92690e..f3c799cf2 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -6,4 +6,5 @@ // //= require jquery //= require jquery_ujs -//= require_tree . \ No newline at end of file +//= require_tree . +//= social-share-button \ No newline at end of file diff --git a/app/assets/javascripts/lib/social-share-button.coffee b/app/assets/javascripts/lib/social-share-button.coffee new file mode 100644 index 000000000..cec9fcbc4 --- /dev/null +++ b/app/assets/javascripts/lib/social-share-button.coffee @@ -0,0 +1,33 @@ +window.SocialShareButton = + openUrl : (url) -> + window.open(url) + false + + share : (el) -> + site = $(el).data('site') + title = encodeURIComponent($(el).parent().data('title')) + img = encodeURIComponent($(el).parent().data("img")) + fb_url = encodeURIComponent($(el).parent().data("fb_url")) + url = encodeURIComponent(location.href) + switch site + when "weibo" + SocialShareButton.openUrl("http://v.t.sina.com.cn/share/share.php?url=#{url}&pic=#{img}&title=#{title}&content=utf-8") + when "twitter" + SocialShareButton.openUrl("https://twitter.com/home?status=#{title}: #{url}") + when "douban" + SocialShareButton.openUrl("http://www.douban.com/recommend/?url=#{url}&title=#{title}&image=#{img}") + when "facebook" + SocialShareButton.openUrl("http://www.facebook.com/sharer.php?t=#{title}&u=#{fb_url}") + when "qq" + SocialShareButton.openUrl("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=#{url}&title=#{title}&pics=#{img}") + when "tqq" + SocialShareButton.openUrl("http://share.v.t.qq.com/index.php?c=share&a=index&url=#{url}&title=#{title}&pic=#{img}") + when "baidu" + SocialShareButton.openUrl("http://apps.hi.baidu.com/share/?url=#{url}&title=#{title}&content=") + when "kaixin001" + SocialShareButton.openUrl("http://www.kaixin001.com/rest/records.php?url=#{url}&content=#{title}&style=11&pic=#{img}") + when "renren" + SocialShareButton.openUrl("http://widget.renren.com/dialog/share?resourceUrl=#{url}&title=#{title}&description=") + when "google_plus" + SocialShareButton.openUrl("https://plus.google.com/share?url=#{url}&t=#{title}") + false \ No newline at end of file diff --git a/app/assets/javascripts/tinymce_orbit.js.erb b/app/assets/javascripts/tinymce_orbit.js.erb index 868825306..aa9549734 100644 --- a/app/assets/javascripts/tinymce_orbit.js.erb +++ b/app/assets/javascripts/tinymce_orbit.js.erb @@ -47,7 +47,6 @@ function myFileBrowser(field_name, url, type, win) { var cmsURL = window.location.toString(); cmsURL = cmsURL.split("/"); cmsURL = "<%= Rails.application.routes.url_helpers.file_upload_admin_assets_path %>"; - // console.log(cmsURL); // script URL - use an absolute path! if (cmsURL.indexOf("?") < 0) { //add the type as the only query parameter diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 9833ffda0..c0c227fe5 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -3,5 +3,5 @@ *and any sub-directories. You're free to add application-wide styles to this file and they'll appear at *the top of the compiled file, but it's generally better to create a new file per style scope. *= require_self - + *= require social-share-button */ diff --git a/app/assets/stylesheets/bootstrap.css.erb b/app/assets/stylesheets/bootstrap.css.erb index 62a0afe8e..eb17ef121 100644 --- a/app/assets/stylesheets/bootstrap.css.erb +++ b/app/assets/stylesheets/bootstrap.css.erb @@ -1116,381 +1116,959 @@ table .span12 { width: 924px; margin-left: 0; } -[class^="icon-"] { +/* Font Awesome + the iconic font designed for use with Twitter Bootstrap + ------------------------------------------------------- + The full suite of pictographic icons, examples, and documentation + can be found at: http://fortawesome.github.com/Font-Awesome/ + + License + ------------------------------------------------------- + The Font Awesome webfont, CSS, and LESS files are licensed under CC BY 3.0: + http://creativecommons.org/licenses/by/3.0/ A mention of + 'Font Awesome - http://fortawesome.github.com/Font-Awesome' in human-readable + source code is considered acceptable attribution (most common on the web). + If human readable source code is not available to the end user, a mention in + an 'About' or 'Credits' screen is considered acceptable (most common in desktop + or mobile software). + + Contact + ------------------------------------------------------- + Email: dave@davegandy.com + Twitter: http://twitter.com/fortaweso_me + Work: http://lemonwi.se co-founder + + */ +@font-face { + font-family: "FontAwesome"; + src: url(<%= asset_path 'fontawesome-webfont.eot' %>); + src: url(<%= asset_path 'fontawesome-webfont.eot?#iefix' %>) format('eot'), url('../fonts/fontawesome-webfont.woff') format('woff'), url('../fonts/fontawesome-webfont.ttf') format('truetype'), url('../fonts/fontawesome-webfont.svg#FontAwesome') format('svg'); + font-weight: normal; + font-style: normal; +} + +/* Font Awesome styles + ------------------------------------------------------- */ +[class^="icon-"]:before, [class*=" icon-"]:before { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; display: inline-block; - width: 14px; - height: 14px; - vertical-align: text-top; - background-image: url(<%= asset_path 'glyphicons-halflings.png' %>); - background-position: 14px 14px; - background-repeat: no-repeat; - *margin-right: .3em; + text-decoration: inherit; } -[class^="icon-"]:last-child { - *margin-left: 0; +a [class^="icon-"], a [class*=" icon-"] { + display: inline-block; + text-decoration: inherit; } -.icon-white { - background-image: url(<%= asset_path 'glyphicons-halflings-white.png' %>); +/* makes the font 33% larger relative to the icon container */ +.icon-large:before { + vertical-align: top; + font-size: 1.3333333333333333em; +} +.btn [class^="icon-"], .btn [class*=" icon-"] { + /* keeps button heights with and without icons the same */ + + line-height: .9em; +} +li [class^="icon-"], li [class*=" icon-"] { + display: inline-block; + width: 1.25em; + text-align: center; +} +li .icon-large[class^="icon-"], li .icon-large[class*=" icon-"] { + /* 1.5 increased font size for icon-large * 1.25 width */ + + width: 1.875em; +} +li[class^="icon-"], li[class*=" icon-"] { + margin-left: 0; + list-style-type: none; +} +li[class^="icon-"]:before, li[class*=" icon-"]:before { + text-indent: -2em; + text-align: center; +} +li[class^="icon-"].icon-large:before, li[class*=" icon-"].icon-large:before { + text-indent: -1.3333333333333333em; +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.icon-glass:before { content: "\f000"; } +.icon-music:before { content: "\f001"; } +.icon-search:before { content: "\f002"; } +.icon-envelope:before { content: "\f003"; } +.icon-heart:before { content: "\f004"; } +.icon-star:before { content: "\f005"; } +.icon-star-empty:before { content: "\f006"; } +.icon-user:before { content: "\f007"; } +.icon-film:before { content: "\f008"; } +.icon-th-large:before { content: "\f009"; } +.icon-th:before { content: "\f00a"; } +.icon-th-list:before { content: "\f00b"; } +.icon-ok:before { content: "\f00c"; } +.icon-remove:before { content: "\f00d"; } +.icon-zoom-in:before { content: "\f00e"; } + +.icon-zoom-out:before { content: "\f010"; } +.icon-off:before { content: "\f011"; } +.icon-signal:before { content: "\f012"; } +.icon-cog:before { content: "\f013"; } +.icon-trash:before { content: "\f014"; } +.icon-home:before { content: "\f015"; } +.icon-file:before { content: "\f016"; } +.icon-time:before { content: "\f017"; } +.icon-road:before { content: "\f018"; } +.icon-download-alt:before { content: "\f019"; } +.icon-download:before { content: "\f01a"; } +.icon-upload:before { content: "\f01b"; } +.icon-inbox:before { content: "\f01c"; } +.icon-play-circle:before { content: "\f01d"; } +.icon-repeat:before { content: "\f01e"; } + +/* \f020 doesn't work in Safari. all shifted one down */ +.icon-refresh:before { content: "\f021"; } +.icon-list-alt:before { content: "\f022"; } +.icon-lock:before { content: "\f023"; } +.icon-flag:before { content: "\f024"; } +.icon-headphones:before { content: "\f025"; } +.icon-volume-off:before { content: "\f026"; } +.icon-volume-down:before { content: "\f027"; } +.icon-volume-up:before { content: "\f028"; } +.icon-qrcode:before { content: "\f029"; } +.icon-barcode:before { content: "\f02a"; } +.icon-tag:before { content: "\f02b"; } +.icon-tags:before { content: "\f02c"; } +.icon-book:before { content: "\f02d"; } +.icon-bookmark:before { content: "\f02e"; } +.icon-print:before { content: "\f02f"; } + +.icon-camera:before { content: "\f030"; } +.icon-font:before { content: "\f031"; } +.icon-bold:before { content: "\f032"; } +.icon-italic:before { content: "\f033"; } +.icon-text-height:before { content: "\f034"; } +.icon-text-width:before { content: "\f035"; } +.icon-align-left:before { content: "\f036"; } +.icon-align-center:before { content: "\f037"; } +.icon-align-right:before { content: "\f038"; } +.icon-align-justify:before { content: "\f039"; } +.icon-list:before { content: "\f03a"; } +.icon-indent-left:before { content: "\f03b"; } +.icon-indent-right:before { content: "\f03c"; } +.icon-facetime-video:before { content: "\f03d"; } +.icon-picture:before { content: "\f03e"; } + +.icon-pencil:before { content: "\f040"; } +.icon-map-marker:before { content: "\f041"; } +.icon-adjust:before { content: "\f042"; } +.icon-tint:before { content: "\f043"; } +.icon-edit:before { content: "\f044"; } +.icon-share:before { content: "\f045"; } +.icon-check:before { content: "\f046"; } +.icon-move:before { content: "\f047"; } +.icon-step-backward:before { content: "\f048"; } +.icon-fast-backward:before { content: "\f049"; } +.icon-backward:before { content: "\f04a"; } +.icon-play:before { content: "\f04b"; } +.icon-pause:before { content: "\f04c"; } +.icon-stop:before { content: "\f04d"; } +.icon-forward:before { content: "\f04e"; } + +.icon-fast-forward:before { content: "\f050"; } +.icon-step-forward:before { content: "\f051"; } +.icon-eject:before { content: "\f052"; } +.icon-chevron-left:before { content: "\f053"; } +.icon-chevron-right:before { content: "\f054"; } +.icon-plus-sign:before { content: "\f055"; } +.icon-minus-sign:before { content: "\f056"; } +.icon-remove-sign:before { content: "\f057"; } +.icon-ok-sign:before { content: "\f058"; } +.icon-question-sign:before { content: "\f059"; } +.icon-info-sign:before { content: "\f05a"; } +.icon-screenshot:before { content: "\f05b"; } +.icon-remove-circle:before { content: "\f05c"; } +.icon-ok-circle:before { content: "\f05d"; } +.icon-ban-circle:before { content: "\f05e"; } + +.icon-arrow-left:before { content: "\f060"; } +.icon-arrow-right:before { content: "\f061"; } +.icon-arrow-up:before { content: "\f062"; } +.icon-arrow-down:before { content: "\f063"; } +.icon-share-alt:before { content: "\f064"; } +.icon-resize-full:before { content: "\f065"; } +.icon-resize-small:before { content: "\f066"; } +.icon-plus:before { content: "\f067"; } +.icon-minus:before { content: "\f068"; } +.icon-asterisk:before { content: "\f069"; } +.icon-exclamation-sign:before { content: "\f06a"; } +.icon-gift:before { content: "\f06b"; } +.icon-leaf:before { content: "\f06c"; } +.icon-fire:before { content: "\f06d"; } +.icon-eye-open:before { content: "\f06e"; } + +.icon-eye-close:before { content: "\f070"; } +.icon-warning-sign:before { content: "\f071"; } +.icon-plane:before { content: "\f072"; } +.icon-calendar:before { content: "\f073"; } +.icon-random:before { content: "\f074"; } +.icon-comment:before { content: "\f075"; } +.icon-magnet:before { content: "\f076"; } +.icon-chevron-up:before { content: "\f077"; } +.icon-chevron-down:before { content: "\f078"; } +.icon-retweet:before { content: "\f079"; } +.icon-shopping-cart:before { content: "\f07a"; } +.icon-folder-close:before { content: "\f07b"; } +.icon-folder-open:before { content: "\f07c"; } +.icon-resize-vertical:before { content: "\f07d"; } +.icon-resize-horizontal:before { content: "\f07e"; } + +.icon-bar-chart:before { content: "\f080"; } +.icon-twitter-sign:before { content: "\f081"; } +.icon-facebook-sign:before { content: "\f082"; } +.icon-camera-retro:before { content: "\f083"; } +.icon-key:before { content: "\f084"; } +.icon-cogs:before { content: "\f085"; } +.icon-comments:before { content: "\f086"; } +.icon-thumbs-up:before { content: "\f087"; } +.icon-thumbs-down:before { content: "\f088"; } +.icon-star-half:before { content: "\f089"; } +.icon-heart-empty:before { content: "\f08a"; } +.icon-signout:before { content: "\f08b"; } +.icon-linkedin-sign:before { content: "\f08c"; } +.icon-pushpin:before { content: "\f08d"; } +.icon-external-link:before { content: "\f08e"; } + +.icon-signin:before { content: "\f090"; } +.icon-trophy:before { content: "\f091"; } +.icon-github-sign:before { content: "\f092"; } +.icon-upload-alt:before { content: "\f093"; } +.icon-lemon:before { content: "\f094"; } +.icon-phone:before { content: "\f095"; } +.icon-check-empty:before { content: "\f096"; } +.icon-bookmark-empty:before { content: "\f097"; } +.icon-phone-sign:before { content: "\f098"; } +.icon-twitter:before { content: "\f099"; } +.icon-facebook:before { content: "\f09a"; } +.icon-github:before { content: "\f09b"; } +.icon-unlock:before { content: "\f09c"; } +.icon-credit-card:before { content: "\f09d"; } +.icon-rss:before { content: "\f09e"; } + +.icon-hdd:before { content: "\f0a0"; } +.icon-bullhorn:before { content: "\f0a1"; } +.icon-bell:before { content: "\f0a2"; } +.icon-certificate:before { content: "\f0a3"; } +.icon-hand-right:before { content: "\f0a4"; } +.icon-hand-left:before { content: "\f0a5"; } +.icon-hand-up:before { content: "\f0a6"; } +.icon-hand-down:before { content: "\f0a7"; } +.icon-circle-arrow-left:before { content: "\f0a8"; } +.icon-circle-arrow-right:before { content: "\f0a9"; } +.icon-circle-arrow-up:before { content: "\f0aa"; } +.icon-circle-arrow-down:before { content: "\f0ab"; } +.icon-globe:before { content: "\f0ac"; } +.icon-wrench:before { content: "\f0ad"; } +.icon-tasks:before { content: "\f0ae"; } + +.icon-filter:before { content: "\f0b0"; } +.icon-briefcase:before { content: "\f0b1"; } +.icon-fullscreen:before { content: "\f0b2"; } + +.icon-group:before { content: "\f0c0"; } +.icon-link:before { content: "\f0c1"; } +.icon-cloud:before { content: "\f0c2"; } +.icon-beaker:before { content: "\f0c3"; } +.icon-cut:before { content: "\f0c4"; } +.icon-copy:before { content: "\f0c5"; } +.icon-paper-clip:before { content: "\f0c6"; } +.icon-save:before { content: "\f0c7"; } +.icon-sign-blank:before { content: "\f0c8"; } +.icon-reorder:before { content: "\f0c9"; } +.icon-list-ul:before { content: "\f0ca"; } +.icon-list-ol:before { content: "\f0cb"; } +.icon-strikethrough:before { content: "\f0cc"; } +.icon-underline:before { content: "\f0cd"; } +.icon-table:before { content: "\f0ce"; } + +.icon-magic:before { content: "\f0d0"; } +.icon-truck:before { content: "\f0d1"; } +.icon-pinterest:before { content: "\f0d2"; } +.icon-pinterest-sign:before { content: "\f0d3"; } +.icon-google-plus-sign:before { content: "\f0d4"; } +.icon-google-plus:before { content: "\f0d5"; } +.icon-money:before { content: "\f0d6"; } +.icon-caret-down:before { content: "\f0d7"; } +.icon-caret-up:before { content: "\f0d8"; } +.icon-caret-left:before { content: "\f0d9"; } +.icon-caret-right:before { content: "\f0da"; } +.icon-columns:before { content: "\f0db"; } +.icon-sort:before { content: "\f0dc"; } +.icon-sort-down:before { content: "\f0dd"; } +.icon-sort-up:before { content: "\f0de"; } + +.icon-envelope-alt:before { content: "\f0e0"; } +.icon-linkedin:before { content: "\f0e1"; } +.icon-undo:before { content: "\f0e2"; } +.icon-legal:before { content: "\f0e3"; } +.icon-dashboard:before { content: "\f0e4"; } +.icon-comment-alt:before { content: "\f0e5"; } +.icon-comments-alt:before { content: "\f0e6"; } +.icon-bolt:before { content: "\f0e7"; } +.icon-sitemap:before { content: "\f0e8"; } +.icon-umbrella:before { content: "\f0e9"; } +.icon-paste:before { content: "\f0ea"; } +.icon-user-md:before { content: "\f200"; } + + + + + + + +[class^="icon-"], +[class*=" icon-"] { + font-family: FontAwesome; + font-style: normal; + font-weight: normal; +} +.btn.dropdown-toggle [class^="icon-"], +.btn.dropdown-toggle [class*=" icon-"] { + /* keeps button heights with and without icons the same */ + + line-height: 1.4em; +} +.icon-large { + font-size: 1.3333em; } .icon-glass { - background-position: 0 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-music { - background-position: -24px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-search { - background-position: -48px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-envelope { - background-position: -72px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-heart { - background-position: -96px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-star { - background-position: -120px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-star-empty { - background-position: -144px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-user { - background-position: -168px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-film { - background-position: -192px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-th-large { - background-position: -216px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-th { - background-position: -240px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-th-list { - background-position: -264px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-ok { - background-position: -288px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-remove { - background-position: -312px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-zoom-in { - background-position: -336px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-zoom-out { - background-position: -360px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-off { - background-position: -384px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-signal { - background-position: -408px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-cog { - background-position: -432px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-trash { - background-position: -456px 0; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-home { - background-position: 0 -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-file { - background-position: -24px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-time { - background-position: -48px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-road { - background-position: -72px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-download-alt { - background-position: -96px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-download { - background-position: -120px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-upload { - background-position: -144px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-inbox { - background-position: -168px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-play-circle { - background-position: -192px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-repeat { - background-position: -216px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-refresh { - background-position: -240px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-list-alt { - background-position: -264px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-lock { - background-position: -287px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-flag { - background-position: -312px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-headphones { - background-position: -336px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-volume-off { - background-position: -360px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-volume-down { - background-position: -384px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-volume-up { - background-position: -408px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-qrcode { - background-position: -432px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-barcode { - background-position: -456px -24px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-tag { - background-position: 0 -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-tags { - background-position: -25px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-book { - background-position: -48px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-bookmark { - background-position: -72px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-print { - background-position: -96px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-camera { - background-position: -120px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-font { - background-position: -144px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-bold { - background-position: -167px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-italic { - background-position: -192px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-text-height { - background-position: -216px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-text-width { - background-position: -240px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-align-left { - background-position: -264px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-align-center { - background-position: -288px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-align-right { - background-position: -312px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-align-justify { - background-position: -336px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-list { - background-position: -360px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-indent-left { - background-position: -384px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-indent-right { - background-position: -408px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-facetime-video { - background-position: -432px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-picture { - background-position: -456px -48px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-pencil { - background-position: 0 -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-map-marker { - background-position: -24px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-adjust { - background-position: -48px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-tint { - background-position: -72px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-edit { - background-position: -96px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-share { - background-position: -120px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-check { - background-position: -144px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-move { - background-position: -168px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-step-backward { - background-position: -192px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-fast-backward { - background-position: -216px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-backward { - background-position: -240px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-play { - background-position: -264px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-pause { - background-position: -288px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-stop { - background-position: -312px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-forward { - background-position: -336px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-fast-forward { - background-position: -360px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-step-forward { - background-position: -384px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-eject { - background-position: -408px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-chevron-left { - background-position: -432px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-chevron-right { - background-position: -456px -72px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-plus-sign { - background-position: 0 -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-minus-sign { - background-position: -24px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-remove-sign { - background-position: -48px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-ok-sign { - background-position: -72px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-question-sign { - background-position: -96px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-info-sign { - background-position: -120px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-screenshot { - background-position: -144px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-remove-circle { - background-position: -168px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-ok-circle { - background-position: -192px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-ban-circle { - background-position: -216px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-arrow-left { - background-position: -240px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-arrow-right { - background-position: -264px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-arrow-up { - background-position: -289px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-arrow-down { - background-position: -312px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-share-alt { - background-position: -336px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-resize-full { - background-position: -360px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-resize-small { - background-position: -384px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-plus { - background-position: -408px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-minus { - background-position: -433px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-asterisk { - background-position: -456px -96px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-exclamation-sign { - background-position: 0 -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-gift { - background-position: -24px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-leaf { - background-position: -48px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-fire { - background-position: -72px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-eye-open { - background-position: -96px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-eye-close { - background-position: -120px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-warning-sign { - background-position: -144px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-plane { - background-position: -168px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-calendar { - background-position: -192px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-random { - background-position: -216px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-comment { - background-position: -240px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-magnet { - background-position: -264px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-chevron-up { - background-position: -288px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-chevron-down { - background-position: -313px -119px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-retweet { - background-position: -336px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-shopping-cart { - background-position: -360px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-folder-close { - background-position: -384px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-folder-open { - background-position: -408px -120px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-resize-vertical { - background-position: -432px -119px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .icon-resize-horizontal { - background-position: -456px -118px; + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-bar-chart { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-twitter-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-facebook-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-camera-retro { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-key { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-cogs { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-comments { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-thumbs-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-thumbs-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-star-half { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-heart-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-signout { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-linkedin-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-pushpin { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-external-link { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-signin { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-trophy { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-github-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-upload-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-lemon { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-phone { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-check-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-bookmark-empty { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-phone-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-twitter { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-facebook { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-github { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-unlock { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-credit-card { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-rss { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-hdd { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-bullhorn { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-bell { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-certificate { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-hand-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-hand-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-hand-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-hand-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-circle-arrow-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-circle-arrow-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-circle-arrow-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-circle-arrow-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-globe { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-wrench { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-tasks { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-filter { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-briefcase { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-fullscreen { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-group { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-link { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-cloud { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-beaker { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-cut { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-copy { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-paper-clip { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-save { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-sign-blank { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-reorder { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-list-ul { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-list-ol { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-strikethrough { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-underline { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-table { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-magic { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-truck { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-pinterest { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-pinterest-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-google-plus-sign { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-google-plus { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-money { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-caret-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-caret-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-caret-left { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-caret-right { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-columns { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-sort { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-sort-down { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-sort-up { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-envelope-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-linkedin { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-undo { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-legal { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-dashboard { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-comment-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-comments-alt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-bolt { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-sitemap { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-umbrella { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-paste { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); +} +.icon-user-md { + *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = ' '); } .dropdown { position: relative; @@ -2665,15 +3243,6 @@ button.btn.small, input[type="submit"].btn.small { .pagination li { display: inline; } - -/*.pagination .page{ - float: left; - padding: 0 14px; - line-height: 34px; - text-decoration: none; - border: 1px solid #ddd; - border-left-width: 0; -}*/ .pagination a { float: left; padding: 0 14px; @@ -3100,6 +3669,15 @@ a.thumbnail:hover { .label-info { background-color: #3a87ad; } +.label-teacher { + background-color: #0071A9; +} +.label-student { + background-color: #AF0045; +} +.label-staff { + background-color: #219C6B; +} @-webkit-keyframes progress-bar-stripes { from { background-position: 0 0; diff --git a/app/assets/stylesheets/style.css.erb b/app/assets/stylesheets/style.css.erb index f45faf9cf..0ab84c3f5 100644 --- a/app/assets/stylesheets/style.css.erb +++ b/app/assets/stylesheets/style.css.erb @@ -31,8 +31,7 @@ padding-bottom: 1px; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset; -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset; - + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(127, 149, 165, 1), 0 -1px 0 rgba(31, 32, 36, 1) inset; background-image: -moz-linear-gradient(top, #5282A6, #133757); background-image: -ms-linear-gradient(top, #5282A6, #133757); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5282A6), to(#133757)); @@ -40,15 +39,6 @@ background-image: -o-linear-gradient(top, #5282A6, #133757); background-image: linear-gradient(top, #5282A6, #133757); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5282A6', endColorstr='#133757', GradientType=0); - /* - background-image: -moz-linear-gradient(top, #545b60, #191a1c); - background-image: -ms-linear-gradient(top, #545b60, #191a1c); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#545b60), to(#191a1c)); - background-image: -webkit-linear-gradient(top, #545b60, #191a1c); - background-image: -o-linear-gradient(top, #545b60, #191a1c); - background-image: linear-gradient(top, #545b60, #191a1c); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#545b60', endColorstr='#191a1c', GradientType=0); - */ } #orbit-bar .navbar-search { left: 28px; @@ -62,25 +52,20 @@ } #orbit-bar .search-query { padding: 7px 9px 5px; - height: 10px; + height: 11px; margin-top: 3px; border: 1px solid #333333; font-size: 11px; - /*background-color: rgba(255, 255, 255, 0.8); - color: #333; - text-shadow: 0px 1px 0px #FFF;*/ + line-height: 21px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3) inset, 0 1px 0 rgba(255, 255, 255, 0.15); } #orbit-bar .search-query:focus { - /*background-color: rgba(255, 255, 255, 0.9); - text-shadow: 0px 1px 0px #FFF;*/ background-position: 5px 2px; } #orbit-bar .container { width:100%; } #orbit-bar .orbit-logo .brand { - /* background: url(<%= asset_path 'orbit-bar.png' %>) no-repeat -162px -5px; */ background: url(<%= asset_path 'nccu_logo.png' %>) no-repeat 6px 0px; text-indent:-9999px; padding: 5px 20px 4px; @@ -118,8 +103,7 @@ background-position: -10px -10px; } #orbit-bar .nav > li > a.orbit-bar-desktop { - background-position: -73px -42px; - width: 48px; + background-position: -73px -42px;width: 48px; } #orbit-bar .nav > li > a.orbit-bar-member { background-position: -4px -37px; @@ -190,7 +174,7 @@ margin: 0; } #orbit-bar .bar-login .dropdown-menu .log .span2 { - width: 183px; + width: 182px; } #orbit-bar .bar-login .dropdown-menu .log .forgot { margin-bottom: 20px; @@ -286,18 +270,9 @@ background-color: #FFF; margin-left:160px; padding-top: 32px; - /*padding-bottom: 18px;*/ - position: relative; padding-bottom: 45px; - /*min-height: 100%;*/ + position: relative; } -/*#main-wrap > .form-actions { - background-color: #FFF; - text-align: center; - padding: 17px 20px 0; - margin: 0; - border-top: none; -}*/ #main-wrap .subnav { height: auto; min-height: 36px; @@ -378,11 +353,10 @@ #post-body .editor { } #post-body-content { - /*margin-right: 320px;*/ padding: 8px 0 8px 6px; } .filter .accordion-heading > a:hover { - text-decoration: none; + text-decoration: none; } .filter .accordion-group { border-bottom: none; @@ -581,6 +555,22 @@ /*background-color: #AF0045; border-left: 2px solid #AF0045;*/ } +.gender { + position: absolute; + border-radius: 0 0 5px 0; + border-width: 10px; + margin: 0; + border-style: solid; + z-index: 10; + bottom: 0; + right: 0; +} +.gender.male { + border-color: transparent #41B1D5 #41B1D5 transparent; +} +.gender.female { + border-color: transparent #DB186E #DB186E transparent; +} .user-info .roles-nav { margin: 0; position: relative; @@ -642,6 +632,20 @@ min-width: 220px; display: inline-block; float: left; + position: relative; +} +.user-info-basic .gender { + border-radius: 0; + top: 0; + left: 0; + right: auto; + bottom: auto; +} +.user-info-basic .gender.male { + border-color: #41B1D5 transparent transparent #41B1D5; +} +.user-info-basic .gender.female { + border-color: #DB186E transparent transparent #DB186E; } .user-info-roles { padding: 20px; @@ -655,7 +659,7 @@ margin-right: 10px; } .user-avatar .reflective { - background-image: url(img/reflective.png); + background-image: url(<%= asset_path 'reflective.png' %>); background-repeat: no-repeat; background-position: 0; height: 80px; @@ -663,7 +667,7 @@ position: absolute; } .user .user-avatar .reflective { - background-image: url(img/reflective.png); + background-image: url(<%= asset_path 'reflective.png' %>); background-repeat: no-repeat; background-position: 0 -20px; height: 80px; @@ -855,6 +859,7 @@ .site-map .map-block ul { margin: 0px; list-style: none; + width: 220px \9; } .site-map .map-block li { font-size: 12px; @@ -929,6 +934,27 @@ margin-top: 2px; } +.modal.alert-error { + color: #B94A48; + background-color: #F2DEDE; + border-color: #EED3D7; +} +.news_paragraph p { + line-height: 20px; +} +.nav-tabs>li>.edit, .nav-tabs>li>.edit:hover { + background-color: #333; + color: #FFF; + padding-right: 12px; +} +.nav-tabs li .icons-pencil { + float: right; + margin-top: 8px; +} +.nav-tabs li a { + padding-right: 32px; +} + /*icons*/ .the-icons i:after { diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5fd9de5c9..109d4742a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -106,6 +106,15 @@ class ApplicationController < ActionController::Base render :text => '404 Not Found' end end + + def render_share + object_class = params[:model].classify.constantize + @object = object_class.find(params[:id]) + module_app = ModuleApp.first(:conditions => {:key => params[:key]}) + @item = Item.where(module_app_id: module_app.id).all_of("tag" => {"$in" => [nil,'']},"category" => { "$in" => [nil,'']}).first + @orig_url = "http://#{request.host_with_port}/#{@item.path}?id=#{@object.id}" + render 'shared/render_share', :layout => false + end protected diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 4375ba1ab..053660a51 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -1,9 +1,6 @@ class PagesController < ApplicationController - include ApplicationHelper - before_filter :get_item, :only => [:index_from_link, :show_from_link] - # caches_page :index def index @@ -11,7 +8,7 @@ class PagesController < ApplicationController if @item impressionist(@item) - render_page + render_page else render :text => 'You need a home page' end @@ -19,14 +16,15 @@ class PagesController < ApplicationController def show #begin + @item = Item.first(:conditions => {:path => params[:page_name]}) - if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s)) + if @item && @item.is_published #&& (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s)) impressionist(@item) case @item.class.to_s - when 'Page' - render_page + when 'Page' + render_page unless save_from_no_lang_for_page when 'Link' - redirect_to @item[:url] + redirect_to(@item[:url]) unless save_from_no_lang_for_page end else render :file => "#{Rails.root}/public/404.html", :status => :not_found @@ -43,15 +41,17 @@ class PagesController < ApplicationController options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank? options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank? options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank? + options << "#{options.blank? ? '?' : '&'}name=#{params[:name]}" unless params[:name].blank? uri = URI::escape(url + options) - redirect_to uri + #uri = URI::escape("#{url}?" + params.collect{|k,v| "#{k}=#{v}"}.join('&')) + redirect_to(uri)unless save_from_no_lang_for_page end def show_from_link url = "/#{@item.path}?id=#{params[:id]}" options = '' options << "&preview=#{params[:preview]}" unless params[:preview].blank? - redirect_to url + options + redirect_to(url + options) unless save_from_no_lang_for_page end def load_orbit_bar @@ -66,12 +66,22 @@ class PagesController < ApplicationController @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => params[:tag_id]}) @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => ''}) unless @item elsif !params[:category_id].blank? - @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id], :tag => ''}) + @item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action],category: params[:category_id]).any_in(tag: [nil,'']).first elsif !params[:tag_id].blank? - @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => '', :tag => params[:tag_id]}) + @item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action],tag: params[:tag_id]).any_in(category: [nil,'']).first end - @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => '', :tag => ''}) unless @item + @item = Item.where(module_app_id: module_app.id,app_frontend_url:params[:app_action]).all_of("tag" => {"$in" => [nil,'']},"category" => { "$in" => [nil,'']}).first unless @item #TODO 需要做 error handler 處理沒有新增該模組頁面導致錯誤的可能性 end + protected + def save_from_no_lang_for_page + if @item.nil? or !@item.enabled_for_lang(I18n.locale.to_s) + flash[:notice] = t('sys.module_page_lang_not_support') + redirect_to '/' + return true + else + return false + end + end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0c6229b3c..63526229f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -140,6 +140,7 @@ module ApplicationHelper stylesheets << "\n" stylesheets << "\n" end + stylesheets << "\n" stylesheets << "\n" if page.design.reset_css stylesheets << "\n" stylesheets << "\n" if page.design.default_css @@ -161,6 +162,8 @@ module ApplicationHelper end javascripts << "\n" javascripts << "\n" + # javascripts << "\n" + javascripts << "\n" javascripts << "\n" page.design.javascripts.each do |js| # javascripts << "" @@ -212,4 +215,15 @@ module ApplicationHelper object.strftime("%Y-%m-%d") end + def share_links(object, key) + js = '' + js << "\n" rescue '' + js << "\n" rescue '' + js << "\n" rescue '' + content_tag :div, :class => 'fb' do + concat social_share_button_tag(object.title, :fb_url => "http://#{request.env['HTTP_HOST']}/share/#{object.class.to_s.underscore}/#{object.id}?key=#{key}", :image => "http://#{request.env['HTTP_HOST']}#{object.image.url}") + # concat javascript_tag "$('head').append('#{j js}');" + end + end + end diff --git a/app/models/item.rb b/app/models/item.rb index f43421af9..ae086c7d3 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -21,9 +21,12 @@ class Item validates_associated :parent, :children before_destroy :destroy_children - after_rearrange :rebuild_path, :if => "parent_id_changed?" - + after_rearrange :rebuild_path, :if => "parent_id_changed? || name_changed?" + def enabled_for_lang(lang) + enabled_for.include?(lang) + end + def self.find_by_name(item_name) Item.first(:conditions => { :name => item_name, :is_published => true }) end diff --git a/app/models/page.rb b/app/models/page.rb index 20a512889..cba692d06 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -6,8 +6,8 @@ class Page < Item field :content field :app_frontend_url field :theme_id, :type => BSON::ObjectId, :default => nil - field :category - field :tag + field :category, :default => '' + field :tag, :default => '' field :view_count, :type => Integer, :default => 0 field :page_title, localize: true diff --git a/app/models/user/user.rb b/app/models/user/user.rb index f51d49f0f..4cb00bbbb 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -31,12 +31,7 @@ class User VALID_LOCALES.each do |loc| locale = loc.to_sym - # debugger - # if(self.cache_dept.nil?) - # self.build_cache_dept key: "dept_cache_user_#{self.id}" - # end dept_hash[locale] = sub_roles.collect{|sr| sr.title}.join(',') - # self.cache_dept[locale] = sub_roles.collect{|sr| sr.title}.join(',') end self.cache_dept = dept_hash self.save! diff --git a/app/views/admin/assets/file_upload.html.erb b/app/views/admin/assets/file_upload.html.erb index c954624bf..91afdeefd 100644 --- a/app/views/admin/assets/file_upload.html.erb +++ b/app/views/admin/assets/file_upload.html.erb @@ -59,4 +59,4 @@ <% end %> - \ No newline at end of file + diff --git a/app/views/admin/sites/sitemap_frontend.html.erb b/app/views/admin/sites/sitemap_frontend.html.erb index cd8372d3f..bf126c90d 100644 --- a/app/views/admin/sites/sitemap_frontend.html.erb +++ b/app/views/admin/sites/sitemap_frontend.html.erb @@ -16,7 +16,7 @@ $(document).ready(function(){ $('.site-map').masonry({ itemSelector: '.map-block', - columnWidth: 260, + columnWidth: 220, isAnimated: true }); }); diff --git a/app/views/layouts/page_layout.html.erb b/app/views/layouts/page_layout.html.erb index 0a7240ef3..ae73e59d0 100644 --- a/app/views/layouts/page_layout.html.erb +++ b/app/views/layouts/page_layout.html.erb @@ -1,5 +1,5 @@ - + <%= page_title(@item).html_safe %> @@ -12,6 +12,17 @@ <%= page_javascripts(@item).html_safe %> - <%= yield %> + <%= yield %> + <% if !flash.empty? %> + + + <% end -%> diff --git a/app/views/shared/render_share.html.erb b/app/views/shared/render_share.html.erb new file mode 100644 index 000000000..f8d3c9302 --- /dev/null +++ b/app/views/shared/render_share.html.erb @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/config/initializers/override_and_new_class_methods.rb b/config/initializers/override_and_new_class_methods.rb index 8170d674f..075158042 100644 --- a/config/initializers/override_and_new_class_methods.rb +++ b/config/initializers/override_and_new_class_methods.rb @@ -3,3 +3,24 @@ Integer.class_eval do !self.zero? end end + +module SocialShareButton + module Helper + def social_share_button_tag(title = "", opts = {}) + rel = opts[:rel] + html = [] + html << "
" + + SocialShareButton.config.allow_sites.each do |name| + link_title = t "social_share_button.share_to", :name => t("social_share_button.#{name.downcase}") + html << link_to("","#", :rel => "nofollow #{rel}", + "data-site" => name, + :class => "social-share-button-#{name}", + :onclick => "return SocialShareButton.share(this);", + :title => h(link_title)) + end + html << "
" + raw html.join("\n") + end + end +end \ No newline at end of file diff --git a/config/initializers/redis_search.rb b/config/initializers/redis_search.rb deleted file mode 100644 index 76971b97c..000000000 --- a/config/initializers/redis_search.rb +++ /dev/null @@ -1,18 +0,0 @@ -require "redis" -require "redis-namespace" -require "redis-search" -# don't forget change namespace -redis = Redis.new(:host => "127.0.0.1",:port => "6379") -# We suggest you use a special db in Redis, when you need to clear all data, you can use flushdb command to clear them. -redis.select(3) -# Give a special namespace as prefix for Redis key, when your have more than one project used redis-search, this config will make them work fine. -redis = Redis::Namespace.new("orbit_nccu:redis_search2", :redis => redis) -Redis::Search.configure do |config| - config.redis = redis - config.complete_max_length = 100 - #config.pinyin_match = true - # use rmmseg, true to disable it, it can save memroy - config.disable_rmmseg = false -end -# Bulletin.new -# NewsBulletin.new \ No newline at end of file diff --git a/config/initializers/social_share_button.rb b/config/initializers/social_share_button.rb new file mode 100644 index 000000000..8b9335778 --- /dev/null +++ b/config/initializers/social_share_button.rb @@ -0,0 +1,3 @@ +SocialShareButton.configure do |config| + config.allow_sites = %w(twitter facebook google_plus) +end \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 93fbcc108..a3e295ff0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -298,7 +298,8 @@ en: sys: not_previewable: "Preview not support" limit_of_upload_file_size: "Upload file must be less than: %{best_size}" - + can_not_display_due_to_no_context: "Can not display due to no context for English" + module_page_lang_not_support: "We are sorry, this page is not available for English" search: not_found: "NOT FOUND" domains: Google Search Domains @@ -306,3 +307,5 @@ en: sitesearch: Google Site Search site_setting_help: Please Enter the search argument for Google search. result_get: "Searched about ' %{search_word} ' Found %{item_num} items" + too_many: "Search about ' %{search_word} 'resulted more than %{exceed_num} items maybe try to search with more specific terms?" + unit_get: "Listed items created by :%{unit_name} Found %{item_num} items" diff --git a/config/locales/social_share_button.en.yml b/config/locales/social_share_button.en.yml new file mode 100644 index 000000000..7e3f1fb0e --- /dev/null +++ b/config/locales/social_share_button.en.yml @@ -0,0 +1,14 @@ +en: + social_share_button: + share_to: Share to %{name} + weibo: Sina Weibo + twitter: Twitter + facebook: Facebook + douban: Douban + qq: Qzone + tqq: Tqq + delicious: Delicious + baidu: Baidu.com + kaixin001: Kaixin001.com + renren: Renren.com + google_plus: Google+ diff --git a/config/locales/social_share_button.zh-tw.yml b/config/locales/social_share_button.zh-tw.yml new file mode 100644 index 000000000..b0321eb5a --- /dev/null +++ b/config/locales/social_share_button.zh-tw.yml @@ -0,0 +1,14 @@ +zh_tw: + social_share_button: + share_to: 分享到%{name} + weibo: 新浪微博 + twitter: Twitter + facebook: Facebook + douban: 豆瓣 + qq: QQ空間 + tqq: 腾讯微博 + delicious: Delicious + baidu: 百度收藏 + kaixin001: 開心網 + renren: 人人網 + google_plus: Google+ diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 79251f922..28bc5e1dc 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -442,7 +442,11 @@ zh_tw: site_search: "全站搜尋" sitesearch: Google Site Search site_setting_help: 請輸入送交Google搜尋的參數 + result_get: "搜尋有關 ' %{search_word} ' 共搜尋到%{item_num}筆資料" + too_many: "搜尋有關 ' %{search_word} ' 尋找到超過 %{exceed_num} 筆資料,請嘗試加入更多關鍵字縮小搜尋範圍,以作更精確的搜尋" + result_get: "搜尋標題有關 ' %{search_word} ' 共搜尋到%{item_num}筆資料" + unit_get: "列出由:%{unit_name}發佈的資料,共有%{item_num}筆" activerecord: errors: template: # ~ 2.3.5 backward compatible @@ -524,7 +528,8 @@ zh_tw: sys: not_previewable: "不支援預覽" limit_of_upload_file_size: "上傳檔案大小限制: %{best_size}" - + can_not_display_due_to_no_context: "因為沒有中文版本,所以無法顯示" + module_page_lang_not_support: "很抱歉,本頁沒有開放中文版本" object_disable: change_to_true: "設為停用" change_to_false: "重新啓用" \ No newline at end of file diff --git a/config/mongoid.yml b/config/mongoid.yml index 0d68cb7a8..219e13728 100644 --- a/config/mongoid.yml +++ b/config/mongoid.yml @@ -8,7 +8,7 @@ defaults: &defaults development: <<: *defaults - database: prototype_r4_ldap0229 + database: i18n_var test: <<: *defaults diff --git a/config/routes.rb b/config/routes.rb index b281dd33b..91a28d60e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -140,6 +140,8 @@ Orbit::Application.routes.draw do match '/panel/:app_name/front_end/:app_action' => 'pages#index_from_link', :constraints => lambda { |request| !request.query_string.include?("inner=true") } + + match '/share/:model/:id' => 'application#render_share' # routes for gridfs files match "/gridfs/*path" => "gridfs#serve" diff --git a/config/sunspot.yml b/config/sunspot.yml index 79867b7a6..7bbd32c0f 100644 --- a/config/sunspot.yml +++ b/config/sunspot.yml @@ -7,11 +7,11 @@ production: development: solr: hostname: localhost - port: 8983 + port: 8982 log_level: INFO test: solr: hostname: localhost - port: 8983 + port: 8981 log_level: WARNING \ No newline at end of file diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index eca375a42..6a9390eae 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -180,7 +180,7 @@ module ParserCommon if (content["main"] == "true" && !page.module_app.nil?) ret << "
" else part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil diff --git a/lib/tasks/data_migration.rake b/lib/tasks/data_migration.rake index 54d8bd0f1..624cf39c3 100644 --- a/lib/tasks/data_migration.rake +++ b/lib/tasks/data_migration.rake @@ -83,4 +83,17 @@ namespace :data_migration do puts("#{'='*10}Finished#{'='*10}") end + task :make_bulletin_save_dept_data => :environment do + Bulletin.all.each{|bt| bt.save!} + end + + task :extend_exsisted_app_module_for_dept_search => :environment do + app = ModuleApp.first({:conditions=>{:title => 'news'}}) + app.app_pages << "index_by_unit" if !app.widgets.include?("index_by_unit") + app.save! + app = ModuleApp.first({:conditions=>{:title => 'Announcement'}}) + app.app_pages << "index_by_unit" if !app.widgets.include?("index_by_unit") + app.save! + end + end \ No newline at end of file diff --git a/lib/tasks/matt_dev.rake b/lib/tasks/matt_dev.rake index c82606c23..ce0cd5093 100644 --- a/lib/tasks/matt_dev.rake +++ b/lib/tasks/matt_dev.rake @@ -6,9 +6,22 @@ namespace :matt_dev do p a a= Redis::Search.query("NewsBulletin",'社科院',:conditions =>{:is_checked=>true,:is_hidden=>false}) p a - # p Pinyin.t('台灣不是中國的一部分') end - + + task :searching_02 => :environment do + a= Bulletin.solr_search do #("Bulletin",'我',:conditions =>{:is_checked=>true,:is_hidden=>false}) + fulltext '關島' + with(:frontend_search,true) + #with(:is_hidden,true) + end + p a.results + a= NewsBulletin.solr_search do #("NewsBulletin",'社科院',:conditions =>{:is_checked=>true,:is_hidden=>false}) + fulltext '社科院' + with(:frontend_search,true) + #with(:is_hidden,true) + end + p a.results + end task :testing_new_tag_cal do ranges = [[1],[1,2],[1,2,3],[1,2,3,4],[1,2,3,4,5],[1,2,3,4,5,6],[1,2,3,4,5,6,7],[1,2,3,4,5,6,7,8],[1,2,3,4,5,6,7,8,9],[1,2,3,4,5,6,7,8,9,10],[1,2,3,4,5,6,7,8,9,10,11],[1,2,3,4,5,6,7,8,9,10,11,12],[-1,-2,-3,-4,5,6,7,8,9,10,11,12]] diff --git a/lib/tasks/mid_site_sync.rake b/lib/tasks/mid_site_sync.rake index 707a609b3..e009f8619 100644 --- a/lib/tasks/mid_site_sync.rake +++ b/lib/tasks/mid_site_sync.rake @@ -9,7 +9,7 @@ namespace :mid_site do admin_role = nil sub_role = nil test_account_ldap_id ='139716' - MiddleSiteConnection.establish + #MiddleSiteConnection.establish task :sync => :environment do info_profile = Info.first(conditions: {:key => 'profile'}) diff --git a/solr/conf/admin-extra.html b/solr/conf/admin-extra.html new file mode 100644 index 000000000..aa739da86 --- /dev/null +++ b/solr/conf/admin-extra.html @@ -0,0 +1,31 @@ + + + diff --git a/solr/conf/elevate.xml b/solr/conf/elevate.xml new file mode 100644 index 000000000..7630ebe20 --- /dev/null +++ b/solr/conf/elevate.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + diff --git a/solr/conf/mapping-ISOLatin1Accent.txt b/solr/conf/mapping-ISOLatin1Accent.txt new file mode 100644 index 000000000..ede774258 --- /dev/null +++ b/solr/conf/mapping-ISOLatin1Accent.txt @@ -0,0 +1,246 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Syntax: +# "source" => "target" +# "source".length() > 0 (source cannot be empty.) +# "target".length() >= 0 (target can be empty.) + +# example: +# "À" => "A" +# "\u00C0" => "A" +# "\u00C0" => "\u0041" +# "ß" => "ss" +# "\t" => " " +# "\n" => "" + +# À => A +"\u00C0" => "A" + +# Á => A +"\u00C1" => "A" + +#  => A +"\u00C2" => "A" + +# à => A +"\u00C3" => "A" + +# Ä => A +"\u00C4" => "A" + +# Å => A +"\u00C5" => "A" + +# Æ => AE +"\u00C6" => "AE" + +# Ç => C +"\u00C7" => "C" + +# È => E +"\u00C8" => "E" + +# É => E +"\u00C9" => "E" + +# Ê => E +"\u00CA" => "E" + +# Ë => E +"\u00CB" => "E" + +# Ì => I +"\u00CC" => "I" + +# Í => I +"\u00CD" => "I" + +# Î => I +"\u00CE" => "I" + +# Ï => I +"\u00CF" => "I" + +# IJ => IJ +"\u0132" => "IJ" + +# Ð => D +"\u00D0" => "D" + +# Ñ => N +"\u00D1" => "N" + +# Ò => O +"\u00D2" => "O" + +# Ó => O +"\u00D3" => "O" + +# Ô => O +"\u00D4" => "O" + +# Õ => O +"\u00D5" => "O" + +# Ö => O +"\u00D6" => "O" + +# Ø => O +"\u00D8" => "O" + +# Œ => OE +"\u0152" => "OE" + +# Þ +"\u00DE" => "TH" + +# Ù => U +"\u00D9" => "U" + +# Ú => U +"\u00DA" => "U" + +# Û => U +"\u00DB" => "U" + +# Ü => U +"\u00DC" => "U" + +# Ý => Y +"\u00DD" => "Y" + +# Ÿ => Y +"\u0178" => "Y" + +# à => a +"\u00E0" => "a" + +# á => a +"\u00E1" => "a" + +# â => a +"\u00E2" => "a" + +# ã => a +"\u00E3" => "a" + +# ä => a +"\u00E4" => "a" + +# å => a +"\u00E5" => "a" + +# æ => ae +"\u00E6" => "ae" + +# ç => c +"\u00E7" => "c" + +# è => e +"\u00E8" => "e" + +# é => e +"\u00E9" => "e" + +# ê => e +"\u00EA" => "e" + +# ë => e +"\u00EB" => "e" + +# ì => i +"\u00EC" => "i" + +# í => i +"\u00ED" => "i" + +# î => i +"\u00EE" => "i" + +# ï => i +"\u00EF" => "i" + +# ij => ij +"\u0133" => "ij" + +# ð => d +"\u00F0" => "d" + +# ñ => n +"\u00F1" => "n" + +# ò => o +"\u00F2" => "o" + +# ó => o +"\u00F3" => "o" + +# ô => o +"\u00F4" => "o" + +# õ => o +"\u00F5" => "o" + +# ö => o +"\u00F6" => "o" + +# ø => o +"\u00F8" => "o" + +# œ => oe +"\u0153" => "oe" + +# ß => ss +"\u00DF" => "ss" + +# þ => th +"\u00FE" => "th" + +# ù => u +"\u00F9" => "u" + +# ú => u +"\u00FA" => "u" + +# û => u +"\u00FB" => "u" + +# ü => u +"\u00FC" => "u" + +# ý => y +"\u00FD" => "y" + +# ÿ => y +"\u00FF" => "y" + +# ff => ff +"\uFB00" => "ff" + +# fi => fi +"\uFB01" => "fi" + +# fl => fl +"\uFB02" => "fl" + +# ffi => ffi +"\uFB03" => "ffi" + +# ffl => ffl +"\uFB04" => "ffl" + +# ſt => ft +"\uFB05" => "ft" + +# st => st +"\uFB06" => "st" diff --git a/solr/conf/protwords.txt b/solr/conf/protwords.txt new file mode 100644 index 000000000..1dfc0abec --- /dev/null +++ b/solr/conf/protwords.txt @@ -0,0 +1,21 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# Use a protected word file to protect against the stemmer reducing two +# unrelated words to the same base word. + +# Some non-words that normally won't be encountered, +# just to test that they won't be stemmed. +dontstems +zwhacky + diff --git a/solr/conf/schema.xml b/solr/conf/schema.xml new file mode 100644 index 000000000..17a751ad0 --- /dev/null +++ b/solr/conf/schema.xml @@ -0,0 +1,238 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + text + + + + diff --git a/solr/conf/scripts.conf b/solr/conf/scripts.conf new file mode 100644 index 000000000..f58b262ae --- /dev/null +++ b/solr/conf/scripts.conf @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +user= +solr_hostname=localhost +solr_port=8983 +rsyncd_port=18983 +data_dir= +webapp_name=solr +master_host= +master_data_dir= +master_status_dir= diff --git a/solr/conf/solrconfig.xml b/solr/conf/solrconfig.xml new file mode 100644 index 000000000..65c196073 --- /dev/null +++ b/solr/conf/solrconfig.xml @@ -0,0 +1,934 @@ + + + + + + ${solr.abortOnConfigurationError:true} + + + + + + + + + + + + + ${solr.data.dir:./solr/data} + + + + false + 10 + + + + 32 + + 10000 + 1000 + 10000 + + + + + + + + native + + + + + + false + 32 + 10 + + + + + + false + + true + + + + + + 1 + + 0 + + + + false + + + + + + + + + + + + + + + + + 1024 + + + + + + + + + + true + + + + + 20 + + 200 + + + + + + + + + + + + solr rocks + 0 + 10 + + + static firstSearcher warming query from solrconfig.xml + + + + + false + + 2 + + + + + + + + + + + + + + + + + + explicit + + + + + + + + + + + dismax + explicit + 0.01 + + text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4 + + + text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9 + + + popularity^0.5 recip(price,1,1000,1000)^0.3 + + + id,name,price,score + + + 2<-1 5<-2 6<90% + + 100 + *:* + + text features name + + 0 + + name + regex + + + + + + + dismax + explicit + text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 + 2<-1 5<-2 6<90% + + incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2 + + + + inStock:true + + + + cat + manu_exact + price:[* TO 500] + price:[500 TO *] + + + + + + textSpell + + default + name + ./spellchecker + + + + + + + + + false + + false + + 1 + + + spellcheck + + + + + + + true + + + tvComponent + + + + + + + + default + + org.carrot2.clustering.lingo.LingoClusteringAlgorithm + + 20 + + + stc + org.carrot2.clustering.stc.STCClusteringAlgorithm + + + + + true + default + true + + name + id + + features + + true + + + + false + + + clusteringComponent + + + + + + + text + true + ignored_ + + true + links + ignored_ + + + + + + + true + + + termsComponent + + + + + + string + elevate.xml + + + + + explicit + + + elevator + + + + + + + + + + + + + + + + + + standard + solrpingquery + all + + + + + + explicit + + true + + + + + + + + 100 + + + + + + + 70 + + 0.5 + + [-\w ,/\n\"']{20,200} + + + + + + ]]> + ]]> + + + + + + + + + 5 + + + + + + solr + + + + + 1 + 2 + + + diff --git a/solr/conf/spellings.txt b/solr/conf/spellings.txt new file mode 100644 index 000000000..d7ede6f56 --- /dev/null +++ b/solr/conf/spellings.txt @@ -0,0 +1,2 @@ +pizza +history \ No newline at end of file diff --git a/solr/conf/stopwords.txt b/solr/conf/stopwords.txt new file mode 100644 index 000000000..b5824da32 --- /dev/null +++ b/solr/conf/stopwords.txt @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +#Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +s +such +t +that +the +their +then +there +these +they +this +to +was +will +with + diff --git a/solr/conf/synonyms.txt b/solr/conf/synonyms.txt new file mode 100644 index 000000000..b0e31cb7e --- /dev/null +++ b/solr/conf/synonyms.txt @@ -0,0 +1,31 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +#some test synonym mappings unlikely to appear in real input text +aaa => aaaa +bbb => bbbb1 bbbb2 +ccc => cccc1,cccc2 +a\=>a => b\=>b +a\,a => b\,b +fooaaa,baraaa,bazaaa + +# Some synonym groups specific to this example +GB,gib,gigabyte,gigabytes +MB,mib,megabyte,megabytes +Television, Televisions, TV, TVs +#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming +#after us won't split it into two words. + +# Synonym mappings can be used for spelling correction too +pixima => pixma + diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb index f787ff280..5dfbb7501 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb @@ -10,11 +10,8 @@ class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendControlle def approve notice = "" @bulletin = Bulletin.find params[:bulletin_id] - - @bulletin.is_checked = params[:bulletin][:is_checked] - @bulletin.not_checked_reason = params[:bulletin][:not_checked_reason] + @bulletin.proc_check(params[:bulletin][:is_checked],params[:bulletin][:not_checked_reason]) @bulletin.de_pending - if @bulletin.save notice = t('bulletin.approve_bulletin_success') else diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb index 3979ca78e..60784f05f 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb @@ -14,8 +14,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController def index # @bulletins = Bulletin.all # @bulletins = Bulletin.desc("postdate desc") - get_categorys('BulletinCategory',params[:bulletin_category_id]) - get_tags + get_categorys('BulletinCategory',params[:bulletin_category_id]) + get_tags @filter = params[:filter] new_filter = params[:new_filter] @@ -34,12 +34,6 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController @filter = {new_filter[:type] => [new_filter[:id].to_s]} end - # @bulletins = Bulletin.where("bulletin_category_id" => params[:bulletin_category_id]).desc("postdate") if params[:bulletin_category_id] - - # @bulletins = Bulletin.search(params[:search], params[:category_id]) - # @bulletins = Bulletin.all.order_by([params[:sort], params[:direction]]) - - # @bulletins = (params[:sort] || @filter) ? get_sorted_and_filtered_bulletins : Bulletin.all.page(params[:page]).per(10) @bulletin_categories = get_categories_for_index("BulletinCategory") @bulletin_category_ids = @bulletin_categories.collect{|t| t.id.to_s} + [nil] @@ -62,16 +56,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController # GET /bulletins/1.xml def show @bulletin = Bulletin.find(params[:id]) - get_tags - # get_categorys - - # @bulletin_categorys = BulletinCategory.where("_id" => params[:id]) - - # if params[:id] - # @bulletins = Bulletin.where("bulletin_category_id" => params[:id]) - # else - # @bulletins = Bulletin.desc("postdate desc") - # end + get_tags respond_to do |format| format.html # show.html.erb @@ -84,13 +69,9 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController def new @bulletin = Bulletin.new(:postdate => DateTime.now) - @link_url = panel_announcement_back_end_bulletins_path - - # @bulletin.bulletin_files.build - # @bulletin.bulletin_files.new - - get_tags - respond_to do |format| + @link_url = panel_announcement_back_end_bulletins_path + get_tags + respond_to do |format| format.html # new.html.erb format.xml { render :xml => @bulletin } end @@ -128,11 +109,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController @bulletin_file = BulletinFile.new(params[:bulletin_file]) - # respond_to do |format| + respond_to do |format| if @bulletin_file.save - render 'create_bulletin_file',:layout=>false + format.js { render 'create_bulletin_file' } end - # end + end else @@ -141,6 +122,9 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController @bulletin.create_user_id = current_user.id @bulletin.update_user_id = current_user.id + if(is_manager? || is_admin?) + @bulletin.de_pending + end respond_to do |format| if @bulletin.save @@ -158,13 +142,10 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController end - def link_quick_add - # debugger - + def link_quick_add @bulletin_link = BulletinLink.new - @link_url = panel_announcement_back_end_bulletins_path - - @bulletin_link.bulletin_id = params[:bulletin_id] + @link_url = panel_announcement_back_end_bulletins_path + @bulletin_link.bulletin_id = params[:bulletin_id] respond_to do |format| format.js @@ -173,29 +154,17 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController end def link_quick_edit - # debugger @bulletin_link = BulletinLink.find(params[:bulletin_id]) - - @link_url = panel_announcement_back_end_bulletin_path(@bulletin_link) - - # @bulletin = Bulletin.find(params[:bulletin_id]) - - # @link_url = panel_announcement_back_end_bulletin_path(@bulletin) - + @link_url = panel_announcement_back_end_bulletin_path(@bulletin_link) respond_to do |format| format.js end - end - def file_quick_add - # debugger - + def file_quick_add @bulletin_file = BulletinFile.new @file_url = panel_announcement_back_end_bulletins_path - @bulletin_file.bulletin_id = params[:bulletin_id] - respond_to do |format| format.js end @@ -203,11 +172,8 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController end def file_quick_edit - # debugger @bulletin_file = BulletinFile.find(params[:bulletin_id]) - @file_url = panel_announcement_back_end_bulletin_path(@bulletin_file) - respond_to do |format| format.js end @@ -215,6 +181,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController # PUT /bulletins/1 # PUT /bulletins/1.xml + def update if params[:bulletin_link] @@ -248,7 +215,6 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController else @bulletin = Bulletin.find(params[:id]) - # @bulletin.image.clear if params[:bulletin][:image_del] == '1' # if params[:bulletin][:image_del] == '1' @@ -262,6 +228,11 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController respond_to do |format| if @bulletin.update_attributes(params[:bulletin]) + if(is_manager? || is_admin?) + @bulletin.is_checked = true + @bulletin.is_rejected = false + @bulletin.de_pending! + end # if (params[:bulletin][:is_checked] == "false") # @bulletin.is_rejected = true # @bulletin.save! @@ -276,8 +247,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController format.js { render 'toggle_enable' } format.xml { head :ok } else - get_tags - + get_tags format.html { render :action => "edit" } format.xml { render :xml => @bulletin.errors, :status => :unprocessable_entity } end diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb index 685eaa248..0adc848b9 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb @@ -7,14 +7,23 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController # GET /bulletins # GET /bulletins.xml - + def index_bulletins_by_unit + @page = Page.find(params[:page_id]) + @bulletins=Bulletin.all.available_for_lang(I18n.locale).can_display.where("cache_dept.#{I18n.locale.to_s.downcase}"=>params[:name]).page( params[:page_main]).per(15) + render :index + end + def index @page = Page.find(params[:page_id]) if !params[:search_query].blank? - search_cond = {:is_checked=>true,:is_hidden=>false,:is_pending => false} - search_cond.merge!({:bulletin_category_id => "#{params[:category_id]}" }) if !params[:category_id].blank? - search = Redis::Search.query("Bulletin", params[:search_query], :conditions =>search_cond,:limit=>Bulletin.all.count) - search_result = search.collect{|t| t["id"]} + # search_cond = {:is_checked=>true,:is_hidden=>false,:is_pending => false} + # search_cond.merge!({:bulletin_category_id => "#{params[:category_id]}" }) if !params[:category_id].blank? + @search = Bulletin.solr_search do + fulltext params[:search_query] + with(:frontend_search,true) + #order_by(:average_rating) + end + search_result = @search.results.collect{|result| result.id} @bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(15) else @@ -44,10 +53,14 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController if params[:preview] == "true" preview_content else - @bulletin = Bulletin.all.available_for_lang(I18n.locale).can_display.where(_id: params[:id]).first - unless @bulletin.disable? - impressionist(@bulletin) - get_categorys + @bulletin = Bulletin.all.can_display.where(_id: params[:id]).first + if !@bulletin.disable? + if @bulletin.enabled_for_lang(I18n.locale.to_s) + impressionist(@bulletin) + get_categorys + else + render :text => "
#{t('sys.can_not_display_due_to_no_context')}
".html_safe + end else render :nothing => true, :status => 403 end diff --git a/vendor/built_in_modules/announcement/app/models/bulletin.rb b/vendor/built_in_modules/announcement/app/models/bulletin.rb index e70acf57b..f2f0dd56e 100644 --- a/vendor/built_in_modules/announcement/app/models/bulletin.rb +++ b/vendor/built_in_modules/announcement/app/models/bulletin.rb @@ -4,7 +4,7 @@ class Bulletin include Mongoid::Document include Mongoid::Timestamps include Mongoid::MultiParameterAttributes - include Redis::Search + include Sunspot::Mongo include Impressionist::Impressionable BelongsToCategory = :bulletin_category @@ -25,6 +25,8 @@ class Bulletin field :postdate , :type => DateTime field :deadline , :type => DateTime # field :url + field :cache_dept,type: Hash + field :create_user_id field :update_user_id, :class_name => "User" @@ -59,61 +61,55 @@ class Bulletin accepts_nested_attributes_for :bulletin_links, :allow_destroy => true validates :title, :at_least_one => true - + before_save :check_deadline,:update_status,:update_avliable_language - + + before_save :fetch_dept after_save :save_bulletin_links after_save :save_bulletin_files - redis_search_index(:title_field => :s_title, - :alias_field =>:s_title_en , - :score_field => :view_count, - :condition_fields => [:is_checked,:is_hidden,:bulletin_category_id,:is_pending], - :ext_fields => []) - + searchable do + text :titles do + title_translations.to_a.collect{|t| t[1]} + end + text :texts do + text_translations.to_a.collect{|t| Nokogiri::HTML(t[1]).text} + end + # text :text do + # a = (title_translations["zh_tw"] + title_translations["en"]) + # a + # end + boolean :frontend_search do + ( !is_hidden && !is_pending && is_checked && !is_rejected ) + end - # def gen_title_for_search - # # [s_title,s_title_en,s_text_en,s_text_zh_tw].join(' ') - # end + integer :view_count + string :bulletin_category_id + end - #alias_method - - def s_title - self.title_translations["zh_tw"] + def proc_check(check,not_pass_info = "") + self.is_checked = true + if check =="true" + self.is_rejected = false + elsif check == "false" + self.is_rejected = true + self.not_checked_reason = not_pass_info + end end - def s_title_was - self.title_was["zh_tw"] - end - - def s_title_en - self.title_translations["en"] - end - - def s_title_en_was - self.title_was["en"] - end - - # def s_text_en - # Nokogiri::HTML(self.text.en).text - # end - # def s_text_zh_tw - # Nokogiri::HTML(self.text.zh_tw).text - # end - - # scope :currently_available, lambda { |category, limit| - # # limit ||= 5 - # # { - # # debugger - # # a=1 - # :where => {:bulletin_category_id => bulletin_category_id, :disable => false}#, - # # :limit => limit - # # } - # } def de_pending self.is_pending = false end + def de_pending! + de_pending + self.save! + end + + def enabled_for_lang(lang) + eval("self.available_for_#{lang}") + end + def publish_month published_at.strftime("%B %Y") end @@ -214,21 +210,6 @@ class Bulletin end end - - def update_status - if !self.is_pending - if !self.is_checked - # self.is_pending = false - self.is_rejected = true - #self.is_checked = false - elsif self.is_checked - # self.is_pending = false - self.is_rejected = false - #self.is_checked = true - end - end - return true - end def update_avliable_language VALID_LOCALES.each do |locale| @@ -240,4 +221,8 @@ class Bulletin end end + def fetch_dept + self.cache_dept = (User.current.cache_dept rescue nil) || (User.find(self.create_user_id).cache_dept rescue nil) + end + end \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_list_bulletin_file.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_list_bulletin_file.html.erb index ce9ce90c2..4fca4715b 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_list_bulletin_file.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_list_bulletin_file.html.erb @@ -3,7 +3,7 @@ <%= list_bulletin_file.file.file ? ( link_to list_bulletin_file.title_translations['en'], list_bulletin_file.file.url, {:target => '_blank', :title => list_bulletin_file.description_translations['en']} ) : list_bulletin_file.title_translations['zh_tw'] %> - + <%= fields_for "bulletin[bulletin_files_attributes][]", list_bulletin_file, :index => list_bulletin_file_counter do |f| %> <%= f.hidden_field :id %> <%= hidden_field_tag :tr, (dom_id list_bulletin_file) %> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb index 1bb363d07..9ba18b9c9 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb @@ -7,22 +7,32 @@ - + <%= content_tag (:th) do %> + <%= t('announcement.bulletin.category') %> + <% end if (!params[:search_query].blank? or params[:category_id].blank?)-%> + <% if !params[:name].blank?%> + <%= t("search.unit_get",:unit_name => params[:name],:item_num=>@bulletins.count) %> + <% end %> + <% if @bulletins.blank? and !params[:search_query].blank? %> <%=render :partial => 'shared/search_not_found' %> <% elsif !params[:search_query].blank? %> - <%= t("search.result_get",:search_word => params[:search_query],:item_num=>@bulletins.count) %> + <%= t("search.result_get",:search_word => params[:search_query],:item_num=>@bulletins.count) unless (@bulletins.count == 30) %> + <%= t("search.too_many",:search_word => params[:search_query],:exceed_num=>@bulletins.count) if (@bulletins.count ==30) %> <% end %> + <% @bulletins.each do |post| %> > - + <%= content_tag(:th) do%> + + <% end if(!params[:search_query].blank? or params[:category_id].blank?) %> - + <% end %> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb index af1ca12c3..a26f92006 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb @@ -4,7 +4,7 @@
<%= dislpay_view_count(@bulletin) %> <%= display_date_time(@bulletin.postdate) %> - <%= User.find(@bulletin.create_user_id).cache_dept[I18n.locale.to_s] rescue nil %> + <%= link_to @bulletin.cache_dept[I18n.locale.to_s],panel_announcement_front_end_index_bulletins_by_unit_path(:name=>@bulletin.cache_dept[I18n.locale.to_s]) rescue nil %>
@@ -36,6 +36,5 @@
<% end %> -
- <%= render "shared/addthis_toolbox"%> -
+ +<%= share_links(@bulletin, 'announcement') %> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.html.erb index 50ae0674d..9b600a67e 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.html.erb @@ -5,7 +5,7 @@
-

<%= t("announcement.bulletins") %>

+

<%= link_to t("announcement.bulletins"), panel_announcement_front_end_bulletins_path, :class => 'more' %>

diff --git a/vendor/built_in_modules/announcement/config/routes.rb b/vendor/built_in_modules/announcement/config/routes.rb index ce6c5ec34..0640a1f05 100644 --- a/vendor/built_in_modules/announcement/config/routes.rb +++ b/vendor/built_in_modules/announcement/config/routes.rb @@ -34,6 +34,7 @@ Rails.application.routes.draw do resources :tags end namespace :front_end do + match "index_by_unit" => "bulletins#index_bulletins_by_unit",:as => :index_bulletins_by_unit resources :bulletins # do # match "preview" => "bulletins#preview_content",:as => :get_preview_content # end diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_approvals_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_approvals_controller.rb index 0c946ca30..2cd1b684d 100644 --- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_approvals_controller.rb +++ b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_approvals_controller.rb @@ -10,11 +10,8 @@ class Panel::News::BackEnd::NewsApprovalsController < OrbitBackendController def approve notice = "" @news_bulletin = NewsBulletin.find params[:news_bulletin_id] - - @news_bulletin.is_checked = params[:news_bulletin][:is_checked] - @news_bulletin.not_checked_reason = params[:news_bulletin][:not_checked_reason] + @news_bulletin.proc_check(params[:news_bulletin][:is_checked],params[:news_bulletin][:not_checked_reason]) @news_bulletin.de_pending - if @news_bulletin.save notice = t('news_bulletin.approve_bulletin_success') else diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb index 8ada0a012..fa08cac17 100644 --- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb +++ b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb @@ -148,6 +148,10 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController @news_bulletin.create_user_id = current_user.id @news_bulletin.update_user_id = current_user.id + if(is_manager? || is_admin?) + @news_bulletin.de_pending + end + respond_to do |format| if @news_bulletin.save expire_page(:controller=>'panel/news/widget/news_bulletins' , :action=>'home_banner') @@ -267,6 +271,11 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController respond_to do |format| if @news_bulletin.update_attributes(params[:news_bulletin]) + if(is_manager? || is_admin?) + @news_bulletin.is_checked = true + @news_bulletin.is_rejected = false + @news_bulletin.de_pending! + end expire_page(:controller=>'panel/news/widget/news_bulletins' , :action=>'home_banner') # format.html { redirect_to(panel_news_back_end_news_bulletin_url(@news_bulletin), :notice => t('news_bulletin.update_news_bulletin_success')) } format.html { redirect_to(panel_news_back_end_news_bulletins_url, :notice => t('news_bulletin.update_success')) } diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb index 87826f021..e2cdf2892 100644 --- a/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb +++ b/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb @@ -8,13 +8,24 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController # GET /news_bulletins # GET /news_bulletins.xml + def index_news_bulletins_by_unit + @page = Page.find(params[:page_id]) + @news_bulletins=NewsBulletin.all.available_for_lang(I18n.locale).can_display.where("unit_list_for_anc_id"=>params[:name]).page( params[:page_main]).per(15).page( params[:page_main]).per(10) + render :index + end + def index @page = Page.find(params[:page_id]) if !params[:search_query].blank? - search_cond = {:is_checked=>true,:is_hidden=>false,:is_pending=>false,:is_pending=>false} - search_cond.merge!({:news_bulletin_category_id => "#{params[:category_id]}" }) if !params[:category_id].blank? - search = Redis::Search.query("NewsBulletin", params[:search_query], :conditions =>search_cond,:limit=>NewsBulletin.all.count) - search_result = search.collect{|t| t["id"]} + # search_cond = {:is_checked=>true,:is_hidden=>false,:is_pending=>false,:is_pending=>false} + # search_cond.merge!({:news_bulletin_category_id => "#{params[:category_id]}" }) if !params[:category_id].blank? + + @search = NewsBulletin.solr_search do + fulltext params[:search_query] + with(:frontend_search,true) + #order_by(:average_rating) + end + search_result = @search.results.collect{|result| result.id} @news_bulletins = NewsBulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(10) else date_now = Time.now @@ -42,10 +53,14 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController preview_content else '' - @news_bulletin = NewsBulletin.all.available_for_lang(I18n.locale).can_display.where(_id: params[:id]).first - unless @news_bulletin.disable? - impressionist(@news_bulletin) - get_categorys + @news_bulletin = NewsBulletin.all.can_display.where(_id: params[:id]).first + if !@news_bulletin.disable? + if @news_bulletin.enabled_for_lang(I18n.locale.to_s) + impressionist(@news_bulletin) + get_categorys + else + render :text => "
#{t('sys.can_not_display_due_to_no_context')}
".html_safe + end else render :nothing => true, :status => 403 end diff --git a/vendor/built_in_modules/news/app/models/news_bulletin.rb b/vendor/built_in_modules/news/app/models/news_bulletin.rb index 3fdabd56d..4cb139be3 100644 --- a/vendor/built_in_modules/news/app/models/news_bulletin.rb +++ b/vendor/built_in_modules/news/app/models/news_bulletin.rb @@ -4,7 +4,7 @@ class NewsBulletin include Mongoid::Document include Mongoid::Timestamps include Mongoid::MultiParameterAttributes - include Redis::Search + include Sunspot::Mongo include Impressionist::Impressionable BelongsToCategory = :news_bulletin_category @@ -61,7 +61,7 @@ class NewsBulletin validates :title, :at_least_one => true - before_save :update_status,:update_avliable_language + before_save :update_avliable_language after_save :save_news_bulletin_links after_save :save_news_bulletin_files @@ -91,31 +91,47 @@ class NewsBulletin "news_bulletin" end - redis_search_index(:title_field => :s_title, - :alias_field => :s_title_en, - :score_field => :view_count, - :condition_fields => [:is_checked,:is_hidden,:news_bulletin_category_id,:is_pending], - :ext_fields =>[]) + searchable do + text :titles do + title_translations.to_a.collect{|t| t[1]} + end + text :texts do + text_translations.to_a.collect{|t| Nokogiri::HTML(t[1]).text} + end + integer :view_count + + boolean :frontend_search do + ( !is_hidden && !is_pending && is_checked && !is_rejected ) + end + + + string :news_bulletin_category_id + end + # redis_search_index(:title_field => :s_title, + # :alias_field => :s_title_en, + # :score_field => :view_count, + # :condition_fields => [:is_checked,:is_hidden,:news_bulletin_category_id,:is_pending], + # :ext_fields =>[]) # def gen_title_for_search # # [s_title,s_title_en,s_text_en,s_text_zh_tw].join(' ') # end - def s_title - self.title_translations["zh_tw"] - end + # def s_title + # self. + # end - def s_title_was - self.title_was["zh_tw"] - end + # def s_title_was + # self.title_was["zh_tw"] + # end - def s_title_en - self.title_translations["en"] - end + # def s_title_en + # self.title_translations["en"] + # end - def s_title_en_was - self.title_was["en"] - end + # def s_title_en_was + # self.title_was["en"] + # end # def s_text_en # Nokogiri::HTML(self.text.en).text @@ -140,10 +156,28 @@ class NewsBulletin end + def proc_check(check,not_pass_info = "") + self.is_checked = true + if check =="true" + self.is_rejected = false + elsif check == "false" + self.is_rejected = true + self.not_checked_reason = not_pass_info + end + end + + eval("self.available_for_#{lang}") + end + def de_pending self.is_pending = false end + def de_pending! + de_pending + self.save! + end + def is_expired? Date.today > self.deadline ? true : false rescue false #some dates might sat as nil so rescue false @@ -213,19 +247,4 @@ class NewsBulletin end end - def update_status - if !self.is_pending - if !self.is_checked - # self.is_pending = false - self.is_rejected = true - #self.is_checked = false - elsif self.is_checked - # self.is_pending = false - self.is_rejected = false - #self.is_checked = true - end - end - return true - end - end \ No newline at end of file diff --git a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb index 23708c132..3324928c7 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb @@ -4,12 +4,15 @@

<%= @page.title %>

+<% if !params[:name].blank?%> + <%= t("search.unit_get",:unit_name => UnitListForAnc.find(params[:name]).title,:item_num=>@news_bulletins.count) %> +<% end %> + <% if @news_bulletins.blank? and !params[:search_query].blank? %> <%=render :partial => 'shared/search_not_found' %> <% elsif !params[:search_query].blank? %> <%= t("search.result_get",:search_word => params[:search_query],:item_num=>@news_bulletins.count) %> <% end %> -
<%= t('announcement.bulletin.category') %><%= t('announcement.bulletin.title') %> <%= t('announcement.bulletin.postdate') %>
<%= (post.bulletin_category.title rescue nil ) if !params[:search_query].blank? %><%= (post.bulletin_category.title rescue nil ) %><%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %> <%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %> <%= display_date_time(post.postdate) %><%= display_date_time(post.postdate) %>
@@ -19,12 +22,12 @@ <% @news_bulletins.each do |post| %> - + - + <% end %> diff --git a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb index edd8a9e1a..7366127af 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb @@ -6,7 +6,7 @@ <%= display_date(@news_bulletin.postdate) %> <% unit = @news_bulletin.unit_list_for_anc.title rescue nil %> <%= " | " if unit %> - <%= unit %> + <%= link_to unit, panel_news_front_end_index_news_bulletins_by_unit_path(:name=>@news_bulletin.unit_list_for_anc_id)%>
@@ -39,6 +39,4 @@ <% end %>
-
- <%= render "shared/addthis_toolbox"%> -
+<%= share_links(@news_bulletin, 'news') %> diff --git a/vendor/built_in_modules/news/config/routes.rb b/vendor/built_in_modules/news/config/routes.rb index e78f28748..701136e5a 100644 --- a/vendor/built_in_modules/news/config/routes.rb +++ b/vendor/built_in_modules/news/config/routes.rb @@ -34,6 +34,7 @@ Rails.application.routes.draw do resources :tags end namespace :front_end do + match "index_by_unit" => "news_bulletins#index_news_bulletins_by_unit",:as => :index_news_bulletins_by_unit resources :news_bulletins # do # match "preview" => "news_bulletins#preview_content",:as => :get_preview_content # end
<%= image_tag post.image rescue nil %><%= image_tag post.image rescue nil %> <%= link_to post.title, panel_news_front_end_news_bulletin_path(post), :class => 'news_title' %> <%= post.subtitle.html_safe rescue '' %> <%= display_date(post.postdate) %><%= display_date(post.postdate) %>