Changeset 274

Show
Ignore:
Timestamp:
04/26/08 02:25:51 (7 months ago)
Author:
eric.dumin..@gmail.com
Message:

More info displayed for results.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/picolena/templates/app/models/document.rb

    r270 r274  
    1212 
    1313  #Delegating properties to File::method_name(complete_path) 
    14   [:dirname, :basename, :extname, :ext_as_sym, :file?, :ext_as_sym].each{|method_name| 
     14  [:dirname, :basename, :extname, :ext_as_sym, :file?, :size?, :ext_as_sym].each{|method_name| 
    1515    define_method(method_name){File.send(method_name,complete_path)} 
    1616  } 
    1717  alias_method :filename, :basename 
     18  alias_method :size, :size? 
    1819 
    1920  # Returns filename without extension 
     
    6566  end 
    6667 
    67   # FIXME: Not just date anymore. 
    6868  # Returns the last modification date before the document got indexed. 
    6969  # Useful to know how old a document is, and to which version the cache corresponds. 
    70   def date 
     70  def pretty_date 
     71    from_index[:modified].sub(/(\d{4})(\d{2})(\d{2})\d{6}/,'\1-\2-\3') 
     72  end 
     73   
     74  def pretty_mtime 
    7175    from_index[:modified].sub(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/,'\1-\2-\3 \4:\5:\6') 
    7276  end 
  • trunk/lib/picolena/templates/app/views/documents/_document.html.haml

    r228 r274  
    88  %p 
    99    =link_to_plain_text_content(document) 
     10    - 
     11    =number_to_human_size(document.size) 
     12    - 
     13    =document.pretty_date 
     14    - 
    1015    =link_to_cached_content(document) 
    1116%hr/ 
  • trunk/lib/picolena/templates/app/views/documents/cached.html.haml

    r127 r274  
    33  ( 
    44  =:as_it_was_indexed_on.l 
    5   =@document.date 
     5  =@document.pretty_date 
    66  ) 
    77%p=link_to_containing_directory(@document)