From 04877b994551536b28153879328c098bded78145 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 21 Aug 2012 19:36:49 +0800 Subject: [PATCH] design update --- app/assets/javascripts/orbitTimeline.js | 8 +++ app/assets/stylesheets/orbitTimeline.css | 68 +++++++++++++++++++ app/controllers/desktop_orbit_controller.rb | 2 +- .../desktop_publications_controller.rb | 1 + app/models/paper.rb | 3 - app/models/user/user.rb | 1 + config/routes.rb | 1 + 7 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 app/assets/stylesheets/orbitTimeline.css diff --git a/app/assets/javascripts/orbitTimeline.js b/app/assets/javascripts/orbitTimeline.js index a8b5c663..bd2fbb78 100644 --- a/app/assets/javascripts/orbitTimeline.js +++ b/app/assets/javascripts/orbitTimeline.js @@ -232,4 +232,12 @@ var orbitTimeline = function(dom){ } }) } + this.ajaxEventPull = function(){ + if(!t.update){ + t.update = true; + $.getJSON("desktop_orbit/ajaxeventpull",{"from":t.fromdate},function(){ + + }) + } + } } \ No newline at end of file diff --git a/app/assets/stylesheets/orbitTimeline.css b/app/assets/stylesheets/orbitTimeline.css new file mode 100644 index 00000000..2718b69d --- /dev/null +++ b/app/assets/stylesheets/orbitTimeline.css @@ -0,0 +1,68 @@ +.t_scale{ + height:516px; + bottom:0; +} +#timline_marker{ + width:100px; + height:140px; + opacity:0.4; + cursor: move; + border-style:solid; + border-width:5px; + border-radius:5px; +} +.t_scale{ + border-style:solid; + border-width:2px; + border-radius:5px; +} +#t_container{ + height:366px; +} +.scale_region{ + height:516px; + border-style:solid; + border-width:0 2px 0 2px; + float: left; + margin-right:1px; + font-size:20px; + padding:5px; +} +.scale_region span{ + display: block; +} +.month{ + +} +.year{ + background-color: #c0bebe; + width:30px; +} +.bubble{ + cursor: pointer; + width:300px; + height:30px; + border-style:solid; + border-width:5px; + float: left; + border-radius:5px; + margin-top: 10px; + margin-bottom:10px; + font-size:15px; + padding:5px; + text-align:justify; + display: none; +} +.month_heading{ + text-align: center; + margin-bottom: 10px; +} + +.bubble_list ul{ + width:350px; + float:left; +} +.bubble_list ul li span.date{ + font-weight:bolder; + float:right; +} \ No newline at end of file diff --git a/app/controllers/desktop_orbit_controller.rb b/app/controllers/desktop_orbit_controller.rb index 4541868e..d2fa9bbc 100644 --- a/app/controllers/desktop_orbit_controller.rb +++ b/app/controllers/desktop_orbit_controller.rb @@ -43,10 +43,10 @@ class DesktopOrbitController< ApplicationController if(@fromdate[1] == 0) @fromdate[1] = 12 @fromdate[0] = @fromdate[0] - 1 + end end render :json=>@data.to_json end - end \ No newline at end of file diff --git a/app/controllers/desktop_publications_controller.rb b/app/controllers/desktop_publications_controller.rb index 74983fca..14307022 100644 --- a/app/controllers/desktop_publications_controller.rb +++ b/app/controllers/desktop_publications_controller.rb @@ -67,6 +67,7 @@ class DesktopPublicationsController< ApplicationController paper.update_attributes(:user_id => current_user.id) end b = Array.new + b << {"success"=>"true"} render :json=>b.to_json end diff --git a/app/models/paper.rb b/app/models/paper.rb index a92dde1f..a2772574 100644 --- a/app/models/paper.rb +++ b/app/models/paper.rb @@ -9,7 +9,4 @@ class Paper field :coauthors, default: "Allen, Shelly, Eric, Manson, Chris, Clara, Anna, Albee, Vincent, Devin, Chunchi, Ika, Jaoshua, Ray, Matt, Lin, Spen" field :created_at, type: Date belongs_to :journal - - - end \ No newline at end of file diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 3df40a3b..34e496d8 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -26,6 +26,7 @@ class User has_many :journals, :autosave => true, :dependent => :destroy has_many :papers, :autosave => true, :dependent => :destroy + belongs_to :role has_and_belongs_to_many :sub_roles accepts_nested_attributes_for :attribute_values, :allow_destroy => true diff --git a/config/routes.rb b/config/routes.rb index 64e2648a..6e35956a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -216,6 +216,7 @@ Orbit::Application.routes.draw do match '/desktop_appstore/widgets_settings'=>'desktop_appstore#widgets_settings' match '/desktop_orbit/orbit' => 'desktop_orbit#orbit' + match '/desktop_orbit/eventajaxload'=> 'desktop_orbit#eventajaxload' match '/desktop_orbit/gettimelinespan' => 'desktop_orbit#gettimelinespan'