Changeset 23

Show
Ignore:
Timestamp:
02/10/07 12:33:37 (2 years ago)
Author:
simon
Message:

Show some photos on the front page #11.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Memories.pm

    r22 r23  
    113113} 
    114114 
    115 sub _recent_uploads { Memories::Photo->search_recent() } 
    116 sub _random { Memories::Photo->search_random() } 
    117  
    118 sub recent_uploads { shift->do_cached(\&_recent_uploads) } 
    119 sub random { shift->do_cached(\&_random) } 
     115for my $how (qw(random recent interesting popular)) { 
     116    no strict; 
     117    my $method = "search_$how"; 
     118    *{"_$how"} = sub { Memories::Photo->$method }; 
     119    *{$how} = sub { shift->do_cached(\&{"_$how"})}; 
     120
     121 
    120122sub tagcloud { shift->do_cached(\&_tagcloud) } 
    121123 
  • trunk/templates/frontpage

    r2 r23  
    11[% INCLUDE header %] 
    2 <h1> Welcome to Memories </h1> 
    3  
     2[% PROCESS macros %] 
     3<table class="frontpagetable" width="100%"> 
     4[% FOR how = ["popular", "interesting", "random"] %] 
     5<tr><th colspan="4">[%how | ucfirst%] photos</th></tr> 
     6<tr> 
     7[% FOR pic = request.$how %] 
     8    <td align="center"> [% minithumb(pic) %] <br> [%pic.title%] </td> 
     9[% END %] 
     10</tr> 
     11[% END %] 
     12</table> 
     13    
    414<p> 
    515 Memories is a site where you can upload and share your photos. 
  • trunk/templates/static/memories.css

    r17 r23  
    9292.smaller { font-size: 80%  } 
    9393 
     94.frontpagetable { padding: 10px;  } 
     95.frontpagetable th { border: 1px solid black; } 
    9496span.tagcloud0 { font-size: 9px;} 
    9597span.tagcloud1 { font-size: 10px;}