Changeset 274
- Timestamp:
- 04/26/08 02:25:51 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/picolena/templates/app/models/document.rb
r270 r274 12 12 13 13 #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| 15 15 define_method(method_name){File.send(method_name,complete_path)} 16 16 } 17 17 alias_method :filename, :basename 18 alias_method :size, :size? 18 19 19 20 # Returns filename without extension … … 65 66 end 66 67 67 # FIXME: Not just date anymore.68 68 # Returns the last modification date before the document got indexed. 69 69 # 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 71 75 from_index[:modified].sub(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/,'\1-\2-\3 \4:\5:\6') 72 76 end trunk/lib/picolena/templates/app/views/documents/_document.html.haml
r228 r274 8 8 %p 9 9 =link_to_plain_text_content(document) 10 - 11 =number_to_human_size(document.size) 12 - 13 =document.pretty_date 14 - 10 15 =link_to_cached_content(document) 11 16 %hr/ trunk/lib/picolena/templates/app/views/documents/cached.html.haml
r127 r274 3 3 ( 4 4 =:as_it_was_indexed_on.l 5 =@document. date5 =@document.pretty_date 6 6 ) 7 7 %p=link_to_containing_directory(@document)
