Changeset 111
- Timestamp:
- 04/23/07 20:48:15 (3 years ago)
- Location:
- veekun/trunk
- Files:
-
- 1 added
- 11 modified
-
lib/Vee/BBCode.pm (modified) (4 diffs)
-
lib/Vee/Controller/Forum.pm (modified) (1 diff)
-
lib/Vee/Controller/Index.pm (modified) (1 diff)
-
lib/Vee/Controller/Style.pm (modified) (1 diff)
-
root/style/bbcode.css (modified) (1 diff)
-
root/style/dex.css (modified) (1 diff)
-
templates/forum/common.tt (modified) (7 diffs)
-
templates/forum/view.tt (modified) (1 diff)
-
templates/style/bbcode.tt (added)
-
templates/style/forum.tt (modified) (1 diff)
-
templates/style/global.tt (modified) (6 diffs)
-
templates/wrapper.tt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
veekun/trunk/lib/Vee/BBCode.pm
r38 r111 33 33 # - replace won't work with no_close 34 34 our %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>' }, 40 40 color => { param => 2, strip_quotes => 1, start => sub { 41 41 my $color = shift; … … 47 47 | [a-z]+[0-9]* 48 48 /ix) { $color = 'inherit' } 49 qq'<span class="bbcode _color" style="color: $color;">'49 qq'<span class="bbcode-color" style="color: $color;">' 50 50 }, end => '</span>' }, 51 51 # 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>' }, 57 57 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>' }, 60 60 # list => { param => 1, contents => { '*' => 1 }, }, 61 61 # '*' => { param => 0, container => { list => 1 }, self_closing => 1, }, … … 192 192 193 193 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>'; 195 195 } 196 196 … … 198 198 # we have run out of initial closing tags! replace this with something temporary for now 199 199 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>'; 201 201 next PARSE; 202 202 } -
veekun/trunk/lib/Vee/Controller/Forum.pm
r24 r111 153 153 $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>' ]; 154 154 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' ]; 156 156 $s->{form} = $form; 157 157 -
veekun/trunk/lib/Vee/Controller/Index.pm
r21 r111 40 40 $s->{page_title} = 'Home/News'; 41 41 $s->{link_name} = 'main'; 42 $s->{extra_css} = 'index';42 $s->{extra_css} = [ 'index', 'bbcode' ]; 43 43 44 44 my $news_forum = $c->model('DBIC::Forums')->find( $c->site_opts->{special_forums}{news} ); -
veekun/trunk/lib/Vee/Controller/Style.pm
r109 r111 25 25 =cut 26 26 27 # this will be fleshed/migrated out later, when I have interchangeable color schemes and such 28 29 my %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 27 40 sub style : Path : Args(1) { 28 41 my ($self, $c, $filename) = @_; 42 43 $c->stash( %colors ); 29 44 30 45 $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 121 121 table.dex-locations tr td.dex-locations-ds { padding: 3px 1px; width: 16px; } 122 122 .dex-locations-map { position: relative; } 123 .dex-locations-map > img { float: left; margin-right: 16px; }123 .dex-locations-map > img { margin-bottom: 16px; } 124 124 .dex-locations-map .location { position: absolute; top: 0; left: 0; } 125 125 .dex-locations-map .partition { position: absolute; overflow: hidden; -moz-outline-radius: 2px; z-index: 1; } -
veekun/trunk/templates/forum/common.tt
r109 r111 82 82 <p> 83 83 <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. 85 85 [% IF allowed_postdelete(post, thread, forum) %] 86 86 <a href="/forum/post/[% post.id %]/undelete">Restore it?</a> Or <a href="/forum/post/[% post.id %]/edits">read it</a>? … … 93 93 <div class="sidebar-wrapper"><div class="sidebar"> 94 94 [% 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> 96 96 <div class="title[% IF post.user.customtitle -%] custom">[% post.user.customtitle %][% ELSE %]">[% UserGroups.$primary_group.name %][% END %]</div> 97 97 <div class="avatar">[% IF post.user.avatar %]<img src="/images/avatars/[% post.user.avatar %]" alt="">[% ELSE %]No avatar[% END %]</div> … … 103 103 </div></div> 104 104 <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> 106 110 [% IF timediff %] 107 111 <span class="timediff">-- [% timediff | timespan %] since previous post</span> … … 113 117 [% END %] 114 118 [% 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> 116 120 [% END %] 117 121 <div class="message"> … … 157 161 [% END %] 158 162 </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> 160 164 <td class="count">[% thread.postct - 1 %]</td><td class="count">[% thread.hitct %]</td> 161 165 <td class="postinfo"> … … 163 167 - 164 168 [% 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> 166 170 [% END -%] 167 171 </td></tr> … … 204 208 [% IF forum.lastpostid %] 205 209 [% 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> 207 211 [% ELSE %] 208 212 (no posts) -
veekun/trunk/templates/forum/view.tt
r33 r111 26 26 <h1>Create a new thread</h1> 27 27 <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> 30 30 <p> 31 31 <input type="hidden" name="fid" value="[% forum.id %]"/> -
veekun/trunk/templates/style/forum.tt
r106 r111 50 50 .forum-post-diff + .forum-post { margin-top: 0; } 51 51 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 52 61 .postbar { } 53 62 .postbar .postrank { float: right; } -
veekun/trunk/templates/style/global.tt
r106 r111 1 1 [% 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'; 8 3 %] 9 4 … … 23 18 .color1.dimmed { background-color: #f6f6f6; } 24 19 .color2.dimmed { background-color: #eaeaea; } 25 table tr.heading th { background: #e6d3b8; color: #806640; border: 1px solid #c0a680; border-left: none; border-right: none; }20 table tr.heading th { background: [% header_fill %]; color: #806640; border: 1px solid [% header_border %]; border-left: none; border-right: none; } 26 21 27 22 /* lazy alignment */ … … 39 34 /* regular ol' layout bits */ 40 35 p { 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; } 42 37 #content h1 { margin: 0.5em -8px; padding: 0; padding-left: 80px; border-top: 2px solid #806640; } 43 38 #content h2 { background-image: url(/images/h2-ground.png); } … … 45 40 #content h1 img, #content h2 img, #content h3 img { vertical-align: 0; } 46 41 #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; } 48 44 49 45 body { 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) #e6d3b8fixed 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; } 51 47 #logo { position: absolute; bottom: -4px; left: -10px; height: 100px; width: 100px; margin-right: 8px; z-index: 1; } 52 48 #site-title { color: #807059; font-size: 30px; font-weight: bold; } … … 68 64 #linkbar > li { list-style: none; margin: 0; padding: 0; } 69 65 #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%; } 71 67 #linkbar > li > a:hover { background-color: #802020; } 72 68 #linkbar #youarehere:before { content: ' '; background: url(/images/youarehere.png) left center no-repeat; vertical-align: middle; margin-left: -16px; padding-right: 16px; } 73 69 #linkbar > li > ul { margin: 0; padding: 0; } 74 70 #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; } 76 72 #linkbar > li > ul > li > a:hover { background-color: #d89090; border-color: #802020; } 77 73 … … 85 81 #footer { -moz-border-radius-bottomright: 64px; } 86 82 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; } 88 84 #breadcrumbs a { padding: 0.25em; margin: 0 -0.25em; border: 1px solid transparent; } 89 85 #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 13 13 <title>[% page_title %] - [% c.site_opts.site_title %]</title> 14 14 <link rel="shortcut icon" type="image/png" href="/images/favicon.png"/> 15 <link rel="stylesheet" type="text/css" href="/style/global"/> 15 16 [% IF extra_css %] 16 17 [% FOREACH css IN extra_css %] … … 19 20 [% END %] 20 21 [% extra_headers.join("\n") %] 21 <link rel="stylesheet" type="text/css" href="/style/global"/>22 22 <link rel="search" type="application/opensearchdescription+xml" title="Veekun Pokédex" href="/files/mozsearch.pokedex.xml"/> 23 23 <script type="text/javascript" src="/script/jquery.js"></script>
