Changeset 111

Show
Ignore:
Timestamp:
04/23/07 20:48:15 (3 years ago)
Author:
eevee
Message:

Fixed: bbcode stylesheet was not being loaded.
Changed: Stylesheet variables are now available to all stylesheets.
Styled forum reply form.

Location:
veekun/trunk
Files:
1 added
11 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/lib/Vee/BBCode.pm

    r38 r111  
    3333#  - replace won't work with no_close 
    3434our %tags = ( 
    35     b       => { param => 0, start => '<strong class="bbcode_b">', end => '</strong>' }, 
    36     i       => { param => 0, start => '<em class="bbcode_i">', end => '</em>' }, 
    37     u       => { param => 0, start => '<span class="bbcode_u">', end => '</span>' }, 
    38     s       => { param => 0, start => '<span class="bbcode_s">', end => '</span>' }, 
    39     h       => { param => 0, start => '<span class="bbcode_h">', end => '</span>' }, 
     35    b       => { param => 0, start => '<strong class="bbcode-b">', end => '</strong>' }, 
     36    i       => { param => 0, start => '<em class="bbcode-i">', end => '</em>' }, 
     37    u       => { param => 0, start => '<span class="bbcode-u">', end => '</span>' }, 
     38    s       => { param => 0, start => '<span class="bbcode-s">', end => '</span>' }, 
     39    h       => { param => 0, start => '<span class="bbcode-h">', end => '</span>' }, 
    4040    color   => { param => 2, strip_quotes => 1, start => sub { 
    4141        my $color = shift; 
     
    4747            | [a-z]+[0-9]* 
    4848         /ix) { $color = 'inherit' } 
    49         qq'<span class="bbcode_color" style="color: $color;">' 
     49        qq'<span class="bbcode-color" style="color: $color;">' 
    5050    }, end => '</span>' }, 
    5151#    size    => { param => 2, }, 
    52     url     => { param => 1, strip_quotes => 1, replace => sub { qq'<a href="@{[ $_[0] ? $_[0] : $_[1] ]}" class="bbcode_url">$_[1]</a>' }  }, 
    53     img     => { param => 1, strip_quotes => 1, raw => 1, start => sub { $_[0] ? qq'<img src="$_[0]" alt="' : '<img alt="" src="' }, end => '" class="bbcode_img"/>' }, 
    54     code    => { param => 1, raw => 1, start => sub { '<span class="bbcode_code_header">' . ($_[0] ? "Code for $_[0]" : 'Code') . ':</span><span class="bbcode_code">' }, end => '</span>' }, 
    55     quote   => { param => 1, start => sub { '<fieldset class="bbcode_quote"><legend class="bbcode_quote_header">' . ($_[0] ? "Quote from $_[0]" : 'Quote') . ':</legend>' }, end => '</fieldset>' }, 
    56     mono    => { param => 1, start => '<span class="bbcode_prop">', end => '</span>' }, 
     52    url     => { param => 1, strip_quotes => 1, replace => sub { qq'<a href="@{[ $_[0] ? $_[0] : $_[1] ]}" class="bbcode-url">$_[1]</a>' }  }, 
     53    img     => { param => 1, strip_quotes => 1, raw => 1, start => sub { $_[0] ? qq'<img src="$_[0]" alt="' : '<img alt="" src="' }, end => '" class="bbcode-img"/>' }, 
     54    code    => { param => 1, raw => 1, start => sub { '<div class="bbcode-code-heading">' . ($_[0] ? "Code for $_[0]" : 'Code') . ':</div><div class="bbcode-code">' }, end => '</div>' }, 
     55    quote   => { param => 1, start => sub { '<div class="bbcode-quote-heading">' . ($_[0] ? "Quote from $_[0]" : 'Quote') . ':</div><div class="bbcode-quote">' }, end => '</div>' }, 
     56    mono    => { param => 1, start => '<span class="bbcode-prop">', end => '</span>' }, 
    5757    raw     => { param => 1, raw => 1, start => '', end => '' }, 
    58     hr      => { param => 0, no_close => 1, start => '<hr class="bbcode_hr"/>' }, 
    59     center  => { param => 0, no_close => 0, start => '<div class="bbcode_center">', end => '</div>' }, 
     58    hr      => { param => 0, no_close => 1, start => '<hr class="bbcode-hr"/>' }, 
     59    center  => { param => 0, no_close => 0, start => '<div class="bbcode-center">', end => '</div>' }, 
    6060#    list    => { param => 1, contents => { '*' => 1 }, }, 
    6161#    '*'     => { param => 0, container => { list => 1 }, self_closing => 1, }, 
     
    192192 
    193193                push @errors, [ "Tag '$tag_name' not closed before parent tag '$next_tag'", $left_bracket ]; 
    194                 $output[-1] .= qq'<span class="bbcode_error_wrongorder">[/$tag_name]</span>'; 
     194                $output[-1] .= qq'<span class="bbcode-error-wrongorder">[/$tag_name]</span>'; 
    195195            } 
    196196 
     
    198198                # we have run out of initial closing tags!  replace this with something temporary for now 
    199199                push @errors, [ "Tag '$tag_name' closed but not open", $left_bracket ]; 
    200                 $output[-1] .= qq'<span class="bbcode_error_notopen">[/$tag_name]</span>'; 
     200                $output[-1] .= qq'<span class="bbcode-error-notopen">[/$tag_name]</span>'; 
    201201                next PARSE; 
    202202            } 
  • veekun/trunk/lib/Vee/Controller/Forum.pm

    r24 r111  
    153153    $s->{crumbs}      = [ '<a href="/forum">Forum Index</a>', '<a href="/forum/'.$thread->forum->id.'">'.$thread->forum->name.'</a>', qq'$threadflags<a href="/forum/thread/'.$thread->id.'">'.$thread->subject.'</a>' ]; 
    154154    if ($filter_user) { push @{ $s->{crumbs} }, '<a href="/user/'.$filter_user->id.'">'.$filter_user->name.'</a>\'s posts' } 
    155     $s->{extra_css}   = 'forum'; 
     155    $s->{extra_css}   = [ 'forum', 'bbcode' ]; 
    156156    $s->{form}        = $form; 
    157157 
  • veekun/trunk/lib/Vee/Controller/Index.pm

    r21 r111  
    4040    $s->{page_title} = 'Home/News'; 
    4141    $s->{link_name}  = 'main'; 
    42     $s->{extra_css}  = 'index'; 
     42    $s->{extra_css}  = [ 'index', 'bbcode' ]; 
    4343 
    4444    my $news_forum = $c->model('DBIC::Forums')->find( $c->site_opts->{special_forums}{news} ); 
  • veekun/trunk/lib/Vee/Controller/Style.pm

    r109 r111  
    2525=cut 
    2626 
     27# this will be fleshed/migrated out later, when I have interchangeable color schemes and such 
     28 
     29my %colors = ( 
     30    link_normal     => '#40a040', 
     31    link_visited    => '#208020', 
     32 
     33    hover_dark      => '#802020', 
     34    hover_medium    => '#f2d3c9', 
     35 
     36    header_fill     => '#e6d3b8', 
     37    header_border   => '#c0a680', 
     38); 
     39 
    2740sub style : Path : Args(1) { 
    2841    my ($self, $c, $filename) = @_; 
     42 
     43    $c->stash( %colors ); 
    2944 
    3045    $c->stash->{template} = 'style/' . $filename . '.tt'; 
  • veekun/trunk/root/style/bbcode.css

    r38 r111  
    1 .bbcode_u { text-decoration: underline; } 
    2 .bbcode_s { text-decoration: line-through; } 
    3 .bbcode_h { outline: 2px solid gold; -moz-outline-radius: 4px; } 
    4 .bbcode_code_header { display: block; margin: 4px 16px 0 16px; } 
    5 .bbcode_code { display: block; margin: 0 16px 4px 16px; color: #ffe090; font-weight: normal; font-style: normal; font-size: 11px; font-family: monospace; border: 1px solid gray; } 
    6 .bbcode_quote_header { margin-left: 12px; background: #406090; background: rgba(100%, 100%, 100%, .1); padding: 0 4px; -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; } 
    7 .bbcode_quote { border: 1px solid black; background: #406090; background: rgba(100%, 100%, 100%, .1); } 
    8 .bbcode_prop { font-family: monospace; } 
    9 .bbcode_center { text-align: center; } 
     1.bbcode-u { text-decoration: underline; } 
     2.bbcode-s { text-decoration: line-through; } 
     3.bbcode-h { outline: 2px solid gold; -moz-outline-radius: 4px; } 
     4.bbcode-code_header { display: block; margin: 4px 16px 0 16px; } 
     5.bbcode-code { display: block; margin: 0 16px 4px 16px; color: #ffe090; font-weight: normal; font-style: normal; font-size: 11px; font-family: monospace; border: 1px solid gray; } 
     6.bbcode-quote_header { margin-left: 12px; background: #406090; background: rgba(100%, 100%, 100%, .1); padding: 0 4px; -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; } 
     7.bbcode-quote { border: 1px solid black; background: #406090; background: rgba(100%, 100%, 100%, .1); } 
     8.bbcode-prop { font-family: monospace; } 
     9.bbcode-center { text-align: center; } 
     10.bbcode-hr { clear: none; } 
     11 
  • veekun/trunk/root/style/dex.css

    r76 r111  
    121121table.dex-locations tr td.dex-locations-ds { padding: 3px 1px; width: 16px; } 
    122122.dex-locations-map { position: relative; } 
    123 .dex-locations-map > img { float: left; margin-right: 16px; } 
     123.dex-locations-map > img { margin-bottom: 16px; } 
    124124.dex-locations-map .location { position: absolute; top: 0; left: 0; } 
    125125.dex-locations-map .partition { position: absolute; overflow: hidden; -moz-outline-radius: 2px; z-index: 1; } 
  • veekun/trunk/templates/forum/common.tt

    r109 r111  
    8282 <p> 
    8383  <img src="/images/icons/delete.png" alt=""/> 
    84   This post by <a href="/user/[% post.userid %]">[% post.user.name %]</a> has been deleted. 
     84  This post by <a href="[% c.uri('Users', 'info', post.userid) %]">[% post.user.name %]</a> has been deleted. 
    8585[%         IF allowed_postdelete(post, thread, forum) %] 
    8686  <a href="/forum/post/[% post.id %]/undelete">Restore it?</a>  Or <a href="/forum/post/[% post.id %]/edits">read it</a>? 
     
    9393    <div class="sidebar-wrapper"><div class="sidebar"> 
    9494[%     groups = post.user.groups.split(' '); primary_group = groups.shift %] 
    95         <div class="username"><a href="/user/[% post.userid %]"><img src="/images/groups/[% UserGroups.$primary_group.icon %]" alt="[% UserGroups.$primary_group.name %]" title="[% UserGroups.$primary_group.name %]"/> [% post.user.name %]</a></div> 
     95        <div class="username"><a href="[% c.uri('Users', 'info', post.userid) %]"><img src="/images/groups/[% UserGroups.$primary_group.icon %]" alt="[% UserGroups.$primary_group.name %]" title="[% UserGroups.$primary_group.name %]"/> [% post.user.name %]</a></div> 
    9696        <div class="title[% IF post.user.customtitle -%] custom">[% post.user.customtitle %][% ELSE %]">[% UserGroups.$primary_group.name %][% END %]</div> 
    9797        <div class="avatar">[% IF post.user.avatar %]<img src="/images/avatars/[% post.user.avatar %]" alt="">[% ELSE %]No avatar[% END %]</div> 
     
    103103    </div></div> 
    104104    <div class="topbar"> 
    105         <a[% IF post.id %] href="/forum/post/[% post.id %]"[% END %] name="p[% post.id %]">[% post.time | date %]</a> 
     105[% IF 0 AND post.id AND pos %] 
     106[%# fix this for filters and then re-enable it %] 
     107        <a href="/forum/post/[% post.id %]" name="p[% post.id %]">post #[% pos %]</a> -- 
     108[% END %] 
     109        <a[% IF post.id %] href="/forum/post/[% post.id %]"[% END %] name="p[% post.id %]">posted at [% post.time | date %]</a> 
    106110[%     IF timediff %] 
    107111        <span class="timediff">-- [% timediff | timespan %] since previous post</span> 
     
    113117[%     END %] 
    114118[%     IF post.lastedit %] 
    115         <div class="edits">Post last <a href="/forum/post/[% post.id %]/edits">edited</a> on [% post.lastedit.time | date %] by <a href="/user/[% post.editor %]">[% post.lastedit.user.name %]</a></div> 
     119        <div class="edits">Post last <a href="/forum/post/[% post.id %]/edits">edited</a> on [% post.lastedit.time | date %] by <a href="[% c.uri('Users', 'info', post.editor) %]">[% post.lastedit.user.name %]</a></div> 
    116120[%     END %] 
    117121        <div class="message"> 
     
    157161[%     END %] 
    158162</td> 
    159 <td class="postinfo"><a href="/user/[% thread.firstpost.userid %]">[% thread.firstpost.user.name %]</a> <a href="/forum/post/[% thread.firstpost.id %]">[% thread.firstpost.time | date %]</a></td> 
     163<td class="postinfo"><a href="[% c.uri('Users', 'info', thread.firstpost.userid) %]">[% thread.firstpost.user.name %]</a> <a href="/forum/post/[% thread.firstpost.id %]">[% thread.firstpost.time | date %]</a></td> 
    160164<td class="count">[% thread.postct - 1 %]</td><td class="count">[% thread.hitct %]</td> 
    161165<td class="postinfo"> 
     
    163167- 
    164168[%     ELSE %] 
    165 <a href="/user/[% thread.lastpost.userid %]">[% thread.lastpost.user.name %]</a> <a href="/forum/post/[% thread.lastpost.id %]">[% thread.lastpost.time | date %]</a> 
     169<a href="[% c.uri('Users', 'info', thread.lastpost.userid) %]">[% thread.lastpost.user.name %]</a> <a href="/forum/post/[% thread.lastpost.id %]">[% thread.lastpost.time | date %]</a> 
    166170[%     END -%] 
    167171</td></tr> 
     
    204208[%     IF forum.lastpostid %] 
    205209[%         IF 25 < forum.lastpost.thread.subject.length; subject = last_thread.subject.substr(0, 22) _ '...'; ELSE; subject = forum.lastpost.thread.subject; END -%] 
    206 [%             subject %] <a href="/user/[% forum.lastpost.userid %]">[% forum.lastpost.user.name %]</a> <a href="/forum/post/[% forum.lastpostid %]">[% forum.lastpost.time | date %]</a> 
     210[%             subject %] <a href="[% c.uri('Users', 'info', forum.lastpost.userid) %]">[% forum.lastpost.user.name %]</a> <a href="/forum/post/[% forum.lastpostid %]">[% forum.lastpost.time | date %]</a> 
    207211[%     ELSE %] 
    208212(no posts) 
  • veekun/trunk/templates/forum/view.tt

    r33 r111  
    2626<h1>Create a new thread</h1> 
    2727<form class="forum-reply" action="[% c.uri_for('/forum/create/thread') %]" method="post"> 
    28  <p> <label>Subject: <input type="text" name="subject" id="frmrepsub" maxlength="48"/></label> </p> 
    29  <p> <label>Blurb: <input type="text" name="blurb" id="frmrepblr" maxlength="96"/></label> </p> 
     28 <p> <label>Subject: <input type="text" name="subject" maxlength="48"/></label> </p> 
     29 <p> <label>Blurb: <input type="text" name="blurb" maxlength="96"/></label> </p> 
    3030 <p> 
    3131  <input type="hidden" name="fid" value="[% forum.id %]"/> 
  • veekun/trunk/templates/style/forum.tt

    r106 r111  
    5050  .forum-post-diff + .forum-post { margin-top: 0; } 
    5151 
     52.forum-reply { } 
     53  .forum-reply p { text-align: center; } 
     54  .forum-reply textarea { width: 66%; } 
     55  .forum-reply input[type="submit"], 
     56  .forum-reply input[type="reset"] { font-size: 1.5em; height: 1.5em; width: 18%; margin: 0 2%; } 
     57  .forum-reply label { display: block; width: 66%; text-align: right; margin: 0 auto; } 
     58  .forum-reply input[type="text"] { width: 85%; } 
     59  
     60 
    5261.postbar { } 
    5362  .postbar .postrank { float: right; } 
  • veekun/trunk/templates/style/global.tt

    r106 r111  
    11[% 
    2     link_normal  = '#40a040'; 
    3     link_visited = '#208020'; 
    4     hover_dark   = '#802020'; 
    5     hover_medium = '#f2d3c9'; 
    6  
    7     sidebar_width = '10em'; 
     2    sidebar_width = '12em'; 
    83%] 
    94 
     
    2318.color1.dimmed { background-color: #f6f6f6; } 
    2419.color2.dimmed { background-color: #eaeaea; } 
    25 table tr.heading th { background: #e6d3b8; color: #806640; border: 1px solid #c0a680; border-left: none; border-right: none; } 
     20table tr.heading th { background: [% header_fill %]; color: #806640; border: 1px solid [% header_border %]; border-left: none; border-right: none; } 
    2621 
    2722/* lazy alignment */ 
     
    3934/* regular ol' layout bits */ 
    4035p { margin: 0.5em 0; line-height: 133%; } 
    41 #content h1, #content h2, #content h3 { background: url(/images/h1-ground.png) #e6d3b8 no-repeat left center; clear: both; margin: 1em 0 0.5em 0; padding-left: 80px; color: #806640; border: 1px solid #c0a680; border-left: none; border-right: none; } 
     36#content h1, #content h2, #content h3 { background: url(/images/h1-ground.png) [% header_fill %] no-repeat left center; clear: both; margin: 1em 0 0.5em 0; padding-left: 80px; color: #806640; border: 1px solid [% header_border %]; border-left: none; border-right: none; } 
    4237#content h1 { margin: 0.5em -8px; padding: 0; padding-left: 80px; border-top: 2px solid #806640; } 
    4338#content h2 { background-image: url(/images/h2-ground.png); } 
     
    4540#content h1 img, #content h2 img, #content h3 img { vertical-align: 0; } 
    4641#content > h1:first-child, #content > h2:first-child, #content > h3:first-child { margin-top: -0.5em; border-top: none; } 
    47 #content hr { border: none; border-bottom: 1px dotted #806640; background: url(/images/hr.png) no-repeat bottom left; height: 14px; clear: both; margin: 2px 0; } 
     42#content hr { border: none; border-bottom: 1px dotted #806640; background: url(/images/hr.png) no-repeat bottom left; height: 14px; margin: 2px 0; } 
     43#content > hr { clear: both; } 
    4844 
    4945body { color: black; background: url(/images/bg.png) #bf9960 fixed left bottom no-repeat; margin: 1.5em; } 
    50 #header { position: relative; height: 6em; background: url(/images/bg-fade.png) #e6d3b8 fixed left bottom no-repeat; border: 1px solid #806640; -moz-border-radius-topleft: 64px; padding: 0.5em; padding-left: 100px; } 
     46#header { position: relative; height: 6em; background: url(/images/bg-fade.png) [% header_fill %] fixed left bottom no-repeat; border: 1px solid #806640; -moz-border-radius-topleft: 64px; padding: 0.5em; padding-left: 100px; } 
    5147  #logo { position: absolute; bottom: -4px; left: -10px; height: 100px; width: 100px; margin-right: 8px; z-index: 1; } 
    5248  #site-title { color: #807059; font-size: 30px; font-weight: bold; } 
     
    6864  #linkbar > li { list-style: none; margin: 0; padding: 0; } 
    6965  #linkbar > li > a, 
    70   #linkbar > li > span { display: block; background: url(/images/bg-fade.png) #806640 fixed left bottom no-repeat; color: white; padding: 3px; border: 1px solid #806640; border-right: none; } 
     66  #linkbar > li > span { display: block; background: url(/images/bg-fade.png) #806640 fixed left bottom no-repeat; color: white; padding: 3px; border: 1px solid #806640; border-right: none; letter-spacing: 0.1em; font-size: 120%; } 
    7167  #linkbar > li > a:hover { background-color: #802020; } 
    7268  #linkbar #youarehere:before { content: ' '; background: url(/images/youarehere.png) left center no-repeat; vertical-align: middle; margin-left: -16px; padding-right: 16px; } 
    7369    #linkbar > li > ul { margin: 0; padding: 0; } 
    7470    #linkbar > li > ul > li { display: block; } 
    75     #linkbar > li > ul > li > a { display: block; background: url(/images/bg-fade.png) #e6d3b8 fixed left bottom no-repeat; font-size: 85%; padding: 3px 0 3px 5px; border-left: 3px double #806640; color: black; } 
     71    #linkbar > li > ul > li > a { display: block; background: url(/images/bg-fade.png) #e6d3b8 fixed left bottom no-repeat; padding: 3px 0 3px 5px; border-left: 3px double #806640; color: black; } 
    7672    #linkbar > li > ul > li > a:hover { background-color: #d89090; border-color: #802020; } 
    7773 
     
    8581#footer { -moz-border-radius-bottomright: 64px; } 
    8682 
    87 #breadcrumbs { border-bottom: 1px dotted #c0a680; margin: -0.5em; margin-bottom: 0.5em; padding: 0.5em; } 
     83#breadcrumbs { border-bottom: 1px dotted [% header_border %]; margin: -0.5em; margin-bottom: 0.5em; padding: 0.5em; } 
    8884  #breadcrumbs a { padding: 0.25em; margin: 0 -0.25em; border: 1px solid transparent; } 
    8985    #breadcrumbs a:hover { background: url(/images/bg-fade.png) [% hover_medium %] fixed left bottom no-repeat; border-color: [% hover_dark %]; } 
  • veekun/trunk/templates/wrapper.tt

    r109 r111  
    1313<title>[% page_title %] - [% c.site_opts.site_title %]</title> 
    1414<link rel="shortcut icon" type="image/png" href="/images/favicon.png"/> 
     15<link rel="stylesheet" type="text/css" href="/style/global"/> 
    1516[% IF extra_css %] 
    1617[%     FOREACH css IN extra_css %] 
     
    1920[% END %] 
    2021[% extra_headers.join("\n") %] 
    21 <link rel="stylesheet" type="text/css" href="/style/global"/> 
    2222<link rel="search" type="application/opensearchdescription+xml" title="Veekun Pok&eacute;dex" href="/files/mozsearch.pokedex.xml"/> 
    2323<script type="text/javascript" src="/script/jquery.js"></script>