From 9ead6cafda3ee86fb1ba663b10e0b831bfdaa911 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Wed, 9 May 2012 04:15:02 +0800 Subject: [PATCH] Ray's changes --- app/assets/javascripts/event.js | 2 +- app/assets/stylesheets/style.css.erb | 333 +++++++++++++++++- app/models/item.rb | 11 + lib/parsers/parser_common.rb | 16 +- .../{nccu_calendar.rss => nccu_calendar.xml} | 0 .../front_end/bulletins/show.html.erb | 33 +- .../bulletins/bulletins_side_bar.html.erb | 10 +- .../front_end/news_bulletins/index.html.erb | 28 +- .../front_end/news_bulletins/show.html.erb | 32 +- .../news_bulletins_side_bar.html.erb | 10 +- 10 files changed, 403 insertions(+), 72 deletions(-) rename public/static/{nccu_calendar.rss => nccu_calendar.xml} (100%) diff --git a/app/assets/javascripts/event.js b/app/assets/javascripts/event.js index afe558d8..7db3e47c 100644 --- a/app/assets/javascripts/event.js +++ b/app/assets/javascripts/event.js @@ -66,7 +66,7 @@ $(document).ready(function(){ function getEvent(selet){ $.ajax({ type: "GET", - url: "/static/Other.xml", + url: "/static/nccu_calendar.xml", dataType: "xml", timeout: 1000, error: function(xml){ diff --git a/app/assets/stylesheets/style.css.erb b/app/assets/stylesheets/style.css.erb index b4410a47..bc38be86 100644 --- a/app/assets/stylesheets/style.css.erb +++ b/app/assets/stylesheets/style.css.erb @@ -113,6 +113,7 @@ background-image: none; overflow: hidden; width: 28px; + margin-bottom: 0; position: relative; } #orbit-bar .nav > li > a.orbit-bar-home { @@ -579,6 +580,35 @@ .popover-title { display: none; } + +/*show link and file*/ +.linkAndFile { + clear: both; +} +.linkAndFile>div { + margin-top: 20px; +} +.linkAndFile [class^="icons-"] { + float: left; + margin-top: 10px; +} +.linkAndFile .showLink, .linkAndFile .showFile { + background-color: #ededed; + padding: 5px; + border-radius: 5px; + margin-left: 25px; +} +.linkAndFile .showLink a, .linkAndFile .showFile a { + display: inline-block; + margin: 5px 10px; +} +.linkAndFile>div>a:last-child { + margin-right: 5px +} +.news_paragraph p { + line-height: 20px; +} + /*icons*/ .the-icons i:after { content: attr(class); @@ -734,15 +764,99 @@ .icons-unlock { background-position: -192px -32px; } +.icons-thumbtack { + background-position: -224px -32px; +} +.icons-pin { + background-position: -257px -32px; +} +.icons-shield { + background-position: -288px -32px; +} +.icons-key { + background-position: -320px -32px; +} +.icons-fire { + background-position: -352px -32px; +} +.icons-bulls-eye { + background-position: -384px -32px; +} +.icons-flash { + background-position: -416px -32px; +} .icons-time { background-position: -448px -32px; } +.icons-halo { + background-position: -480px -32px; +} +.icons-hourglass { + background-position: -513px -32px; +} +.icons-alarm-clock { + background-position: -545px -32px; +} +.icons-paper { + background-position: -577px -32px; +} .icons-banner { background-position: -608px -32px; } /*3*/ +.icons-phone { + background-position: 0px -64px; +} +.icons-mobile { + background-position: -32px -64px; +} +.icons-mail { + background-position: -64px -64px; +} +.icons-mail-open { + background-position: -96px -64px; +} +.icons-mail-read { + background-position: -128px -64px; +} .icons-content { - background-position: -160px -66px; + background-position: -160px -64px; +} +.icons-content-out { + background-position: -192px -64px; +} +.icons-content-in { + background-position: -224px -64px; +} +.icons-projector { + background-position: -256px -64px; +} +.icons-tape { + background-position: -288px -64px; +} +.icons-chat-a { + background-position: -320px -64px; +} +.icons-chat-b { + background-position: -352px -64px; +} +.icons-chat-c { + background-position: -384px -64px; +} +.icons-comment { + background-position: -416px -64px; +} +.icons-rss { + background-position: -448px -64px; +} +.icons-ship { + background-position: -480px -64px; +} +.icons-send { + background-position: -512px -64px; +} +.icons-bell { + background-position: -544px -64px; } .icons-announcement { background-position: -576px -64px; @@ -803,20 +917,110 @@ .icons-page-copy { background-position: -64px -128px; } -.icons- { - background-position: -0px -128px; +.icons-folder { + background-position: -96px -128px; +} +.icons-folder-open { + background-position: -128px -128px; +} +.icons-folder-lock { + background-position: -160px -128px; +} +.icons-folder-plus { + background-position: -192px -128px; +} +.icons-folder-minus { + background-position: -224px -128px; +} +.icons-page-plus { + background-position: -256px -128px; +} +.icons-page-minus { + background-position: -288px -128px; +} +.icons-page-edit { + background-position: -320px -128px; +} +.icons-page-download { + background-position: -352px -128px; } /*6*/ +.icons-house-w { + background-position: 0px -160px; +} +.icons-house-b { + background-position: -32px -160px; +} +.icons-signs { + background-position: -64px -160px; +} .icons-globe { background-position: -96px -160px; } +.icons-map { + background-position: -128px -160px; +} +.icons-markers { + background-position: -160px -160px; +} +.icons-barrier { + background-position: -192px -160px; +} +.icons-assist { + background-position: -224px -160px; +} +.icons-cones { + background-position: -256px -160px; +} +.icons-group { + background-position: -288px -160px; +} +.icons-cuble { + background-position: -320px -160px; +} .icons-structure { background-position: -352px -160px; } +.icons-layer { + background-position: -384px -160px; +} /*7*/ +.icons-shopcar-a { + background-position: 0px -192px; +} +.icons-shopcar-b { + background-position: -34px -192px; +} .icons-purchase { background-position: -64px -192px; } +.icons-shopcart { + background-position: -96px -192px; +} +.icons-van { + background-position: -128px -192px; +} +.icons-form { + background-position: -160px -192px; +} +.icons-gift { + background-position: -192px -192px; +} +.icons-credit-card { + background-position: -224px -192px; +} +.icons-cash { + background-position: -256px -192px; +} +.icons-assets { + background-position: -288px -192px; +} +.icons-computer { + background-position: -320px -192px; +} +.icons-library { + background-position: -352px -192px; +} /*8*/ .icons-dashboard { background-position: 0 -224px; @@ -846,21 +1050,90 @@ background-position: -256px -224px; } /*9*/ +.icons-book-cover { + background-position: 0px -256px; +} +.icons-book-make { + background-position: -32px -256px; +} +.icons-binder { + background-position: -64px -256px; +} +.icons-album { + background-position: -96px -256px; +} +.icons-camera { + background-position: -128px -256px; +} +.icons-video-camera { + background-position: -160px -256px; +} +.icons-pillar { + background-position: -192px -256px; +} +.icons-chart { + background-position: -224px -256px; +} .icons-picture { background-position: -256px -256px; } +.icons-pictures { + background-position: -288px -256px; +} +.icons-brief { + background-position: -320px -256px; +} +.icons-film { + background-position: -352px -256px; +} .icons-asset { background-position: -384px -256px; } -.icons-asset-upload { - background-position: -448px -256px; -} .icons-asset-download { background-position: -416px -256px; } +.icons-asset-upload { + background-position: -448px -256px; +} +.icons-music { + background-position: -480px -256px; +} +.icons-book-open-w { + background-position: -512px -256px; +} +.icons-book-open-b { + background-position: -544px -256px; +} +.icons-clapper-board { + background-position: -576px -256px; +} /*10*/ -.icons- { - background-position: -0px -288px; +.icons-date { + background-position: 0px -288px; +} +.icons-screen { + background-position: -32px -288px; +} +.icons-iphone { + background-position: -64px -288px; +} +.icons-ipad { + background-position: -96px -288px; +} +.icons-ipod { + background-position: -128px -288px; +} +.icons-battery-low { + background-position: -160px -288px; +} +.icons-battery-mid { + background-position: -192px -288px; +} +.icons-battery-full { + background-position: -224px -288px; +} +.icons-battery-charge { + background-position: -256px -288px; } /*11*/ .icons-pie { @@ -888,14 +1161,50 @@ background-position: -224px -320px; } /*12*/ +.icons-heart-w { + background-position: 0px -352px; +} +.icons-heart-b { + background-position: -32px -352px; +} +.icons-like { + background-position: -64px -352px; +} +.icons-hate { + background-position: -96px -352px; +} +.icons-medal { + background-position: -128px -352px; +} +.icons-warning { + background-position: -160px -352px; +} +.icons-check { + background-position: -192px -352px; +} +.icons-check-box-solid { + background-position: -224px -352px; +} +.icons-check-box-dot { + background-position: -256px -352px; +} .icons-check-2 { background-position: -288px -352px; } +.icons-check-circle-solid { + background-position: -320px -352px; +} +.icons-check-circle-dot { + background-position: -352px -352px; +} +.icons-check-circle-b { + background-position: -384px -352px; +} .icons-star-thin { background-position: -416px -352px; } -.icons- { - background-position: -0px -352px; +.icons-star { + background-position: -448px -352px; } /*13*/ .icons- { @@ -940,5 +1249,5 @@ } /*21*/ .icons- { - background-position: -0px -640px -} + background-position: -0px -640px; +} \ No newline at end of file diff --git a/app/models/item.rb b/app/models/item.rb index c8b7812c..cea088fc 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -31,6 +31,17 @@ class Item nodes << node = node.parent while !node.parent.blank? rescue nil nodes.reverse end + + # Get an array of ancestor's id + def ancestor_ids + node, nodes = self, [] + while !node.parent.blank? do + node = node.parent rescue nil + nodes << node.id if node + end + # nodes << node = node.parent while !node.parent.blank? rescue nil + nodes.reverse + end # Build the url from the array of ancestors def url diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index 7e0bcf74..28600980 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -1,7 +1,7 @@ module ParserCommon include ActionView::Helpers::TagHelper - def menu_level(page, current_page_id, current, menu, edit = false) + def menu_level(page, current_page, current, menu, edit = false) res = '' if page.ordered_and_visible_children.size > 0 res << "