summaryrefslogtreecommitdiff
path: root/views/models_navigation.haml
diff options
context:
space:
mode:
Diffstat (limited to 'views/models_navigation.haml')
-rw-r--r--views/models_navigation.haml31
1 files changed, 18 insertions, 13 deletions
diff --git a/views/models_navigation.haml b/views/models_navigation.haml
index d324fce..4b3ba2d 100644
--- a/views/models_navigation.haml
+++ b/views/models_navigation.haml
@@ -3,15 +3,14 @@
%form{:name => "nav", :action => url_for('/models'), :method => "get", :id => "nav"}
%input{:type => :hidden, :name => :sort_by, :id => "sort_by", :value => params[:sort_by]}
%input{:type => :hidden, :name => :order, :id => "order", :value => params[:order]}
- %input{:type => :hidden, :name => :subjectid, :value => session[:subjectid]}
%input{:type => :hidden, :name => :page, :id => "page", :value => params[:page]}
Models are sorted by:
- - ["id","created_at","name","type"].each do |s|
- - idname = s == "created_at" ? "date" : s
+ - ["id","created_at","name","type"].each do |s|
+ - idname = s == "created_at" ? "date" : s
- if params[:sort_by] == s
%div{:id => idname, :class => "active"}
- %span="#{idname}"
+ %span="#{idname.capitalize}"
- if params[:order] == "ASC"
#up{:class => "link"}
%img{:src => "arrow_down.png", :alt => 'in ascending order', :title => 'in ascending order'}/
@@ -19,20 +18,26 @@
#down{:class => "link"}
%img{:src => "arrow_up.png", :alt => 'in descending order', :title => 'in descending order'}/
- else
- %div{:id => idname, :class => "link"}="#{idname}"
+ %div{:id => idname, :class => "link"}="#{idname.capitalize} "
|
- models:
-
- #prev= "prev" unless @page.to_i == 0
+ Models:
+ - unless @page.to_i == 0
+ #prev
+ %img{:src => "arrow_left.png", :alt => 'previous', :title => 'previous'}/
+ -else
+ %img{:src => "arrow_left_inactive.png", :alt => '', :title => ''}/
- if @models.size < 5*@page+5
- - last = @models.size
- - else
+ - last = @models.size
+ - else
- last = 5*@page+5
- = "(#{5*@page+1}-#{last}/#{@models.size})"
-
- #next= "next" unless 5*@page.to_i+5 >= @models.size
+ = "(#{5*@page+1}-#{last}/#{@models.size})"
+ - unless 5*@page.to_i+5 >= @models.size
+ #next
+ %img{:src => "arrow_right.png", :alt => 'next', :title => 'next'}/
+ -else
+ %img{:src => "arrow_right_inactive.png", :alt => '', :title => ''}/
- js = ""
- ["id","created_at","name","type"].each do |s|