Changeset 1217

Show
Ignore:
Timestamp:
08/04/08 16:00:01 (4 months ago)
Author:
kovit
Message:

create filter for application types

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app/controllers/file_controller.rb

    r1158 r1217  
    3939    end 
    4040  end 
     41 
     42  def recent_audio 
     43    @subject = _("Recent Files Audio")      
     44    @files = Upload.paginate(:page => params[:page], :conditions => "content_type LIKE '%audio%'", :order => "created_at DESC", :per_page => $ITEMS_PRE_PAGE) 
     45    @feed = [@subject, file_rss20_url] 
     46 
     47     respond_to do |format| 
     48      format.html { render :template => "file/file_list" } 
     49      format.xml { render :xml => @files.to_xml } 
     50      format.rss { get_rss_recent } 
     51      format.all { redirect_to :action => "recent" } 
     52    end 
     53  end 
     54 
     55  def recent_only_images 
     56    @subject = _("Recent Files images") 
     57    @files = Upload.paginate(:page => params[:page], :conditions => "content_type LIKE '%image%'", :order => "created_at DESC", :per_page => $ITEMS_PRE_PAGE) 
     58    @feed = [@subject, file_rss20_url] 
     59 
     60     respond_to do |format| 
     61      format.html { render :template => "file/file_list" } 
     62      format.xml { render :xml => @files.to_xml } 
     63      format.rss { get_rss_recent } 
     64      format.all { redirect_to :action => "recent" } 
     65    end 
     66  end 
     67 
     68  def recent_application 
     69    @subject = _("Recent Files application") 
     70    @files = Upload.paginate(:page => params[:page], :conditions => "content_type LIKE '%application%'", :order => "created_at DESC", :per_page => $ITEMS_PRE_PAGE) 
     71    @feed = [@subject, file_rss20_url] 
     72 
     73     respond_to do |format| 
     74      format.html { render :template => "file/file_list" } 
     75      format.xml { render :xml => @files.to_xml } 
     76      format.rss { get_rss_recent } 
     77      format.all { redirect_to :action => "recent" } 
     78    end 
     79  end 
     80 
    4181 
    4282  def recently_commented 
     
    110150    end 
    111151  end 
    112    
     152  
    113153  def theme 
    114154    @themes = get_all_themes 
  • trunk/config/routes.rb

    r1194 r1217  
    1313 
    1414  map.tag_field_auto_complete "home/tag-field-auto-complete/:field_id", :controller => "home", :action => "tag_field_auto_complete", :field_id => nil 
    15  
     15   
    1616  # user 
    1717  map.user_login "login/", :controller => "user", :action => "login" 
     
    173173 
    174174  map.file_recent "file/recent", :controller => "file", :action => "recent" 
     175  map.file_recent_audio "file/recent/audio", :controller => "file", :action => "recent_audio" 
     176  map.file_recent_only_images "file/recent/images", :controller => "file", :action => "recent_only_images" 
     177  map.file_recent_application "file/recent/application", :controller => "file", :action => "recent_application" 
    175178  map.file_recent_images "file/recent_images", :controller => "file", :action => "recent_images" 
    176179  map.file_recently_commented "file/recently-commented", :controller => "file", :action => "recently_commented" 
  • trunk/po/th_TH/kv.po

    r1208 r1217  
    11571157msgstr "ไฟล์ล่าสุด" 
    11581158 
     1159#: app/controllers/file_controller.rb:43 
     1160msgid "Recent Files Audio" 
     1161msgstr "ไฟล์เสียงล่าสุด" 
     1162 
     1163#: app/controllers/file_controller.rb:57 
     1164msgid "Recent Files images" 
     1165msgstr "ไฟล์รูปล่าสุด" 
     1166 
     1167#: app/controllers/file_controller.rb:69 
     1168msgid "Recent Files application" 
     1169msgstr "ไฟล์โปรแกรมประยุกต์ล่าสุด" 
     1170 
    11591171#: app/controllers/file_controller.rb:43 app/views/shared/_menu.html.erb:44 
    11601172msgid "Recently Commented Files"