From e967ffe75370d39d0928e440a9023e2da6e35ae3 Mon Sep 17 00:00:00 2001 From: mr Date: Wed, 21 Sep 2011 11:16:28 +0200 Subject: remove id from sort tab --- application.rb | 2 +- views/models_navigation.haml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application.rb b/application.rb index 12784f0..2b320e0 100644 --- a/application.rb +++ b/application.rb @@ -102,7 +102,7 @@ get '/models/?' do @models = ToxCreateModel.all.sort(:order => "#{order}") end else - params["sort_by"] = "id" + params["sort_by"] = "created_at" end @models = ToxCreateModel.all.sort(:order => "DESC") unless @models diff --git a/views/models_navigation.haml b/views/models_navigation.haml index ed8b720..b491cb5 100644 --- a/views/models_navigation.haml +++ b/views/models_navigation.haml @@ -5,8 +5,8 @@ %input{:type => :hidden, :name => :order, :id => "order", :value => params[:order]} %input{:type => :hidden, :name => :page, :id => "page", :value => params[:page]} - Models are sorted by: - - ["id","created_at","name","type"].each do |s| + Sort by: + - ["created_at","name","type"].each do |s| - idname = s == "created_at" ? "date" : s - if params[:sort_by] == s %div{:id => idname, :class => "active"} -- cgit v1.2.3 From 778c58cad1c6a5b81655d731992c64a0efcec592 Mon Sep 17 00:00:00 2001 From: mr Date: Fri, 23 Sep 2011 13:04:49 +0200 Subject: require opentox gem ~>3 --- application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application.rb b/application.rb index 2b320e0..6d9ea76 100644 --- a/application.rb +++ b/application.rb @@ -1,7 +1,7 @@ ['rubygems', "haml", "sass", "rack-flash"].each do |lib| require lib end -gem "opentox-ruby", "~> 2" +gem "opentox-ruby", "~> 3" require 'opentox-ruby' gem 'sinatra-static-assets' require 'sinatra/static_assets' -- cgit v1.2.3 From d1a61ff236cf95a7f3cba4a60e85c14e877c730d Mon Sep 17 00:00:00 2001 From: mr Date: Fri, 23 Sep 2011 15:58:03 +0200 Subject: remove unused js --- views/models_navigation.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/models_navigation.haml b/views/models_navigation.haml index b491cb5..0dc1f63 100644 --- a/views/models_navigation.haml +++ b/views/models_navigation.haml @@ -42,7 +42,7 @@ %img{:src => "arrow_right_inactive.png", :alt => '', :title => ''}/ - js = "" - - ["id","created_at","name","type"].each do |s| + - ["created_at","name","type"].each do |s| - idname = s == "created_at" ? "date" : s - js += "$('##{idname}').click(function() \{ \n " - js += " $('#sort_by').val('#{s}');\n " -- cgit v1.2.3