diff --git a/tracks/app/views/layouts/standard.rhtml b/tracks/app/views/layouts/standard.rhtml index 1b45f717..a06a0283 100644 --- a/tracks/app/views/layouts/standard.rhtml +++ b/tracks/app/views/layouts/standard.rhtml @@ -13,10 +13,17 @@ <%= javascript_include_tag 'calendar', 'calendar-en', 'calendar-setup' %> <%= javascript_include_tag "accesskey-hints" %> <%= javascript_include_tag "todo-items" %> + <%= javascript_include_tag "niftycube" %> <%= auto_discovery_link_tag(:rss,{:controller => "feed", :action => "na_feed", :name => "#{@user.login}", :token => "#{@user.word}"}, {:title => "RSS feed of next actions"}) %> + + <%= @page_title %> diff --git a/tracks/db/schema.rb b/tracks/db/schema.rb index eff04e23..5f0d0b46 100644 --- a/tracks/db/schema.rb +++ b/tracks/db/schema.rb @@ -2,26 +2,13 @@ # migrations feature of ActiveRecord to incrementally modify your database, and # then regenerate this schema definition. -ActiveRecord::Schema.define(:version => 0) do - - create_table "bow_wows", :force => true do |t| - t.column "name", :string - t.column "created_at", :datetime, :null => false - t.column "updated_at", :datetime, :null => false - end - - create_table "cats", :force => true do |t| - t.column "name", :string - t.column "cat_type", :string - t.column "created_at", :datetime, :null => false - t.column "updated_at", :datetime, :null => false - end +ActiveRecord::Schema.define(:version => 32) do create_table "contexts", :force => true do |t| - t.column "name", :string, :default => "", :null => false - t.column "hide", :integer, :limit => 4, :default => 0, :null => false - t.column "position", :integer, :default => 0, :null => false - t.column "user_id", :integer, :default => 0, :null => false + t.column "name", :string, :default => "", :null => false + t.column "position", :integer, :null => false + t.column "hide", :boolean, :default => false + t.column "user_id", :integer, :default => 1 t.column "created_at", :datetime t.column "updated_at", :datetime end @@ -29,48 +16,9 @@ ActiveRecord::Schema.define(:version => 0) do add_index "contexts", ["user_id"], :name => "index_contexts_on_user_id" add_index "contexts", ["user_id", "name"], :name => "index_contexts_on_user_id_and_name" - create_table "eaters_foodstuffs", :force => true do |t| - t.column "foodstuff_id", :integer - t.column "eater_id", :integer - t.column "some_attribute", :integer, :default => 0 - t.column "eater_type", :string - t.column "created_at", :datetime, :null => false - t.column "updated_at", :datetime, :null => false - end - - create_table "fish", :force => true do |t| - t.column "name", :string - t.column "speed", :integer - t.column "created_at", :datetime, :null => false - t.column "updated_at", :datetime, :null => false - end - - create_table "frogs", :force => true do |t| - t.column "name", :string - t.column "created_at", :datetime, :null => false - t.column "updated_at", :datetime, :null => false - end - - create_table "keep_your_enemies_close", :force => true do |t| - t.column "enemy_id", :integer - t.column "enemy_type", :string - t.column "protector_id", :integer - t.column "protector_type", :string - t.column "created_at", :datetime, :null => false - t.column "updated_at", :datetime, :null => false - end - - create_table "little_whale_pupils", :force => true do |t| - t.column "whale_id", :integer - t.column "aquatic_pupil_id", :integer - t.column "aquatic_pupil_type", :string - t.column "created_at", :datetime, :null => false - t.column "updated_at", :datetime, :null => false - end - create_table "notes", :force => true do |t| - t.column "user_id", :integer, :default => 0, :null => false - t.column "project_id", :integer, :default => 0, :null => false + t.column "user_id", :integer, :null => false + t.column "project_id", :integer, :null => false t.column "body", :text t.column "created_at", :datetime t.column "updated_at", :datetime @@ -95,15 +43,8 @@ ActiveRecord::Schema.define(:version => 0) do t.column "value", :binary end - create_table "petfoods", :id => false, :force => true do |t| - t.column "the_petfood_primary_key", :integer, :null => false - t.column "name", :string - t.column "created_at", :datetime, :null => false - t.column "updated_at", :datetime, :null => false - end - create_table "preferences", :force => true do |t| - t.column "user_id", :integer, :default => 0, :null => false + t.column "user_id", :integer, :null => false t.column "date_format", :string, :limit => 40, :default => "%d/%m/%Y", :null => false t.column "week_starts", :integer, :default => 0, :null => false t.column "show_number_completed", :integer, :default => 5, :null => false @@ -125,8 +66,8 @@ ActiveRecord::Schema.define(:version => 0) do create_table "projects", :force => true do |t| t.column "name", :string, :default => "", :null => false - t.column "position", :integer, :default => 0, :null => false - t.column "user_id", :integer, :default => 0, :null => false + t.column "position", :integer, :null => false + t.column "user_id", :integer, :default => 1 t.column "description", :text t.column "state", :string, :limit => 20, :default => "active", :null => false t.column "created_at", :datetime @@ -143,7 +84,7 @@ ActiveRecord::Schema.define(:version => 0) do t.column "updated_at", :datetime end - add_index "sessions", ["session_id"], :name => "sessions_session_id_index" + add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id" create_table "taggings", :force => true do |t| t.column "taggable_id", :integer @@ -163,16 +104,16 @@ ActiveRecord::Schema.define(:version => 0) do add_index "tags", ["name"], :name => "index_tags_on_name" create_table "todos", :force => true do |t| - t.column "context_id", :integer, :default => 0, :null => false - t.column "description", :string, :limit => 100, :default => "", :null => false + t.column "context_id", :integer, :null => false + t.column "project_id", :integer + t.column "description", :string, :default => "", :null => false t.column "notes", :text t.column "created_at", :datetime t.column "due", :date t.column "completed_at", :datetime - t.column "project_id", :integer - t.column "user_id", :integer, :default => 0, :null => false + t.column "user_id", :integer, :default => 1 t.column "show_from", :date - t.column "state", :string, :limit => 20, :default => "immediate", :null => false + t.column "state", :string, :limit => 20, :default => "immediate", :null => false end add_index "todos", ["user_id", "state"], :name => "index_todos_on_user_id_and_state" @@ -182,10 +123,10 @@ ActiveRecord::Schema.define(:version => 0) do add_index "todos", ["user_id", "context_id"], :name => "index_todos_on_user_id_and_context_id" create_table "users", :force => true do |t| - t.column "login", :string, :limit => 80 - t.column "password", :string, :limit => 40 + t.column "login", :string, :limit => 80, :default => "", :null => false + t.column "password", :string, :limit => 40, :default => "", :null => false t.column "word", :string - t.column "is_admin", :integer, :limit => 4, :default => 0, :null => false + t.column "is_admin", :boolean, :default => false, :null => false t.column "first_name", :string t.column "last_name", :string t.column "auth_type", :string, :default => "database", :null => false @@ -194,16 +135,4 @@ ActiveRecord::Schema.define(:version => 0) do add_index "users", ["login"], :name => "index_users_on_login" - create_table "whales", :force => true do |t| - t.column "name", :string - t.column "created_at", :datetime, :null => false - t.column "updated_at", :datetime, :null => false - end - - create_table "wild_boars", :force => true do |t| - t.column "name", :string - t.column "created_at", :datetime, :null => false - t.column "updated_at", :datetime, :null => false - end - end diff --git a/tracks/public/javascripts/niftycube.js b/tracks/public/javascripts/niftycube.js new file mode 100755 index 00000000..a6c75a55 --- /dev/null +++ b/tracks/public/javascripts/niftycube.js @@ -0,0 +1,298 @@ +/* Nifty Corners Cube - rounded corners with CSS and Javascript +Copyright 2006 Alessandro Fulciniti (a.fulciniti@html.it) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +var niftyOk=(document.getElementById && document.createElement && Array.prototype.push); +var niftyCss=false; + +String.prototype.find=function(what){ +return(this.indexOf(what)>=0 ? true : false); +} + +var oldonload=window.onload; +if(typeof(NiftyLoad)!='function') NiftyLoad=function(){}; +if(typeof(oldonload)=='function') + window.onload=function(){oldonload();AddCss();NiftyLoad()}; +else window.onload=function(){AddCss();NiftyLoad()}; + +function AddCss(){ +niftyCss=true; +var l=CreateEl("link"); +l.setAttribute("type","text/css"); +l.setAttribute("rel","stylesheet"); +l.setAttribute("href","/stylesheets/niftyCorners.css"); +l.setAttribute("media","screen"); +document.getElementsByTagName("head")[0].appendChild(l); +} + +function Nifty(selector,options){ +if(niftyOk==false) return; +if(niftyCss==false) AddCss(); +var i,v=selector.split(","),h=0; +if(options==null) options=""; +if(options.find("fixed-height")) + h=getElementsBySelector(v[0])[0].offsetHeight; +for(i=0;i0;i--) + d.appendChild(CreateStrip(i,side,color,border,btype)); +el.style.paddingBottom=0; +el.appendChild(d); +} + +function CreateStrip(index,side,color,border,btype){ +var x=CreateEl("b"); +x.className=btype+index; +x.style.backgroundColor=color; +x.style.borderColor=border; +if(side=="left"){ + x.style.borderRightWidth="0"; + x.style.marginRight="0"; + } +else if(side=="right"){ + x.style.borderLeftWidth="0"; + x.style.marginLeft="0"; + } +return(x); +} + +function CreateEl(x){ +return(document.createElement(x)); +} + +function FixIE(el){ +if(el.currentStyle!=null && el.currentStyle.hasLayout!=null && el.currentStyle.hasLayout==false) + el.style.display="inline-block"; +} + +function SameHeight(selector,maxh){ +var i,v=selector.split(","),t,j,els=[],gap; +for(i=0;imaxh) maxh=els[i].offsetHeight; + els[i].style.height="auto"; + } +for(i=0;i0){ + t=CreateEl("b");t.className="niftyfill";t.style.height=gap+"px"; + nc=els[i].lastChild; + if(nc.className=="niftycorners") + els[i].insertBefore(t,nc); + else els[i].appendChild(t); + } + } +} + +function getElementsBySelector(selector){ +var i,j,selid="",selclass="",tag=selector,tag2="",v2,k,f,a,s=[],objlist=[],c; +if(selector.find("#")){ //id selector like "tag#id" + if(selector.find(" ")){ //descendant selector like "tag#id tag" + s=selector.split(" "); + var fs=s[0].split("#"); + if(fs.length==1) return(objlist); + f=document.getElementById(fs[1]); + if(f){ + v=f.getElementsByTagName(s[1]); + for(i=0;i