diff --git a/Gemfile b/Gemfile index aa6a2ba9..07a50937 100644 --- a/Gemfile +++ b/Gemfile @@ -21,7 +21,7 @@ gem 'kaminari', :git => 'git://github.com/amatsuda/kaminari.git' gem 'mini_magick' gem 'mongoid', '> 2.1', '< 3.0.0' gem 'mongoid-tree', :require => 'mongoid/tree' -gem "mongo_session_store-rails3" +gem "mongo_session_store-rails3", '3.0.6' gem 'nokogiri' @@ -72,10 +72,10 @@ end group :test, :development do - gem 'pry' - gem 'pry-remote' - gem 'pry-stack_explorer' - gem 'pry-debugger' + #gem 'pry' + #gem 'pry-remote' + #gem 'pry-stack_explorer' + #gem 'pry-debugger' gem 'faker' gem "sunspot-rails-tester" diff --git a/app/assets/javascripts/desktop.js b/app/assets/javascripts/desktop.js index a0fad151..e5e4a05a 100644 --- a/app/assets/javascripts/desktop.js +++ b/app/assets/javascripts/desktop.js @@ -14,6 +14,5 @@ //= require orbitdesktopAPI //= require orbitTimeline //= require orbitdesktop -//= require desktop/journal_pages +//= require desktop/books_pages //= require desktop/seminar_pages -//= require desktop/books_pages \ No newline at end of file diff --git a/app/assets/javascripts/desktop/books_pages.js.erb b/app/assets/javascripts/desktop/books_pages.js similarity index 100% rename from app/assets/javascripts/desktop/books_pages.js.erb rename to app/assets/javascripts/desktop/books_pages.js diff --git a/app/assets/javascripts/desktop/seminar_pages.js.erb b/app/assets/javascripts/desktop/seminar_pages.js similarity index 100% rename from app/assets/javascripts/desktop/seminar_pages.js.erb rename to app/assets/javascripts/desktop/seminar_pages.js diff --git a/app/assets/javascripts/mobile/orbit.mobile.js.erb b/app/assets/javascripts/mobile/orbit.mobile.js.erb index d8c647e2..2a567730 100644 --- a/app/assets/javascripts/mobile/orbit.mobile.js.erb +++ b/app/assets/javascripts/mobile/orbit.mobile.js.erb @@ -37,7 +37,7 @@ $('#index').live('pageinit',function(){ // $('.newlist').swipePlanes(); // }, 1000); }); -$('#news_content').live('pageinit',function(){ +$('#announcement_content').live('pageinit',function(){ $(this).find(".newpic img").muImageResize({width: 320, height: 220}); }); var mobileDemo = { 'center': '24.987449, 121.576117', 'zoom': 17 }; @@ -113,8 +113,8 @@ $(window).bind("orientationchange", function(){ $(".slideImg").muImageResize({width: $globalW, height: Math.floor($globalW/720*240)}); $('.slideshow').cycle({ - fx:'scrollLeft', - timeout: 6000, + fx: $effect, + timeout: $timeout }); $(".newlist").css({ diff --git a/app/assets/stylesheets/icons.css.erb b/app/assets/stylesheets/icons.css.erb index 6335a8b9..167bb37a 100644 --- a/app/assets/stylesheets/icons.css.erb +++ b/app/assets/stylesheets/icons.css.erb @@ -1,9 +1,12 @@ -[data-icon]:before { +[data-icons]:before { font-family: 'entypo'; - content: attr(data-icon); + content: attr(data-icons); speak: none; font-weight: normal; -webkit-font-smoothing: antialiased; + font-size: 1.5em; + line-height: .6em; + color: white; } @font-face { font-family: 'entypo'; @@ -56,15 +59,20 @@ a [class*=" icon"] { vertical-align: -10%; font-size: 1.3333333333333333em; } -.btn [class^="icon"], + .nav [class^="icon"], -.btn [class*=" icon"], .nav [class*=" icon"] { display: inline; /* keeps button heights with and without icons the same */ - line-height: 1.4em; - font-size: 1.5em; + line-height: 1.5em; +} +.btn [class^="icon"], +.btn [class*=" icon"] { + display: inline; + /* keeps button heights with and without icons the same */ + + line-height: .9em; } .btn [class^="icon"].icon-spin, .nav [class^="icon"].icon-spin, diff --git a/app/assets/stylesheets/mobile/font-awesome.css b/app/assets/stylesheets/mobile/font-awesome.css new file mode 100644 index 00000000..9d59b156 --- /dev/null +++ b/app/assets/stylesheets/mobile/font-awesome.css @@ -0,0 +1,303 @@ +/* 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('../fonts/fontawesome-webfont.eot'); + src: url('../fonts/fontawesome-webfont.eot?#iefix') format('eot'), url('../fonts/fontawesome-webfont.woff') format('woff'), url('../fonts/fontawesome-webfont.ttf') format('truetype'), url('../font/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; + text-decoration: inherit; +} +a [class^="icon-"], a [class*=" icon-"] { + display: inline-block; + text-decoration: inherit; +} +/* 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"; } diff --git a/app/assets/stylesheets/mobile/icons.css.erb b/app/assets/stylesheets/mobile/icons.css.erb new file mode 100644 index 00000000..6f85bd3c --- /dev/null +++ b/app/assets/stylesheets/mobile/icons.css.erb @@ -0,0 +1,519 @@ +/* WARNING: Your are using ligatures for your icon font. + Ligatures are not supported in IE 9 (and older). + Use the Private Use Area encoding for best browser support. +==================================================================== */ +@font-face { + font-family: 'entypo'; + src:url(<%= asset_path 'entypo.eot' %>); + src:url(<%= asset_path 'entypo.eot?#iefix' %>) format('embedded-opentype'), + url(<%= asset_path 'entypo.svg#entypo' %>) format('svg'), + url(<%= asset_path 'entypo.woff' %>) format('woff'), + url(<%= asset_path 'entypo.ttf' %>) format('truetype'); + font-weight: normal; + font-style: normal; +} + +/* Use the following CSS code if you want to use data attributes for inserting your icons */ +[data-icons]:before { + font-family: 'entypo'; + content: attr(data-icon); + speak: none; + /* Enable Ligatures */ + -webkit-font-feature-settings:"liga","dlig"; + -moz-font-feature-settings:"liga=1, dlig=1"; + -moz-font-feature-settings:"liga","dlig"; + -ms-font-feature-settings:"liga","dlig"; + -o-font-feature-settings:"liga","dlig"; + font-feature-settings:"liga","dlig"; + text-rendering:optimizeLegibility; + font-weight: normal; + -webkit-font-smoothing: antialiased; +} + +/* Use the following CSS code if you want to have a class per icon */ +[class^="icons-"]:before, [class*=" icons-"]:before { + font-size: 1.5em; + font-family: 'entypo'; + font-style: normal; + speak: none; + /* Enable Ligatures */ + -webkit-font-feature-settings:"liga","dlig"; + -moz-font-feature-settings:"liga=1, dlig=1"; + -moz-font-feature-settings:"liga","dlig"; + -ms-font-feature-settings:"liga","dlig"; + -o-font-feature-settings:"liga","dlig"; + font-feature-settings:"liga","dlig"; + text-rendering:optimizeLegibility; + font-weight: normal; + -webkit-font-smoothing: antialiased; + display: inline-block; + text-decoration: inherit; +} +a [class^="icons-"], a [class*=" icons-"] { + display: inline-block; + text-decoration: inherit; +} +/* makes the font 33% larger relative to the icon container */ +.icons-large:before { + vertical-align: top; + font-size: 1.3333333333333333em; +} +.btn [class^="icons-"], .btn [class*=" icons-"] { + /* keeps button heights with and without icons the same */ + + line-height: .9em; +} +li [class^="icons-"], li [class*=" icons-"] { + display: inline-block; + width: 1.25em; + text-align: center; + margin-right: 10px; +} +li .icons-large[class^="icons-"], li .icons-large[class*=" icons-"] { + /* 1.5 increased font size for icons-large * 1.25 width */ + + width: 1.875em; +} +li[class^="icons-"], li[class*=" icons-"] { + margin-left: 0; + list-style-type: none; +} +li[class^="icons-"]:before, li[class*=" icons-"]:before { + text-indent: -2em; + text-align: center; +} +li[class^="icons-"].icons-large:before, li[class*=" icons-"].icons-large:before { + text-indent: -1.3333333333333333em; +} +.icons-phone:before { + content: "\70\68\6f\6e\65"; +} +.icons-directions:before { + content: "\64\69\72\65\63\74\69\6f\6e\73"; +} +.icons-mail:before { + content: "\6d\61\69\6c"; +} +.icons-pencil:before { + content: "\70\65\6e\63\69\6c"; +} +.icons-paperclip:before { + content: "\70\61\70\65\72\63\6c\69\70"; +} +.icons-drawer:before { + content: "\64\72\61\77\65\72"; +} +.icons-member:before { + content: "\6d\65\6d\62\65\72"; +} +.icons-group:before { + content: "\67\72\6f\75\70"; +} +.icons-addmember:before { + content: "\61\64\64\6d\65\6d\62\65\72"; +} +.icons-location:before { + content: "\6c\6f\63\61\74\69\6f\6e"; +} +.icons-share:before { + content: "\73\68\61\72\65"; +} +.icons-heart-full:before { + content: "\68\65\61\72\74\2d\66\75\6c\6c"; +} +.icons-heart-bare:before { + content: "\68\65\61\72\74\2d\62\61\72\65"; +} +.icons-star-full:before { + content: "\73\74\61\72\2d\66\75\6c\6c"; +} +.icons-star-bare:before { + content: "\73\74\61\72\2d\62\61\72\65"; +} +.icons-discuss:before { + content: "\64\69\73\63\75\73\73"; +} +.icons-comment:before { + content: "\63\6f\6d\6d\65\6e\74"; +} +.icons-quote:before { + content: "\71\75\6f\74\65"; +} +.icons-house:before { + content: "\68\6f\75\73\65"; +} +.icons-search:before { + content: "\73\65\61\72\63\68"; +} +.icons-printer:before { + content: "\70\72\69\6e\74\65\72"; +} +.icons-bell:before { + content: "\62\65\6c\6c"; +} +.icons-link:before { + content: "\6c\69\6e\6b"; +} +.icons-flag:before { + content: "\66\61\6c\67"; +} +.icons-cog:before { + content: "\63\6f\67"; +} +.icons-tools:before { + content: "\74\6f\6f\6c\73"; +} +.icons-tag:before { + content: "\74\61\67"; +} +.icons-camera:before { + content: "\63\61\6d\65\72\61"; +} +.icons-megaphone:before { + content: "\6d\65\67\61\70\68\6f\6e\65"; +} +.icons-new:before { + content: "\6e\65\77"; +} +.icons-graduation:before { + content: "\67\72\61\64\75\61\74\69\6f\6e"; +} +.icons-books:before { + content: "\62\6f\6f\6b\73"; +} +.icons-page:before { + content: "\70\61\67\65"; +} +.icons-lifebuoy:before { + content: "\6c\69\66\65\62\75\6f\79"; +} +.icons-eye:before { + content: "\65\79\65"; +} +.icons-clock:before { + content: "\63\6c\6f\63\6b"; +} +.icons-calendar:before { + content: "\63\61\6c\65\6e\64\61\72"; +} +.icons-briefcase:before { + content: "\62\72\69\65\66\63\61\73\65"; +} +.icons-gauge:before { + content: "\67\61\75\67\65"; +} +.icons-language:before { + content: "\6c\61\6e\67\75\61\67\65"; +} +.icons-keys:before { + content: "\6b\65\79\73"; +} +.icons-earth:before { + content: "\65\61\72\74\68"; +} +.icons-keyboard:before { + content: "\6b\65\79\62\6f\61\72\64"; +} +.icons-browser:before { + content: "\62\72\6f\77\73\65\72"; +} +.icons-publish:before { + content: "\70\75\62\6c\69\73\68"; +} +.icons-code:before { + content: "\63\6f\64\65"; +} +.icons-light-bulb:before { + content: "\6c\69\67\68\74\2d\62\75\6c\62"; +} +.icons-database:before { + content: "\64\61\74\61\62\61\73\65"; +} +.icons-box:before { + content: "\62\6f\78"; +} +.icons-rss:before { + content: "\72\73\73"; +} +.icons-clipboard:before { + content: "\63\6c\69\70\62\6f\61\72\64"; +} +.icons-cart:before { + content: "\63\61\72\74"; +} +.icons-untitled:before { + content: "\75\6e\74\69\74\6c\65\64"; +} +.icons-statistics:before { + content: "\73\74\61\74\69\73\74\69\63\73"; +} +.icons-pie:before { + content: "\70\69\65"; +} +.icons-bars:before { + content: "\62\61\72\73"; +} +.icons-graph:before { + content: "\67\72\61\70\68"; +} +.icons-lock:before { + content: "\6c\6f\63\6b"; +} +.icons-unlock:before { + content: "\75\6e\6c\6f\63\6b"; +} +.icons-outlog:before { + content: "\6f\75\74\6c\6f\67"; +} +.icons-inlog:before { + content: "\69\6e\6c\6f\67"; +} +.icons-checkmark:before { + content: "\63\68\65\63\6b\6d\61\72\6b"; +} +.icons-aminus:before { + content: "\61\6d\69\6e\75\73"; +} +.icons-aplus:before { + content: "\61\70\6c\75\73"; +} +.icons-aclose:before { + content: "\61\63\6c\6f\73\65"; +} +.icons-bminus:before { + content: "\62\6d\69\6e\75\73"; +} +.icons-bplus:before { + content: "\62\70\6c\75\73"; +} +.icons-bclose:before { + content: "\62\63\6c\6f\73\65"; +} +.icons-cminus:before { + content: "\63\6d\69\6e\75\73"; +} +.icons-cplus:before { + content: "\63\70\6c\75\73"; +} +.icons-cross:before { + content: "\63\72\6f\73\73"; +} +.icons-blocked:before { + content: "\62\6c\6f\63\6b\65\64"; +} +.icons-information:before { + content: "\69\6e\66\6f\72\6d\61\74\69\6f\6e"; +} +.icons-binfo:before { + content: "\62\69\6e\66\6f"; +} +.icons-question:before { + content: "\71\75\65\73\74\69\6f\6e"; +} +.icons-help:before { + content: "\68\65\6c\70"; +} +.icons-warning:before { + content: "\77\61\72\6e\69\6e\67"; +} +.icons-shuffle:before { + content: "\73\68\75\66\66\6c\65"; +} +.icons-return:before { + content: "\72\65\74\75\72\6e"; +} +.icons-enter:before { + content: "\65\6e\74\65\72"; +} +.icons-exchange:before { + content: "\65\78\63\68\61\6e\67\65"; +} +.icons-loop:before { + content: "\6c\6f\6f\70"; +} +.icons-th-list:before { + content: "\74\68\2d\6c\69\73\74"; +} +.icons-th-large:before { + content: "\74\68\2d\6c\61\72\67\65"; +} +.icons-align-justify:before { + content: "\61\6c\69\67\6e\2d\6a\75\73\74\69\66\79"; +} +.icons-wtext:before { + content: "\77\74\65\78\74"; +} +.icons-btext:before { + content: "\62\74\65\78\74"; +} +.icons-pictures:before { + content: "\70\69\63\74\75\72\65"; +} +.icons-video:before { + content: "\76\69\64\65\6f"; +} +.icons-music:before { + content: "\6d\6f\75\73\65"; +} +.icons-folder:before { + content: "\66\6f\6c\64\65\72"; +} +.icons-archive:before { + content: "\61\72\63\68\69\76\65"; +} +.icons-trash:before { + content: "\74\72\61\73\68"; +} +.icons-upload:before { + content: "\75\70\6c\6f\61\64"; +} +.icons-download:before { + content: "\64\6f\77\6e\6c\6f\61\64"; +} +.icons-disk:before { + content: "\64\69\73\6b"; +} +.icons-bookmark:before { + content: "\62\6f\6f\6b\6d\61\72\6b"; +} +.icons-booma:before { + content: "\62\6f\6f\6d\61"; +} +.icons-resize-enlarge:before { + content: "\72\65\73\69\7a\65\2d\65\6e\6c\61\72\67\65"; +} +.icons-resize-shrink:before { + content: "\72\65\73\69\7a\65\2d\73\68\72\69\6e\6b"; +} +.icons-flow-tree:before { + content: "\66\6c\6f\77\2d\74\72\65\65"; +} +.icons-arrow-left-a:before { + content: "\61\72\72\6f\77\2d\6c\65\66\74\2d\61"; +} +.icons-arrow-bottom-a:before { + content: "\61\72\72\6f\77\2d\62\6f\74\74\6f\6d\2d\61"; +} +.icons-arrow-top-a:before { + content: "\61\72\72\6f\77\2d\74\6f\70\2d\61"; +} +.icons-arrow-right-a:before { + content: "\61\72\72\6f\77\2d\72\69\67\68\74\2d\61"; +} +.icons-arrow-left-b:before { + content: "\61\72\72\6f\77\2d\6c\65\66\74\2d\62"; +} +.icons-arrow-bottom-b:before { + content: "\61\72\72\6f\77\2d\62\6f\74\74\6f\6d\2d\62"; +} +.icons-arrow-top-b:before { + content: "\61\72\72\6f\77\2d\74\6f\70\2d\62"; +} +.icons-arrow-right-b:before { + content: "\61\72\72\6f\77\2d\72\69\67\68\74\2d\62"; +} +.icons-arrow-left-c:before { + content: "\61\72\72\6f\77\2d\6c\65\66\74\2d\63"; +} +.icons-arrow-bottom-c:before { + content: "\61\72\72\6f\77\2d\62\6f\74\74\6f\6d\2d\63"; +} +.icons-arrow-top-c:before { + content: "\61\72\72\6f\77\2d\74\6f\70\2d\63"; +} +.icons-arrow-right-c:before { + content: "\61\72\72\6f\77\2d\72\69\67\68\74\2d\63"; +} +.icons-arrow-left-d:before { + content: "\61\72\72\6f\77\2d\6c\65\66\74\2d\64"; +} +.icons-arrow-bottom-d:before { + content: "\61\72\72\6f\77\2d\62\6f\74\74\6f\6d\2d\64"; +} +.icons-arrow-top-d:before { + content: "\61\72\72\6f\77\2d\74\6f\70\2d\64"; +} +.icons-arrow-right-d:before { + content: "\61\72\72\6f\77\2d\72\69\67\68\74\2d\64"; +} +.icons-arrow-left-e:before { + content: "\61\72\72\6f\77\2d\6c\65\66\74\2d\65"; +} +.icons-arrow-bottom-e:before { + content: "\61\72\72\6f\77\2d\62\6f\74\74\6f\6d\2d\65"; +} +.icons-arrow-top-e:before { + content: "\61\72\72\6f\77\2d\74\6f\70\2d\65"; +} +.icons-arrow-right-e:before { + content: "\61\72\72\6f\77\2d\72\69\67\68\74\2d\65"; +} +.icons-arrow-left-f:before { + content: "\61\72\72\6f\77\2d\6c\65\66\74\2d\66"; +} +.icons-arrow-bottom-f:before { + content: "\61\72\72\6f\77\2d\62\6f\74\74\6f\6d\2d\66"; +} +.icons-arrow-top-f:before { + content: "\61\72\72\6f\77\2d\74\6f\70\2d\66"; +} +.icons-left-f:before { + content: "\61\72\72\6f\77\2d\72\69\67\68\74\2d\66"; +} +.icons-menu:before { + content: "\6d\65\6e\75"; +} +.icons-ellipsis:before { + content: "\65\6c\6c\69\70\73\69\73"; +} +.icons-dots:before { + content: "\64\6f\74\73"; +} +.icons-dot:before { + content: "\64\6f\74"; +} +.icons-like:before { + content: "\6c\69\6b\65"; +} +.icons-suck:before { + content: "\73\75\63\6b"; +} +.icons-export:before { + content: "\65\78\70\6f\72\74"; +} +.icons-vcard:before { + content: "\76\63\61\72\64"; +} +.icons-flow-cascade:before { + content: "\21"; +} +.icons-landscape:before { + content: "\22"; +} +.icons-brush:before { + content: "\62\72\75\73\68"; +} +.icons-palette:before { + content: "\70\61\6c\65\74\74\65"; +} +.icons-desktop:before { + content: "\64\65\73\6b\74\6f\70"; +} +.icons-plane:before { + content: "\70\6c\61\6e\65"; +} +.icons-booklet:before { + content: "\62\6f\6f\6b\6c\65\74"; +} +.icons-update:before { + content: "\75\70\64\61\74\65"; +} +.icons-reload:before { + content: "\72\65\6c\6f\61\64"; +} +.icons-unload:before { + content: "\75\6e\6c\6f\61\64"; +} +.icons-trophy:before { + content: "\74\72\6f\70\68\79"; +} \ No newline at end of file diff --git a/app/assets/stylesheets/mobile/orbit-mobile.css.erb b/app/assets/stylesheets/mobile/orbit-mobile.css.erb index 302a6013..72a3c887 100644 --- a/app/assets/stylesheets/mobile/orbit-mobile.css.erb +++ b/app/assets/stylesheets/mobile/orbit-mobile.css.erb @@ -128,8 +128,8 @@ div[data-role="page"] { left: 0; } .header .language .ui-btn-text i { - font-size: 1.1em; - margin-top: .3em; + font-size: .83em; + margin-top: .2em; } .header .language .ui-icon { background-image: none; @@ -194,28 +194,25 @@ div[data-role="page"] { padding: 0 0 20px; margin-bottom: 0; } -#news_content .content .newpic { +#announcement_content .content .newpic { width: 320px; height: 220px; margin: 0 auto; } -#news_content .content .newstitle { +#announcement_content .content .newstitle { font-size: 1.4em; padding: 0 10px; margin: 1em 0; } -#news_content .content .newsDate { +#announcement_content .content .newsDate { padding: 0 10px; font-size: 1em; color: #8D8D8D; } -#news_content .content .newsummary { +#announcement_content .content .newsummary { padding: 0 10px 20px; margin-bottom: 0; } -#announcement_content .content { - padding: 10px; -} #map div[data-role="content"] { padding: 0; } diff --git a/app/assets/stylesheets/new_admin.css.erb b/app/assets/stylesheets/new_admin.css.erb index 494c760d..2cb340da 100644 --- a/app/assets/stylesheets/new_admin.css.erb +++ b/app/assets/stylesheets/new_admin.css.erb @@ -11,7 +11,7 @@ *= require orbit-bar *= require bootstrap-orbit *= require list - *= require widgets + *= require widget *= require scroll_style *= require isotope *= require icons diff --git a/app/assets/stylesheets/widget.css b/app/assets/stylesheets/widget.css index 6181b32f..6942221b 100644 --- a/app/assets/stylesheets/widget.css +++ b/app/assets/stylesheets/widget.css @@ -3,7 +3,6 @@ } .widget-box { background-color: #FFF; - overflow: hidden; min-width: 300px; margin: 0 0 5px 5px; position:relative; diff --git a/app/assets/stylesheets/widgets.css b/app/assets/stylesheets/widgets.css deleted file mode 100644 index f4f72e9c..00000000 --- a/app/assets/stylesheets/widgets.css +++ /dev/null @@ -1,160 +0,0 @@ -.widget-size-300 { - width:298px; -} -.widget-box { - background-color: #FFF; - overflow: hidden; - min-width: 300px; - margin: 0 0 5px 5px; - position:relative; -} -.widget-box .widget-title { - margin: 0; - font-size: 1.5em; - line-height: 1.5em; - color: #FFF; - padding-left: 5px; - border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-radius: 5px 5px 0 0; - background-image: -moz-linear-gradient(top, #B7B7B7, #9d9d9d); - background-image: -ms-linear-gradient(top, #B7B7B7, #9d9d9d); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#B7B7B7), to(#9d9d9d)); - background-image: -webkit-linear-gradient(top, #B7B7B7, #9d9d9d); - background-image: -o-linear-gradient(top, #B7B7B7, #9d9d9d); - background-image: linear-gradient(top, #B7B7B7, #9d9d9d); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#B7B7B7', endColorstr='#9d9d9d', GradientType=0); -} -.widget-box .widget-title [class^="icon"] { - margin: 3px 5px 0 2px; -} -.widget-box .widget-content { - padding: 10px; - border-width: 0 1px 1px; - border-style: solid; - border-color: #CCCCCC; - border-radius: 0 0 5px 5px; - -moz-border-radius: 0 0 5px 5px; - -webkit-border-radius: 0 0 5px 5px; -} -.widget-box .form-horizontal .control-group > label { - width: 50px; -} -.widget-box .form-horizontal .controls { - margin-left: 60px; -} -.widget-action { - position:absolute; - right:1px; - top:6px; -} -.action { - float: left; - display:inline-block; - margin-right: 5px; - opacity: 0.8; - filter: alpha(opacity=80); - color: #FFF; -} -.action:hover { - opacity: 1; - filter: alpha(opacity=80); - cursor: pointer; - color: #FFF; - text-decoration: none; -} -.select-role { - display:none; - padding: 10px 0; -} -.file-upload { - position:relative; - overflow: hidden; -} -.file-upload .file-name { - white-space: nowrap; - overflow: hidden; - border-style: solid; - border-width: 1px 1px 1px 0; - border-color: #CCC; - display: inline-block; - float: left; - padding: 4px 10px; - height: 18px; - line-height: 18px; - -webkit-border-radius: 0 3px 3px 0; - -moz-border-radius: 0 3px 3px 0; - border-radius: 0 3px 3px 0; - text-align: left; - margin: 0; - width: 193px; -} -.file-upload .upload { - margin:0; - padding:0; - position:absolute; - top: 0; - left:0; - opacity:.0; - font-size: 60px; - left: -595px/9; - filter: alpha(opacity= 0); - outline: none; -} -.file-upload .upload:focus { - position:absolute; -} -.file-upload .input-medium { - border-radius: 3px 3px 3px 3px !important; - width: 267px; - position: relative; - z-index: 5; - display: block; - clear: both; -} -.file-upload .control-label { - margin-top: 0; - margin-bottom: 5px; -} -.upload-picture { - margin-bottom: 5px; - text-align: center; - width: 276px; - overflow: hidden; - height: 90px; -} -.upload-picture img { - left: 0; - margin-top: -15%; - width: 100%; -} -.widget-box .widgetInfo { - display: inline-block; - text-align: center; - width: 255px; - margin : 0px 0 5px; - padding: 5px 10px; -} -#widget-link table { - margin-bottom:0 -} -/*Date*/ -.showDate { - border-style: solid; - border-width: 1px 0 1px 1px; - border-color: #CCC; - display: inline-block; - float: left; - padding: 4px 10px; - height: 18px; - line-height: 18px; - -webkit-border-radius: 3px 0 0 3px; - -moz-border-radius: 3px 0 0 3px; - border-radius: 3px 0 0 3px; - text-align: center; -} -.calendarInput { - position: absolute; - visibility: hidden; - left: 11px; -} \ No newline at end of file diff --git a/app/controllers/admin/infos_controller.rb b/app/controllers/admin/infos_controller.rb index e79fba7b..d6325ef0 100644 --- a/app/controllers/admin/infos_controller.rb +++ b/app/controllers/admin/infos_controller.rb @@ -40,9 +40,10 @@ class Admin::InfosController < ApplicationController @attribute.update_attributes(params[:info]) @attribute.attribute_fields.each{|t| t.destroy if t["to_delete"] == true} respond_to do |format| - format.html { redirect_to :action => :index } + format.html { redirect_to(edit_admin_info_path(params[:id])) } format.js { render 'admin/attributes/toggle_enable' } end + end def destroy diff --git a/app/controllers/admin/module_apps_controller.rb b/app/controllers/admin/module_apps_controller.rb index af529086..9729a97a 100644 --- a/app/controllers/admin/module_apps_controller.rb +++ b/app/controllers/admin/module_apps_controller.rb @@ -3,7 +3,7 @@ class Admin::ModuleAppsController < ApplicationController before_filter :user_has_sub_manager_privilege?, :only => [ :assign_sub_manager, :remove_sub_manager ] layout "new_admin" - + helper Admin::PagePartsHelper def index @module_apps = ModuleApp.all.entries end diff --git a/app/controllers/admin/roles_controller.rb b/app/controllers/admin/roles_controller.rb index 3e8576c6..ade4aa43 100644 --- a/app/controllers/admin/roles_controller.rb +++ b/app/controllers/admin/roles_controller.rb @@ -3,7 +3,7 @@ class Admin::RolesController < ApplicationController layout "new_admin" before_filter :authenticate_user! before_filter :is_admin? - before_filter :set_attribute, :only => [:index, :show, :new, :edit] + before_filter :set_attribute, :only => [:index, :show, :new, :edit, :role_field, :sub_role, :add_sub_role, :edit_sub_role, :sub_role_field] helper Admin::AttributeValuesViewHelper def index @@ -13,11 +13,98 @@ class Admin::RolesController < ApplicationController def show + end + + def role_field + + @field_name = 'role' + + @attribute = Role.find(params[:role_id]) + + end + + def sub_role + + @attribute = Role.find(params[:role_id]) + @attribute_fields_upper_object = @attribute.sub_roles + + + end + + def add_sub_role + + @attribute = Role.find(params[:role_id]) + # @sub_attribute = Role.find(params[:role_id]) + + @sub_attribute = SubRole.new + @sub_attribute.role_id = params[:role_id] + + end + + def edit_sub_role + + @sub_attribute = SubRole.find(params[:role_id]) + + @attribute = Role.find(@sub_attribute.role_id) + + @sub_attribute.role_id = @sub_attribute.role_id + + end + + def sub_role_field + + @field_name = 'sub_role' + + @sub_attribute = SubRole.find(params[:role_id]) + + @attribute = Role.find(@sub_attribute.role_id) + + end + + def add_attribute_field + + if params[:sub_role] + + @field_name = 'sub_role' + + attribute = SubRole.find(params[:sub_role][:id]) rescue nil + @attribute_field_counter = attribute.attribute_fields.count + @attribute_field = attribute.attribute_fields.build + @attribute_field.save + + @attribute_field[:af_count] = @attribute_field_counter + + @attribute = SubRole.find(params[:sub_role][:id]) + + else + + @field_name = 'role' + + attribute = Role.find(params[:role_id]) rescue nil + @attribute_field_counter = attribute.attribute_fields.count + @attribute_field = attribute.attribute_fields.build + @attribute_field.save + + @attribute_field[:af_count] = @attribute_field_counter + + @attribute = Role.find(params[:role_id]) + + end + + respond_to do |format| + format.js { render 'add_attribute_field' } + end + + end def new @attribute = Role.new - render :template => 'admin/attributes/new' + + if !params[:parent_id] + render :template => 'admin/attributes/new' + end + end def edit @@ -27,24 +114,75 @@ class Admin::RolesController < ApplicationController end def create - @attribute = Role.new(params[:role]) - @attribute.save - redirect_to :action => :index + + if params[:sub_role] + + @sub_role = SubRole.new(params[:sub_role]) + + # @sub_role.role_id = params[:id] + + respond_to do |format| + if @sub_role.save + format.html { redirect_to(admin_role_sub_role_url(params[:sub_role][:role_id])) } + end + end + + else + + @attribute = Role.new(params[:role]) + @attribute.save + redirect_to :action => :index + + end + end def update - @attribute = Role.find(params[:id]) - @attribute.update_attributes(params[:role]) - respond_to do |format| - format.html { redirect_to :action => :index } - format.js { render 'admin/attributes/toggle_enable' } + + if params[:sub_role] + + @sub_role = SubRole.find(params[:sub_role][:id]) + @sub_role.update_attributes(params[:sub_role]) + @sub_role.attribute_fields.each{|t| t.destroy if t["to_delete"] == true} + respond_to do |format| + format.html { redirect_to(admin_role_sub_role_url(@sub_role.role_id)) } + format.js { render 'toggle_enable' } + end + + else + + @attribute = Role.find(params[:id]) + @attribute.update_attributes(params[:role]) + @attribute.attribute_fields.each{|t| t.destroy if t["to_delete"] == true} + respond_to do |format| + format.html { redirect_to :action => :index } + format.js { render 'admin/attributes/toggle_enable' } + end + end + end def destroy - @attribute = Role.find(params[:id]) - @attribute.destroy - redirect_to :action => :index + + if params[:sub_role] + + @sub_role = SubRole.find(params[:sub_role][:id]) + + respond_to do |format| + if @sub_role.destroy + format.html { redirect_to(admin_role_sub_role_url(@sub_role.role_id)) } + end + end + + else + + @attribute = Role.find(params[:id]) + @attribute.destroy + redirect_to :action => :index + + end + end protected diff --git a/app/controllers/admin/sub_roles_controller.rb b/app/controllers/admin/sub_roles_controller.rb new file mode 100644 index 00000000..e39f783d --- /dev/null +++ b/app/controllers/admin/sub_roles_controller.rb @@ -0,0 +1,4 @@ +class Admin::SubRolesController < RolesController + + +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bbd6063e..b0fc4adb 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -11,7 +11,7 @@ class ApplicationController < ActionController::Base rescue_from PageError, :with => :render_page_error layout :layout_by_resource - + helper :admin, :orbit_form before_filter :set_locale, :set_site, :prepare_for_mobile diff --git a/app/controllers/desktop/journal_lists_controller.rb b/app/controllers/desktop/journal_lists_controller.rb deleted file mode 100644 index 2667a5a7..00000000 --- a/app/controllers/desktop/journal_lists_controller.rb +++ /dev/null @@ -1,18 +0,0 @@ -class Desktop::JournalListsController < ApplicationController - def index - level_types = JournalLevelType.all - all_journal_lists = WritingJournal.where(create_user_id: current_user.id) - all_journal_lists = all_journal_lists.map do |j| - [ j.journal_title, - j.journal_level_type_ids.map do |type| - level_types.find(type).title - end] - end - - @journal_lists = all_journal_lists.uniq - - respond_to do |format| - format.html { render :layout => false} - end - end -end diff --git a/app/controllers/desktop_controller.rb b/app/controllers/desktop_controller.rb index 4eef26be..bb3e12dc 100644 --- a/app/controllers/desktop_controller.rb +++ b/app/controllers/desktop_controller.rb @@ -117,8 +117,8 @@ class DesktopController< ApplicationController widge = DesktopWidget.find(tile.desktop_widget_id.to_s) # data_content = widge.widget_layout.file data_content = "/desktop/widget_layout?id="+tile.desktop_widget_id.to_s - jsfile = widge.javascripts.collect{|js| js.file} - cssfile = widge.css_default.file + jsfile = widge.javascripts.collect{|js| js.file.as_json[:file]} + cssfile = widge.css_default.file.as_json[:file] shape = widge.shape title = widge.name else @@ -212,4 +212,4 @@ class DesktopController< ApplicationController render :xml=>feed end -end \ No newline at end of file +end diff --git a/app/controllers/desktop_publications_controller.rb b/app/controllers/desktop_publications_controller.rb index 6c38de37..ae77ed19 100644 --- a/app/controllers/desktop_publications_controller.rb +++ b/app/controllers/desktop_publications_controller.rb @@ -1,9 +1,9 @@ require 'mime/types' class DesktopPublicationsController< ApplicationController - def journal_p - render "desktop/journal_p", :layout => false - end + #def journal_p + # render "desktop/journal_p", :layout => false + #end def books render "desktop/books", :layout => false diff --git a/app/controllers/mobile_controller.rb b/app/controllers/mobile_controller.rb index 5b05214e..d07e9a87 100644 --- a/app/controllers/mobile_controller.rb +++ b/app/controllers/mobile_controller.rb @@ -2,6 +2,8 @@ class MobileController < ApplicationController layout 'mobile' + before_filter :no_footer_for_app + def index date_now = Time.now @bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page(params[:page_main]).per(15) @@ -49,4 +51,10 @@ class MobileController < ApplicationController @page_title = @page_context.page.title end + protected + + def no_footer_for_app + @no_footer = true if request.path.starts_with?("/app") + end + end diff --git a/app/helpers/attribute_fields_helper.rb b/app/helpers/attribute_fields_helper.rb index 2705dc8f..be1b39ee 100644 --- a/app/helpers/attribute_fields_helper.rb +++ b/app/helpers/attribute_fields_helper.rb @@ -149,7 +149,7 @@ protected link_entry_ary = [".#{get_pairing_tab_class({})}",".#{key}"] link_entry_ary << ".add_more_item_#{add_more_counter}" if can_add_more link_entry = link_entry_ary.join - content_tag(:li,link_to(I18n.t("langs."+key),link_entry,:data=>{:toggle=>"tab"}),:class=>(key == I18n.locale.to_s ? "active" : nil),:for=>key) + content_tag(:li,link_to(I18nVariable.from_locale(key),link_entry,:data=>{:toggle=>"tab"}),:class=>(key == I18n.locale.to_s ? "active" : nil),:for=>key) end.join.html_safe # of VALID_LOCALES.collect for tabs end # of content ul end diff --git a/app/helpers/desktop/co_author_relations_helper.rb b/app/helpers/desktop/co_author_relations_helper.rb deleted file mode 100644 index fa03bbae..00000000 --- a/app/helpers/desktop/co_author_relations_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module Desktop::CoAuthorRelationsHelper -end diff --git a/app/helpers/desktop/journal_lists_helper.rb b/app/helpers/desktop/journal_lists_helper.rb deleted file mode 100644 index e21dc09f..00000000 --- a/app/helpers/desktop/journal_lists_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module Desktop::JournalListsHelper -end diff --git a/app/helpers/front_helper.rb b/app/helpers/front_helper.rb index b44f28f2..6a276d96 100644 --- a/app/helpers/front_helper.rb +++ b/app/helpers/front_helper.rb @@ -2,8 +2,8 @@ module FrontHelper def ad_image_link(ad_image) link = ad_image.out_link - link =front_show_inner_ad_image_path(:id=> ad_image.id) if link.blank? && !ad_image.context.blank? - + link = front_show_inner_ad_image_path(:id=> ad_image.id) if link.blank? && !ad_image.context.blank? + link end end \ No newline at end of file diff --git a/app/models/ad_image.rb b/app/models/ad_image.rb index c3260c5e..aad34852 100644 --- a/app/models/ad_image.rb +++ b/app/models/ad_image.rb @@ -5,7 +5,10 @@ class AdImage mount_uploader :file, ImageUploader field :title, localize: true - field :context, localize: true + field :context, localize: true + field :to_save, :type => Boolean + field :to_destroy, :type => Boolean + field :direct_to_after_click,type: Boolean diff --git a/app/models/user/attribute.rb b/app/models/user/attribute.rb index c0970863..a1367c9f 100644 --- a/app/models/user/attribute.rb +++ b/app/models/user/attribute.rb @@ -6,7 +6,9 @@ class Attribute field :key field :built_in, :type => Boolean, :default => false field :disabled, :type => Boolean, :default => false - field :title, localize: true + field :title, localize: true + + field :to_search, :type => Boolean, :default => false has_many :attribute_fields, :autosave => true, :dependent => :destroy accepts_nested_attributes_for :attribute_fields, :allow_destroy => true diff --git a/app/models/user/attribute_field.rb b/app/models/user/attribute_field.rb index d486ccd0..0a6c4ac3 100644 --- a/app/models/user/attribute_field.rb +++ b/app/models/user/attribute_field.rb @@ -11,6 +11,9 @@ class AttributeField field :built_in, :type => Boolean, :default => false field :disabled, :type => Boolean, :default => false field :to_delete,:type=> Boolean,:default => false + + field :to_search,:type=> Boolean,:default => false + field :typeA,:type=> Hash,:default=>{:cross_lang=>false} field :typeB,:type=> Hash,:default=>{} field :typeC,:type=> Hash,:default=>{:calendar=>"west_calendar",:format=>"format3"} diff --git a/app/models/user/role.rb b/app/models/user/role.rb index cd3d6775..7291c88c 100644 --- a/app/models/user/role.rb +++ b/app/models/user/role.rb @@ -1,4 +1,4 @@ -class Role +class Role < Attribute include Mongoid::Document include Mongoid::Timestamps @@ -6,12 +6,13 @@ class Role field :key field :built_in, :type => Boolean, :default => false field :disabled, :type => Boolean, :default => false + field :title, localize: true has_many :sub_roles, :autosave => true, :dependent => :destroy has_many :users has_many :statuses, :autosave => true, :dependent => :destroy - has_many :attribute_fields, :autosave => true, :dependent => :destroy + # has_many :attribute_fields, :autosave => true, :dependent => :destroy accepts_nested_attributes_for :sub_roles, :allow_destroy => true def is_built_in? diff --git a/app/models/user/user.rb b/app/models/user/user.rb index ac32423f..26c8a042 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -72,14 +72,32 @@ class User sub_roles.where(role_id: role.id) end - def disable_sub_role=(var) + def disable_role=(var) var[:id].each do |id,val| # binding.pry if id == '5052c5b22b5c49ab02000004' if (val=="true") + self.roles = self.roles.reject{|t| t.id.to_s==id} + elsif(val=="false") + self.roles << Role.find(id) + end + end + end + + def disable_sub_role=(var) + var[:id].each do |id,val| + + @sr = SubRole.find(id) + + @roid = Role.find(@sr.role_id.to_s) + + # binding.pry if id == '5052c5b22b5c49ab02000004' + + if ( self.roles.include?(@roid) == false or val=="true") self.sub_roles = self.sub_roles.reject{|t| t.id.to_s==id} elsif(val=="false") self.sub_roles << SubRole.find(id) end + end end @@ -189,7 +207,8 @@ class User protected def save_roles - self.roles = self.sub_roles.collect{|t| t.role}.uniq + # self.roles = self.sub_roles.collect{|t| t.role}.uniq + self.roles = self.roles.uniq end diff --git a/app/views/admin/ad_images/_form.html.erb b/app/views/admin/ad_images/_form.html.erb index a925b40b..884c08c0 100644 --- a/app/views/admin/ad_images/_form.html.erb +++ b/app/views/admin/ad_images/_form.html.erb @@ -10,8 +10,8 @@
-
- +
+

<%= t(:date_) %>

@@ -21,8 +21,8 @@
-
- +
+

<%= t(:picture) %>

@@ -49,8 +49,8 @@
-
- +
+

<%= t(:type) %>

@@ -59,8 +59,8 @@
-
- +
+

<%= t(:frequency) %>

@@ -69,8 +69,8 @@