public
Description: Super simple wiki targeted at developers
Clone URL: git://github.com/citrusbyte/quiki.git
minor visual fixes
benalavi (author)
Tue Jul 15 01:30:24 -0700 2008
commit  fe8b341d6c0fa95f9d69deb56429fe9d011ccd91
tree    15058caf4dcb5fccef797dbf7141d7b24d9d998d
parent  d83593472dc084e3f1797989921b3491ff61af35
...
17
18
19
20
21
22
 
23
 
 
24
25
 
 
 
 
26
...
17
18
19
 
 
 
20
21
22
23
24
25
26
27
28
29
30
0
@@ -17,10 +17,14 @@ module ApplicationHelper
0
   # helper to output the time since. if it's more than 1 day old it outputs the
0
   # time according to the given stftime format
0
   def smart_datetime(datetime, format=nil)
0
- if datetime < 1.days.ago
0
- datetime.strftime(format || DATETIME_FORMATS[:pretty_datetime])
0
- else
0
+ if happened_today?(datetime)
0
       time_ago_in_words(datetime) + ' ago'
0
+ else
0
+ datetime.strftime(format || DATETIME_FORMATS[:pretty_datetime])
0
     end
0
   end
0
+
0
+ def happened_today?(datetime)
0
+ datetime > 1.days.ago
0
+ end
0
 end
...
1
2
 
3
4
5
6
7
 
8
9
10
11
...
1
 
2
3
4
5
6
 
7
8
9
10
11
0
@@ -1,10 +1,10 @@
0
 %h1 Recently Updated
0
-%table
0
+%table#recent_pages
0
   %tr
0
     %th Page
0
     %th Updated
0
   - for page in @pages
0
- %tr
0
+ %tr{ :class => happened_today?(page.updated_at) ? 'today' : 'old' }
0
       %td= link_to page, page
0
       %td= smart_datetime page.updated_at
0
     
0
\ No newline at end of file
...
173
174
175
176
 
177
178
179
...
219
220
221
 
 
 
 
 
 
222
...
173
174
175
 
176
177
178
179
...
219
220
221
222
223
224
225
226
227
228
0
@@ -173,7 +173,7 @@ body.pages.edit
0
     input#page_title
0
       :font-weight normal
0
       :font-size 2.0em
0
- :width 662px
0
+ :width 500px
0
     textarea
0
       :margin-top 10px
0
       :height 500px
0
@@ -219,3 +219,9 @@ body.pages.show
0
     :background-color #eee
0
   dd.rule_hack
0
     :margin-top 20px
0
+
0
+// recently updated pages =====================================================
0
+#recent_pages
0
+ tr.today
0
+ td
0
+ :background-color #eee
0
\ No newline at end of file

Comments

    No one has commented yet.